nacha 0.1.7 → 0.1.8

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: 8375798ff41c91e7a14ae4ebbf1442f7ceaf83ae7f61c81b1b88c87fd2ca4760
4
- data.tar.gz: b35fa722059c4eab240896141868eb27cd2b17c5c17539b5281a5d2a71ccfb07
3
+ metadata.gz: 8e70f9ad804c23687e8b3c9b6aa0fed4327554a98bdad5419a84dfe9f5d7f459
4
+ data.tar.gz: 475cc33a0528eda1b5c55f670f87537ea8f7a6610b7943304738e09f4740bae1
5
5
  SHA512:
6
- metadata.gz: f5bd9637030e63e90ca54b3203a09341badba050d4b9351063e2ea6c2da743ecbf33539280e1b7fc03b44a93bfa90fb644ace1cd895a98ee473e7925ca0b0454
7
- data.tar.gz: 49b0621426a2609b6f65b4385f159cd053cfd9e7dc6e294850b1bcf7b1c7c723f771d2487e494a9dee0c704c4d572e35f5441c8391ddf2b78460d4c7f2a55b77
6
+ metadata.gz: 7b5d4c12e34b8eda4e97fd6a1ee4fa082217f967ac75893195566091673196346b544bc262d1ad789f136f55c28d1b4002495ae859474776200841d06fc10a21
7
+ data.tar.gz: 98f8cb7134340a7088946dfe1904b1e11c485676f9ad7369bf299e20aa23af45323bb12dd7d0ba2d2064ff7fcffa8a9a9639ca4e885e09fa89c5f9b191d73dea
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.8] - 2025-06-24
11
+
12
+ - Now parses filler records correctly (fixed definition)
13
+
14
+ - Add support for `ack_entry_detail` record type
15
+
16
+ - Tweaked the child record types for file_control and file_header
17
+
10
18
  ## [0.1.7] - 2025-06-23
11
19
 
12
20
  - Better parsing. Nacha::Record::FileControl had issues parsing if the reserved
data/lib/nacha/field.rb CHANGED
@@ -108,7 +108,9 @@ class Nacha::Field
108
108
  add_error("'position' must be present for a field definition.") unless @position
109
109
  add_error("'contents' must be present for a field definition.") unless @contents
110
110
 
111
- if @data_assigned && (mandatory? || required?) && (@input_data.nil? || @input_data.to_s.strip.empty?)
111
+ if @data_assigned &&
112
+ (mandatory? || required?) &&
113
+ ((@input_data.nil? || @input_data.to_s.empty?) && @contents !~ /\AC( *)\z/)
112
114
  add_error("'#{human_name}' is a required field and cannot be blank.")
113
115
  end
114
116
 
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ # frozen_string_literal: true
3
+
4
+ require 'nacha/record/base.rb'
5
+ require 'nacha/record/detail_record_type.rb'
6
+
7
+ module Nacha
8
+ module Record
9
+ class AckEntryDetail < Nacha::Record::Base
10
+ include DetailRecordType
11
+ nacha_field :record_type_code, inclusion: 'M', contents: 'C6', position: 1..1
12
+ nacha_field :transaction_code, inclusion: 'M', contents: 'Numeric', position: 2..3
13
+ nacha_field :receiving_dfi_identification, inclusion: 'M', contents: 'TTTTAAAAC', position: 4..12
14
+ nacha_field :dfi_account_number, inclusion: 'R', contents: 'Alphameric', position: 13..29
15
+ nacha_field :amount, inclusion: 'M', contents: '$$$$$$$$¢¢', position: 30..39
16
+ nacha_field :originl_entry_trace_number, inclusion: 'M', contents: 'Numeric', position: 40..54
17
+ nacha_field :receiving_company_name, inclusion: 'R', contents: 'Alphameric', position: 55..76
18
+ nacha_field :discretionary_data, inclusion: 'O', contents: 'Alphameric', position: 77..78
19
+ nacha_field :addenda_record_indicator, inclusion: 'M', contents: 'Numeric', position: 79..79
20
+ nacha_field :trace_number, inclusion: 'M', contents: 'Numeric', position: 80..94
21
+ end
22
+ end
23
+ end
@@ -90,12 +90,8 @@ module Nacha
90
90
  last_match
91
91
  end
92
92
  elsif d[:contents] =~ /\ANumeric\z/
93
- if output_started
94
- '[0-9 ]' + "{#{(d[:position] || d['position']).size}}"
95
- else
96
- skipped_output = true
97
- ''
98
- end
93
+ output_started = true
94
+ '[0-9 ]' + "{#{(d[:position] || d['position']).size}}"
99
95
  elsif d[:contents] =~ /\AYYMMDD\z/
100
96
  if output_started
101
97
  '[0-9 ]' + "{#{(d[:position] || d['position']).size}}"
@@ -9,7 +9,9 @@ module Nacha
9
9
 
10
10
  module ClassMethods
11
11
  def child_record_types
12
- []
12
+ [
13
+ "Nacha::Record::Filler",
14
+ ]
13
15
  end
14
16
  end
15
17
 
@@ -12,7 +12,6 @@ module Nacha
12
12
  [
13
13
  'Nacha::Record::BatchHeader',
14
14
  'Nacha::Record::FileControl',
15
- 'Nacha::Record::Filler'
16
15
  ]
17
16
  end
18
17
  end
@@ -9,8 +9,8 @@ module Nacha
9
9
  class Filler < Nacha::Record::Base
10
10
  include FillerRecordType
11
11
 
12
- nacha_field :record_type_code, inclusion: 'M', contents: ('C' + ('9' * 93)), position: 1..1
13
- nacha_field :filler, inclusion: 'M', contents: 'Numeric', position: 2..94
12
+ nacha_field :record_type_code, inclusion: 'M', contents: 'C9', position: 1..1
13
+ nacha_field :filler, inclusion: 'M', contents: ('C' + ('9' * 93)), position: 2..94
14
14
  end
15
15
  end
16
16
  end
data/lib/nacha/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nacha
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nacha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David H. Wilkins
@@ -238,6 +238,7 @@ files:
238
238
  - lib/nacha/numeric.rb
239
239
  - lib/nacha/parser.rb
240
240
  - lib/nacha/parser_context.rb
241
+ - lib/nacha/record/ack_entry_detail.rb
241
242
  - lib/nacha/record/addenda_record_type.rb
242
243
  - lib/nacha/record/adv_batch_control.rb
243
244
  - lib/nacha/record/adv_entry_detail.rb