gobl 0.9.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -13
  3. data/data/regimes/co.json +55 -1
  4. data/data/regimes/es.json +570 -64
  5. data/data/regimes/it.json +1182 -0
  6. data/lib/{gobl → generated/gobl}/bill/charge.rb +1 -1
  7. data/lib/{gobl → generated/gobl}/bill/delivery.rb +1 -1
  8. data/lib/{gobl → generated/gobl}/bill/discount.rb +1 -1
  9. data/lib/{gobl → generated/gobl}/bill/document_reference.rb +1 -1
  10. data/lib/{gobl → generated/gobl}/bill/invoice.rb +19 -8
  11. data/lib/{gobl → generated/gobl}/bill/line.rb +3 -3
  12. data/lib/{gobl → generated/gobl}/bill/line_charge.rb +1 -1
  13. data/lib/{gobl → generated/gobl}/bill/line_discount.rb +1 -1
  14. data/lib/{gobl → generated/gobl}/bill/ordering.rb +1 -1
  15. data/lib/{gobl → generated/gobl}/bill/outlay.rb +3 -3
  16. data/lib/{gobl → generated/gobl}/bill/payment.rb +1 -1
  17. data/lib/{gobl → generated/gobl}/bill/preceding.rb +23 -23
  18. data/lib/{gobl → generated/gobl}/bill/tax.rb +4 -4
  19. data/lib/{gobl → generated/gobl}/bill/totals.rb +5 -5
  20. data/lib/{gobl → generated/gobl}/cal/date.rb +2 -2
  21. data/lib/{gobl → generated/gobl}/cal/period.rb +3 -3
  22. data/lib/{gobl → generated/gobl}/cbc/code.rb +3 -3
  23. data/lib/{gobl → generated/gobl}/cbc/key.rb +2 -2
  24. data/lib/{gobl → generated/gobl}/cbc/meta.rb +1 -1
  25. data/lib/{gobl → generated/gobl}/cbc/note.rb +6 -6
  26. data/lib/{gobl → generated/gobl}/cbc/stamp.rb +3 -3
  27. data/lib/{gobl → generated/gobl}/currency/code.rb +7 -4
  28. data/lib/{gobl → generated/gobl}/currency/exchange_rate.rb +3 -3
  29. data/lib/generated/gobl/document.rb +16 -0
  30. data/lib/{gobl → generated/gobl}/dsig/digest.rb +3 -3
  31. data/lib/{gobl → generated/gobl}/dsig/signature.rb +2 -2
  32. data/lib/{gobl → generated/gobl}/envelope.rb +5 -5
  33. data/lib/{gobl → generated/gobl}/header.rb +4 -4
  34. data/lib/{gobl → generated/gobl}/i18n/string.rb +1 -1
  35. data/lib/{gobl → generated/gobl}/l10n/code.rb +2 -2
  36. data/lib/{gobl → generated/gobl}/l10n/country_code.rb +7 -4
  37. data/lib/{gobl → generated/gobl}/note/message.rb +4 -4
  38. data/lib/{gobl → generated/gobl}/org/address.rb +2 -2
  39. data/lib/{gobl → generated/gobl}/org/coordinates.rb +1 -1
  40. data/lib/{gobl → generated/gobl}/org/email.rb +2 -2
  41. data/lib/generated/gobl/org/identity.rb +38 -0
  42. data/lib/{gobl → generated/gobl}/org/image.rb +1 -1
  43. data/lib/{gobl → generated/gobl}/org/inbox.rb +3 -3
  44. data/lib/{gobl → generated/gobl}/org/item.rb +10 -10
  45. data/lib/{gobl → generated/gobl}/org/name.rb +3 -3
  46. data/lib/{gobl → generated/gobl}/org/party.rb +7 -7
  47. data/lib/{gobl → generated/gobl}/org/person.rb +2 -7
  48. data/lib/{gobl → generated/gobl}/org/registration.rb +1 -1
  49. data/lib/{gobl → generated/gobl}/org/telephone.rb +2 -2
  50. data/lib/{gobl → generated/gobl}/org/unit.rb +8 -3
  51. data/lib/{gobl → generated/gobl}/org/website.rb +2 -2
  52. data/lib/{gobl → generated/gobl}/pay/advance.rb +3 -3
  53. data/lib/{gobl → generated/gobl}/pay/card.rb +3 -3
  54. data/lib/{gobl → generated/gobl}/pay/credit_transfer.rb +1 -1
  55. data/lib/{gobl → generated/gobl}/pay/direct_debit.rb +1 -1
  56. data/lib/{gobl → generated/gobl}/pay/due_date.rb +3 -3
  57. data/lib/{gobl → generated/gobl}/pay/instructions.rb +19 -4
  58. data/lib/{gobl → generated/gobl}/pay/online.rb +2 -2
  59. data/lib/{gobl → generated/gobl}/pay/terms.rb +19 -4
  60. data/lib/{gobl → generated/gobl}/tax/category.rb +14 -4
  61. data/lib/{gobl → generated/gobl}/tax/category_total.rb +5 -5
  62. data/lib/{gobl → generated/gobl}/tax/combo.rb +7 -2
  63. data/lib/{gobl → generated/gobl}/tax/identity.rb +16 -6
  64. data/lib/generated/gobl/tax/key_definition.rb +38 -0
  65. data/lib/generated/gobl/tax/preceding_definitions.rb +27 -0
  66. data/lib/{gobl → generated/gobl}/tax/rate.rb +11 -4
  67. data/lib/{gobl → generated/gobl}/tax/rate_total.rb +4 -4
  68. data/lib/{gobl → generated/gobl}/tax/rate_total_surcharge.rb +3 -3
  69. data/lib/{gobl → generated/gobl}/tax/rate_value.rb +2 -2
  70. data/lib/{gobl → generated/gobl}/tax/regime.rb +19 -9
  71. data/lib/generated/gobl/tax/scenario.rb +37 -0
  72. data/lib/generated/gobl/tax/scenario_set.rb +29 -0
  73. data/lib/{gobl → generated/gobl}/tax/set.rb +1 -1
  74. data/lib/generated/gobl/tax/tag.rb +33 -0
  75. data/lib/{gobl → generated/gobl}/tax/total.rb +2 -2
  76. data/lib/{gobl → generated/gobl}/tax/zone.rb +2 -2
  77. data/lib/{gobl → generated/gobl}/uuid/uuid.rb +2 -2
  78. data/lib/gobl/enum.rb +8 -56
  79. data/lib/gobl/version.rb +1 -1
  80. data/lib/gobl.rb +1 -0
  81. metadata +75 -76
  82. data/lib/gobl/bill/invoice_type.rb +0 -30
  83. data/lib/gobl/cbc/note_key.rb +0 -48
  84. data/lib/gobl/document.rb +0 -13
  85. data/lib/gobl/org/item_code.rb +0 -28
  86. data/lib/gobl/pay/method_key.rb +0 -30
  87. data/lib/gobl/pay/term_key.rb +0 -33
  88. data/lib/gobl/tax/scheme.rb +0 -44
  89. data/lib/gobl/tax/source_key.rb +0 -28
  90. data/lib/gobl/value.rb +0 -77
@@ -3,11 +3,11 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
10
- # Header defines the meta data of the body.
10
+ # Header defines the metadata of the body.
11
11
  class Header < GOBL::Object
12
12
  # The Schema ID of the GOBL Header structure
13
13
  SCHEMA_ID = 'https://gobl.org/draft-0/envelope#/$defs/Header'
@@ -16,13 +16,13 @@ module GOBL
16
16
  # Unique UUIDv1 identifier for the envelope.
17
17
  # @return [GOBL::UUID::UUID]
18
18
  property :uuid, GOBL::UUID::UUID
19
- validates :uuid, presence: true
19
+ validates_presence_of :uuid
20
20
 
21
21
  # @!attribute [r] dig
22
22
  # Digest of the canonical JSON body.
23
23
  # @return [GOBL::DSig::Digest]
24
24
  property :dig, GOBL::DSig::Digest
25
- validates :dig, presence: true
25
+ validates_presence_of :dig
26
26
 
27
27
  # @!attribute [r] stamps
28
28
  # Seals of approval from other organisations.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -3,13 +3,13 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
10
10
  module L10n
11
11
  # Code is used for short identifies like country or state codes.
12
- class Code < GOBL::Value
12
+ class Code < String
13
13
  # The Schema ID of the GOBL Code structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/l10n/code'
15
15
  end
@@ -3,17 +3,18 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
10
10
  module L10n
11
11
  # Defines an ISO 3166-2 country code
12
- class CountryCode < GOBL::Enum
12
+ class CountryCode < String
13
13
  # The Schema ID of the GOBL CountryCode structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/l10n/country-code'
15
15
 
16
- # The enumeration of values of the object and their descriptions (Values different to these are not allowed)
16
+ include GOBL::Enum
17
+
17
18
  ENUM = {
18
19
  'AF' => 'Afghanistan',
19
20
  'AX' => 'Åland Islands',
@@ -266,7 +267,9 @@ module GOBL
266
267
  'ZW' => 'Zimbabwe'
267
268
  }.freeze
268
269
 
269
- validates_inclusion_of :_value, in: ENUM.keys, message: '"%{value}" is not within the allowed values of the enumeration'
270
+ def strict_enum?
271
+ true
272
+ end
270
273
  end
271
274
  end
272
275
  end
@@ -3,12 +3,12 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
10
10
  module Note
11
- # Message represents the minimum possible contents for a GoBL document type.
11
+ # Message represents a simple message object with a title and some content meant.
12
12
  class Message < GOBL::Object
13
13
  # The Schema ID of the GOBL Message structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/note/message'
@@ -19,10 +19,10 @@ module GOBL
19
19
  property :title, String
20
20
 
21
21
  # @!attribute [r] content
22
- # Details of what exactly this message wants to communicate
22
+ # Details of what exactly this message wants to communicate.
23
23
  # @return [String]
24
24
  property :content, String
25
- validates :content, presence: true
25
+ validates_presence_of :content
26
26
 
27
27
  # @!attribute [r] meta
28
28
  # Any additional semi-structured data that might be useful.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -62,7 +62,7 @@ module GOBL
62
62
  # Village, town, district, or city, typically inside a region.
63
63
  # @return [String]
64
64
  property :locality, String
65
- validates :locality, presence: true
65
+ validates_presence_of :locality
66
66
 
67
67
  # @!attribute [r] region
68
68
  # Province, county, or state, inside a country.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.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.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -27,7 +27,7 @@ module GOBL
27
27
  # Electronic mailing address.
28
28
  # @return [String]
29
29
  property :addr, String
30
- validates :addr, presence: true
30
+ validates_presence_of :addr
31
31
 
32
32
  # @!attribute [r] meta
33
33
  # Additional fields.
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ## Generated with GOBL v0.38.0
7
+ ##
8
+
9
+ module GOBL
10
+ module Org
11
+ # Identity is used to define a code for a specific context.
12
+ class Identity < GOBL::Object
13
+ # The Schema ID of the GOBL Identity structure
14
+ SCHEMA_ID = 'https://gobl.org/draft-0/org/identity'
15
+
16
+ # @!attribute [r] uuid
17
+ # Unique identity for this identity object.
18
+ # @return [GOBL::UUID::UUID]
19
+ property :uuid, GOBL::UUID::UUID
20
+
21
+ # @!attribute [r] label
22
+ # Optional label useful for non-standard identities to give a bit more context.
23
+ # @return [String]
24
+ property :label, String
25
+
26
+ # @!attribute [r] type
27
+ # The type of Code being represented and usually specific for a particular context, country, or tax regime.
28
+ # @return [GOBL::CBC::Code]
29
+ property :type, GOBL::CBC::Code
30
+
31
+ # @!attribute [r] code
32
+ # The actual value of the identity code.
33
+ # @return [GOBL::CBC::Code]
34
+ property :code, GOBL::CBC::Code
35
+ validates_presence_of :code
36
+ end
37
+ end
38
+ end
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.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.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -22,7 +22,7 @@ module GOBL
22
22
  # Type of inbox being defined.
23
23
  # @return [GOBL::CBC::Key]
24
24
  property :key, GOBL::CBC::Key
25
- validates :key, presence: true
25
+ validates_presence_of :key
26
26
 
27
27
  # @!attribute [r] role
28
28
  # Role assigned to this inbox that may be relevant for the consumer.
@@ -38,7 +38,7 @@ module GOBL
38
38
  # Actual Code or ID that identifies the Inbox.
39
39
  # @return [String]
40
40
  property :code, String
41
- validates :code, presence: true
41
+ validates_presence_of :code
42
42
  end
43
43
  end
44
44
  end
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -14,12 +14,12 @@ module GOBL
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/org/item'
15
15
 
16
16
  # @!attribute [r] uuid
17
- # Unique identify of this item independent of the Supplier IDs
17
+ # Unique identity of this item
18
18
  # @return [GOBL::UUID::UUID]
19
19
  property :uuid, GOBL::UUID::UUID
20
20
 
21
21
  # @!attribute [r] ref
22
- # Primary reference code that identifies this item. Additional codes can be provided in the 'codes' field.
22
+ # Primary reference code that identifies this item. Additional codes can be provided in the 'identities' property.
23
23
  # @return [String]
24
24
  property :ref, String
25
25
 
@@ -27,7 +27,12 @@ module GOBL
27
27
  # Brief name of the item
28
28
  # @return [String]
29
29
  property :name, String
30
- validates :name, presence: true
30
+ validates_presence_of :name
31
+
32
+ # @!attribute [r] identities
33
+ # List of additional codes, IDs, or SKUs which can be used to identify the item. They should be agreed upon between supplier and customer.
34
+ # @return [Array<GOBL::Org::Identity>]
35
+ property :identities, [GOBL::Org::Identity]
31
36
 
32
37
  # @!attribute [r] desc
33
38
  # Detailed description
@@ -43,18 +48,13 @@ module GOBL
43
48
  # Base price of a single unit to be sold.
44
49
  # @return [GOBL::Num::Amount]
45
50
  property :price, GOBL::Num::Amount
46
- validates :price, presence: true
51
+ validates_presence_of :price
47
52
 
48
53
  # @!attribute [r] unit
49
54
  # Unit of measure.
50
55
  # @return [GOBL::Org::Unit]
51
56
  property :unit, GOBL::Org::Unit
52
57
 
53
- # @!attribute [r] codes
54
- # List of additional codes, IDs, or SKUs which can be used to identify the item. The should be agreed upon between supplier and customer.
55
- # @return [Array<ItemCode>]
56
- property :codes, [ItemCode]
57
-
58
58
  # @!attribute [r] origin
59
59
  # Country code of where this item was from originally.
60
60
  # @return [GOBL::L10n::CountryCode]
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -32,7 +32,7 @@ module GOBL
32
32
  # Person's given or first name
33
33
  # @return [String]
34
34
  property :given, String
35
- validates :given, presence: true
35
+ validates_presence_of :given
36
36
 
37
37
  # @!attribute [r] middle
38
38
  # Middle names or initials
@@ -43,7 +43,7 @@ module GOBL
43
43
  # Second or Family name.
44
44
  # @return [String]
45
45
  property :surname, String
46
- validates :surname, presence: true
46
+ validates_presence_of :surname
47
47
 
48
48
  # @!attribute [r] surname2
49
49
  # Additional second of family name.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -13,11 +13,6 @@ module GOBL
13
13
  # The Schema ID of the GOBL Party structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/org/party'
15
15
 
16
- # @!attribute [r] id
17
- # Internal ID used to identify the party inside a document.
18
- # @return [String]
19
- property :id, String
20
-
21
16
  # @!attribute [r] uuid
22
17
  # Unique identity code
23
18
  # @return [GOBL::UUID::UUID]
@@ -28,11 +23,16 @@ module GOBL
28
23
  # @return [GOBL::Tax::Identity]
29
24
  property :tax_id, GOBL::Tax::Identity
30
25
 
26
+ # @!attribute [r] identities
27
+ # Set of codes used to identify the party in other systems.
28
+ # @return [Array<GOBL::Org::Identity>]
29
+ property :identities, [GOBL::Org::Identity]
30
+
31
31
  # @!attribute [r] name
32
32
  # Legal name or representation of the organization.
33
33
  # @return [String]
34
34
  property :name, String
35
- validates :name, presence: true
35
+ validates_presence_of :name
36
36
 
37
37
  # @!attribute [r] alias
38
38
  # Alternate short name.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -13,11 +13,6 @@ module GOBL
13
13
  # The Schema ID of the GOBL Person structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/org/person'
15
15
 
16
- # @!attribute [r] id
17
- # Internal ID used to identify the person inside a document.
18
- # @return [String]
19
- property :id, String
20
-
21
16
  # @!attribute [r] uuid
22
17
  # Unique identity code
23
18
  # @return [GOBL::UUID::UUID]
@@ -27,7 +22,7 @@ module GOBL
27
22
  # Complete details on the name of the person
28
23
  # @return [GOBL::Org::Name]
29
24
  property :name, GOBL::Org::Name
30
- validates :name, presence: true
25
+ validates_presence_of :name
31
26
 
32
27
  # @!attribute [r] role
33
28
  # What they do within an organization
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.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.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -27,7 +27,7 @@ module GOBL
27
27
  # The number to be dialed in ITU E.164 international format.
28
28
  # @return [String]
29
29
  property :num, String
30
- validates :num, presence: true
30
+ validates_presence_of :num
31
31
  end
32
32
  end
33
33
  end
@@ -3,17 +3,18 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
10
10
  module Org
11
11
  # Unit describes how the quantity of the product should be interpreted.
12
- class Unit < GOBL::Enum
12
+ class Unit < String
13
13
  # The Schema ID of the GOBL Unit structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/org/unit'
15
15
 
16
- # The enumeration of values of the object and their descriptions (Values different to these are also allowed)
16
+ include GOBL::Enum
17
+
17
18
  ENUM = {
18
19
  'g' => 'Metric grams',
19
20
  'kg' => 'Metric kilograms',
@@ -64,6 +65,10 @@ module GOBL
64
65
  'sheet' => 'Sheets',
65
66
  'envelope' => 'Envelopes'
66
67
  }.freeze
68
+
69
+ def strict_enum?
70
+ false
71
+ end
67
72
  end
68
73
  end
69
74
  end
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -32,7 +32,7 @@ module GOBL
32
32
  # URL for the website.
33
33
  # @return [String]
34
34
  property :url, String
35
- validates :url, presence: true
35
+ validates_presence_of :url
36
36
  end
37
37
  end
38
38
  end
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -37,7 +37,7 @@ module GOBL
37
37
  # Details about the advance.
38
38
  # @return [String]
39
39
  property :desc, String
40
- validates :desc, presence: true
40
+ validates_presence_of :desc
41
41
 
42
42
  # @!attribute [r] percent
43
43
  # How much as a percentage of the total with tax was paid
@@ -48,7 +48,7 @@ module GOBL
48
48
  # How much was paid.
49
49
  # @return [GOBL::Num::Amount]
50
50
  property :amount, GOBL::Num::Amount
51
- validates :amount, presence: true
51
+ validates_presence_of :amount
52
52
 
53
53
  # @!attribute [r] currency
54
54
  # If different from the parent document's base currency.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -17,13 +17,13 @@ module GOBL
17
17
  # Last 4 digits of the card's Primary Account Number (PAN).
18
18
  # @return [String]
19
19
  property :last4, String
20
- validates :last4, presence: true
20
+ validates_presence_of :last4
21
21
 
22
22
  # @!attribute [r] holder
23
23
  # Name of the person whom the card belongs to.
24
24
  # @return [String]
25
25
  property :holder, String
26
- validates :holder, presence: true
26
+ validates_presence_of :holder
27
27
  end
28
28
  end
29
29
  end
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.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.36.0
6
+ ## Generated with GOBL v0.38.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.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -17,7 +17,7 @@ module GOBL
17
17
  # When the payment is due.
18
18
  # @return [GOBL::Cal::Date]
19
19
  property :date, GOBL::Cal::Date
20
- validates :date, presence: true
20
+ validates_presence_of :date
21
21
 
22
22
  # @!attribute [r] notes
23
23
  # Other details to take into account for the due date.
@@ -28,7 +28,7 @@ module GOBL
28
28
  # How much needs to be paid by the date.
29
29
  # @return [GOBL::Num::Amount]
30
30
  property :amount, GOBL::Num::Amount
31
- validates :amount, presence: true
31
+ validates_presence_of :amount
32
32
 
33
33
  # @!attribute [r] percent
34
34
  # Percentage of the total that should be paid by the date.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -13,11 +13,26 @@ module GOBL
13
13
  # The Schema ID of the GOBL Instructions structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/pay/instructions'
15
15
 
16
+ # Enumeration of possible values for {#key} with their corresponding descriptions
17
+ KEY_ENUM = {
18
+ 'any' => 'Any method available, no preference',
19
+ 'card' => 'Credit or debit card',
20
+ 'credit-transfer' => 'Sender initiated bank or wire transfer',
21
+ 'debit-transfer' => 'Receiver initiated bank or wire transfer',
22
+ 'cash' => 'Cash',
23
+ 'cheque' => 'Cheque',
24
+ 'credit' => 'Credit',
25
+ 'bank-draft' => 'Bankers Draft or Bank Cheque',
26
+ 'direct-debit' => 'Direct debit',
27
+ 'online' => 'Online or web payment'
28
+ }.freeze
29
+
16
30
  # @!attribute [r] key
17
31
  # How payment is expected or has been arranged to be collected
18
- # @return [MethodKey]
19
- property :key, MethodKey
20
- validates :key, presence: true
32
+ # @return [GOBL::CBC::Key]
33
+ property :key, GOBL::CBC::Key
34
+ validates_presence_of :key
35
+ validates_inclusion_of :key, in: KEY_ENUM.keys
21
36
 
22
37
  # @!attribute [r] detail
23
38
  # Optional text description of the payment method
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -22,7 +22,7 @@ module GOBL
22
22
  # Full URL to be used for payment.
23
23
  # @return [String]
24
24
  property :addr, String
25
- validates :addr, presence: true
25
+ validates_presence_of :addr
26
26
  end
27
27
  end
28
28
  end
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.36.0
6
+ ## Generated with GOBL v0.38.0
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -13,11 +13,26 @@ module GOBL
13
13
  # The Schema ID of the GOBL Terms structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/pay/terms'
15
15
 
16
+ # Enumeration of possible values for {#key} with their corresponding descriptions
17
+ KEY_ENUM = {
18
+ '' => 'Not yet defined',
19
+ 'end-of-month' => 'End of month',
20
+ 'due-date' => 'Due on a specific date',
21
+ 'deferred' => 'Deferred until after the due date',
22
+ 'proximo' => 'Month after the present',
23
+ 'instant' => 'On receipt of invoice',
24
+ 'elective' => 'Chosen by the buyer',
25
+ 'pending' => 'Seller to advise buyer in separate transaction',
26
+ 'advance' => 'Payment made in advance',
27
+ 'delivery' => 'Payment on Delivery'
28
+ }.freeze
29
+
16
30
  # @!attribute [r] key
17
31
  # Type of terms to be applied.
18
- # @return [TermKey]
19
- property :key, TermKey
20
- validates :key, presence: true
32
+ # @return [GOBL::CBC::Key]
33
+ property :key, GOBL::CBC::Key
34
+ validates_presence_of :key
35
+ validates_inclusion_of :key, in: KEY_ENUM.keys
21
36
 
22
37
  # @!attribute [r] detail
23
38
  # Text detail of the chosen payment terms.