gobl 0.21.0 → 0.23.0

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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/data/regimes/ae.json +173 -0
  3. data/data/regimes/at.json +56 -50
  4. data/data/regimes/be.json +56 -50
  5. data/data/regimes/br.json +135 -0
  6. data/data/regimes/ca.json +2 -1
  7. data/data/regimes/ch.json +56 -50
  8. data/data/regimes/co.json +34 -203
  9. data/data/regimes/de.json +74 -47
  10. data/data/regimes/el.json +211 -0
  11. data/data/regimes/es.json +69 -550
  12. data/data/regimes/fr.json +56 -50
  13. data/data/regimes/gb.json +60 -50
  14. data/data/regimes/in.json +128 -0
  15. data/data/regimes/it.json +48 -1311
  16. data/data/regimes/mx.json +39 -639
  17. data/data/regimes/nl.json +56 -50
  18. data/data/regimes/pl.json +101 -97
  19. data/data/regimes/pt.json +1459 -227
  20. data/data/regimes/us.json +55 -50
  21. data/lib/generated/gobl/bill/charge.rb +34 -19
  22. data/lib/generated/gobl/bill/correction_options.rb +8 -3
  23. data/lib/generated/gobl/bill/delivery.rb +184 -16
  24. data/lib/generated/gobl/bill/delivery_details.rb +41 -0
  25. data/lib/generated/gobl/bill/discount.rb +36 -13
  26. data/lib/generated/gobl/bill/invoice.rb +88 -41
  27. data/lib/generated/gobl/bill/line.rb +39 -4
  28. data/lib/generated/gobl/bill/line_charge.rb +56 -11
  29. data/lib/generated/gobl/bill/line_discount.rb +45 -12
  30. data/lib/generated/gobl/bill/order.rb +208 -0
  31. data/lib/generated/gobl/bill/ordering.rb +40 -35
  32. data/lib/generated/gobl/bill/payment.rb +155 -15
  33. data/lib/generated/gobl/bill/payment_details.rb +36 -0
  34. data/lib/generated/gobl/bill/payment_line.rb +77 -0
  35. data/lib/generated/gobl/bill/sub_line.rb +83 -0
  36. data/lib/generated/gobl/bill/tax.rb +19 -5
  37. data/lib/generated/gobl/bill/totals.rb +18 -18
  38. data/lib/generated/gobl/bill/tracking.rb +26 -0
  39. data/lib/generated/gobl/cal/date_time.rb +1 -1
  40. data/lib/generated/gobl/cal/time.rb +16 -0
  41. data/lib/generated/gobl/cbc/code.rb +2 -1
  42. data/lib/generated/gobl/cbc/{key_definition.rb → definition.rb} +18 -14
  43. data/lib/generated/gobl/cbc/source.rb +37 -0
  44. data/lib/generated/gobl/currency/code.rb +16 -16
  45. data/lib/generated/gobl/currency/exchange_rate.rb +10 -5
  46. data/lib/generated/gobl/head/header.rb +5 -5
  47. data/lib/generated/gobl/head/link.rb +43 -0
  48. data/lib/generated/gobl/l10n/{country_code.rb → iso_country_code.rb} +3 -3
  49. data/lib/generated/gobl/l10n/tax_country_code.rb +277 -0
  50. data/lib/generated/gobl/org/address.rb +11 -7
  51. data/lib/generated/gobl/org/attachment.rb +62 -0
  52. data/lib/generated/gobl/org/document_ref.rb +102 -0
  53. data/lib/generated/gobl/org/identity.rb +11 -1
  54. data/lib/generated/gobl/org/inbox.rb +22 -14
  55. data/lib/generated/gobl/org/item.rb +4 -5
  56. data/lib/generated/gobl/org/name.rb +0 -2
  57. data/lib/generated/gobl/{cbc → org}/note.rb +16 -5
  58. data/lib/generated/gobl/org/party.rb +9 -6
  59. data/lib/generated/gobl/org/person.rb +5 -0
  60. data/lib/generated/gobl/org/registration.rb +4 -0
  61. data/lib/generated/gobl/org/telephone.rb +1 -1
  62. data/lib/generated/gobl/org/unit.rb +2 -1
  63. data/lib/generated/gobl/pay/advance.rb +8 -1
  64. data/lib/generated/gobl/pay/card.rb +5 -2
  65. data/lib/generated/gobl/pay/instructions.rb +10 -3
  66. data/lib/generated/gobl/pay/terms.rb +7 -2
  67. data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +5 -0
  68. data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +5 -0
  69. data/lib/generated/gobl/tax/addon_def.rb +76 -0
  70. data/lib/generated/gobl/tax/catalogue_def.rb +39 -0
  71. data/lib/generated/gobl/tax/{category.rb → category_def.rb} +14 -14
  72. data/lib/generated/gobl/tax/combo.rb +5 -0
  73. data/lib/generated/gobl/tax/correction_definition.rb +6 -1
  74. data/lib/generated/gobl/tax/correction_set.rb +13 -0
  75. data/lib/generated/gobl/tax/identity.rb +8 -3
  76. data/lib/generated/gobl/tax/{rate.rb → rate_def.rb} +11 -16
  77. data/lib/generated/gobl/tax/rate_total.rb +5 -0
  78. data/lib/generated/gobl/tax/{rate_value.rb → rate_value_def.rb} +4 -4
  79. data/lib/generated/gobl/tax/{regime.rb → regime_def.rb} +38 -33
  80. data/lib/generated/gobl/tax/scenario.rb +22 -12
  81. data/lib/generated/gobl/tax/scenario_note.rb +42 -0
  82. data/lib/generated/gobl/tax/scenario_set.rb +1 -1
  83. data/lib/generated/gobl/tax/tag_set.rb +28 -0
  84. data/lib/generated/gobl/tax/total.rb +6 -1
  85. data/lib/gobl/extensions/bill/invoice_helper.rb +6 -36
  86. data/lib/gobl/extensions/envelope_helper.rb +4 -0
  87. data/lib/gobl/version.rb +1 -1
  88. data/lib/gobl.rb +3 -2
  89. metadata +36 -21
  90. data/lib/generated/gobl/bill/document_reference.rb +0 -36
  91. data/lib/generated/gobl/bill/outlay.rb +0 -58
  92. data/lib/generated/gobl/bill/preceding.rb +0 -78
  93. data/lib/generated/gobl/cbc/code_definition.rb +0 -37
  94. data/lib/generated/gobl/tax/source.rb +0 -27
  95. data/lib/gobl/extensions/bill/scenario_summary.rb +0 -25
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Cal
10
+ # Civil time in simplified ISO format, like 13:45:30
11
+ class Time < String
12
+ # The Schema ID of the GOBL Time structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/cal/time'
14
+ end
15
+ end
16
+ end
@@ -7,7 +7,8 @@
7
7
 
8
8
  module GOBL
9
9
  module CBC
10
- # Alphanumerical text identifier with upper-case letters, no whitespace, nor symbols.
10
+ # Alphanumerical text identifier with upper-case letters and limits on using
11
+ # special characters or whitespace to separate blocks.
11
12
  class Code < String
12
13
  # The Schema ID of the GOBL Code structure
13
14
  SCHEMA_ID = 'https://gobl.org/draft-0/cbc/code'
@@ -7,16 +7,20 @@
7
7
 
8
8
  module GOBL
9
9
  module CBC
10
- # KeyDefinition defines properties of a key that is specific for a regime.
11
- class KeyDefinition < GOBL::Object
12
- # The Schema ID of the GOBL KeyDefinition structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/cbc/key-definition'
10
+ # Definition defines properties of a key, code, or other value that has a specific meaning or utility.
11
+ class Definition < GOBL::Object
12
+ # The Schema ID of the GOBL Definition structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/cbc/definition'
14
14
 
15
15
  # @!attribute [r] key
16
- # Actual key value.
16
+ # Key being defined.
17
17
  # @return [GOBL::CBC::Key]
18
18
  property :key, GOBL::CBC::Key
19
- validates_presence_of :key
19
+
20
+ # @!attribute [r] code
21
+ # Code this definition represents.
22
+ # @return [GOBL::CBC::Code]
23
+ property :code, GOBL::CBC::Code
20
24
 
21
25
  # @!attribute [r] name
22
26
  # Short name for the key.
@@ -34,15 +38,15 @@ module GOBL
34
38
  # @return [GOBL::CBC::Meta]
35
39
  property :meta, GOBL::CBC::Meta
36
40
 
37
- # @!attribute [r] codes
38
- # Codes describes the list of codes that can be used alongside the Key, for example with identities.
39
- # @return [Array<GOBL::CBC::CodeDefinition>]
40
- property :codes, [GOBL::CBC::CodeDefinition]
41
+ # @!attribute [r] sources
42
+ # Where the information was sourced from.
43
+ # @return [Array<GOBL::CBC::Source>]
44
+ property :sources, [GOBL::CBC::Source]
41
45
 
42
- # @!attribute [r] keys
43
- # Keys is used instead of codes to define a further sub-set of keys that can be used alongside this one.
44
- # @return [Array<GOBL::CBC::KeyDefinition>]
45
- property :keys, [GOBL::CBC::KeyDefinition]
46
+ # @!attribute [r] values
47
+ # Values defines the possible values associated with the key, which themselves will either be keys or codes depending on the context.
48
+ # @return [Array<GOBL::CBC::Definition>]
49
+ property :values, [GOBL::CBC::Definition]
46
50
 
47
51
  # @!attribute [r] pattern
48
52
  # Pattern is used to validate the key value instead of using a fixed value from the code or key definitions.
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module CBC
10
+ # Source is used to identify a specific source of data.
11
+ class Source < GOBL::Object
12
+ # The Schema ID of the GOBL Source structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/cbc/source'
14
+
15
+ # @!attribute [r] title
16
+ # Title stores the name of the source of information.
17
+ # @return [GOBL::I18n::String]
18
+ property :title, GOBL::I18n::String
19
+
20
+ # @!attribute [r] url
21
+ # URL is the location of the source of information.
22
+ # @return [String]
23
+ property :url, String
24
+ validates_presence_of :url
25
+
26
+ # @!attribute [r] content_type
27
+ # ContentType of the information expected at the URL.
28
+ # @return [String]
29
+ property :content_type, String
30
+
31
+ # @!attribute [r] at
32
+ # At is the date and time the information was retrieved.
33
+ # @return [GOBL::Cal::DateTime]
34
+ property :at, GOBL::Cal::DateTime
35
+ end
36
+ end
37
+ end
@@ -21,9 +21,14 @@ module GOBL
21
21
  'AUD' => 'Australian Dollar',
22
22
  'CAD' => 'Canadian Dollar',
23
23
  'JPY' => 'Japanese Yen',
24
- 'BYR' => 'Belarusian Ruble',
25
- 'MOP' => 'Macanese Pataca',
26
- 'HTG' => 'Haitian Gourde',
24
+ 'AED' => 'United Arab Emirates Dirham',
25
+ 'AFN' => 'Afghan Afghani',
26
+ 'ALL' => 'Albanian Lek',
27
+ 'AMD' => 'Armenian Dram',
28
+ 'ANG' => 'Netherlands Antillean Gulden',
29
+ 'AOA' => 'Angolan Kwanza',
30
+ 'ARS' => 'Argentine Peso',
31
+ 'AWG' => 'Aruban Florin',
27
32
  'AZN' => 'Azerbaijani Manat',
28
33
  'BAM' => 'Bosnia and Herzegovina Convertible Mark',
29
34
  'BBD' => 'Barbadian Dollar',
@@ -39,9 +44,8 @@ module GOBL
39
44
  'BTN' => 'Bhutanese Ngultrum',
40
45
  'BWP' => 'Botswana Pula',
41
46
  'BYN' => 'Belarusian Ruble',
42
- 'ARS' => 'Argentine Peso',
47
+ 'BYR' => 'Belarusian Ruble',
43
48
  'BZD' => 'Belize Dollar',
44
- 'AOA' => 'Angolan Kwanza',
45
49
  'CDF' => 'Congolese Franc',
46
50
  'CHF' => 'Swiss Franc',
47
51
  'CLF' => 'Unidad de Fomento',
@@ -55,15 +59,13 @@ module GOBL
55
59
  'CZK' => 'Czech Koruna',
56
60
  'DJF' => 'Djiboutian Franc',
57
61
  'DKK' => 'Danish Krone',
58
- 'MXN' => 'Mexican Peso',
62
+ 'DOP' => 'Dominican Peso',
59
63
  'DZD' => 'Algerian Dinar',
60
64
  'EGP' => 'Egyptian Pound',
61
65
  'ERN' => 'Eritrean Nakfa',
62
66
  'ETB' => 'Ethiopian Birr',
63
- 'ANG' => 'Netherlands Antillean Gulden',
64
67
  'FJD' => 'Fijian Dollar',
65
68
  'FKP' => 'Falkland Pound',
66
- 'AMD' => 'Armenian Dram',
67
69
  'GEL' => 'Georgian Lari',
68
70
  'GHS' => 'Ghanaian Cedi',
69
71
  'GIP' => 'Gibraltar Pound',
@@ -73,7 +75,7 @@ module GOBL
73
75
  'GYD' => 'Guyanese Dollar',
74
76
  'HKD' => 'Hong Kong Dollar',
75
77
  'HNL' => 'Honduran Lempira',
76
- 'MWK' => 'Malawian Kwacha',
78
+ 'HTG' => 'Haitian Gourde',
77
79
  'HUF' => 'Hungarian Forint',
78
80
  'IDR' => 'Indonesian Rupiah',
79
81
  'ILS' => 'Israeli New Sheqel',
@@ -83,7 +85,6 @@ module GOBL
83
85
  'ISK' => 'Icelandic Króna',
84
86
  'JMD' => 'Jamaican Dollar',
85
87
  'JOD' => 'Jordanian Dinar',
86
- 'ALL' => 'Albanian Lek',
87
88
  'KES' => 'Kenyan Shilling',
88
89
  'KGS' => 'Kyrgyzstani Som',
89
90
  'KHR' => 'Cambodian Riel',
@@ -105,12 +106,12 @@ module GOBL
105
106
  'MKD' => 'Macedonian Denar',
106
107
  'MMK' => 'Myanmar Kyat',
107
108
  'MNT' => 'Mongolian Tögrög',
108
- 'AED' => 'United Arab Emirates Dirham',
109
+ 'MOP' => 'Macanese Pataca',
109
110
  'MRU' => 'Mauritanian Ouguiya',
110
111
  'MUR' => 'Mauritian Rupee',
111
- 'PLN' => 'Polish Złoty',
112
- 'AWG' => 'Aruban Florin',
113
- 'DOP' => 'Dominican Peso',
112
+ 'MVR' => 'Maldivian Rufiyaa',
113
+ 'MWK' => 'Malawian Kwacha',
114
+ 'MXN' => 'Mexican Peso',
114
115
  'MYR' => 'Malaysian Ringgit',
115
116
  'MZN' => 'Mozambican Metical',
116
117
  'NAD' => 'Namibian Dollar',
@@ -125,7 +126,7 @@ module GOBL
125
126
  'PGK' => 'Papua New Guinean Kina',
126
127
  'PHP' => 'Philippine Peso',
127
128
  'PKR' => 'Pakistani Rupee',
128
- 'MVR' => 'Maldivian Rufiyaa',
129
+ 'PLN' => 'Polish Złoty',
129
130
  'PYG' => 'Paraguayan Guaraní',
130
131
  'QAR' => 'Qatari Riyal',
131
132
  'RON' => 'Romanian Leu',
@@ -161,7 +162,6 @@ module GOBL
161
162
  'TZS' => 'Tanzanian Shilling',
162
163
  'UAH' => 'Ukrainian Hryvnia',
163
164
  'UGX' => 'Ugandan Shilling',
164
- 'AFN' => 'Afghan Afghani',
165
165
  'UYU' => 'Uruguayan Peso',
166
166
  'UZS' => 'Uzbekistan Som',
167
167
  'VES' => 'Venezuelan Bolívar Soberano',
@@ -24,16 +24,21 @@ module GOBL
24
24
  property :to, GOBL::Currency::Code
25
25
  validates_presence_of :to
26
26
 
27
+ # @!attribute [r] at
28
+ # At represents the effective date and time at which the exchange rate is determined by the source. The time may be zero if referring to a specific day only.
29
+ # @return [GOBL::Cal::DateTime]
30
+ property :at, GOBL::Cal::DateTime
31
+
32
+ # @!attribute [r] source
33
+ # Source key provides a reference to the source the exchange rate was obtained from. Typically this will be determined by an application used to update exchange rates automatically.
34
+ # @return [GOBL::CBC::Key]
35
+ property :source, GOBL::CBC::Key
36
+
27
37
  # @!attribute [r] amount
28
38
  # How much is 1 of the "from" currency worth in the "to" currency.
29
39
  # @return [GOBL::Num::Amount]
30
40
  property :amount, GOBL::Num::Amount
31
41
  validates_presence_of :amount
32
-
33
- # @!attribute [r] at
34
- # At represents the date and time (which may be 00:00:00) when the currency rate amount was determined.
35
- # @return [GOBL::Cal::DateTime]
36
- property :at, GOBL::Cal::DateTime
37
42
  end
38
43
  end
39
44
  end
@@ -29,6 +29,11 @@ module GOBL
29
29
  # @return [Array<GOBL::Head::Stamp>]
30
30
  property :stamps, [GOBL::Head::Stamp]
31
31
 
32
+ # @!attribute [r] links
33
+ # Links provide URLs to other resources that are related to this envelope and unlike stamps can be added even in the draft state.
34
+ # @return [Array<GOBL::Head::Link>]
35
+ property :links, [GOBL::Head::Link]
36
+
32
37
  # @!attribute [r] tags
33
38
  # Set of labels that describe but have no influence on the data.
34
39
  # @return [Array<String>]
@@ -43,11 +48,6 @@ module GOBL
43
48
  # Any information that may be relevant to other humans about this envelope
44
49
  # @return [String]
45
50
  property :notes, String
46
-
47
- # @!attribute [r] draft
48
- # When true, implies that this document should not be considered final. Digital signatures are optional.
49
- # @return [Boolean]
50
- property :draft, Boolean
51
51
  end
52
52
  end
53
53
  end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Head
10
+ # Link defines a link between this document and another resource.
11
+ class Link < GOBL::Object
12
+ # The Schema ID of the GOBL Link structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/head/link'
14
+
15
+ # @!attribute [r] key
16
+ # Key is a unique identifier for the link.
17
+ # @return [GOBL::CBC::Key]
18
+ property :key, GOBL::CBC::Key
19
+ validates_presence_of :key
20
+
21
+ # @!attribute [r] title
22
+ # Title of the resource to use when presenting to users.
23
+ # @return [String]
24
+ property :title, String
25
+
26
+ # @!attribute [r] description
27
+ # Description of the resource to use when presenting to users.
28
+ # @return [String]
29
+ property :description, String
30
+
31
+ # @!attribute [r] mime
32
+ # Expected MIME type of the link's content.
33
+ # @return [String]
34
+ property :mime, String
35
+
36
+ # @!attribute [r] url
37
+ # URL of the resource.
38
+ # @return [String]
39
+ property :url, String
40
+ validates_presence_of :url
41
+ end
42
+ end
43
+ end
@@ -8,9 +8,9 @@
8
8
  module GOBL
9
9
  module L10n
10
10
  # Defines an ISO 3166-2 country code
11
- class CountryCode < String
12
- # The Schema ID of the GOBL CountryCode structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/l10n/country-code'
11
+ class ISOCountryCode < String
12
+ # The Schema ID of the GOBL ISOCountryCode structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/l10n/iso-country-code'
14
14
 
15
15
  include GOBL::Enum
16
16
 
@@ -0,0 +1,277 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module L10n
10
+ # Defines an ISO base country code used for tax purposes
11
+ class TaxCountryCode < String
12
+ # The Schema ID of the GOBL TaxCountryCode structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/l10n/tax-country-code'
14
+
15
+ include GOBL::Enum
16
+
17
+ ENUM = {
18
+ 'AF' => 'Afghanistan',
19
+ 'AX' => 'Åland Islands',
20
+ 'AL' => 'Albania',
21
+ 'DZ' => 'Algeria',
22
+ 'AS' => 'American Samoa',
23
+ 'AD' => 'Andorra',
24
+ 'AO' => 'Angola',
25
+ 'AI' => 'Anguilla',
26
+ 'AQ' => 'Antarctica',
27
+ 'AG' => 'Antigua and Barbuda',
28
+ 'AR' => 'Argentina',
29
+ 'AM' => 'Armenia',
30
+ 'AW' => 'Aruba',
31
+ 'AU' => 'Australia',
32
+ 'AT' => 'Austria',
33
+ 'AZ' => 'Azerbaijan',
34
+ 'BS' => 'Bahamas',
35
+ 'BH' => 'Bahrain',
36
+ 'BD' => 'Bangladesh',
37
+ 'BB' => 'Barbados',
38
+ 'BY' => 'Belarus',
39
+ 'BE' => 'Belgium',
40
+ 'BZ' => 'Belize',
41
+ 'BJ' => 'Benin',
42
+ 'BM' => 'Bermuda',
43
+ 'BT' => 'Bhutan',
44
+ 'BO' => 'Bolivia, Plurinational State of',
45
+ 'BQ' => 'Bonaire, Sint Eustatius and Saba',
46
+ 'BA' => 'Bosnia and Herzegovina',
47
+ 'BW' => 'Botswana',
48
+ 'BV' => 'Bouvet Island',
49
+ 'BR' => 'Brazil',
50
+ 'IO' => 'British Indian Ocean Territory',
51
+ 'BN' => 'Brunei Darussalam',
52
+ 'BG' => 'Bulgaria',
53
+ 'BF' => 'Burkina Faso',
54
+ 'BI' => 'Burundi',
55
+ 'CV' => 'Cabo Verde',
56
+ 'KH' => 'Cambodia',
57
+ 'CM' => 'Cameroon',
58
+ 'CA' => 'Canada',
59
+ 'KY' => 'Cayman Islands',
60
+ 'CF' => 'Central African Republic',
61
+ 'TD' => 'Chad',
62
+ 'CL' => 'Chile',
63
+ 'CN' => 'China',
64
+ 'CX' => 'Christmas Island',
65
+ 'CC' => 'Cocos (Keeling) Islands',
66
+ 'CO' => 'Colombia',
67
+ 'KM' => 'Comoros',
68
+ 'CG' => 'Congo',
69
+ 'CD' => 'Congo, Democratic Republic of the',
70
+ 'CK' => 'Cook Islands',
71
+ 'CR' => 'Costa Rica',
72
+ 'CI' => 'Côte dIvoireIvoire',
73
+ 'HR' => 'Croatia',
74
+ 'CU' => 'Cuba',
75
+ 'CW' => 'Curaçao',
76
+ 'CY' => 'Cyprus',
77
+ 'CZ' => 'Czechia',
78
+ 'DK' => 'Denmark',
79
+ 'DJ' => 'Djibouti',
80
+ 'DM' => 'Dominica',
81
+ 'DO' => 'Dominican Republic',
82
+ 'EC' => 'Ecuador',
83
+ 'EG' => 'Egypt',
84
+ 'SV' => 'El Salvador',
85
+ 'GQ' => 'Equatorial Guinea',
86
+ 'ER' => 'Eritrea',
87
+ 'EE' => 'Estonia',
88
+ 'SZ' => 'Eswatini',
89
+ 'ET' => 'Ethiopia',
90
+ 'FK' => 'Falkland Islands',
91
+ 'FO' => 'Faroe Islands',
92
+ 'FJ' => 'Fiji',
93
+ 'FI' => 'Finland',
94
+ 'FR' => 'France',
95
+ 'GF' => 'French Guiana',
96
+ 'PF' => 'French Polynesia',
97
+ 'TF' => 'French Southern Territories',
98
+ 'GA' => 'Gabon',
99
+ 'GM' => 'Gambia',
100
+ 'GE' => 'Georgia',
101
+ 'DE' => 'Germany',
102
+ 'GH' => 'Ghana',
103
+ 'GI' => 'Gibraltar',
104
+ 'GL' => 'Greenland',
105
+ 'GD' => 'Grenada',
106
+ 'GP' => 'Guadeloupe',
107
+ 'GU' => 'Guam',
108
+ 'GT' => 'Guatemala',
109
+ 'GG' => 'Guernsey',
110
+ 'GN' => 'Guinea',
111
+ 'GW' => 'Guinea-Bissau',
112
+ 'GY' => 'Guyana',
113
+ 'HT' => 'Haiti',
114
+ 'HM' => 'Heard Island and McDonald Islands',
115
+ 'VA' => 'Holy See (the)',
116
+ 'HN' => 'Honduras',
117
+ 'HK' => 'Hong Kong',
118
+ 'HU' => 'Hungary',
119
+ 'IS' => 'Iceland',
120
+ 'IN' => 'India',
121
+ 'ID' => 'Indonesia',
122
+ 'IR' => 'Iran, Islamic Republic of',
123
+ 'IQ' => 'Iraq',
124
+ 'IE' => 'Ireland',
125
+ 'IM' => 'Isle of Man',
126
+ 'IL' => 'Israel',
127
+ 'IT' => 'Italy',
128
+ 'JM' => 'Jamaica',
129
+ 'JP' => 'Japan',
130
+ 'JE' => 'Jersey',
131
+ 'JO' => 'Jordan',
132
+ 'KZ' => 'Kazakhstan',
133
+ 'KE' => 'Kenya',
134
+ 'KI' => 'Kiribati',
135
+ 'KP' => 'Korea, Democratic Peoples Republic ofs Republic of',
136
+ 'KR' => 'Korea, Republic of',
137
+ 'KW' => 'Kuwait',
138
+ 'KG' => 'Kyrgyzstan',
139
+ 'LA' => 'Lao Peoples Democratic Republics Democratic Republic',
140
+ 'LV' => 'Latvia',
141
+ 'LB' => 'Lebanon',
142
+ 'LS' => 'Lesotho',
143
+ 'LR' => 'Liberia',
144
+ 'LY' => 'Libya',
145
+ 'LI' => 'Liechtenstein',
146
+ 'LT' => 'Lithuania',
147
+ 'LU' => 'Luxembourg',
148
+ 'MO' => 'Macao',
149
+ 'MK' => 'North Macedonia',
150
+ 'MG' => 'Madagascar',
151
+ 'MW' => 'Malawi',
152
+ 'MY' => 'Malaysia',
153
+ 'MV' => 'Maldives',
154
+ 'ML' => 'Mali',
155
+ 'MT' => 'Malta',
156
+ 'MH' => 'Marshall Islands',
157
+ 'MQ' => 'Martinique',
158
+ 'MR' => 'Mauritania',
159
+ 'MU' => 'Mauritius',
160
+ 'YT' => 'Mayotte',
161
+ 'MX' => 'Mexico',
162
+ 'FM' => 'Micronesia, Federated States of',
163
+ 'MD' => 'Moldova, Republic of',
164
+ 'MC' => 'Monaco',
165
+ 'MN' => 'Mongolia',
166
+ 'ME' => 'Montenegro',
167
+ 'MS' => 'Montserrat',
168
+ 'MA' => 'Morocco',
169
+ 'MZ' => 'Mozambique',
170
+ 'MM' => 'Myanmar',
171
+ 'NA' => 'Namibia',
172
+ 'NR' => 'Nauru',
173
+ 'NP' => 'Nepal',
174
+ 'NL' => 'Netherlands',
175
+ 'NC' => 'New Caledonia',
176
+ 'NZ' => 'New Zealand',
177
+ 'NI' => 'Nicaragua',
178
+ 'NE' => 'Niger',
179
+ 'NG' => 'Nigeria',
180
+ 'NU' => 'Niue',
181
+ 'NF' => 'Norfolk Island',
182
+ 'MP' => 'Northern Mariana Islands',
183
+ 'NO' => 'Norway',
184
+ 'OM' => 'Oman',
185
+ 'PK' => 'Pakistan',
186
+ 'PW' => 'Palau',
187
+ 'PS' => 'Palestine, State of',
188
+ 'PA' => 'Panama',
189
+ 'PG' => 'Papua New Guinea',
190
+ 'PY' => 'Paraguay',
191
+ 'PE' => 'Peru',
192
+ 'PH' => 'Philippines',
193
+ 'PN' => 'Pitcairn',
194
+ 'PL' => 'Poland',
195
+ 'PT' => 'Portugal',
196
+ 'PR' => 'Puerto Rico',
197
+ 'QA' => 'Qatar',
198
+ 'RE' => 'Réunion',
199
+ 'RO' => 'Romania',
200
+ 'RU' => 'Russian Federation',
201
+ 'RW' => 'Rwanda',
202
+ 'BL' => 'Saint Barthélemy',
203
+ 'SH' => 'Saint Helena, Ascension and Tristan da Cunha',
204
+ 'KN' => 'Saint Kitts and Nevis',
205
+ 'LC' => 'Saint Lucia',
206
+ 'MF' => 'Saint Martin (French part)',
207
+ 'PM' => 'Saint Pierre and Miquelon',
208
+ 'VC' => 'Saint Vincent and the Grenadines',
209
+ 'WS' => 'Samoa',
210
+ 'SM' => 'San Marino',
211
+ 'ST' => 'Sao Tome and Principe',
212
+ 'SA' => 'Saudi Arabia',
213
+ 'SN' => 'Senegal',
214
+ 'RS' => 'Serbia',
215
+ 'SC' => 'Seychelles',
216
+ 'SL' => 'Sierra Leone',
217
+ 'SG' => 'Singapore',
218
+ 'SX' => 'Sint Maarten (Dutch part)',
219
+ 'SK' => 'Slovakia',
220
+ 'SI' => 'Slovenia',
221
+ 'SB' => 'Solomon Islands',
222
+ 'SO' => 'Somalia',
223
+ 'ZA' => 'South Africa',
224
+ 'GS' => 'South Georgia and the South Sandwich Islands',
225
+ 'SS' => 'South Sudan',
226
+ 'ES' => 'Spain',
227
+ 'LK' => 'Sri Lanka',
228
+ 'SD' => 'Sudan',
229
+ 'SR' => 'Suriname',
230
+ 'SJ' => 'Svalbard and Jan Mayen',
231
+ 'SE' => 'Sweden',
232
+ 'CH' => 'Switzerland',
233
+ 'SY' => 'Syrian Arab Republic',
234
+ 'TW' => 'Taiwan (Province of China)',
235
+ 'TJ' => 'Tajikistan',
236
+ 'TZ' => 'Tanzania, the United Republic of',
237
+ 'TH' => 'Thailand',
238
+ 'TL' => 'Timor-Leste',
239
+ 'TG' => 'Togo',
240
+ 'TK' => 'Tokelau',
241
+ 'TO' => 'Tonga',
242
+ 'TT' => 'Trinidad and Tobago',
243
+ 'TN' => 'Tunisia',
244
+ 'TR' => 'Türkiye',
245
+ 'TM' => 'Turkmenistan',
246
+ 'TC' => 'Turks and Caicos Islands',
247
+ 'TV' => 'Tuvalu',
248
+ 'UG' => 'Uganda',
249
+ 'UA' => 'Ukraine',
250
+ 'AE' => 'United Arab Emirates',
251
+ 'GB' => 'United Kingdom',
252
+ 'US' => 'United States of America',
253
+ 'UM' => 'United States Minor Outlying Islands',
254
+ 'UY' => 'Uruguay',
255
+ 'UZ' => 'Uzbekistan',
256
+ 'VU' => 'Vanuatu',
257
+ 'VE' => 'Venezuela, Bolivarian Republic of',
258
+ 'VN' => 'Viet Nam',
259
+ 'VG' => 'Virgin Islands (British)',
260
+ 'VI' => 'Virgin Islands (U.S.)',
261
+ 'WF' => 'Wallis and Futuna',
262
+ 'EH' => 'Western Sahara',
263
+ 'YE' => 'Yemen',
264
+ 'ZM' => 'Zambia',
265
+ 'ZW' => 'Zimbabwe',
266
+ 'EL' => 'Greece',
267
+ 'XI' => 'United Kingdom (Northern Ireland)',
268
+ 'XU' => 'United Kingdom (excluding Northern Ireland)',
269
+ 'EU' => 'European Union'
270
+ }.freeze
271
+
272
+ def strict_enum?
273
+ true
274
+ end
275
+ end
276
+ end
277
+ end
@@ -58,25 +58,29 @@ module GOBL
58
58
  property :street_extra, String
59
59
 
60
60
  # @!attribute [r] locality
61
- # Village, town, district, or city, typically inside a region.
61
+ # Name of a village, town, district, or city, typically inside a region.
62
62
  # @return [String]
63
63
  property :locality, String
64
- validates_presence_of :locality
65
64
 
66
65
  # @!attribute [r] region
67
- # Province, county, or state, inside a country.
66
+ # Name of a city, province, county, or state, inside a country.
68
67
  # @return [String]
69
68
  property :region, String
70
69
 
70
+ # @!attribute [r] state
71
+ # State or province code for countries that require it.
72
+ # @return [GOBL::CBC::Code]
73
+ property :state, GOBL::CBC::Code
74
+
71
75
  # @!attribute [r] code
72
76
  # Post or ZIP code.
73
- # @return [String]
74
- property :code, String
77
+ # @return [GOBL::CBC::Code]
78
+ property :code, GOBL::CBC::Code
75
79
 
76
80
  # @!attribute [r] country
77
81
  # ISO country code.
78
- # @return [GOBL::L10n::CountryCode]
79
- property :country, GOBL::L10n::CountryCode
82
+ # @return [GOBL::L10n::ISOCountryCode]
83
+ property :country, GOBL::L10n::ISOCountryCode
80
84
 
81
85
  # @!attribute [r] coords
82
86
  # When the postal address is not sufficient, coordinates help locate the address more precisely.