gobl 0.22.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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/data/regimes/ae.json +173 -0
  3. data/data/regimes/at.json +1 -0
  4. data/data/regimes/be.json +1 -0
  5. data/data/regimes/br.json +135 -0
  6. data/data/regimes/ca.json +1 -0
  7. data/data/regimes/ch.json +1 -0
  8. data/data/regimes/co.json +0 -221
  9. data/data/regimes/de.json +14 -1
  10. data/data/regimes/el.json +8 -1
  11. data/data/regimes/es.json +3 -2
  12. data/data/regimes/fr.json +1 -0
  13. data/data/regimes/gb.json +1 -0
  14. data/data/regimes/in.json +128 -0
  15. data/data/regimes/it.json +2 -14
  16. data/data/regimes/mx.json +1 -0
  17. data/data/regimes/nl.json +1 -0
  18. data/data/regimes/pl.json +8 -7
  19. data/data/regimes/pt.json +1573 -9
  20. data/lib/generated/gobl/bill/charge.rb +34 -19
  21. data/lib/generated/gobl/bill/correction_options.rb +6 -1
  22. data/lib/generated/gobl/bill/delivery.rb +184 -16
  23. data/lib/generated/gobl/bill/delivery_details.rb +41 -0
  24. data/lib/generated/gobl/bill/discount.rb +36 -13
  25. data/lib/generated/gobl/bill/invoice.rb +39 -32
  26. data/lib/generated/gobl/bill/line.rb +39 -4
  27. data/lib/generated/gobl/bill/line_charge.rb +56 -11
  28. data/lib/generated/gobl/bill/line_discount.rb +45 -12
  29. data/lib/generated/gobl/bill/order.rb +208 -0
  30. data/lib/generated/gobl/bill/ordering.rb +8 -3
  31. data/lib/generated/gobl/bill/payment.rb +155 -15
  32. data/lib/generated/gobl/bill/payment_details.rb +36 -0
  33. data/lib/generated/gobl/bill/payment_line.rb +77 -0
  34. data/lib/generated/gobl/bill/sub_line.rb +83 -0
  35. data/lib/generated/gobl/bill/tax.rb +20 -1
  36. data/lib/generated/gobl/bill/totals.rb +18 -18
  37. data/lib/generated/gobl/bill/tracking.rb +26 -0
  38. data/lib/generated/gobl/cal/date_time.rb +1 -1
  39. data/lib/generated/gobl/cal/time.rb +16 -0
  40. data/lib/generated/gobl/cbc/code.rb +2 -1
  41. data/lib/generated/gobl/cbc/{key_definition.rb → definition.rb} +18 -9
  42. data/lib/generated/gobl/cbc/source.rb +37 -0
  43. data/lib/generated/gobl/currency/code.rb +16 -16
  44. data/lib/generated/gobl/currency/exchange_rate.rb +10 -5
  45. data/lib/generated/gobl/org/address.rb +9 -4
  46. data/lib/generated/gobl/org/attachment.rb +62 -0
  47. data/lib/generated/gobl/org/document_ref.rb +20 -5
  48. data/lib/generated/gobl/org/identity.rb +6 -1
  49. data/lib/generated/gobl/org/inbox.rb +22 -14
  50. data/lib/generated/gobl/org/item.rb +2 -3
  51. data/lib/generated/gobl/{cbc → org}/note.rb +16 -5
  52. data/lib/generated/gobl/org/party.rb +4 -0
  53. data/lib/generated/gobl/org/telephone.rb +1 -1
  54. data/lib/generated/gobl/org/unit.rb +2 -1
  55. data/lib/generated/gobl/pay/advance.rb +3 -1
  56. data/lib/generated/gobl/pay/card.rb +5 -2
  57. data/lib/generated/gobl/pay/instructions.rb +5 -3
  58. data/lib/generated/gobl/pay/terms.rb +7 -2
  59. data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +5 -0
  60. data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +5 -0
  61. data/lib/generated/gobl/tax/addon_def.rb +19 -4
  62. data/lib/generated/gobl/tax/catalogue_def.rb +39 -0
  63. data/lib/generated/gobl/tax/category_def.rb +4 -4
  64. data/lib/generated/gobl/tax/correction_definition.rb +5 -0
  65. data/lib/generated/gobl/tax/identity.rb +5 -0
  66. data/lib/generated/gobl/tax/regime_def.rb +17 -22
  67. data/lib/generated/gobl/tax/scenario.rb +6 -6
  68. data/lib/generated/gobl/tax/scenario_note.rb +42 -0
  69. data/lib/generated/gobl/tax/tag_set.rb +2 -2
  70. data/lib/generated/gobl/tax/total.rb +6 -1
  71. data/lib/gobl/version.rb +1 -1
  72. metadata +24 -13
  73. data/lib/generated/gobl/bill/outlay.rb +0 -58
  74. data/lib/generated/gobl/cbc/value_definition.rb +0 -37
  75. data/lib/generated/gobl/tax/source.rb +0 -27
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Bill
10
+ # PaymentLine defines the details of a line item in a payment document.
11
+ class PaymentLine < GOBL::Object
12
+ # The Schema ID of the GOBL PaymentLine structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/payment#/$defs/PaymentLine'
14
+
15
+ # @!attribute [r] uuid
16
+ # Universally Unique Identifier.
17
+ # @return [String]
18
+ property :uuid, String
19
+
20
+ # @!attribute [r] i
21
+ # Line number within the parent document (automatically calculated)
22
+ # @return [Integer]
23
+ property :i, Integer
24
+
25
+ # @!attribute [r] refund
26
+ # Indicates whether this payment is a refund of a previous payment, effectively reversing the flow of funds between the supplier and customer or their representatives.
27
+ # @return [Boolean]
28
+ property :refund, Boolean
29
+
30
+ # @!attribute [r] document
31
+ # Reference to the document being paid
32
+ # @return [GOBL::Org::DocumentRef]
33
+ property :document, GOBL::Org::DocumentRef
34
+
35
+ # @!attribute [r] installment
36
+ # When making multiple payments for a single document, this specifies the installment number for this payment line.
37
+ # @return [Integer]
38
+ property :installment, Integer
39
+
40
+ # @!attribute [r] description
41
+ # Additional human readable description of the payment line which may be useful for explaining the purpose or special conditions. Notes should be used for more formal comments.
42
+ # @return [String]
43
+ property :description, String
44
+
45
+ # @!attribute [r] payable
46
+ # Payable reflects the amount of the document that is payable. This will be calculated from the embedded document's amount automatically and converted to the currency of the document.
47
+ # @return [GOBL::Num::Amount]
48
+ property :payable, GOBL::Num::Amount
49
+
50
+ # @!attribute [r] advances
51
+ # Amount already paid in previous installments, which may be required by some tax regimes or specific use cases.
52
+ # @return [GOBL::Num::Amount]
53
+ property :advances, GOBL::Num::Amount
54
+
55
+ # @!attribute [r] amount
56
+ # Amount of the total payment allocated to the referenced document.
57
+ # @return [GOBL::Num::Amount]
58
+ property :amount, GOBL::Num::Amount
59
+ validates_presence_of :amount
60
+
61
+ # @!attribute [r] due
62
+ # Due reflects how much still needs to be paid
63
+ # @return [GOBL::Num::Amount]
64
+ property :due, GOBL::Num::Amount
65
+
66
+ # @!attribute [r] tax
67
+ # Tax contains a breakdown of the taxes that will be applied to this payment line after taking into account currency conversion and the relative amounts.
68
+ # @return [GOBL::Tax::Total]
69
+ property :tax, GOBL::Tax::Total
70
+
71
+ # @!attribute [r] notes
72
+ # Additional notes specific to this line item for clarification purposes
73
+ # @return [Array<GOBL::Org::Note>]
74
+ property :notes, [GOBL::Org::Note]
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Bill
10
+ # SubLine provides a simplified line that can be embedded inside other lines to provide a more detailed breakdown of the items being sold or substituted.
11
+ class SubLine < GOBL::Object
12
+ # The Schema ID of the GOBL SubLine structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/line#/$defs/SubLine'
14
+
15
+ # @!attribute [r] uuid
16
+ # Universally Unique Identifier.
17
+ # @return [String]
18
+ property :uuid, String
19
+
20
+ # @!attribute [r] i
21
+ # Line number inside the parent (calculated)
22
+ # @return [Integer]
23
+ property :i, Integer
24
+
25
+ # @!attribute [r] quantity
26
+ # Number of items
27
+ # @return [GOBL::Num::Amount]
28
+ property :quantity, GOBL::Num::Amount
29
+ validates_presence_of :quantity
30
+
31
+ # @!attribute [r] identifier
32
+ # Single identifier provided by the supplier for an object on which the line item is based and is not considered a universal identity. Examples include a subscription number, telephone number, meter point, etc. Utilize the label property to provide a description of the identifier.
33
+ # @return [GOBL::Org::Identity]
34
+ property :identifier, GOBL::Org::Identity
35
+
36
+ # @!attribute [r] period
37
+ # A period of time relevant to when the service or item is delivered.
38
+ # @return [GOBL::Cal::Period]
39
+ property :period, GOBL::Cal::Period
40
+
41
+ # @!attribute [r] order
42
+ # Order reference for a specific line within a purchase order provided by the buyer.
43
+ # @return [GOBL::CBC::Code]
44
+ property :order, GOBL::CBC::Code
45
+
46
+ # @!attribute [r] cost
47
+ # Buyer accounting reference cost code to associate with the line.
48
+ # @return [GOBL::CBC::Code]
49
+ property :cost, GOBL::CBC::Code
50
+
51
+ # @!attribute [r] item
52
+ # Details about the item, service or good, that is being sold
53
+ # @return [GOBL::Org::Item]
54
+ property :item, GOBL::Org::Item
55
+ validates_presence_of :item
56
+
57
+ # @!attribute [r] sum
58
+ # Result of quantity multiplied by the item's price (calculated)
59
+ # @return [GOBL::Num::Amount]
60
+ property :sum, GOBL::Num::Amount
61
+
62
+ # @!attribute [r] discounts
63
+ # Discounts applied to this sub-line
64
+ # @return [Array<LineDiscount>]
65
+ property :discounts, [LineDiscount]
66
+
67
+ # @!attribute [r] charges
68
+ # Charges applied to this sub-line
69
+ # @return [Array<LineCharge>]
70
+ property :charges, [LineCharge]
71
+
72
+ # @!attribute [r] total
73
+ # Total sub-line amount after applying discounts to the sum (calculated).
74
+ # @return [GOBL::Num::Amount]
75
+ property :total, GOBL::Num::Amount
76
+
77
+ # @!attribute [r] notes
78
+ # Set of specific notes for this sub-line that may be required for clarification.
79
+ # @return [Array<GOBL::Org::Note>]
80
+ property :notes, [GOBL::Org::Note]
81
+ end
82
+ end
83
+ end
@@ -10,13 +10,32 @@ module GOBL
10
10
  # Tax defines a summary of the taxes which may be applied to an invoice.
11
11
  class Tax < GOBL::Object
12
12
  # The Schema ID of the GOBL Tax structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Tax'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/tax'
14
14
 
15
15
  # @!attribute [r] prices_include
16
16
  # Category of the tax already included in the line item prices, especially useful for B2C retailers with customers who prefer final prices inclusive of tax.
17
17
  # @return [GOBL::CBC::Code]
18
18
  property :prices_include, GOBL::CBC::Code
19
19
 
20
+ # Enumeration of possible values for {#rounding} with their corresponding descriptions
21
+ ROUNDING_ENUM = {
22
+ 'precise' => 'The default method of calculating the totals in GOBL, and provides the best results
23
+ for most cases as the precision is maintained to the maximum amount possible. The
24
+ tradeoff however is that sometimes the totals may not sum exactly based on what is visible.',
25
+ 'currency' => 'The alternative method of calculating the totals that will first round all the amounts
26
+ to the currencys precision before making the sums. Totals using this approach can always
27
+ be recalculated using the amounts presented, but can lead to rounding errors in the case
28
+ of pre-payments and when line item prices include tax.s precision before making the sums. Totals using this approach can always
29
+ be recalculated using the amounts presented, but can lead to rounding errors in the case
30
+ of pre-payments and when line item prices include tax.'
31
+ }.freeze
32
+
33
+ # @!attribute [r] rounding
34
+ # Rounding model used to perform tax calculations on the invoice. This will be configured automatically based on the tax regime, or `sum-then-round` by default, but you can override here if needed. Use with caution, as some conversion tools may make assumptions about the rounding model used.
35
+ # @return [GOBL::CBC::Key]
36
+ property :rounding, GOBL::CBC::Key
37
+ validates_inclusion_of :rounding, in: ROUNDING_ENUM.keys, allow_blank: true
38
+
20
39
  # @!attribute [r] ext
21
40
  # Additional extensions that are applied to the invoice as a whole as opposed to specific sections.
22
41
  # @return [GOBL::Tax::Extensions]
@@ -10,74 +10,74 @@ module GOBL
10
10
  # Totals contains the summaries of all calculations for the invoice.
11
11
  class Totals < GOBL::Object
12
12
  # The Schema ID of the GOBL Totals structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Totals'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/totals'
14
14
 
15
15
  # @!attribute [r] sum
16
- # Sum of all line item sums
16
+ # Total of all line item amounts.
17
17
  # @return [GOBL::Num::Amount]
18
18
  property :sum, GOBL::Num::Amount
19
19
  validates_presence_of :sum
20
20
 
21
21
  # @!attribute [r] discount
22
- # Sum of all document level discounts
22
+ # Total of all discounts applied at the document level.
23
23
  # @return [GOBL::Num::Amount]
24
24
  property :discount, GOBL::Num::Amount
25
25
 
26
26
  # @!attribute [r] charge
27
- # Sum of all document level charges
27
+ # Total of all charges applied at the document level.
28
28
  # @return [GOBL::Num::Amount]
29
29
  property :charge, GOBL::Num::Amount
30
30
 
31
31
  # @!attribute [r] tax_included
32
- # If prices include tax, this is the total tax included in the price.
32
+ # Total tax amount included in the prices, if prices are tax-inclusive.
33
33
  # @return [GOBL::Num::Amount]
34
34
  property :tax_included, GOBL::Num::Amount
35
35
 
36
36
  # @!attribute [r] total
37
- # Sum of all line sums minus the discounts, plus the charges, without tax.
37
+ # Net total amount after subtracting discounts and adding charges, excluding tax.
38
38
  # @return [GOBL::Num::Amount]
39
39
  property :total, GOBL::Num::Amount
40
40
  validates_presence_of :total
41
41
 
42
42
  # @!attribute [r] taxes
43
- # Summary of all the taxes included in the invoice.
43
+ # Detailed breakdown of all taxes applied to the invoice.
44
44
  # @return [GOBL::Tax::Total]
45
45
  property :taxes, GOBL::Tax::Total
46
46
 
47
47
  # @!attribute [r] tax
48
- # Total amount of tax to apply to the invoice.
48
+ # Total indirect tax amount to be applied to the invoice.
49
49
  # @return [GOBL::Num::Amount]
50
50
  property :tax, GOBL::Num::Amount
51
51
 
52
52
  # @!attribute [r] total_with_tax
53
- # Grand total after all taxes have been applied.
53
+ # Final total amount after applying indirect taxes.
54
54
  # @return [GOBL::Num::Amount]
55
55
  property :total_with_tax, GOBL::Num::Amount
56
56
  validates_presence_of :total_with_tax
57
57
 
58
- # @!attribute [r] rounding
59
- # Rounding amount to apply to the invoice in case the total and payable amounts don't quite match.
58
+ # @!attribute [r] retained_tax
59
+ # Total tax amount retained or withheld by the customer to be paid to the tax authority.
60
60
  # @return [GOBL::Num::Amount]
61
- property :rounding, GOBL::Num::Amount
61
+ property :retained_tax, GOBL::Num::Amount
62
62
 
63
- # @!attribute [r] outlays
64
- # Total paid in outlays that need to be reimbursed
63
+ # @!attribute [r] rounding
64
+ # Adjustment amount applied to the invoice totals to meet rounding rules or expectations.
65
65
  # @return [GOBL::Num::Amount]
66
- property :outlays, GOBL::Num::Amount
66
+ property :rounding, GOBL::Num::Amount
67
67
 
68
68
  # @!attribute [r] payable
69
- # Total amount to be paid after applying taxes and outlays.
69
+ # Final amount to be paid after retained taxes and rounding adjustments.
70
70
  # @return [GOBL::Num::Amount]
71
71
  property :payable, GOBL::Num::Amount
72
72
  validates_presence_of :payable
73
73
 
74
74
  # @!attribute [r] advance
75
- # Total amount already paid in advance.
75
+ # Total amount already paid in advance by the customer.
76
76
  # @return [GOBL::Num::Amount]
77
77
  property :advance, GOBL::Num::Amount
78
78
 
79
79
  # @!attribute [r] due
80
- # How much actually needs to be paid now.
80
+ # Remaining amount that needs to be paid.
81
81
  # @return [GOBL::Num::Amount]
82
82
  property :due, GOBL::Num::Amount
83
83
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Bill
10
+ # Tracking stores tracking information about a delivery.
11
+ class Tracking < GOBL::Object
12
+ # The Schema ID of the GOBL Tracking structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/delivery#/$defs/Tracking'
14
+
15
+ # @!attribute [r] code
16
+ # Code used for tracking
17
+ # @return [GOBL::CBC::Code]
18
+ property :code, GOBL::CBC::Code
19
+
20
+ # @!attribute [r] website
21
+ # Website to access for more tracking details
22
+ # @return [GOBL::Org::Website]
23
+ property :website, GOBL::Org::Website
24
+ end
25
+ end
26
+ end
@@ -8,7 +8,7 @@
8
8
  module GOBL
9
9
  module Cal
10
10
  # Civil date time in simplified ISO format with no time zone
11
- # information, for example: 2021-05-26T13:45:00
11
+ # nor location information, for example: 2021-05-26T13:45:00
12
12
  class DateTime < String
13
13
  # The Schema ID of the GOBL DateTime structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/cal/date-time'
@@ -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,10 +38,15 @@ module GOBL
34
38
  # @return [GOBL::CBC::Meta]
35
39
  property :meta, GOBL::CBC::Meta
36
40
 
41
+ # @!attribute [r] sources
42
+ # Where the information was sourced from.
43
+ # @return [Array<GOBL::CBC::Source>]
44
+ property :sources, [GOBL::CBC::Source]
45
+
37
46
  # @!attribute [r] values
38
- # Values defines the possible values associated with the key.
39
- # @return [Array<GOBL::CBC::ValueDefinition>]
40
- property :values, [GOBL::CBC::ValueDefinition]
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]
41
50
 
42
51
  # @!attribute [r] pattern
43
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
@@ -58,19 +58,24 @@ 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
64
 
65
65
  # @!attribute [r] region
66
- # Province, county, or state, inside a country.
66
+ # Name of a city, province, county, or state, inside a country.
67
67
  # @return [String]
68
68
  property :region, String
69
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
+
70
75
  # @!attribute [r] code
71
76
  # Post or ZIP code.
72
- # @return [String]
73
- property :code, String
77
+ # @return [GOBL::CBC::Code]
78
+ property :code, GOBL::CBC::Code
74
79
 
75
80
  # @!attribute [r] country
76
81
  # ISO country code.
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Org
10
+ # An Attachment provides a structure to be used to attach documents inside a GOBL document, either as a reference via a URL, or directly as a base64 encoded string.
11
+ class Attachment < GOBL::Object
12
+ # The Schema ID of the GOBL Attachment structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/org/attachment'
14
+
15
+ # @!attribute [r] uuid
16
+ # Universally Unique Identifier.
17
+ # @return [String]
18
+ property :uuid, String
19
+
20
+ # @!attribute [r] key
21
+ # Key used to identify the attachment inside the document.
22
+ # @return [GOBL::CBC::Key]
23
+ property :key, GOBL::CBC::Key
24
+
25
+ # @!attribute [r] code
26
+ # Code used to identify the payload of the attachment.
27
+ # @return [GOBL::CBC::Code]
28
+ property :code, GOBL::CBC::Code
29
+
30
+ # @!attribute [r] name
31
+ # Filename of the attachment.
32
+ # @return [String]
33
+ property :name, String
34
+ validates_presence_of :name
35
+
36
+ # @!attribute [r] description
37
+ # Details of why the attachment is being included and details on what it contains.
38
+ # @return [String]
39
+ property :description, String
40
+
41
+ # @!attribute [r] url
42
+ # URL of where to find the attachment. Prefer using this field over the Data field.
43
+ # @return [String]
44
+ property :url, String
45
+
46
+ # @!attribute [r] digest
47
+ # Digest is used to verify the integrity of the attachment when downloaded from the URL.
48
+ # @return [GOBL::DSig::Digest]
49
+ property :digest, GOBL::DSig::Digest
50
+
51
+ # @!attribute [r] mime
52
+ # MIME type of the attachment.
53
+ # @return [String]
54
+ property :mime, String
55
+
56
+ # @!attribute [r] data
57
+ # Data is the base64 encoded data of the attachment directly embedded inside the GOBL document. This should only be used when the URL cannot be used as it can dramatically increase the size of the JSON document, thus effecting usability and performance.
58
+ # @return [String]
59
+ property :data, String
60
+ end
61
+ end
62
+ end