gobl 0.9.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -13
- data/data/regimes/co.json +55 -1
- data/data/regimes/es.json +570 -64
- data/data/regimes/it.json +1182 -0
- data/lib/{gobl → generated/gobl}/bill/charge.rb +1 -1
- data/lib/{gobl → generated/gobl}/bill/delivery.rb +1 -1
- data/lib/{gobl → generated/gobl}/bill/discount.rb +1 -1
- data/lib/{gobl → generated/gobl}/bill/document_reference.rb +1 -1
- data/lib/{gobl → generated/gobl}/bill/invoice.rb +19 -8
- data/lib/{gobl → generated/gobl}/bill/line.rb +3 -3
- data/lib/{gobl → generated/gobl}/bill/line_charge.rb +1 -1
- data/lib/{gobl → generated/gobl}/bill/line_discount.rb +1 -1
- data/lib/{gobl → generated/gobl}/bill/ordering.rb +1 -1
- data/lib/{gobl → generated/gobl}/bill/outlay.rb +3 -3
- data/lib/{gobl → generated/gobl}/bill/payment.rb +1 -1
- data/lib/{gobl → generated/gobl}/bill/preceding.rb +23 -23
- data/lib/{gobl → generated/gobl}/bill/tax.rb +4 -4
- data/lib/{gobl → generated/gobl}/bill/totals.rb +5 -5
- data/lib/{gobl → generated/gobl}/cal/date.rb +2 -2
- data/lib/{gobl → generated/gobl}/cal/period.rb +3 -3
- data/lib/{gobl → generated/gobl}/cbc/code.rb +3 -3
- data/lib/{gobl → generated/gobl}/cbc/key.rb +2 -2
- data/lib/{gobl → generated/gobl}/cbc/meta.rb +1 -1
- data/lib/{gobl → generated/gobl}/cbc/note.rb +6 -6
- data/lib/{gobl → generated/gobl}/cbc/stamp.rb +3 -3
- data/lib/{gobl → generated/gobl}/currency/code.rb +7 -4
- data/lib/{gobl → generated/gobl}/currency/exchange_rate.rb +3 -3
- data/lib/generated/gobl/document.rb +16 -0
- data/lib/{gobl → generated/gobl}/dsig/digest.rb +3 -3
- data/lib/{gobl → generated/gobl}/dsig/signature.rb +2 -2
- data/lib/{gobl → generated/gobl}/envelope.rb +5 -5
- data/lib/{gobl → generated/gobl}/header.rb +4 -4
- data/lib/{gobl → generated/gobl}/i18n/string.rb +1 -1
- data/lib/{gobl → generated/gobl}/l10n/code.rb +2 -2
- data/lib/{gobl → generated/gobl}/l10n/country_code.rb +7 -4
- data/lib/{gobl → generated/gobl}/note/message.rb +4 -4
- data/lib/{gobl → generated/gobl}/org/address.rb +2 -2
- data/lib/{gobl → generated/gobl}/org/coordinates.rb +1 -1
- data/lib/{gobl → generated/gobl}/org/email.rb +2 -2
- data/lib/generated/gobl/org/identity.rb +38 -0
- data/lib/{gobl → generated/gobl}/org/image.rb +1 -1
- data/lib/{gobl → generated/gobl}/org/inbox.rb +3 -3
- data/lib/{gobl → generated/gobl}/org/item.rb +10 -10
- data/lib/{gobl → generated/gobl}/org/name.rb +3 -3
- data/lib/{gobl → generated/gobl}/org/party.rb +7 -7
- data/lib/{gobl → generated/gobl}/org/person.rb +2 -7
- data/lib/{gobl → generated/gobl}/org/registration.rb +1 -1
- data/lib/{gobl → generated/gobl}/org/telephone.rb +2 -2
- data/lib/{gobl → generated/gobl}/org/unit.rb +8 -3
- data/lib/{gobl → generated/gobl}/org/website.rb +2 -2
- data/lib/{gobl → generated/gobl}/pay/advance.rb +3 -3
- data/lib/{gobl → generated/gobl}/pay/card.rb +3 -3
- data/lib/{gobl → generated/gobl}/pay/credit_transfer.rb +1 -1
- data/lib/{gobl → generated/gobl}/pay/direct_debit.rb +1 -1
- data/lib/{gobl → generated/gobl}/pay/due_date.rb +3 -3
- data/lib/{gobl → generated/gobl}/pay/instructions.rb +19 -4
- data/lib/{gobl → generated/gobl}/pay/online.rb +2 -2
- data/lib/{gobl → generated/gobl}/pay/terms.rb +19 -4
- data/lib/{gobl → generated/gobl}/tax/category.rb +14 -4
- data/lib/{gobl → generated/gobl}/tax/category_total.rb +5 -5
- data/lib/{gobl → generated/gobl}/tax/combo.rb +7 -2
- data/lib/{gobl → generated/gobl}/tax/identity.rb +16 -6
- data/lib/generated/gobl/tax/key_definition.rb +38 -0
- data/lib/generated/gobl/tax/preceding_definitions.rb +27 -0
- data/lib/{gobl → generated/gobl}/tax/rate.rb +11 -4
- data/lib/{gobl → generated/gobl}/tax/rate_total.rb +4 -4
- data/lib/{gobl → generated/gobl}/tax/rate_total_surcharge.rb +3 -3
- data/lib/{gobl → generated/gobl}/tax/rate_value.rb +2 -2
- data/lib/{gobl → generated/gobl}/tax/regime.rb +19 -9
- data/lib/generated/gobl/tax/scenario.rb +37 -0
- data/lib/generated/gobl/tax/scenario_set.rb +29 -0
- data/lib/{gobl → generated/gobl}/tax/set.rb +1 -1
- data/lib/generated/gobl/tax/tag.rb +33 -0
- data/lib/{gobl → generated/gobl}/tax/total.rb +2 -2
- data/lib/{gobl → generated/gobl}/tax/zone.rb +2 -2
- data/lib/{gobl → generated/gobl}/uuid/uuid.rb +2 -2
- data/lib/gobl/enum.rb +8 -56
- data/lib/gobl/version.rb +1 -1
- data/lib/gobl.rb +1 -0
- metadata +75 -76
- data/lib/gobl/bill/invoice_type.rb +0 -30
- data/lib/gobl/cbc/note_key.rb +0 -48
- data/lib/gobl/document.rb +0 -13
- data/lib/gobl/org/item_code.rb +0 -28
- data/lib/gobl/pay/method_key.rb +0 -30
- data/lib/gobl/pay/term_key.rb +0 -33
- data/lib/gobl/tax/scheme.rb +0 -44
- data/lib/gobl/tax/source_key.rb +0 -28
- data/lib/gobl/value.rb +0 -77
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -27,18 +27,29 @@ module GOBL
|
|
27
27
|
# Sequential code used to identify this invoice in tax declarations.
|
28
28
|
# @return [String]
|
29
29
|
property :code, String
|
30
|
-
|
30
|
+
validates_presence_of :code
|
31
|
+
|
32
|
+
# Enumeration of possible values for {#type} with their corresponding descriptions
|
33
|
+
TYPE_ENUM = {
|
34
|
+
'standard' => 'A regular commercial invoice document between a supplier and customer.',
|
35
|
+
'proforma' => 'For a clients validation before sending a final invoice.',
|
36
|
+
'corrective' => 'Corrected invoice that completely replaces the preceding document.',
|
37
|
+
'credit-note' => 'Reflects a refund either partial or complete of the preceding document.',
|
38
|
+
'debit-note' => 'An additional set of charges to be added to the preceding document.'
|
39
|
+
}.freeze
|
31
40
|
|
32
41
|
# @!attribute [r] type
|
33
|
-
#
|
34
|
-
# @return [
|
35
|
-
property :type,
|
42
|
+
# Type of invoice document subject to the requirements of the local tax regime.
|
43
|
+
# @return [GOBL::CBC::Key]
|
44
|
+
property :type, GOBL::CBC::Key
|
45
|
+
validates_presence_of :type
|
46
|
+
validates_inclusion_of :type, in: TYPE_ENUM.keys
|
36
47
|
|
37
48
|
# @!attribute [r] currency
|
38
49
|
# Currency for all invoice totals.
|
39
50
|
# @return [GOBL::Currency::Code]
|
40
51
|
property :currency, GOBL::Currency::Code
|
41
|
-
|
52
|
+
validates_presence_of :currency
|
42
53
|
|
43
54
|
# @!attribute [r] exchange_rates
|
44
55
|
# Exchange rates to be used when converting the invoices monetary values into other currencies.
|
@@ -59,7 +70,7 @@ module GOBL
|
|
59
70
|
# When the invoice was created.
|
60
71
|
# @return [GOBL::Cal::Date]
|
61
72
|
property :issue_date, GOBL::Cal::Date
|
62
|
-
|
73
|
+
validates_presence_of :issue_date
|
63
74
|
|
64
75
|
# @!attribute [r] op_date
|
65
76
|
# Date when the operation defined by the invoice became effective.
|
@@ -75,7 +86,7 @@ module GOBL
|
|
75
86
|
# The taxable entity supplying the goods or services.
|
76
87
|
# @return [GOBL::Org::Party]
|
77
88
|
property :supplier, GOBL::Org::Party
|
78
|
-
|
89
|
+
validates_presence_of :supplier
|
79
90
|
|
80
91
|
# @!attribute [r] customer
|
81
92
|
# Legal entity receiving the goods or services, may be empty in certain circumstances such as simplified invoices.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -27,13 +27,13 @@ module GOBL
|
|
27
27
|
# Number of items
|
28
28
|
# @return [GOBL::Num::Amount]
|
29
29
|
property :quantity, GOBL::Num::Amount
|
30
|
-
|
30
|
+
validates_presence_of :quantity
|
31
31
|
|
32
32
|
# @!attribute [r] item
|
33
33
|
# Details about what is being sold
|
34
34
|
# @return [GOBL::Org::Item]
|
35
35
|
property :item, GOBL::Org::Item
|
36
|
-
|
36
|
+
validates_presence_of :item
|
37
37
|
|
38
38
|
# @!attribute [r] sum
|
39
39
|
# Result of quantity multiplied by the item's price (calculated)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -42,7 +42,7 @@ module GOBL
|
|
42
42
|
# Details on what the outlay was.
|
43
43
|
# @return [String]
|
44
44
|
property :desc, String
|
45
|
-
|
45
|
+
validates_presence_of :desc
|
46
46
|
|
47
47
|
# @!attribute [r] supplier
|
48
48
|
# Who was the supplier of the outlay
|
@@ -53,7 +53,7 @@ module GOBL
|
|
53
53
|
# Amount paid by the supplier.
|
54
54
|
# @return [GOBL::Num::Amount]
|
55
55
|
property :amount, GOBL::Num::Amount
|
56
|
-
|
56
|
+
validates_presence_of :amount
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -3,12 +3,12 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
10
10
|
module Bill
|
11
|
-
# Preceding allows for information to be provided about a previous invoice that this one will replace or
|
11
|
+
# Preceding allows for information to be provided about a previous invoice that this one will replace, subtract from, or add to.
|
12
12
|
class Preceding < GOBL::Object
|
13
13
|
# The Schema ID of the GOBL Preceding structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Preceding'
|
@@ -27,38 +27,38 @@ module GOBL
|
|
27
27
|
# Code of the previous document.
|
28
28
|
# @return [String]
|
29
29
|
property :code, String
|
30
|
-
|
30
|
+
validates_presence_of :code
|
31
31
|
|
32
32
|
# @!attribute [r] issue_date
|
33
|
-
# The issue date
|
33
|
+
# The issue date of the previous document.
|
34
34
|
# @return [GOBL::Cal::Date]
|
35
35
|
property :issue_date, GOBL::Cal::Date
|
36
|
-
|
36
|
+
validates_presence_of :issue_date
|
37
37
|
|
38
|
-
# @!attribute [r]
|
39
|
-
#
|
40
|
-
# @return [GOBL::Cal::Period]
|
41
|
-
property :period, GOBL::Cal::Period
|
42
|
-
|
43
|
-
# @!attribute [r] corrections
|
44
|
-
# Specific codes for the corrections made.
|
45
|
-
# @return [Array<String>]
|
46
|
-
property :corrections, [String]
|
47
|
-
|
48
|
-
# @!attribute [r] correction_method
|
49
|
-
# How has the previous invoice been corrected?
|
38
|
+
# @!attribute [r] reason
|
39
|
+
# Human readable description on why the preceding invoice is being replaced.
|
50
40
|
# @return [String]
|
51
|
-
property :
|
41
|
+
property :reason, String
|
52
42
|
|
53
43
|
# @!attribute [r] stamps
|
54
|
-
# Seals of approval from other organisations.
|
44
|
+
# Seals of approval from other organisations that may need to be listed.
|
55
45
|
# @return [Array<GOBL::CBC::Stamp>]
|
56
46
|
property :stamps, [GOBL::CBC::Stamp]
|
57
47
|
|
58
|
-
# @!attribute [r]
|
59
|
-
#
|
60
|
-
# @return [
|
61
|
-
property :
|
48
|
+
# @!attribute [r] corrections
|
49
|
+
# Tax regime specific keys reflecting why the preceding invoice is being replaced.
|
50
|
+
# @return [Array<GOBL::CBC::Key>]
|
51
|
+
property :corrections, [GOBL::CBC::Key]
|
52
|
+
|
53
|
+
# @!attribute [r] correction_method
|
54
|
+
# Tax regime specific keys reflecting the method used to correct the preceding invoice.
|
55
|
+
# @return [GOBL::CBC::Key]
|
56
|
+
property :correction_method, GOBL::CBC::Key
|
57
|
+
|
58
|
+
# @!attribute [r] period
|
59
|
+
# Tax period in which the previous invoice had an effect required by some tax regimes and formats.
|
60
|
+
# @return [GOBL::Cal::Period]
|
61
|
+
property :period, GOBL::Cal::Period
|
62
62
|
|
63
63
|
# @!attribute [r] meta
|
64
64
|
# Additional semi-structured data that may be useful in specific regions
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -18,10 +18,10 @@ module GOBL
|
|
18
18
|
# @return [GOBL::CBC::Code]
|
19
19
|
property :prices_include, GOBL::CBC::Code
|
20
20
|
|
21
|
-
# @!attribute [r]
|
22
|
-
# Special tax
|
21
|
+
# @!attribute [r] tags
|
22
|
+
# Special tax tags that apply to this invoice according to local requirements.
|
23
23
|
# @return [Array<GOBL::CBC::Key>]
|
24
|
-
property :
|
24
|
+
property :tags, [GOBL::CBC::Key]
|
25
25
|
|
26
26
|
# @!attribute [r] meta
|
27
27
|
# Any additional data that may be required for processing, but should never be relied upon by recipients.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,7 +17,7 @@ module GOBL
|
|
17
17
|
# Sum of all line item sums
|
18
18
|
# @return [GOBL::Num::Amount]
|
19
19
|
property :sum, GOBL::Num::Amount
|
20
|
-
|
20
|
+
validates_presence_of :sum
|
21
21
|
|
22
22
|
# @!attribute [r] discount
|
23
23
|
# Sum of all document level discounts
|
@@ -38,7 +38,7 @@ module GOBL
|
|
38
38
|
# Sum of all line sums minus the discounts, plus the charges, without tax.
|
39
39
|
# @return [GOBL::Num::Amount]
|
40
40
|
property :total, GOBL::Num::Amount
|
41
|
-
|
41
|
+
validates_presence_of :total
|
42
42
|
|
43
43
|
# @!attribute [r] taxes
|
44
44
|
# Summary of all the taxes included in the invoice.
|
@@ -54,7 +54,7 @@ module GOBL
|
|
54
54
|
# Grand total after all taxes have been applied.
|
55
55
|
# @return [GOBL::Num::Amount]
|
56
56
|
property :total_with_tax, GOBL::Num::Amount
|
57
|
-
|
57
|
+
validates_presence_of :total_with_tax
|
58
58
|
|
59
59
|
# @!attribute [r] outlays
|
60
60
|
# Total paid in outlays that need to be reimbursed
|
@@ -65,7 +65,7 @@ module GOBL
|
|
65
65
|
# Total amount to be paid after applying taxes and outlays.
|
66
66
|
# @return [GOBL::Num::Amount]
|
67
67
|
property :payable, GOBL::Num::Amount
|
68
|
-
|
68
|
+
validates_presence_of :payable
|
69
69
|
|
70
70
|
# @!attribute [r] advance
|
71
71
|
# Total amount already paid in advance.
|
@@ -3,13 +3,13 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
10
10
|
module Cal
|
11
11
|
# Civil date in simplified ISO format, like 2021-05-26
|
12
|
-
class Date <
|
12
|
+
class Date < String
|
13
13
|
# The Schema ID of the GOBL Date structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/cal/date'
|
15
15
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -16,12 +16,12 @@ module GOBL
|
|
16
16
|
# @!attribute [r] start
|
17
17
|
# @return [GOBL::Cal::Date]
|
18
18
|
property :start, GOBL::Cal::Date
|
19
|
-
|
19
|
+
validates_presence_of :start
|
20
20
|
|
21
21
|
# @!attribute [r] end
|
22
22
|
# @return [GOBL::Cal::Date]
|
23
23
|
property :end, GOBL::Cal::Date
|
24
|
-
|
24
|
+
validates_presence_of :end
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -3,13 +3,13 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
10
10
|
module CBC
|
11
|
-
#
|
12
|
-
class Code <
|
11
|
+
# Alphanumerical text identifier with upper-case letters, no whitespace, nor symbols.
|
12
|
+
class Code < String
|
13
13
|
# The Schema ID of the GOBL Code structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/cbc/code'
|
15
15
|
end
|
@@ -3,13 +3,13 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
10
10
|
module CBC
|
11
11
|
# Text identifier to be used instead of a code for a more verbose but readable identifier.
|
12
|
-
class Key <
|
12
|
+
class Key < String
|
13
13
|
# The Schema ID of the GOBL Key structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/cbc/key'
|
15
15
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -15,8 +15,8 @@ module GOBL
|
|
15
15
|
|
16
16
|
# @!attribute [r] key
|
17
17
|
# Key specifying subject of the text
|
18
|
-
# @return [
|
19
|
-
property :key,
|
18
|
+
# @return [GOBL::CBC::Key]
|
19
|
+
property :key, GOBL::CBC::Key
|
20
20
|
|
21
21
|
# @!attribute [r] code
|
22
22
|
# Code used for additional data that may be required to identify the note.
|
@@ -25,14 +25,14 @@ module GOBL
|
|
25
25
|
|
26
26
|
# @!attribute [r] src
|
27
27
|
# Source of this note, especially useful when auto-generated.
|
28
|
-
# @return [
|
29
|
-
property :src,
|
28
|
+
# @return [GOBL::CBC::Key]
|
29
|
+
property :src, GOBL::CBC::Key
|
30
30
|
|
31
31
|
# @!attribute [r] text
|
32
32
|
# The contents of the note
|
33
33
|
# @return [String]
|
34
34
|
property :text, String
|
35
|
-
|
35
|
+
validates_presence_of :text
|
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.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,13 +17,13 @@ module GOBL
|
|
17
17
|
# Identity of the agency used to create the stamp usually defined by each region.
|
18
18
|
# @return [GOBL::CBC::Key]
|
19
19
|
property :prv, GOBL::CBC::Key
|
20
|
-
|
20
|
+
validates_presence_of :prv
|
21
21
|
|
22
22
|
# @!attribute [r] val
|
23
23
|
# The serialized stamp value generated for or by the external agency
|
24
24
|
# @return [String]
|
25
25
|
property :val, String
|
26
|
-
|
26
|
+
validates_presence_of :val
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -3,17 +3,18 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
10
10
|
module Currency
|
11
11
|
# ISO Currency Code
|
12
|
-
class Code <
|
12
|
+
class Code < String
|
13
13
|
# The Schema ID of the GOBL Code structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/currency/code'
|
15
15
|
|
16
|
-
|
16
|
+
include GOBL::Enum
|
17
|
+
|
17
18
|
ENUM = {
|
18
19
|
'AED' => 'UAE Dirham',
|
19
20
|
'AFN' => 'Afghani',
|
@@ -183,7 +184,9 @@ module GOBL
|
|
183
184
|
'ZWL' => 'Zimbabwe Dollar'
|
184
185
|
}.freeze
|
185
186
|
|
186
|
-
|
187
|
+
def strict_enum?
|
188
|
+
true
|
189
|
+
end
|
187
190
|
end
|
188
191
|
end
|
189
192
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,13 +17,13 @@ module GOBL
|
|
17
17
|
# ISO currency code this rate represents.
|
18
18
|
# @return [GOBL::Currency::Code]
|
19
19
|
property :currency, GOBL::Currency::Code
|
20
|
-
|
20
|
+
validates_presence_of :currency
|
21
21
|
|
22
22
|
# @!attribute [r] amount
|
23
23
|
# How much is 1.00 of this currency worth in the documents currency.
|
24
24
|
# @return [GOBL::Num::Amount]
|
25
25
|
property :amount, GOBL::Num::Amount
|
26
|
-
|
26
|
+
validates_presence_of :amount
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -0,0 +1,16 @@
|
|
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
|
+
# Contains the document payload to be included inside an Envelope.
|
11
|
+
#
|
12
|
+
# The document must contain a `$schema` property that identifies
|
13
|
+
# the data's structure otherwise it will be rejected.
|
14
|
+
class Document < GOBL::Map
|
15
|
+
end
|
16
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,13 +17,13 @@ module GOBL
|
|
17
17
|
# Algorithm stores the algorithm key that was used to generate the value.
|
18
18
|
# @return [String]
|
19
19
|
property :alg, String
|
20
|
-
|
20
|
+
validates_presence_of :alg
|
21
21
|
|
22
22
|
# @!attribute [r] val
|
23
23
|
# Value contains the Hexadecimal representation of the resulting hash generated by the algorithm.
|
24
24
|
# @return [String]
|
25
25
|
property :val, String
|
26
|
-
|
26
|
+
validates_presence_of :val
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -3,13 +3,13 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
10
10
|
module DSig
|
11
11
|
# JSON Web Signature in compact form.
|
12
|
-
class Signature <
|
12
|
+
class Signature < String
|
13
13
|
# The Schema ID of the GOBL Signature structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/dsig/signature'
|
15
15
|
end
|
@@ -3,11 +3,11 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
10
|
-
# Envelope wraps around a
|
10
|
+
# Envelope wraps around a document adding headers and digital signatures.
|
11
11
|
class Envelope < GOBL::Object
|
12
12
|
# The Schema ID of the GOBL Envelope structure
|
13
13
|
SCHEMA_ID = 'https://gobl.org/draft-0/envelope'
|
@@ -16,19 +16,19 @@ module GOBL
|
|
16
16
|
# Schema identifies the schema that should be used to understand this document
|
17
17
|
# @return [String]
|
18
18
|
property :$schema, String
|
19
|
-
|
19
|
+
validates_presence_of :$schema
|
20
20
|
|
21
21
|
# @!attribute [r] head
|
22
22
|
# Details on what the contents are
|
23
23
|
# @return [Header]
|
24
24
|
property :head, Header
|
25
|
-
|
25
|
+
validates_presence_of :head
|
26
26
|
|
27
27
|
# @!attribute [r] doc
|
28
28
|
# The data inside the envelope
|
29
29
|
# @return [Document]
|
30
30
|
property :doc, Document
|
31
|
-
|
31
|
+
validates_presence_of :doc
|
32
32
|
|
33
33
|
# @!attribute [r] sigs
|
34
34
|
# JSON Web Signatures of the header
|