adf_builder 1.3.1 → 1.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0e75f097adeb0e0f73541ee79c693ae5de334a55b9330eb49130037fd6fbbe5
4
- data.tar.gz: 78c32bb06e602c81270ce30b97ed526fb9449d9bc5aa6b6ddf19ac22593c8596
3
+ metadata.gz: 440064d9196befba72c7a471b56db7a5b31f28b0521b7d2fbd0588e09fe9d0d9
4
+ data.tar.gz: fd917e6692abc141a2d1aa4e8c84c47b3ce7ce2ea3061cf6006364d8d51dbf9a
5
5
  SHA512:
6
- metadata.gz: c00a8c760bac13e7347f7a365e9598f6c2993ccf72c3adeaf1ef498e3092b6eab70bcd65b8c31e5bc0594014c012339b2653d4017b09716e20fc5364f174d587
7
- data.tar.gz: 1c2a4588b945d2cc5275e1a583dea5da1fffc6fa7c6d9004c3466bf984d905bbc9bdfe49496073191a025f5c99efbc0ba503042ce587e2cf97380290336869bb
6
+ metadata.gz: a1f11e9074f3a54daa855ac0a1ba732cc7924552ac717efda4f62d2db53aee311d960221eb226a163853a3f7aac52c05feabcdb4b6dc2af554288129123b42ab
7
+ data.tar.gz: 9a0f287c7182b673ce9230d01f609f0644e5e4094117a794aab5fc5f53a96b86f8115dd89357b0f07e7ccf9ff4e8e965128e2fe06aa6c9a3d6a1f6da9b906f7a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.4.0] - 2026-01-19
2
+ - **Vendor & Customer Validation Improvements**:
3
+ - `Vendor`: Now requires `vendorname` and `contact`.
4
+ - `Customer`: Now requires `contact`.
5
+ - `Contact`: Refactored to use declarative `validates_presence_of :name` (previously manual check).
6
+ - Added comprehensive specs for new presence validations.
7
+
1
8
  ## [1.3.1] - 2026-01-19
2
9
  - **Validation Refinement**: `Address` now strictly enforces 1 to 5 `street` lines.
3
10
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adf_builder (1.3.0)
4
+ adf_builder (1.3.1)
5
5
  ox (~> 2.14)
6
6
 
7
7
  GEM
@@ -7,6 +7,8 @@ module AdfBuilder
7
7
  super
8
8
  @tag_name = :customer
9
9
  end
10
+ validates_presence_of :contact
11
+
10
12
 
11
13
  def contact(&block)
12
14
  remove_children(:contact)
@@ -94,6 +94,7 @@ module AdfBuilder
94
94
 
95
95
  class Contact < Node
96
96
  validates_inclusion_of :primarycontact, in: [0, 1, "0", "1"]
97
+ validates_presence_of :name
97
98
 
98
99
  def initialize(primary_contact: nil)
99
100
  super()
@@ -103,9 +104,6 @@ module AdfBuilder
103
104
 
104
105
  def validate!
105
106
  super
106
- # Custom Validation: Name is required
107
- raise AdfBuilder::Error, "Contact must have a Name" unless @children.any? { |c| c.tag_name == :name }
108
-
109
107
  # Custom Validation: At least one Phone OR Email
110
108
  return if @children.any? { |c| %i[phone email].include?(c.tag_name) }
111
109
 
@@ -7,6 +7,7 @@ module AdfBuilder
7
7
  super
8
8
  @tag_name = :vendor
9
9
  end
10
+ validates_presence_of :vendorname, :contact
10
11
 
11
12
  def id(value, sequence: nil, source: nil)
12
13
  add_child(Id.new(value, sequence: sequence, source: source))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AdfBuilder
4
- VERSION = "1.3.1"
4
+ VERSION = "1.4.0"
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.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - marcus.salinas