gobl 0.24.1 → 0.24.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/data/addons/br-nfe-v4.json +481 -0
  3. data/data/addons/br-nfse-v1.json +235 -0
  4. data/data/addons/co-dian-v2.json +311 -0
  5. data/data/addons/de-xrechnung-v3.json +16 -0
  6. data/data/addons/de-zugferd-v2.json +16 -0
  7. data/data/addons/es-facturae-v3.json +359 -0
  8. data/data/addons/es-tbai-v1.json +225 -0
  9. data/data/addons/es-verifactu-v1.json +609 -0
  10. data/data/addons/eu-en16931-v2017.json +92 -0
  11. data/data/addons/fr-choruspro-v1.json +260 -0
  12. data/data/addons/fr-facturx-v1.json +16 -0
  13. data/data/addons/gr-mydata-v1.json +1495 -0
  14. data/data/addons/it-sdi-v1.json +1570 -0
  15. data/data/addons/it-ticket-v1.json +144 -0
  16. data/data/addons/mx-cfdi-v4.json +908 -0
  17. data/data/addons/pl-favat-v2.json +235 -0
  18. data/data/addons/pt-saft-v1.json +950 -0
  19. data/data/catalogues/cef.json +374 -0
  20. data/data/catalogues/iso.json +19 -0
  21. data/data/catalogues/untdid.json +10669 -0
  22. data/data/currency/iso.json +2378 -0
  23. data/data/currency/non-iso.json +128 -0
  24. data/data/schemas/bill/charge.json +125 -0
  25. data/data/schemas/bill/correction-options.json +54 -0
  26. data/data/schemas/bill/delivery-details.json +41 -0
  27. data/data/schemas/bill/delivery.json +412 -0
  28. data/data/schemas/bill/discount.json +137 -0
  29. data/data/schemas/bill/invoice.json +423 -0
  30. data/data/schemas/bill/line.json +433 -0
  31. data/data/schemas/bill/order.json +401 -0
  32. data/data/schemas/bill/ordering.json +107 -0
  33. data/data/schemas/bill/payment-details.json +36 -0
  34. data/data/schemas/bill/payment.json +424 -0
  35. data/data/schemas/bill/tax.json +45 -0
  36. data/data/schemas/bill/totals.json +84 -0
  37. data/data/schemas/cal/date-time.json +13 -0
  38. data/data/schemas/cal/date.json +13 -0
  39. data/data/schemas/cal/period.json +32 -0
  40. data/data/schemas/cal/time.json +13 -0
  41. data/data/schemas/cbc/code-map.json +16 -0
  42. data/data/schemas/cbc/code.json +15 -0
  43. data/data/schemas/cbc/definition.json +67 -0
  44. data/data/schemas/cbc/key.json +15 -0
  45. data/data/schemas/cbc/meta.json +16 -0
  46. data/data/schemas/cbc/source.json +37 -0
  47. data/data/schemas/currency/amount.json +32 -0
  48. data/data/schemas/currency/code.json +734 -0
  49. data/data/schemas/currency/exchange-rate.json +43 -0
  50. data/data/schemas/dsig/digest.json +27 -0
  51. data/data/schemas/dsig/signature.json +12 -0
  52. data/data/schemas/envelope.json +41 -0
  53. data/data/schemas/head/header.json +62 -0
  54. data/data/schemas/head/link.json +42 -0
  55. data/data/schemas/head/stamp.json +27 -0
  56. data/data/schemas/i18n/string.json +18 -0
  57. data/data/schemas/l10n/code.json +13 -0
  58. data/data/schemas/l10n/iso-country-code.json +1010 -0
  59. data/data/schemas/l10n/tax-country-code.json +1022 -0
  60. data/data/schemas/note/message.json +43 -0
  61. data/data/schemas/num/amount.json +13 -0
  62. data/data/schemas/num/percentage.json +13 -0
  63. data/data/schemas/org/address.json +105 -0
  64. data/data/schemas/org/attachment.json +58 -0
  65. data/data/schemas/org/coordinates.json +33 -0
  66. data/data/schemas/org/document-ref.json +117 -0
  67. data/data/schemas/org/email.json +37 -0
  68. data/data/schemas/org/identity.json +57 -0
  69. data/data/schemas/org/image.json +70 -0
  70. data/data/schemas/org/inbox.json +49 -0
  71. data/data/schemas/org/item.json +96 -0
  72. data/data/schemas/org/name.json +59 -0
  73. data/data/schemas/org/note.json +184 -0
  74. data/data/schemas/org/party.json +129 -0
  75. data/data/schemas/org/person.json +90 -0
  76. data/data/schemas/org/registration.json +66 -0
  77. data/data/schemas/org/telephone.json +32 -0
  78. data/data/schemas/org/unit.json +350 -0
  79. data/data/schemas/org/website.json +38 -0
  80. data/data/schemas/pay/advance.json +211 -0
  81. data/data/schemas/pay/instructions.json +245 -0
  82. data/data/schemas/pay/terms.json +128 -0
  83. data/data/schemas/regimes/mx/food-vouchers.json +111 -0
  84. data/data/schemas/regimes/mx/fuel-account-balance.json +179 -0
  85. data/data/schemas/schema/object.json +12 -0
  86. data/data/schemas/tax/addon-def.json +288 -0
  87. data/data/schemas/tax/catalogue-def.json +37 -0
  88. data/data/schemas/tax/extensions.json +16 -0
  89. data/data/schemas/tax/identity.json +45 -0
  90. data/data/schemas/tax/regime-def.json +513 -0
  91. data/data/schemas/tax/set.json +139 -0
  92. data/data/schemas/tax/total.json +135 -0
  93. data/lib/gobl/extensions/tax/addon_helper.rb +37 -0
  94. data/lib/gobl/version.rb +1 -1
  95. data/lib/gobl.rb +1 -0
  96. metadata +93 -1
@@ -0,0 +1,288 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/tax/addon-def",
4
+ "$ref": "#/$defs/AddonDef",
5
+ "$defs": {
6
+ "AddonDef": {
7
+ "properties": {
8
+ "key": {
9
+ "$ref": "https://gobl.org/draft-0/cbc/key",
10
+ "title": "Key",
11
+ "description": "Key that defines how to uniquely idenitfy the add-on."
12
+ },
13
+ "requires": {
14
+ "items": {
15
+ "$ref": "https://gobl.org/draft-0/cbc/key"
16
+ },
17
+ "type": "array",
18
+ "title": "Requires",
19
+ "description": "Requires defines any additional addons that this one depends on to operate\ncorrectly."
20
+ },
21
+ "name": {
22
+ "$ref": "https://gobl.org/draft-0/i18n/string",
23
+ "title": "Name",
24
+ "description": "Name of the add-on"
25
+ },
26
+ "description": {
27
+ "$ref": "https://gobl.org/draft-0/i18n/string",
28
+ "title": "Description",
29
+ "description": "Description of the add-on"
30
+ },
31
+ "sources": {
32
+ "items": {
33
+ "$ref": "https://gobl.org/draft-0/cbc/source"
34
+ },
35
+ "type": "array",
36
+ "title": "Sources",
37
+ "description": "Sources is a list of sources that are used to provide the data for the add-on."
38
+ },
39
+ "extensions": {
40
+ "items": {
41
+ "$ref": "https://gobl.org/draft-0/cbc/definition"
42
+ },
43
+ "type": "array",
44
+ "title": "Extensions",
45
+ "description": "Extensions defines the list of extensions that are associated with an add-on."
46
+ },
47
+ "tags": {
48
+ "items": {
49
+ "$ref": "#/$defs/TagSet"
50
+ },
51
+ "type": "array",
52
+ "title": "Tags",
53
+ "description": "Tags is slice of tag sets that define what can be assigned to each document schema."
54
+ },
55
+ "scenarios": {
56
+ "items": {
57
+ "$ref": "#/$defs/ScenarioSet"
58
+ },
59
+ "type": "array",
60
+ "title": "Scenarios",
61
+ "description": "Scenarios are applied to documents after normalization and before\nvalidation to ensure that form specific extensions have been added\nto the document."
62
+ },
63
+ "identities": {
64
+ "items": {
65
+ "$ref": "https://gobl.org/draft-0/cbc/definition"
66
+ },
67
+ "type": "array",
68
+ "title": "Identities",
69
+ "description": "Identities that are specific for the add-on and may be validated against or\nused during conversion processes."
70
+ },
71
+ "inboxes": {
72
+ "items": {
73
+ "$ref": "https://gobl.org/draft-0/cbc/definition"
74
+ },
75
+ "type": "array",
76
+ "title": "Inboxes",
77
+ "description": "Inboxes is a list of keys that are used to identify where copies of\ndocuments can be sent."
78
+ },
79
+ "corrections": {
80
+ "$ref": "#/$defs/CorrectionSet",
81
+ "title": "Corrections",
82
+ "description": "Corrections is used to provide a map of correction definitions that\nare supported by the add-on."
83
+ }
84
+ },
85
+ "type": "object",
86
+ "required": [
87
+ "key",
88
+ "name",
89
+ "extensions",
90
+ "scenarios",
91
+ "corrections"
92
+ ],
93
+ "description": "AddonDef is an interface that defines the methods that a tax add-on must implement."
94
+ },
95
+ "CorrectionDefinition": {
96
+ "properties": {
97
+ "schema": {
98
+ "type": "string",
99
+ "title": "Schema",
100
+ "description": "Partial or complete schema URL for the document type supported by correction."
101
+ },
102
+ "types": {
103
+ "items": {
104
+ "$ref": "https://gobl.org/draft-0/cbc/key"
105
+ },
106
+ "type": "array",
107
+ "title": "Types",
108
+ "description": "The types of sub-documents supported by the regime"
109
+ },
110
+ "extensions": {
111
+ "items": {
112
+ "$ref": "https://gobl.org/draft-0/cbc/key"
113
+ },
114
+ "type": "array",
115
+ "title": "Extensions",
116
+ "description": "Extension keys that can be included"
117
+ },
118
+ "reason_required": {
119
+ "type": "boolean",
120
+ "title": "Reason Required",
121
+ "description": "ReasonRequired when true implies that a reason must be provided"
122
+ },
123
+ "stamps": {
124
+ "items": {
125
+ "$ref": "https://gobl.org/draft-0/cbc/key"
126
+ },
127
+ "type": "array",
128
+ "title": "Stamps",
129
+ "description": "Stamps that must be copied from the preceding document."
130
+ },
131
+ "copy_tax": {
132
+ "type": "boolean",
133
+ "title": "Copy Tax Totals",
134
+ "description": "Copy tax from the preceding document to the document ref."
135
+ }
136
+ },
137
+ "type": "object",
138
+ "required": [
139
+ "schema"
140
+ ],
141
+ "description": "CorrectionDefinition contains details about what can be defined in ."
142
+ },
143
+ "CorrectionSet": {
144
+ "items": {
145
+ "$ref": "#/$defs/CorrectionDefinition"
146
+ },
147
+ "type": "array",
148
+ "description": "CorrectionSet defines a set of correction definitions for a selection of schemas."
149
+ },
150
+ "Scenario": {
151
+ "properties": {
152
+ "name": {
153
+ "$ref": "https://gobl.org/draft-0/i18n/string",
154
+ "title": "Name",
155
+ "description": "Name of the scenario for further information."
156
+ },
157
+ "desc": {
158
+ "$ref": "https://gobl.org/draft-0/i18n/string",
159
+ "title": "Description",
160
+ "description": "Description of the scenario for documentation purposes."
161
+ },
162
+ "type": {
163
+ "items": {
164
+ "$ref": "https://gobl.org/draft-0/cbc/key"
165
+ },
166
+ "type": "array",
167
+ "title": "Type",
168
+ "description": "Type of document, if present."
169
+ },
170
+ "tags": {
171
+ "items": {
172
+ "$ref": "https://gobl.org/draft-0/cbc/key"
173
+ },
174
+ "type": "array",
175
+ "title": "Tags",
176
+ "description": "Array of tags that have been applied to the document."
177
+ },
178
+ "ext_key": {
179
+ "$ref": "https://gobl.org/draft-0/cbc/key",
180
+ "title": "Extension Key",
181
+ "description": "Extension key that must be present in the document."
182
+ },
183
+ "ext_code": {
184
+ "$ref": "https://gobl.org/draft-0/cbc/code",
185
+ "title": "Extension Code",
186
+ "description": "Extension code that along side the key must be present for a match\nto happen. This cannot be used without an `cbc.Code`. The value will\nbe copied to the note code if needed."
187
+ },
188
+ "note": {
189
+ "$ref": "#/$defs/ScenarioNote",
190
+ "title": "Note",
191
+ "description": "A note to be added to the document if the scenario is applied."
192
+ },
193
+ "codes": {
194
+ "$ref": "https://gobl.org/draft-0/cbc/code-map",
195
+ "title": "Codes",
196
+ "description": "Codes is used to define additional codes for regime specific\nsituations."
197
+ },
198
+ "ext": {
199
+ "$ref": "https://gobl.org/draft-0/tax/extensions",
200
+ "title": "Extensions",
201
+ "description": "Ext represents a set of tax extensions that should be applied to\nthe document in the appropriate \"tax\" context."
202
+ }
203
+ },
204
+ "type": "object",
205
+ "description": "Scenario is used to describe a tax scenario of a document based on the combination of document type and tag used."
206
+ },
207
+ "ScenarioNote": {
208
+ "properties": {
209
+ "key": {
210
+ "$ref": "https://gobl.org/draft-0/cbc/key",
211
+ "title": "Key",
212
+ "description": "Key specifying subject of the text"
213
+ },
214
+ "code": {
215
+ "$ref": "https://gobl.org/draft-0/cbc/code",
216
+ "title": "Code",
217
+ "description": "Code used for additional data that may be required to identify the note."
218
+ },
219
+ "src": {
220
+ "$ref": "https://gobl.org/draft-0/cbc/key",
221
+ "title": "Source",
222
+ "description": "Source of this note, especially useful when auto-generated."
223
+ },
224
+ "text": {
225
+ "type": "string",
226
+ "title": "Text",
227
+ "description": "The contents of the note"
228
+ },
229
+ "ext": {
230
+ "$ref": "https://gobl.org/draft-0/tax/extensions",
231
+ "title": "Extensions",
232
+ "description": "Extension data"
233
+ }
234
+ },
235
+ "type": "object",
236
+ "required": [
237
+ "text"
238
+ ],
239
+ "description": "ScenarioNote represents the structure of the note that needs to be added to the document."
240
+ },
241
+ "ScenarioSet": {
242
+ "properties": {
243
+ "schema": {
244
+ "type": "string",
245
+ "title": "Schema",
246
+ "description": "Partial or complete schema URL for the document type"
247
+ },
248
+ "list": {
249
+ "items": {
250
+ "$ref": "#/$defs/Scenario"
251
+ },
252
+ "type": "array",
253
+ "title": "List",
254
+ "description": "List of scenarios for the schema"
255
+ }
256
+ },
257
+ "type": "object",
258
+ "required": [
259
+ "schema",
260
+ "list"
261
+ ],
262
+ "description": "ScenarioSet is a collection of tax scenarios for a given schema that can be used to determine special codes or notes that need to be included in the final document."
263
+ },
264
+ "TagSet": {
265
+ "properties": {
266
+ "schema": {
267
+ "type": "string",
268
+ "title": "Schema",
269
+ "description": "Schema that the tags are associated with."
270
+ },
271
+ "list": {
272
+ "items": {
273
+ "$ref": "https://gobl.org/draft-0/cbc/definition"
274
+ },
275
+ "type": "array",
276
+ "title": "List",
277
+ "description": "List of tags for the schema"
278
+ }
279
+ },
280
+ "type": "object",
281
+ "required": [
282
+ "schema",
283
+ "list"
284
+ ],
285
+ "description": "TagSet defines a set of tags and their descriptions that can be used for a specific schema in the context of a Regime or Addon."
286
+ }
287
+ }
288
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/tax/catalogue-def",
4
+ "$ref": "#/$defs/CatalogueDef",
5
+ "$defs": {
6
+ "CatalogueDef": {
7
+ "properties": {
8
+ "key": {
9
+ "$ref": "https://gobl.org/draft-0/cbc/key",
10
+ "description": "Key defines a unique identifier for the catalogue."
11
+ },
12
+ "name": {
13
+ "$ref": "https://gobl.org/draft-0/i18n/string",
14
+ "description": "Name is the name of the catalogue."
15
+ },
16
+ "description": {
17
+ "$ref": "https://gobl.org/draft-0/i18n/string",
18
+ "description": "Description is a human readable description of the catalogue."
19
+ },
20
+ "extensions": {
21
+ "items": {
22
+ "$ref": "https://gobl.org/draft-0/cbc/definition"
23
+ },
24
+ "type": "array",
25
+ "description": "Extensions defines all the extensions offered by the catalogue."
26
+ }
27
+ },
28
+ "type": "object",
29
+ "required": [
30
+ "key",
31
+ "name",
32
+ "extensions"
33
+ ],
34
+ "description": "A CatalogueDef contains a set of re-useable extensions, scenarios, and validators that can be used by addons or tax regimes."
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/tax/extensions",
4
+ "$ref": "#/$defs/Extensions",
5
+ "$defs": {
6
+ "Extensions": {
7
+ "patternProperties": {
8
+ "^(?:[a-z]|[a-z0-9][a-z0-9-+]*[a-z0-9])$": {
9
+ "$ref": "https://gobl.org/draft-0/cbc/code"
10
+ }
11
+ },
12
+ "type": "object",
13
+ "description": "Extensions is a map of extension keys to values."
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/tax/identity",
4
+ "$ref": "#/$defs/Identity",
5
+ "$defs": {
6
+ "Identity": {
7
+ "properties": {
8
+ "country": {
9
+ "$ref": "https://gobl.org/draft-0/l10n/tax-country-code",
10
+ "title": "Country Code",
11
+ "description": "Tax country code for Where the tax identity was issued."
12
+ },
13
+ "code": {
14
+ "$ref": "https://gobl.org/draft-0/cbc/code",
15
+ "pattern": "^[A-Z0-9]+$",
16
+ "title": "Code",
17
+ "description": "Normalized code shown on the original identity document."
18
+ },
19
+ "scheme": {
20
+ "$ref": "https://gobl.org/draft-0/cbc/code",
21
+ "title": "Scheme",
22
+ "description": "Scheme is an optional field that may be used to override the tax regime's\ndefault tax scheme. Many electronic formats such as UBL or CII define an\nequivalent field. Examples: `VAT`, `GST`, `ST`, etc."
23
+ },
24
+ "type": {
25
+ "$ref": "https://gobl.org/draft-0/cbc/key",
26
+ "title": "Type",
27
+ "description": "Type is set according to the requirements of each regime, some have a single\ntax document type code, others require a choice to be made.\n\nDeprecated: Tax Identities should only be used for VAT or similar codes\nfor companies. Use the identities array for other types of identification."
28
+ },
29
+ "zone": {
30
+ "$ref": "https://gobl.org/draft-0/l10n/code",
31
+ "title": "Zone",
32
+ "description": "Zone identifies a sub-locality within a country.\n\nDeprecated: Removed 2024-03-14 in favour of using tax tags\nand extensions with local data when required. Maintained here to support\ndata migration."
33
+ }
34
+ },
35
+ "type": "object",
36
+ "required": [
37
+ "country"
38
+ ],
39
+ "description": "Identity stores the details required to identify an entity for tax purposes in a specific country.",
40
+ "recommended": [
41
+ "code"
42
+ ]
43
+ }
44
+ }
45
+ }