gobl 0.7.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/regimes/pt.json +234 -0
- data/lib/gobl/bill/charge.rb +1 -1
- data/lib/gobl/bill/delivery.rb +3 -3
- data/lib/gobl/bill/discount.rb +1 -1
- data/lib/gobl/bill/document_reference.rb +37 -0
- data/lib/gobl/bill/invoice.rb +11 -8
- data/lib/gobl/bill/invoice_type.rb +2 -4
- data/lib/gobl/bill/line.rb +1 -1
- data/lib/gobl/bill/line_charge.rb +1 -1
- data/lib/gobl/bill/line_discount.rb +1 -1
- data/lib/gobl/bill/ordering.rb +48 -3
- data/lib/gobl/bill/outlay.rb +1 -1
- data/lib/gobl/bill/payment.rb +6 -6
- data/lib/gobl/bill/preceding.rb +1 -1
- data/lib/gobl/bill/tax.rb +3 -3
- data/lib/gobl/bill/totals.rb +1 -1
- data/lib/gobl/cal/date.rb +1 -1
- data/lib/gobl/cal/period.rb +1 -1
- data/lib/gobl/cbc/code.rb +1 -1
- data/lib/gobl/cbc/key.rb +1 -1
- data/lib/gobl/cbc/meta.rb +1 -1
- data/lib/gobl/cbc/note.rb +1 -1
- data/lib/gobl/cbc/note_key.rb +2 -4
- data/lib/gobl/cbc/stamp.rb +1 -1
- data/lib/gobl/currency/code.rb +2 -4
- data/lib/gobl/currency/exchange_rate.rb +1 -1
- data/lib/gobl/document.rb +1 -1
- data/lib/gobl/dsig/digest.rb +1 -1
- data/lib/gobl/dsig/signature.rb +1 -1
- data/lib/gobl/enum.rb +2 -12
- data/lib/gobl/envelope.rb +1 -1
- data/lib/gobl/header.rb +1 -1
- data/lib/gobl/i18n/string.rb +1 -1
- data/lib/gobl/l10n/code.rb +1 -1
- data/lib/gobl/l10n/country_code.rb +2 -4
- data/lib/gobl/note/message.rb +1 -1
- data/lib/gobl/org/address.rb +1 -1
- data/lib/gobl/org/coordinates.rb +1 -1
- data/lib/gobl/org/email.rb +1 -1
- data/lib/gobl/org/image.rb +67 -0
- data/lib/gobl/org/inbox.rb +1 -1
- data/lib/gobl/org/item.rb +1 -1
- data/lib/gobl/org/item_code.rb +1 -1
- data/lib/gobl/org/name.rb +1 -1
- data/lib/gobl/org/party.rb +11 -1
- data/lib/gobl/org/person.rb +6 -1
- data/lib/gobl/org/registration.rb +1 -1
- data/lib/gobl/org/telephone.rb +1 -1
- data/lib/gobl/org/unit.rb +1 -1
- data/lib/gobl/org/website.rb +38 -0
- data/lib/gobl/pay/advance.rb +1 -1
- data/lib/gobl/pay/card.rb +1 -1
- data/lib/gobl/pay/credit_transfer.rb +1 -1
- data/lib/gobl/pay/direct_debit.rb +1 -1
- data/lib/gobl/pay/due_date.rb +1 -1
- data/lib/gobl/pay/instructions.rb +2 -2
- data/lib/gobl/pay/method_key.rb +4 -6
- data/lib/gobl/pay/online.rb +1 -1
- data/lib/gobl/pay/term_key.rb +2 -4
- data/lib/gobl/pay/terms.rb +1 -1
- data/lib/gobl/tax/category.rb +1 -1
- data/lib/gobl/tax/category_total.rb +1 -1
- data/lib/gobl/tax/combo.rb +1 -1
- data/lib/gobl/tax/identity.rb +1 -1
- data/lib/gobl/tax/rate.rb +2 -2
- data/lib/gobl/tax/rate_total.rb +1 -1
- data/lib/gobl/tax/rate_total_surcharge.rb +1 -1
- data/lib/gobl/tax/rate_value.rb +6 -1
- data/lib/gobl/tax/regime.rb +3 -3
- data/lib/gobl/tax/scheme.rb +1 -1
- data/lib/gobl/tax/set.rb +1 -1
- data/lib/gobl/tax/source_key.rb +2 -4
- data/lib/gobl/tax/total.rb +1 -1
- data/lib/gobl/tax/zone.rb +1 -1
- data/lib/gobl/uuid/uuid.rb +1 -1
- data/lib/gobl/version.rb +1 -1
- metadata +7 -7
- data/lib/gobl/bill/advances.rb +0 -14
- data/lib/gobl/bill/exchange_rates.rb +0 -14
- data/lib/gobl/bill/scheme_keys.rb +0 -14
- data/lib/gobl/tax/schemes.rb +0 -14
data/lib/gobl/currency/code.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -183,9 +183,7 @@ module GOBL
|
|
183
183
|
'ZWL' => 'Zimbabwe Dollar'
|
184
184
|
}.freeze
|
185
185
|
|
186
|
-
|
187
|
-
true
|
188
|
-
end
|
186
|
+
validates_inclusion_of :_value, in: ENUM.keys, message: '"%{value}" is not within the allowed values of the enumeration'
|
189
187
|
end
|
190
188
|
end
|
191
189
|
end
|
data/lib/gobl/document.rb
CHANGED
data/lib/gobl/dsig/digest.rb
CHANGED
data/lib/gobl/dsig/signature.rb
CHANGED
data/lib/gobl/enum.rb
CHANGED
@@ -4,6 +4,8 @@ module GOBL
|
|
4
4
|
# Base class for single value structures in the GOBL schema that have a controlled set
|
5
5
|
# of values associated to them (i.e., an enumeration) that may constrain them
|
6
6
|
class Enum < Value
|
7
|
+
include ActiveModel::Validations
|
8
|
+
|
7
9
|
# Returns an enum value object that corresponds to a given value. The value can be a
|
8
10
|
# `Symbol`, a `String` or anything coercible into one (via `#to_s`)
|
9
11
|
#
|
@@ -62,18 +64,6 @@ module GOBL
|
|
62
64
|
|
63
65
|
private
|
64
66
|
|
65
|
-
def _value=(value)
|
66
|
-
if strict_enum? && !self.class::ENUM.key?(value)
|
67
|
-
raise TypeError, "\"#{value}\" is not within the valid values of the enumeration"
|
68
|
-
end
|
69
|
-
|
70
|
-
super
|
71
|
-
end
|
72
|
-
|
73
|
-
def strict_enum?
|
74
|
-
false
|
75
|
-
end
|
76
|
-
|
77
67
|
def value_from_sym(sym)
|
78
68
|
self.class.find_by_sym(sym)&.to_s
|
79
69
|
end
|
data/lib/gobl/envelope.rb
CHANGED
data/lib/gobl/header.rb
CHANGED
data/lib/gobl/i18n/string.rb
CHANGED
data/lib/gobl/l10n/code.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -266,9 +266,7 @@ module GOBL
|
|
266
266
|
'ZW' => 'Zimbabwe'
|
267
267
|
}.freeze
|
268
268
|
|
269
|
-
|
270
|
-
true
|
271
|
-
end
|
269
|
+
validates_inclusion_of :_value, in: ENUM.keys, message: '"%{value}" is not within the allowed values of the enumeration'
|
272
270
|
end
|
273
271
|
end
|
274
272
|
end
|
data/lib/gobl/note/message.rb
CHANGED
data/lib/gobl/org/address.rb
CHANGED
data/lib/gobl/org/coordinates.rb
CHANGED
data/lib/gobl/org/email.rb
CHANGED
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## DO NOT EDIT - This file was generated automatically.
|
5
|
+
##
|
6
|
+
## Generated with GOBL v0.36.0
|
7
|
+
##
|
8
|
+
|
9
|
+
module GOBL
|
10
|
+
module Org
|
11
|
+
# Image describes a logo or photo that represents an entity.
|
12
|
+
class Image < GOBL::Object
|
13
|
+
# The Schema ID of the GOBL Image structure
|
14
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/org/image'
|
15
|
+
|
16
|
+
# @!attribute [r] uuid
|
17
|
+
# Unique ID of the image
|
18
|
+
# @return [GOBL::UUID::UUID]
|
19
|
+
property :uuid, GOBL::UUID::UUID
|
20
|
+
|
21
|
+
# @!attribute [r] label
|
22
|
+
# Label to help identify the image.
|
23
|
+
# @return [String]
|
24
|
+
property :label, String
|
25
|
+
|
26
|
+
# @!attribute [r] url
|
27
|
+
# URL of the image
|
28
|
+
# @return [String]
|
29
|
+
property :url, String
|
30
|
+
|
31
|
+
# @!attribute [r] data
|
32
|
+
# As an alternative to the URL and only when the source data is small, like an SVG, the raw data may be provided using Base64 encoding.
|
33
|
+
# @return [String]
|
34
|
+
property :data, String
|
35
|
+
|
36
|
+
# @!attribute [r] mime
|
37
|
+
# Format of the image.
|
38
|
+
# @return [String]
|
39
|
+
property :mime, String
|
40
|
+
|
41
|
+
# @!attribute [r] description
|
42
|
+
# Details of what the image represents.
|
43
|
+
# @return [String]
|
44
|
+
property :description, String
|
45
|
+
|
46
|
+
# @!attribute [r] alt
|
47
|
+
# Alternative text if the image cannot be shown.
|
48
|
+
# @return [String]
|
49
|
+
property :alt, String
|
50
|
+
|
51
|
+
# @!attribute [r] height
|
52
|
+
# Height of the image in pixels.
|
53
|
+
# @return [Integer]
|
54
|
+
property :height, Integer
|
55
|
+
|
56
|
+
# @!attribute [r] width
|
57
|
+
# Width of the image in pixels.
|
58
|
+
# @return [Integer]
|
59
|
+
property :width, Integer
|
60
|
+
|
61
|
+
# @!attribute [r] digest
|
62
|
+
# Digest can be used to ensure the image contained at the URL is the same one as originally intended.
|
63
|
+
# @return [GOBL::DSig::Digest]
|
64
|
+
property :digest, GOBL::DSig::Digest
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
data/lib/gobl/org/inbox.rb
CHANGED
data/lib/gobl/org/item.rb
CHANGED
data/lib/gobl/org/item_code.rb
CHANGED
data/lib/gobl/org/name.rb
CHANGED
data/lib/gobl/org/party.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -59,6 +59,11 @@ module GOBL
|
|
59
59
|
# @return [Array<GOBL::Org::Email>]
|
60
60
|
property :emails, [GOBL::Org::Email]
|
61
61
|
|
62
|
+
# @!attribute [r] websites
|
63
|
+
# Public websites that provide further information about the party.
|
64
|
+
# @return [Array<Website>]
|
65
|
+
property :websites, [Website]
|
66
|
+
|
62
67
|
# @!attribute [r] telephones
|
63
68
|
# Regular telephone numbers
|
64
69
|
# @return [Array<GOBL::Org::Telephone>]
|
@@ -69,6 +74,11 @@ module GOBL
|
|
69
74
|
# @return [GOBL::Org::Registration]
|
70
75
|
property :registration, GOBL::Org::Registration
|
71
76
|
|
77
|
+
# @!attribute [r] logos
|
78
|
+
# Images that can be used to identify the party visually.
|
79
|
+
# @return [Array<GOBL::Org::Image>]
|
80
|
+
property :logos, [GOBL::Org::Image]
|
81
|
+
|
72
82
|
# @!attribute [r] meta
|
73
83
|
# Any additional semi-structured information that does not fit into the rest of the party.
|
74
84
|
# @return [GOBL::CBC::Meta]
|
data/lib/gobl/org/person.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -44,6 +44,11 @@ module GOBL
|
|
44
44
|
# @return [Array<GOBL::Org::Telephone>]
|
45
45
|
property :telephones, [GOBL::Org::Telephone]
|
46
46
|
|
47
|
+
# @!attribute [r] avatars
|
48
|
+
# Avatars provider links to images or photos or the person.
|
49
|
+
# @return [Array<GOBL::Org::Image>]
|
50
|
+
property :avatars, [GOBL::Org::Image]
|
51
|
+
|
47
52
|
# @!attribute [r] meta
|
48
53
|
# Data about the data.
|
49
54
|
# @return [GOBL::CBC::Meta]
|
data/lib/gobl/org/telephone.rb
CHANGED
data/lib/gobl/org/unit.rb
CHANGED
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## DO NOT EDIT - This file was generated automatically.
|
5
|
+
##
|
6
|
+
## Generated with GOBL v0.36.0
|
7
|
+
##
|
8
|
+
|
9
|
+
module GOBL
|
10
|
+
module Org
|
11
|
+
# Website describes what is expected for a web address.
|
12
|
+
class Website < GOBL::Object
|
13
|
+
# The Schema ID of the GOBL Website structure
|
14
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/org/party#/$defs/Website'
|
15
|
+
|
16
|
+
# @!attribute [r] uuid
|
17
|
+
# Unique identity code
|
18
|
+
# @return [GOBL::UUID::UUID]
|
19
|
+
property :uuid, GOBL::UUID::UUID
|
20
|
+
|
21
|
+
# @!attribute [r] label
|
22
|
+
# Identifier for this number.
|
23
|
+
# @return [String]
|
24
|
+
property :label, String
|
25
|
+
|
26
|
+
# @!attribute [r] title
|
27
|
+
# Title of the website to help distinguish between this and other links.
|
28
|
+
# @return [String]
|
29
|
+
property :title, String
|
30
|
+
|
31
|
+
# @!attribute [r] url
|
32
|
+
# URL for the website.
|
33
|
+
# @return [String]
|
34
|
+
property :url, String
|
35
|
+
validates :url, presence: true
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/gobl/pay/advance.rb
CHANGED
data/lib/gobl/pay/card.rb
CHANGED
data/lib/gobl/pay/due_date.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
10
10
|
module Pay
|
11
|
-
# Instructions
|
11
|
+
# Instructions determine how the payment has or should be made.
|
12
12
|
class Instructions < GOBL::Object
|
13
13
|
# The Schema ID of the GOBL Instructions structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/pay/instructions'
|
data/lib/gobl/pay/method_key.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,16 +17,14 @@ module GOBL
|
|
17
17
|
ENUM = {
|
18
18
|
'any' => 'Any method available, no preference',
|
19
19
|
'card' => 'Credit or debit card',
|
20
|
-
'credit-transfer' => '
|
21
|
-
'debit-transfer' => '
|
20
|
+
'credit-transfer' => 'Sender initiated bank or wire transfer',
|
21
|
+
'debit-transfer' => 'Receiver initiated bank or wire transfer',
|
22
22
|
'cash' => 'Cash',
|
23
23
|
'direct-debit' => 'Direct debit',
|
24
24
|
'online' => 'Online or web payment'
|
25
25
|
}.freeze
|
26
26
|
|
27
|
-
|
28
|
-
true
|
29
|
-
end
|
27
|
+
validates_inclusion_of :_value, in: ENUM.keys, message: '"%{value}" is not within the allowed values of the enumeration'
|
30
28
|
end
|
31
29
|
end
|
32
30
|
end
|
data/lib/gobl/pay/online.rb
CHANGED
data/lib/gobl/pay/term_key.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -27,9 +27,7 @@ module GOBL
|
|
27
27
|
'delivery' => 'Payment on Delivery'
|
28
28
|
}.freeze
|
29
29
|
|
30
|
-
|
31
|
-
true
|
32
|
-
end
|
30
|
+
validates_inclusion_of :_value, in: ENUM.keys, message: '"%{value}" is not within the allowed values of the enumeration'
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
data/lib/gobl/pay/terms.rb
CHANGED
data/lib/gobl/tax/category.rb
CHANGED
data/lib/gobl/tax/combo.rb
CHANGED
data/lib/gobl/tax/identity.rb
CHANGED
data/lib/gobl/tax/rate.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -29,7 +29,7 @@ module GOBL
|
|
29
29
|
property :desc, GOBL::I18n::String
|
30
30
|
|
31
31
|
# @!attribute [r] values
|
32
|
-
# Values contains a list of Value objects that contain the current and historical percentage values for the rate
|
32
|
+
# Values contains a list of Value objects that contain the current and historical percentage values for the rate and additional filters. Order is important, newer values should come before older values.
|
33
33
|
# @return [Array<RateValue>]
|
34
34
|
property :values, [RateValue]
|
35
35
|
validates :values, presence: true
|
data/lib/gobl/tax/rate_total.rb
CHANGED
data/lib/gobl/tax/rate_value.rb
CHANGED
@@ -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.36.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -13,6 +13,11 @@ module GOBL
|
|
13
13
|
# The Schema ID of the GOBL RateValue structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/RateValue'
|
15
15
|
|
16
|
+
# @!attribute [r] zones
|
17
|
+
# Only use this value if one of the zones matches.
|
18
|
+
# @return [Array<GOBL::L10n::Code>]
|
19
|
+
property :zones, [GOBL::L10n::Code]
|
20
|
+
|
16
21
|
# @!attribute [r] since
|
17
22
|
# Date from which this value should be applied.
|
18
23
|
# @return [GOBL::Cal::Date]
|