gobl 0.20.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/data/regimes/at.json +160 -0
- data/data/regimes/be.json +169 -0
- data/data/regimes/ca.json +10 -1
- data/data/regimes/ch.json +158 -0
- data/data/regimes/co.json +179 -169
- data/data/regimes/de.json +63 -49
- data/data/regimes/el.json +204 -0
- data/data/regimes/es.json +84 -557
- data/data/regimes/fr.json +57 -52
- data/data/regimes/gb.json +67 -50
- data/data/regimes/gr.json +591 -0
- data/data/regimes/it.json +62 -1298
- data/data/regimes/mx.json +38 -627
- data/data/regimes/nl.json +63 -50
- data/data/regimes/pl.json +161 -101
- data/data/regimes/pt.json +44 -365
- data/data/regimes/us.json +63 -49
- data/lib/generated/gobl/bill/charge.rb +6 -7
- data/lib/generated/gobl/bill/correction_options.rb +5 -1
- data/lib/generated/gobl/bill/delivery.rb +0 -1
- data/lib/generated/gobl/bill/discount.rb +5 -6
- data/lib/generated/gobl/bill/invoice.rb +51 -12
- data/lib/generated/gobl/bill/line.rb +3 -4
- data/lib/generated/gobl/bill/line_charge.rb +0 -1
- data/lib/generated/gobl/bill/line_discount.rb +0 -1
- data/lib/generated/gobl/bill/ordering.rb +34 -35
- data/lib/generated/gobl/bill/outlay.rb +3 -4
- data/lib/generated/gobl/bill/payment.rb +0 -1
- data/lib/generated/gobl/bill/tax.rb +4 -5
- data/lib/generated/gobl/bill/totals.rb +0 -1
- data/lib/generated/gobl/cal/date.rb +0 -1
- data/lib/generated/gobl/cal/date_time.rb +0 -1
- data/lib/generated/gobl/cal/period.rb +0 -1
- data/lib/generated/gobl/cbc/code.rb +0 -1
- data/lib/generated/gobl/cbc/code_map.rb +0 -1
- data/lib/generated/gobl/cbc/key.rb +0 -1
- data/lib/generated/gobl/cbc/key_definition.rb +4 -10
- data/lib/generated/gobl/cbc/meta.rb +0 -1
- data/lib/generated/gobl/cbc/note.rb +0 -1
- data/lib/generated/gobl/cbc/value_definition.rb +37 -0
- data/lib/generated/gobl/currency/amount.rb +33 -0
- data/lib/generated/gobl/currency/code.rb +118 -105
- data/lib/generated/gobl/currency/exchange_rate.rb +17 -7
- data/lib/generated/gobl/dsig/digest.rb +0 -1
- data/lib/generated/gobl/dsig/signature.rb +0 -1
- data/lib/generated/gobl/envelope.rb +0 -1
- data/lib/generated/gobl/head/header.rb +7 -8
- data/lib/generated/gobl/head/link.rb +43 -0
- data/lib/generated/gobl/head/stamp.rb +0 -1
- data/lib/generated/gobl/i18n/string.rb +0 -1
- data/lib/generated/gobl/l10n/code.rb +0 -1
- data/lib/generated/gobl/l10n/{country_code.rb → iso_country_code.rb} +3 -4
- data/lib/generated/gobl/l10n/tax_country_code.rb +277 -0
- data/lib/generated/gobl/note/message.rb +5 -1
- data/lib/generated/gobl/org/address.rb +5 -7
- data/lib/generated/gobl/org/coordinates.rb +0 -1
- data/lib/generated/gobl/org/document_ref.rb +87 -0
- data/lib/generated/gobl/org/email.rb +3 -4
- data/lib/generated/gobl/org/identity.rb +8 -4
- data/lib/generated/gobl/org/image.rb +3 -4
- data/lib/generated/gobl/org/inbox.rb +3 -4
- data/lib/generated/gobl/org/item.rb +10 -6
- data/lib/generated/gobl/org/name.rb +3 -6
- data/lib/generated/gobl/org/party.rb +8 -5
- data/lib/generated/gobl/org/person.rb +8 -4
- data/lib/generated/gobl/org/registration.rb +11 -3
- data/lib/generated/gobl/org/telephone.rb +3 -4
- data/lib/generated/gobl/org/unit.rb +0 -1
- data/lib/generated/gobl/org/website.rb +4 -5
- data/lib/generated/gobl/pay/advance.rb +8 -4
- data/lib/generated/gobl/pay/card.rb +0 -1
- data/lib/generated/gobl/pay/credit_transfer.rb +0 -1
- data/lib/generated/gobl/pay/direct_debit.rb +0 -1
- data/lib/generated/gobl/pay/due_date.rb +0 -1
- data/lib/generated/gobl/pay/instructions.rb +5 -1
- data/lib/generated/gobl/pay/online.rb +12 -8
- data/lib/generated/gobl/pay/terms.rb +0 -1
- data/lib/generated/gobl/regimes/mx/food_vouchers.rb +0 -1
- data/lib/generated/gobl/regimes/mx/food_vouchers_employee.rb +0 -1
- data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +0 -1
- data/lib/generated/gobl/regimes/mx/fuel_account_balance.rb +0 -1
- data/lib/generated/gobl/regimes/mx/fuel_account_item.rb +0 -1
- data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +0 -2
- data/lib/generated/gobl/regimes/mx/fuel_account_tax.rb +11 -9
- data/lib/generated/gobl/schema/object.rb +0 -1
- data/lib/generated/gobl/tax/addon_def.rb +61 -0
- data/lib/generated/gobl/tax/{category.rb → category_def.rb} +11 -12
- data/lib/generated/gobl/tax/category_total.rb +0 -1
- data/lib/generated/gobl/tax/combo.rb +6 -2
- data/lib/generated/gobl/tax/correction_definition.rb +1 -2
- data/lib/generated/gobl/tax/correction_set.rb +13 -0
- data/lib/generated/gobl/tax/extensions.rb +0 -1
- data/lib/generated/gobl/tax/identity.rb +13 -19
- data/lib/generated/gobl/tax/{rate.rb → rate_def.rb} +11 -17
- data/lib/generated/gobl/tax/rate_total.rb +6 -2
- data/lib/generated/gobl/tax/rate_total_surcharge.rb +0 -1
- data/lib/generated/gobl/tax/{rate_value.rb → rate_value_def.rb} +9 -5
- data/lib/generated/gobl/tax/{regime.rb → regime_def.rb} +38 -24
- data/lib/generated/gobl/tax/scenario.rb +20 -11
- data/lib/generated/gobl/tax/scenario_set.rb +1 -2
- data/lib/generated/gobl/tax/set.rb +0 -1
- data/lib/generated/gobl/tax/source.rb +1 -2
- data/lib/generated/gobl/tax/tag_set.rb +28 -0
- data/lib/generated/gobl/tax/total.rb +0 -1
- data/lib/gobl/extensions/bill/invoice_helper.rb +6 -36
- data/lib/gobl/extensions/envelope_helper.rb +4 -0
- data/lib/gobl/version.rb +1 -1
- data/lib/gobl.rb +3 -2
- metadata +20 -12
- data/lib/generated/gobl/bill/document_reference.rb +0 -37
- data/lib/generated/gobl/bill/preceding.rb +0 -79
- data/lib/generated/gobl/cbc/code_definition.rb +0 -38
- data/lib/generated/gobl/uuid/uuid.rb +0 -17
- data/lib/gobl/extensions/bill/scenario_summary.rb +0 -25
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -24,6 +23,11 @@ module GOBL
|
|
24
23
|
# @return [GOBL::Cal::Date]
|
25
24
|
property :issue_date, GOBL::Cal::Date
|
26
25
|
|
26
|
+
# @!attribute [r] series
|
27
|
+
# Series to assign to the new corrective invoice.
|
28
|
+
# @return [GOBL::CBC::Code]
|
29
|
+
property :series, GOBL::CBC::Code
|
30
|
+
|
27
31
|
# @!attribute [r] stamps
|
28
32
|
# Stamps of the previous document to include in the preceding data.
|
29
33
|
# @return [Array<GOBL::Head::Stamp>]
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -14,9 +13,9 @@ module GOBL
|
|
14
13
|
SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Discount'
|
15
14
|
|
16
15
|
# @!attribute [r] uuid
|
17
|
-
# Unique
|
18
|
-
# @return [
|
19
|
-
property :uuid,
|
16
|
+
# Universally Unique Identifier.
|
17
|
+
# @return [String]
|
18
|
+
property :uuid, String
|
20
19
|
|
21
20
|
# @!attribute [r] i
|
22
21
|
# Line number inside the list of discounts (calculated)
|
@@ -29,12 +28,12 @@ module GOBL
|
|
29
28
|
property :ref, String
|
30
29
|
|
31
30
|
# @!attribute [r] base
|
32
|
-
# Base represents the value used as a base for percent calculations
|
31
|
+
# Base represents the value used as a base for percent calculations instead of the invoice's sum of lines.
|
33
32
|
# @return [GOBL::Num::Amount]
|
34
33
|
property :base, GOBL::Num::Amount
|
35
34
|
|
36
35
|
# @!attribute [r] percent
|
37
|
-
# Percentage to apply to the invoice's
|
36
|
+
# Percentage to apply to the base or invoice's sum.
|
38
37
|
# @return [GOBL::Num::Percentage]
|
39
38
|
property :percent, GOBL::Num::Percentage
|
40
39
|
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -13,10 +12,45 @@ module GOBL
|
|
13
12
|
# The Schema ID of the GOBL Invoice structure
|
14
13
|
SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice'
|
15
14
|
|
15
|
+
# Enumeration of possible values for {#$regime} with their corresponding descriptions
|
16
|
+
$REGIME_ENUM = {
|
17
|
+
'AT' => 'Austria',
|
18
|
+
'BE' => 'Belgium',
|
19
|
+
'CA' => 'Canada',
|
20
|
+
'CH' => 'Switzerland',
|
21
|
+
'CO' => 'Colombia',
|
22
|
+
'DE' => 'Germany',
|
23
|
+
'EL' => 'Greece',
|
24
|
+
'ES' => 'Spain',
|
25
|
+
'FR' => 'France',
|
26
|
+
'GB' => 'United Kingdom',
|
27
|
+
'IT' => 'Italy',
|
28
|
+
'MX' => 'Mexico',
|
29
|
+
'NL' => 'The Netherlands',
|
30
|
+
'PL' => 'Poland',
|
31
|
+
'PT' => 'Portugal',
|
32
|
+
'US' => 'United States of America'
|
33
|
+
}.freeze
|
34
|
+
|
35
|
+
# @!attribute [r] $regime
|
36
|
+
# @return [GOBL::L10n::TaxCountryCode]
|
37
|
+
property :$regime, GOBL::L10n::TaxCountryCode
|
38
|
+
validates_inclusion_of :$regime, in: $REGIME_ENUM.keys, allow_blank: true
|
39
|
+
|
40
|
+
# @!attribute [r] $addons
|
41
|
+
# Addons defines a list of keys used to identify tax addons that apply special normalization, scenarios, and validation rules to a document.
|
42
|
+
# @return [Array<GOBL::CBC::Key>]
|
43
|
+
property :$addons, [GOBL::CBC::Key]
|
44
|
+
|
45
|
+
# @!attribute [r] $tags
|
46
|
+
# Tags are used to help identify specific tax scenarios or requirements that will apply changes to the contents of the invoice. Tags by design should always be optional, it should always be possible to build a valid invoice without any tags.
|
47
|
+
# @return [Array<GOBL::CBC::Key>]
|
48
|
+
property :$tags, [GOBL::CBC::Key]
|
49
|
+
|
16
50
|
# @!attribute [r] uuid
|
17
|
-
# Unique
|
18
|
-
# @return [
|
19
|
-
property :uuid,
|
51
|
+
# Universally Unique Identifier.
|
52
|
+
# @return [String]
|
53
|
+
property :uuid, String
|
20
54
|
|
21
55
|
# Enumeration of possible values for {#type} with their corresponding descriptions
|
22
56
|
TYPE_ENUM = {
|
@@ -25,7 +59,12 @@ module GOBL
|
|
25
59
|
'corrective' => 'Corrected invoice that completely *replaces* the preceding document.',
|
26
60
|
'credit-note' => 'Reflects a refund either partial or complete of the preceding document. A
|
27
61
|
credit note effectively *extends* the previous document.',
|
28
|
-
'debit-note' => 'An additional set of charges to be added to the preceding document.'
|
62
|
+
'debit-note' => 'An additional set of charges to be added to the preceding document.',
|
63
|
+
'other' => 'Any other type of invoice that does not fit into the standard categories and implies
|
64
|
+
that any scenarios defined in tax regimes or addons will not be applied.
|
65
|
+
|
66
|
+
This is useful for being able to create invoices with custom types in extensions,
|
67
|
+
but is not recommend for general use.'
|
29
68
|
}.freeze
|
30
69
|
|
31
70
|
# @!attribute [r] type
|
@@ -36,13 +75,13 @@ module GOBL
|
|
36
75
|
|
37
76
|
# @!attribute [r] series
|
38
77
|
# Used as a prefix to group codes.
|
39
|
-
# @return [
|
40
|
-
property :series,
|
78
|
+
# @return [GOBL::CBC::Code]
|
79
|
+
property :series, GOBL::CBC::Code
|
41
80
|
|
42
81
|
# @!attribute [r] code
|
43
82
|
# Sequential code used to identify this invoice in tax declarations.
|
44
|
-
# @return [
|
45
|
-
property :code,
|
83
|
+
# @return [GOBL::CBC::Code]
|
84
|
+
property :code, GOBL::CBC::Code
|
46
85
|
validates_presence_of :code
|
47
86
|
|
48
87
|
# @!attribute [r] issue_date
|
@@ -72,8 +111,8 @@ module GOBL
|
|
72
111
|
|
73
112
|
# @!attribute [r] preceding
|
74
113
|
# Key information regarding previous invoices and potentially details as to why they were corrected.
|
75
|
-
# @return [Array<
|
76
|
-
property :preceding, [
|
114
|
+
# @return [Array<GOBL::Org::DocumentRef>]
|
115
|
+
property :preceding, [GOBL::Org::DocumentRef]
|
77
116
|
|
78
117
|
# @!attribute [r] tax
|
79
118
|
# Special tax configuration for billing.
|
@@ -87,7 +126,7 @@ module GOBL
|
|
87
126
|
validates_presence_of :supplier
|
88
127
|
|
89
128
|
# @!attribute [r] customer
|
90
|
-
# Legal entity receiving the goods or services, may be
|
129
|
+
# Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.
|
91
130
|
# @return [GOBL::Org::Party]
|
92
131
|
property :customer, GOBL::Org::Party
|
93
132
|
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -14,9 +13,9 @@ module GOBL
|
|
14
13
|
SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Line'
|
15
14
|
|
16
15
|
# @!attribute [r] uuid
|
17
|
-
# Unique
|
18
|
-
# @return [
|
19
|
-
property :uuid,
|
16
|
+
# Universally Unique Identifier.
|
17
|
+
# @return [String]
|
18
|
+
property :uuid, String
|
20
19
|
|
21
20
|
# @!attribute [r] i
|
22
21
|
# Line number inside the parent (calculated)
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -15,8 +14,8 @@ module GOBL
|
|
15
14
|
|
16
15
|
# @!attribute [r] code
|
17
16
|
# Identifier assigned by the customer or buyer for internal routing purposes.
|
18
|
-
# @return [
|
19
|
-
property :code,
|
17
|
+
# @return [GOBL::CBC::Code]
|
18
|
+
property :code, GOBL::CBC::Code
|
20
19
|
|
21
20
|
# @!attribute [r] identities
|
22
21
|
# Any additional Codes, IDs, SKUs, or other regional or custom identifiers that may be used to identify the order.
|
@@ -28,50 +27,50 @@ module GOBL
|
|
28
27
|
# @return [GOBL::Cal::Period]
|
29
28
|
property :period, GOBL::Cal::Period
|
30
29
|
|
31
|
-
# @!attribute [r]
|
32
|
-
#
|
33
|
-
# @return [
|
34
|
-
property :
|
30
|
+
# @!attribute [r] buyer
|
31
|
+
# Party who is responsible for making the purchase, but is not responsible for handling taxes.
|
32
|
+
# @return [GOBL::Org::Party]
|
33
|
+
property :buyer, GOBL::Org::Party
|
34
|
+
|
35
|
+
# @!attribute [r] seller
|
36
|
+
# Party who is selling the goods but is not responsible for taxes like the supplier.
|
37
|
+
# @return [GOBL::Org::Party]
|
38
|
+
property :seller, GOBL::Org::Party
|
39
|
+
|
40
|
+
# @!attribute [r] projects
|
41
|
+
# Projects this invoice refers to.
|
42
|
+
# @return [Array<GOBL::Org::DocumentRef>]
|
43
|
+
property :projects, [GOBL::Org::DocumentRef]
|
35
44
|
|
36
|
-
# @!attribute [r]
|
37
|
-
# The identification of
|
38
|
-
# @return [
|
39
|
-
property :
|
45
|
+
# @!attribute [r] contracts
|
46
|
+
# The identification of contracts.
|
47
|
+
# @return [Array<GOBL::Org::DocumentRef>]
|
48
|
+
property :contracts, [GOBL::Org::DocumentRef]
|
40
49
|
|
41
|
-
# @!attribute [r]
|
42
|
-
# Purchase
|
43
|
-
# @return [
|
44
|
-
property :
|
50
|
+
# @!attribute [r] purchases
|
51
|
+
# Purchase orders issued by the customer or buyer.
|
52
|
+
# @return [Array<GOBL::Org::DocumentRef>]
|
53
|
+
property :purchases, [GOBL::Org::DocumentRef]
|
45
54
|
|
46
|
-
# @!attribute [r]
|
47
|
-
# Sales
|
48
|
-
# @return [
|
49
|
-
property :
|
55
|
+
# @!attribute [r] sales
|
56
|
+
# Sales orders issued by the supplier or seller.
|
57
|
+
# @return [Array<GOBL::Org::DocumentRef>]
|
58
|
+
property :sales, [GOBL::Org::DocumentRef]
|
50
59
|
|
51
60
|
# @!attribute [r] receiving
|
52
61
|
# Receiving Advice.
|
53
|
-
# @return [
|
54
|
-
property :receiving,
|
62
|
+
# @return [Array<GOBL::Org::DocumentRef>]
|
63
|
+
property :receiving, [GOBL::Org::DocumentRef]
|
55
64
|
|
56
65
|
# @!attribute [r] despatch
|
57
66
|
# Despatch advice.
|
58
|
-
# @return [
|
59
|
-
property :despatch,
|
67
|
+
# @return [Array<GOBL::Org::DocumentRef>]
|
68
|
+
property :despatch, [GOBL::Org::DocumentRef]
|
60
69
|
|
61
70
|
# @!attribute [r] tender
|
62
71
|
# Tender advice, the identification of the call for tender or lot the invoice relates to.
|
63
|
-
# @return [
|
64
|
-
property :tender,
|
65
|
-
|
66
|
-
# @!attribute [r] buyer
|
67
|
-
# Party who is responsible for making the purchase, but is not responsible for handling taxes.
|
68
|
-
# @return [GOBL::Org::Party]
|
69
|
-
property :buyer, GOBL::Org::Party
|
70
|
-
|
71
|
-
# @!attribute [r] seller
|
72
|
-
# Party who is selling the goods but is not responsible for taxes like the supplier.
|
73
|
-
# @return [GOBL::Org::Party]
|
74
|
-
property :seller, GOBL::Org::Party
|
72
|
+
# @return [Array<GOBL::Org::DocumentRef>]
|
73
|
+
property :tender, [GOBL::Org::DocumentRef]
|
75
74
|
end
|
76
75
|
end
|
77
76
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -14,9 +13,9 @@ module GOBL
|
|
14
13
|
SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Outlay'
|
15
14
|
|
16
15
|
# @!attribute [r] uuid
|
17
|
-
# Unique
|
18
|
-
# @return [
|
19
|
-
property :uuid,
|
16
|
+
# Universally Unique Identifier.
|
17
|
+
# @return [String]
|
18
|
+
property :uuid, String
|
20
19
|
|
21
20
|
# @!attribute [r] i
|
22
21
|
# Outlay number index inside the invoice for ordering (calculated).
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -18,10 +17,10 @@ module GOBL
|
|
18
17
|
# @return [GOBL::CBC::Code]
|
19
18
|
property :prices_include, GOBL::CBC::Code
|
20
19
|
|
21
|
-
# @!attribute [r]
|
22
|
-
#
|
23
|
-
# @return [
|
24
|
-
property :
|
20
|
+
# @!attribute [r] ext
|
21
|
+
# Additional extensions that are applied to the invoice as a whole as opposed to specific sections.
|
22
|
+
# @return [GOBL::Tax::Extensions]
|
23
|
+
property :ext, GOBL::Tax::Extensions
|
25
24
|
|
26
25
|
# @!attribute [r] meta
|
27
26
|
# Any additional data that may be required for processing, but should never be relied upon by recipients.
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -35,15 +34,10 @@ module GOBL
|
|
35
34
|
# @return [GOBL::CBC::Meta]
|
36
35
|
property :meta, GOBL::CBC::Meta
|
37
36
|
|
38
|
-
# @!attribute [r]
|
39
|
-
#
|
40
|
-
# @return [Array<GOBL::CBC::
|
41
|
-
property :
|
42
|
-
|
43
|
-
# @!attribute [r] keys
|
44
|
-
# Keys is used instead of codes to define a further sub-set of keys that can be used alongside this one.
|
45
|
-
# @return [Array<GOBL::CBC::KeyDefinition>]
|
46
|
-
property :keys, [GOBL::CBC::KeyDefinition]
|
37
|
+
# @!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
41
|
|
48
42
|
# @!attribute [r] pattern
|
49
43
|
# 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
|
+
# ValueDefinition describes a specific value and how it maps to a human name and description if appropriate.
|
11
|
+
class ValueDefinition < GOBL::Object
|
12
|
+
# The Schema ID of the GOBL ValueDefinition structure
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/cbc/value-definition'
|
14
|
+
|
15
|
+
# @!attribute [r] value
|
16
|
+
# Value for which the definition is for.
|
17
|
+
# @return [String]
|
18
|
+
property :value, String
|
19
|
+
validates_presence_of :value
|
20
|
+
|
21
|
+
# @!attribute [r] name
|
22
|
+
# Short name for the value, if relevant.
|
23
|
+
# @return [GOBL::I18n::String]
|
24
|
+
property :name, GOBL::I18n::String
|
25
|
+
|
26
|
+
# @!attribute [r] desc
|
27
|
+
# Description offering more details about when the value should be used.
|
28
|
+
# @return [GOBL::I18n::String]
|
29
|
+
property :desc, GOBL::I18n::String
|
30
|
+
|
31
|
+
# @!attribute [r] meta
|
32
|
+
# Meta defines any additional details that may be useful or associated with the value.
|
33
|
+
# @return [GOBL::CBC::Meta]
|
34
|
+
property :meta, GOBL::CBC::Meta
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## DO NOT EDIT - This file was generated automatically.
|
5
|
+
##
|
6
|
+
##
|
7
|
+
|
8
|
+
module GOBL
|
9
|
+
module Currency
|
10
|
+
# An Amount represents a monetary value in a specific currency.
|
11
|
+
class Amount < GOBL::Object
|
12
|
+
# The Schema ID of the GOBL Amount structure
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/currency/amount'
|
14
|
+
|
15
|
+
# @!attribute [r] label
|
16
|
+
# Label allows for additional information to be added to the currency Amount that may be useful.
|
17
|
+
# @return [String]
|
18
|
+
property :label, String
|
19
|
+
|
20
|
+
# @!attribute [r] currency
|
21
|
+
# Code defines the currency for this amount.
|
22
|
+
# @return [GOBL::Currency::Code]
|
23
|
+
property :currency, GOBL::Currency::Code
|
24
|
+
validates_presence_of :currency
|
25
|
+
|
26
|
+
# @!attribute [r] value
|
27
|
+
# Value is the amount in the currency.
|
28
|
+
# @return [GOBL::Num::Amount]
|
29
|
+
property :value, GOBL::Num::Amount
|
30
|
+
validates_presence_of :value
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|