File size: 3,954 Bytes
1c31d52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": [
    "id",
    "pair_id",
    "seed",
    "split",
    "country",
    "family",
    "contract_id",
    "invoice",
    "expected",
    "provenance",
    "mutation",
    "fingerprint_sha256"
  ],
  "properties": {
    "id": { "type": "string", "minLength": 32, "maxLength": 32 },
    "pair_id": { "type": "string", "minLength": 24, "maxLength": 24 },
    "seed": { "type": "integer" },
    "split": { "enum": ["train", "validation", "test"] },
    "country": { "enum": ["SA", "AE", "QA", "KW", "BH", "OM"] },
    "family": {
      "enum": [
        "half_up_tie",
        "line_vs_document_rounding",
        "line_allowance",
        "line_charge",
        "prepayment",
        "credit_note",
        "large_amount_stress",
        "zero_rate",
        "mixed_rates",
        "zero_due"
      ]
    },
    "contract_id": { "const": "gcc-invoice-math-1.0" },
    "invoice": {
      "type": "object",
      "required": [
        "currency",
        "document_type",
        "numeric_style",
        "lines",
        "prepaid",
        "claimed_totals"
      ],
      "properties": {
        "currency": { "enum": ["SAR", "AED", "QAR", "KWD", "BHD", "OMR"] },
        "document_type": { "enum": ["invoice", "credit_note"] },
        "numeric_style": {
          "enum": [
            "ascii",
            "arabic_indic",
            "grouped_ascii",
            "grouped_arabic_indic"
          ]
        },
        "lines": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": ["quantity", "unit_price", "allowance", "charge", "rate"],
            "properties": {
              "quantity": { "type": "string" },
              "unit_price": { "type": "string" },
              "allowance": { "type": "string" },
              "charge": { "type": "string" },
              "rate": { "type": "string" }
            },
            "additionalProperties": false
          }
        },
        "prepaid": { "type": "string" },
        "claimed_totals": {
          "type": "object",
          "required": ["net", "tax", "gross", "due"],
          "properties": {
            "net": { "type": "string" },
            "tax": { "type": "string" },
            "gross": { "type": "string" },
            "due": { "type": "string" }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "expected": {
      "type": "object",
      "required": ["valid", "totals", "error_fields"],
      "properties": {
        "valid": { "type": "boolean" },
        "totals": {
          "type": "object",
          "required": ["net", "tax", "gross", "due"],
          "properties": {
            "net": { "type": "string" },
            "tax": { "type": "string" },
            "gross": { "type": "string" },
            "due": { "type": "string" }
          },
          "additionalProperties": false
        },
        "error_fields": {
          "type": "array",
          "items": { "enum": ["net", "tax", "gross", "due"] }
        }
      },
      "additionalProperties": false
    },
    "provenance": {
      "type": "object",
      "required": [
        "synthetic",
        "external_sources_used_for_research",
        "copied_records",
        "generation_method",
        "license_reviewed",
        "license_review_scope",
        "model"
      ]
    },
    "mutation": {
      "anyOf": [
        { "type": "null" },
        {
          "type": "object",
          "required": ["path", "delta", "single_change"],
          "properties": {
            "path": { "type": "string" },
            "delta": { "type": "string" },
            "single_change": { "const": true }
          }
        }
      ]
    },
    "fingerprint_sha256": { "type": "string", "minLength": 64, "maxLength": 64 }
  },
  "additionalProperties": false
}