sepa_file_parser 0.5.0 → 0.6.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: d849a3d8a2c14d65f90cd313e59ea45d6a61fe9c8a4e2ab4adbdc92b74e2ee44
4
- data.tar.gz: 39b96e5ed8cab2969e2c81aa1c89a6993c519181da677cb3e103e3ff7f6dee79
3
+ metadata.gz: 2cb401c65a44c25eadf2e3c2b8d75cd3a6838bbac979687709af19d156358bcf
4
+ data.tar.gz: df7d103ca5a48a1a50d705488ed49437fffaddcfc7971cb67eabae19421b2414
5
5
  SHA512:
6
- metadata.gz: 52abe875f8007897411b0dfa7d2ef163ff57b94e925afdee25c508e63176418f9a054ab400bdcac35c29dbb51369fac2ca6fc03351e97b2bbd40fc1499c2c20b
7
- data.tar.gz: 016deaaaad4a9ec7cdb922ce4f340033e7772bfb7dd0815d9d899c6f7c52b5bced82233e7f2114e1dfe5de9d2f95697093a0ee049085a00b75448584a0014950
6
+ metadata.gz: 0aad68c7df361fcb4b12bd412cdcb87e6a50b9609f2f6bcc452a5017c887925dcf7fd4fe69369e48858a55a7c0770a1d4879c476c2f832a0bd2223eff0ce9ff2
7
+ data.tar.gz: 3d313635b906e1cbedd4841ccd61ffabb43e30e5ee64f91bd149586de99aeb2a4f7a57cb731aa12725946ce6046db38dab5b325fdfc5cf8e5c75b18e1db1b2ac
@@ -118,7 +118,7 @@ module SepaFileParser
118
118
  @creditor_identifier ||= [
119
119
  xml_data.xpath('RltdPties/Cdtr/Id/PrvtId/Othr/Id/text()'),
120
120
  xml_data.xpath('RltdPties/Cdtr/Pty/Id/PrvtId/Othr/Id/text()'),
121
- ].reject(&:empty?).first.text
121
+ ].reject(&:empty?).first&.text
122
122
  end
123
123
 
124
124
  def payment_information # May be missing
@@ -3,15 +3,19 @@
3
3
  module SepaFileParser
4
4
  module Pain002
5
5
  class Base
6
- attr_reader :group_header, :reports, :xml_data
6
+ attr_reader :group_header, :group_information_and_status, :reports, :xml_data
7
7
 
8
8
  def initialize(xml_data)
9
9
  @xml_data = xml_data
10
10
  # CstmrPmtStsRpt = Customer Payment Status Report
11
11
  grphdr = xml_data.xpath('CstmrPmtStsRpt/GrpHdr')
12
12
  @group_header = SepaFileParser::GroupHeader.new(grphdr)
13
+
13
14
  reports = xml_data.xpath('CstmrPmtStsRpt/OrgnlPmtInfAndSts')
14
15
  @reports = reports.map { |x| Report.new(x) }
16
+
17
+ group_information_and_status = xml_data.xpath('CstmrPmtStsRpt/OrgnlGrpInfAndSts')
18
+ @group_information_and_status = group_information_and_status.map { |x| GroupInformation.new(x) }
15
19
  end
16
20
  end
17
21
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SepaFileParser
4
+ module Pain002
5
+ class GroupInformation
6
+
7
+ attr_reader :xml_data
8
+
9
+ def initialize(xml_data)
10
+ @xml_data = xml_data
11
+ end
12
+
13
+ def message_id
14
+ @message_id ||= xml_data.xpath('OrgnlMsgId/text()').text
15
+ end
16
+
17
+ def message_name_identification
18
+ @message_name_identification ||= xml_data.xpath('OrgnlMsgNmId/text()').text
19
+ end
20
+
21
+ def status
22
+ @status ||= xml_data.xpath('GrpSts/text()').text
23
+ end
24
+
25
+ def source
26
+ xml_data.to_s
27
+ end
28
+ end
29
+ end
30
+ end
@@ -25,7 +25,6 @@ module SepaFileParser
25
25
  def source
26
26
  xml_data.to_s
27
27
  end
28
-
29
28
  end
30
29
  end
31
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SepaFileParser
4
- VERSION = '0.5.0'.freeze
4
+ VERSION = '0.6.0'.freeze
5
5
  end
@@ -30,6 +30,7 @@ require_relative 'sepa_file_parser/camt054/notification'
30
30
  require_relative 'sepa_file_parser/camt054/base'
31
31
  require_relative 'sepa_file_parser/pain001/payment_information'
32
32
  require_relative 'sepa_file_parser/pain001/base'
33
+ require_relative 'sepa_file_parser/pain002/group_information'
33
34
  require_relative 'sepa_file_parser/pain002/report'
34
35
  require_relative 'sepa_file_parser/pain002/base'
35
36
  require_relative 'sepa_file_parser/pain008/payment_information'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sepa_file_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schoknecht
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-14 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake
@@ -128,6 +128,7 @@ files:
128
128
  - lib/sepa_file_parser/pain001/base.rb
129
129
  - lib/sepa_file_parser/pain001/payment_information.rb
130
130
  - lib/sepa_file_parser/pain002/base.rb
131
+ - lib/sepa_file_parser/pain002/group_information.rb
131
132
  - lib/sepa_file_parser/pain002/report.rb
132
133
  - lib/sepa_file_parser/pain008/base.rb
133
134
  - lib/sepa_file_parser/pain008/payment_information.rb
@@ -138,7 +139,10 @@ files:
138
139
  homepage: https://github.com/viafintech/sepa_file_parser
139
140
  licenses:
140
141
  - MIT
141
- metadata: {}
142
+ metadata:
143
+ changelog_uri: https://github.com/viafintech/sepa_file_parser/blob/master/CHANGELOG.md
144
+ source_code_uri: https://github.com/viafintech/sepa_file_parser
145
+ bug_tracker_uri: https://github.com/viafintech/sepa_file_parser/issues
142
146
  rdoc_options: []
143
147
  require_paths:
144
148
  - lib
@@ -153,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
157
  - !ruby/object:Gem::Version
154
158
  version: '0'
155
159
  requirements: []
156
- rubygems_version: 3.6.2
160
+ rubygems_version: 3.6.9
157
161
  specification_version: 4
158
162
  summary: Gem for parsing camt, pain, ... files into a speaking object.
159
163
  test_files: []