adf_builder 1.2.1 → 1.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24b99369efbb491a84bd7a472de00624914228c6de3334e806ab46c7adbb9fa9
4
- data.tar.gz: c9b0e631fa1118938a976d80e3be092d958c7fc35b7d2fe547bb291c4d4bbff9
3
+ metadata.gz: f5c6497310cd559356bd6e358243d2dd2ed5d2a859330fe403ae959b32592b0b
4
+ data.tar.gz: 77e66f74d658adc2022d401d85a037549f8f92c91d984c265db337a33c05353c
5
5
  SHA512:
6
- metadata.gz: 8e46cdda771a5c61882464d1e21a4e1117d156c13603877a7cb35e50bc0cd45ef480236a8aa2add261b983e5ed11142f655e9611e6f97cf04c7944305b6c3640
7
- data.tar.gz: 4560e7057db7c62d8a6bdc90e3b5413c99ae273c5f70a1fd66d621e3a8c3d574ee80e619797c0faf32ce6a6c6fbfd33976fadc3cbda26d66c1a24e673b911447
6
+ metadata.gz: 8aba468994e77c3af346c7f6dccbdd4eed16fd858ccf6206226c90d97a5e1126d75bc5083440d40ce1ac3233d2b6f0395b899fcce70afc76ccba7691867e779f
7
+ data.tar.gz: 215970d63f001f71e21c55651368c9ebab28dafd9e5f26d19519dbff6c897ed4859443623f01d3a99a5c014743d00f8e74b351eda0b371d28e578edc744d5582
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [1.2.2] - 2026-01-19
2
+ - **Strict Validations**: Added ISO 4217 currency validation for `Price`, `Amount`, and `Balance`.
3
+
1
4
  ## [1.2.1] - 2026-01-19
2
5
  - **Strict Validations**: Added `presence` validation for `Vehicle` (year, make, model required).
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adf_builder (1.2.0)
4
+ adf_builder (1.2.1)
5
5
  ox (~> 2.14)
6
6
 
7
7
  GEM
@@ -67,10 +67,21 @@ module AdfBuilder
67
67
  end
68
68
  end
69
69
 
70
+ # Common ISO 4217 codes (Top valid ones per spec/common usage)
71
+ # Keeping it as a constant for reuse.
72
+ # This list can be expanded but covers major currencies.
73
+ ISO_4217 = %w[
74
+ USD EUR GBP JPY AUD CAD CHF CNY SEK NZD
75
+ MXN SGD HKD NOK KRW TRY RUB INR BRL ZAR
76
+ DKK PLN TWD THB IDR HUF CZK ILS CLP PHP
77
+ AED COP SAR MYR RON PEN VND NGN
78
+ ].freeze
79
+
70
80
  class Price < Node
71
81
  validates_inclusion_of :type, in: %i[quote offer msrp invoice call appraisal asking]
72
82
  validates_inclusion_of :delta, in: %i[absolute relative percentage]
73
83
  validates_inclusion_of :relativeto, in: %i[msrp invoice]
84
+ validates_inclusion_of :currency, in: ISO_4217
74
85
 
75
86
  def initialize(value, type: :quote, currency: nil, delta: nil, relativeto: nil, source: nil)
76
87
  super()
@@ -87,6 +98,7 @@ module AdfBuilder
87
98
  class Amount < Node
88
99
  validates_inclusion_of :type, in: %i[downpayment monthly total]
89
100
  validates_inclusion_of :limit, in: %i[maximum minimum exact]
101
+ validates_inclusion_of :currency, in: ISO_4217
90
102
 
91
103
  def initialize(value, type: :total, limit: :maximum, currency: nil)
92
104
  super()
@@ -100,6 +112,7 @@ module AdfBuilder
100
112
 
101
113
  class Balance < Node
102
114
  validates_inclusion_of :type, in: %i[finance residual]
115
+ validates_inclusion_of :currency, in: ISO_4217
103
116
 
104
117
  def initialize(value, type: :finance, currency: nil)
105
118
  super()
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AdfBuilder
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adf_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - marcus.salinas