gobl 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/data/regimes/co.json +11 -14575
  3. data/data/regimes/es.json +28 -499
  4. data/data/regimes/it.json +9 -644
  5. data/data/regimes/mx.json +14 -2
  6. data/data/regimes/pt.json +34 -194
  7. data/lib/generated/gobl/bill/charge.rb +1 -1
  8. data/lib/generated/gobl/bill/correction_options.rb +3 -3
  9. data/lib/generated/gobl/bill/delivery.rb +1 -1
  10. data/lib/generated/gobl/bill/discount.rb +1 -1
  11. data/lib/generated/gobl/bill/document_reference.rb +1 -1
  12. data/lib/generated/gobl/bill/invoice.rb +4 -3
  13. data/lib/generated/gobl/bill/line.rb +1 -1
  14. data/lib/generated/gobl/bill/line_charge.rb +1 -1
  15. data/lib/generated/gobl/bill/line_discount.rb +1 -1
  16. data/lib/generated/gobl/bill/ordering.rb +1 -1
  17. data/lib/generated/gobl/bill/outlay.rb +1 -1
  18. data/lib/generated/gobl/bill/payment.rb +1 -1
  19. data/lib/generated/gobl/bill/preceding.rb +14 -3
  20. data/lib/generated/gobl/bill/tax.rb +1 -1
  21. data/lib/generated/gobl/bill/totals.rb +1 -1
  22. data/lib/generated/gobl/cal/date.rb +1 -1
  23. data/lib/generated/gobl/cal/date_time.rb +1 -1
  24. data/lib/generated/gobl/cal/period.rb +1 -1
  25. data/lib/generated/gobl/cbc/code.rb +1 -1
  26. data/lib/generated/gobl/{tax → cbc}/code_definition.rb +8 -3
  27. data/lib/generated/gobl/cbc/code_map.rb +1 -1
  28. data/lib/generated/gobl/cbc/key.rb +1 -1
  29. data/lib/generated/gobl/{tax → cbc}/key_definition.rb +17 -7
  30. data/lib/generated/gobl/cbc/meta.rb +1 -1
  31. data/lib/generated/gobl/cbc/note.rb +1 -1
  32. data/lib/generated/gobl/currency/code.rb +1 -1
  33. data/lib/generated/gobl/currency/exchange_rate.rb +1 -1
  34. data/lib/generated/gobl/dsig/digest.rb +1 -1
  35. data/lib/generated/gobl/dsig/signature.rb +1 -1
  36. data/lib/generated/gobl/envelope.rb +1 -1
  37. data/lib/generated/gobl/head/header.rb +1 -1
  38. data/lib/generated/gobl/head/stamp.rb +1 -1
  39. data/lib/generated/gobl/i18n/string.rb +1 -1
  40. data/lib/generated/gobl/l10n/code.rb +1 -1
  41. data/lib/generated/gobl/l10n/country_code.rb +1 -1
  42. data/lib/generated/gobl/note/message.rb +1 -1
  43. data/lib/generated/gobl/org/address.rb +1 -1
  44. data/lib/generated/gobl/org/coordinates.rb +1 -1
  45. data/lib/generated/gobl/org/email.rb +1 -1
  46. data/lib/generated/gobl/org/identity.rb +1 -1
  47. data/lib/generated/gobl/org/image.rb +1 -1
  48. data/lib/generated/gobl/org/inbox.rb +1 -1
  49. data/lib/generated/gobl/org/item.rb +3 -3
  50. data/lib/generated/gobl/org/name.rb +1 -1
  51. data/lib/generated/gobl/org/party.rb +3 -3
  52. data/lib/generated/gobl/org/person.rb +1 -1
  53. data/lib/generated/gobl/org/registration.rb +1 -1
  54. data/lib/generated/gobl/org/telephone.rb +1 -1
  55. data/lib/generated/gobl/org/unit.rb +1 -1
  56. data/lib/generated/gobl/org/website.rb +1 -1
  57. data/lib/generated/gobl/pay/advance.rb +1 -1
  58. data/lib/generated/gobl/pay/card.rb +1 -1
  59. data/lib/generated/gobl/pay/credit_transfer.rb +1 -1
  60. data/lib/generated/gobl/pay/direct_debit.rb +1 -1
  61. data/lib/generated/gobl/pay/due_date.rb +1 -1
  62. data/lib/generated/gobl/pay/instructions.rb +1 -1
  63. data/lib/generated/gobl/pay/online.rb +1 -1
  64. data/lib/generated/gobl/pay/terms.rb +1 -1
  65. data/lib/generated/gobl/regimes/mx/food_vouchers.rb +1 -1
  66. data/lib/generated/gobl/regimes/mx/food_vouchers_employee.rb +1 -1
  67. data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +1 -1
  68. data/lib/generated/gobl/regimes/mx/fuel_account_balance.rb +1 -1
  69. data/lib/generated/gobl/regimes/mx/fuel_account_item.rb +1 -1
  70. data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +1 -1
  71. data/lib/generated/gobl/regimes/mx/fuel_account_tax.rb +1 -1
  72. data/lib/generated/gobl/schema/object.rb +1 -1
  73. data/lib/generated/gobl/tax/category.rb +1 -1
  74. data/lib/generated/gobl/tax/category_total.rb +1 -1
  75. data/lib/generated/gobl/tax/combo.rb +3 -3
  76. data/lib/generated/gobl/tax/correction_definition.rb +1 -1
  77. data/lib/generated/gobl/tax/{ext_map.rb → extensions.rb} +3 -3
  78. data/lib/generated/gobl/tax/identity.rb +1 -6
  79. data/lib/generated/gobl/tax/rate.rb +1 -1
  80. data/lib/generated/gobl/tax/rate_total.rb +3 -3
  81. data/lib/generated/gobl/tax/rate_total_surcharge.rb +1 -1
  82. data/lib/generated/gobl/tax/rate_value.rb +5 -5
  83. data/lib/generated/gobl/tax/regime.rb +13 -18
  84. data/lib/generated/gobl/tax/scenario.rb +1 -1
  85. data/lib/generated/gobl/tax/scenario_set.rb +1 -1
  86. data/lib/generated/gobl/tax/set.rb +1 -1
  87. data/lib/generated/gobl/tax/source.rb +1 -1
  88. data/lib/generated/gobl/tax/total.rb +1 -1
  89. data/lib/generated/gobl/uuid/uuid.rb +1 -1
  90. data/lib/gobl/operations/validation_result.rb +1 -3
  91. data/lib/gobl/version.rb +1 -1
  92. metadata +5 -6
  93. data/lib/generated/gobl/tax/zone.rb +0 -48
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.67.0
6
+ ## Generated with GOBL v0.69.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.67.0
6
+ ## Generated with GOBL v0.69.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -4,8 +4,6 @@ module GOBL
4
4
  module Operations
5
5
  # The result of a GOBL validation over a GOBL structure
6
6
  class ValidationResult
7
- SERVICE_ERROR_REGEX = /^code=(?<code>\d+), message=(?<msg>.+)$/.freeze # @api private
8
-
9
7
  def initialize(errors)
10
8
  @errors = errors
11
9
  end
@@ -30,7 +28,7 @@ module GOBL
30
28
  # @param service_error [String]
31
29
  # @return [ValidationResult]
32
30
  def self.from_service_error(service_error)
33
- message = service_error.match(SERVICE_ERROR_REGEX)[:msg]
31
+ message = service_error["message"] || service_error["key"]
34
32
  errors = message.split('; ')
35
33
  new errors
36
34
  end
data/lib/gobl/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GOBL
4
- VERSION = '0.19.0'
4
+ VERSION = '0.20.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luismi Cavalle
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-02-05 00:00:00.000000000 Z
14
+ date: 2024-03-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -93,8 +93,10 @@ files:
93
93
  - lib/generated/gobl/cal/date_time.rb
94
94
  - lib/generated/gobl/cal/period.rb
95
95
  - lib/generated/gobl/cbc/code.rb
96
+ - lib/generated/gobl/cbc/code_definition.rb
96
97
  - lib/generated/gobl/cbc/code_map.rb
97
98
  - lib/generated/gobl/cbc/key.rb
99
+ - lib/generated/gobl/cbc/key_definition.rb
98
100
  - lib/generated/gobl/cbc/meta.rb
99
101
  - lib/generated/gobl/cbc/note.rb
100
102
  - lib/generated/gobl/currency/code.rb
@@ -140,12 +142,10 @@ files:
140
142
  - lib/generated/gobl/schema/object.rb
141
143
  - lib/generated/gobl/tax/category.rb
142
144
  - lib/generated/gobl/tax/category_total.rb
143
- - lib/generated/gobl/tax/code_definition.rb
144
145
  - lib/generated/gobl/tax/combo.rb
145
146
  - lib/generated/gobl/tax/correction_definition.rb
146
- - lib/generated/gobl/tax/ext_map.rb
147
+ - lib/generated/gobl/tax/extensions.rb
147
148
  - lib/generated/gobl/tax/identity.rb
148
- - lib/generated/gobl/tax/key_definition.rb
149
149
  - lib/generated/gobl/tax/rate.rb
150
150
  - lib/generated/gobl/tax/rate_total.rb
151
151
  - lib/generated/gobl/tax/rate_total_surcharge.rb
@@ -156,7 +156,6 @@ files:
156
156
  - lib/generated/gobl/tax/set.rb
157
157
  - lib/generated/gobl/tax/source.rb
158
158
  - lib/generated/gobl/tax/total.rb
159
- - lib/generated/gobl/tax/zone.rb
160
159
  - lib/generated/gobl/uuid/uuid.rb
161
160
  - lib/gobl.rb
162
161
  - lib/gobl/config.rb
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ##
4
- ## DO NOT EDIT - This file was generated automatically.
5
- ##
6
- ## Generated with GOBL v0.67.0
7
- ##
8
-
9
- module GOBL
10
- module Tax
11
- # Zone represents an area inside a country, like a province or a state, which shares the basic definitions of the country, but may vary in some validation rules.
12
- class Zone < GOBL::Object
13
- # The Schema ID of the GOBL Zone structure
14
- SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/Zone'
15
-
16
- # @!attribute [r] code
17
- # Unique zone code.
18
- # @return [GOBL::L10n::Code]
19
- property :code, GOBL::L10n::Code
20
- validates_presence_of :code
21
-
22
- # @!attribute [r] name
23
- # Name of the zone to be use if a locality or region is not applicable.
24
- # @return [GOBL::I18n::String]
25
- property :name, GOBL::I18n::String
26
-
27
- # @!attribute [r] locality
28
- # Village, town, district, or city name which should coincide with address data.
29
- # @return [GOBL::I18n::String]
30
- property :locality, GOBL::I18n::String
31
-
32
- # @!attribute [r] region
33
- # Province, county, or state which should match address data.
34
- # @return [GOBL::I18n::String]
35
- property :region, GOBL::I18n::String
36
-
37
- # @!attribute [r] codes
38
- # Codes defines a set of regime specific code mappings.
39
- # @return [GOBL::CBC::CodeMap]
40
- property :codes, GOBL::CBC::CodeMap
41
-
42
- # @!attribute [r] meta
43
- # Any additional information
44
- # @return [GOBL::CBC::Meta]
45
- property :meta, GOBL::CBC::Meta
46
- end
47
- end
48
- end