norma43_parser 4.1.0 → 4.2.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 +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/release.yml +2 -2
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +2 -5
- data/README.md +1 -1
- data/lib/norma43/line_parsers/transaction.rb +1 -1
- data/lib/norma43/version.rb +1 -1
- data/spec/example1_parse_spec.rb +1 -1
- data/spec/example2_parse_spec.rb +86 -0
- data/spec/fixtures/example2.n43 +13 -0
- data/spec/norma43/line_parsers/transaction_spec.rb +1 -1
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a576ebd4936bf3b9f7c190dd6f9024f6581efabca4141d8383ebdd16c4cdb9d
|
4
|
+
data.tar.gz: '079b2f02c83c570abe052d635d82d7ad78919b18341de0d81fe2f22e62a64108'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b54505e514e0f3e226b6d910963570a753686db02f8bc6229fcb2f6586b79153fb914f8a2ed0c0ad73a4381a72c7f1ff5e9f2333c6d21ee3dd6e9bdecc03151
|
7
|
+
data.tar.gz: cffc3991bef02c3fe166d711db5e9c7d5d3d804eeb9b02d1188679fcfd84d46b511de0ce064c2eded074bdffd9d925817385f545553383459e8c428dd0f2006b
|
data/.github/workflows/ci.yml
CHANGED
@@ -7,14 +7,14 @@ jobs:
|
|
7
7
|
release:
|
8
8
|
runs-on: ubuntu-latest
|
9
9
|
steps:
|
10
|
-
- uses: GoogleCloudPlatform/release-please-action@
|
10
|
+
- uses: GoogleCloudPlatform/release-please-action@v4
|
11
11
|
id: release
|
12
12
|
with:
|
13
13
|
release-type: ruby
|
14
14
|
package-name: norma43_parser
|
15
15
|
bump-minor-pre-major: true
|
16
16
|
version-file: 'lib/norma43/version.rb'
|
17
|
-
- uses: actions/checkout@
|
17
|
+
- uses: actions/checkout@v4
|
18
18
|
if: ${{ steps.release.outputs.release_created }}
|
19
19
|
- uses: ruby/setup-ruby@v1
|
20
20
|
with:
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,13 @@
|
|
7
7
|
* Soft-deprecate `Norma43::Models::Document#transaction_date`, use transaction_date in transactions instead
|
8
8
|
|
9
9
|
|
10
|
+
## [4.2.0](https://github.com/sequra/norma43_parser/compare/v4.1.0...v4.2.0) (2025-03-25)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* [PAY-1007] Parse `reference_1` as string to be able to filter lines ([#42](https://github.com/sequra/norma43_parser/issues/42)) ([f60f4e4](https://github.com/sequra/norma43_parser/commit/f60f4e4f396e0e4ccfba22e59018a8e97a39dd47))
|
16
|
+
|
10
17
|
## [4.0.0](https://github.com/sequra/norma43_parser/compare/3.0.0...v4.0.0) (2024-06-18)
|
11
18
|
|
12
19
|
### ⚠ BREAKING CHANGES
|
@@ -24,7 +31,6 @@
|
|
24
31
|
|
25
32
|
- Drop Ruby support below 2.6.
|
26
33
|
|
27
|
-
|
28
34
|
## v2.1.1 (2020-03-13)
|
29
35
|
|
30
36
|
### Enhancements
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
norma43_parser (4.
|
4
|
+
norma43_parser (4.2.0)
|
5
5
|
zeitwerk (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -21,8 +21,7 @@ GEM
|
|
21
21
|
rainbow (3.1.1)
|
22
22
|
rake (13.2.1)
|
23
23
|
regexp_parser (2.9.2)
|
24
|
-
rexml (3.3.
|
25
|
-
strscan
|
24
|
+
rexml (3.3.9)
|
26
25
|
rspec (3.13.0)
|
27
26
|
rspec-core (~> 3.13.0)
|
28
27
|
rspec-expectations (~> 3.13.0)
|
@@ -53,8 +52,6 @@ GEM
|
|
53
52
|
rubocop (>= 1.48.1, < 2.0)
|
54
53
|
rubocop-ast (>= 1.31.1, < 2.0)
|
55
54
|
ruby-progressbar (1.13.0)
|
56
|
-
strscan (3.1.0)
|
57
|
-
strscan (3.1.0-java)
|
58
55
|
unicode-display_width (2.5.0)
|
59
56
|
zeitwerk (2.6.15)
|
60
57
|
|
data/README.md
CHANGED
data/lib/norma43/version.rb
CHANGED
data/spec/example1_parse_spec.rb
CHANGED
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "norma43"
|
4
|
+
|
5
|
+
RSpec.describe Norma43 do
|
6
|
+
describe "parse" do
|
7
|
+
let(:document) do
|
8
|
+
file = File.open(File.join(__dir__, "fixtures/example2.n43"),
|
9
|
+
encoding: "iso-8859-1")
|
10
|
+
Norma43.parse file
|
11
|
+
end
|
12
|
+
|
13
|
+
it "finds one account" do
|
14
|
+
expect(document.accounts.size).to eq 1
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "first account" do
|
18
|
+
let(:account) { document.accounts.first }
|
19
|
+
|
20
|
+
it "stores expected attributes from AccountStart parser" do
|
21
|
+
expect(account).to have_attributes(
|
22
|
+
"bank_code" => 81,
|
23
|
+
"branch_code" => 4797,
|
24
|
+
"account_number" => 6995216857,
|
25
|
+
"start_date" => Date.parse("2025-03-17"),
|
26
|
+
"end_date" => Date.parse("2025-03-17"),
|
27
|
+
"currency_code" => 978,
|
28
|
+
"information_mode_code" => 3,
|
29
|
+
"abbreviated_name" => "SEQURA WORLDWIDE S.A.",
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "stores expected attributes from AccountEnd parser" do
|
34
|
+
expect(account).to have_attributes(
|
35
|
+
"balance_code" => 2,
|
36
|
+
"balance_amount" => 8614571,
|
37
|
+
"debit_entries" => nil,
|
38
|
+
"debit_amount" => nil,
|
39
|
+
"credit_entries" => nil,
|
40
|
+
"credit_amount" => nil,
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "transactions" do
|
45
|
+
it "finds all transactions" do
|
46
|
+
expect(account.transactions.size).to eq 4
|
47
|
+
end
|
48
|
+
|
49
|
+
describe "first transaction" do
|
50
|
+
let(:transaction) { account.transactions[0] }
|
51
|
+
it "stores expected attributes" do
|
52
|
+
expect(transaction).to have_attributes(
|
53
|
+
"origin_branch_code" => 7013,
|
54
|
+
"transaction_date" => Date.parse("2025-03-17"),
|
55
|
+
"value_date" => Date.parse("2025-03-14"),
|
56
|
+
"shared_item" => 4,
|
57
|
+
"own_item" => 7,
|
58
|
+
"amount_code" => 2,
|
59
|
+
"amount" => 9726,
|
60
|
+
"document_number" => 6871166755,
|
61
|
+
"reference_1" => "TRANSFERENCI",
|
62
|
+
"reference_2" => "A48555633617",
|
63
|
+
)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it "each transaction has 5 additional_items as a maximum" do
|
68
|
+
account.transactions.each do |transaction|
|
69
|
+
expect(transaction.additional_items.size).to be <= 5
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe "first additional item" do
|
74
|
+
let(:additional_item) { account.transactions[0].additional_items[0] }
|
75
|
+
it "stores expected attributes" do
|
76
|
+
expect(additional_item).to have_attributes(
|
77
|
+
"data_code" => 1,
|
78
|
+
"item_1" => "MARIA NARANJO ENFLOR",
|
79
|
+
"item_2" => "A48555633617"
|
80
|
+
)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
110081479769952168572503172503172000000086145719783SEQURA WORLDWIDE S.A.
|
2
|
+
2201827013250317250314040072000000000097266871166755TRANSFERENCIA48555633617
|
3
|
+
2301MARIA NARANJO ENFLOR A48555633617
|
4
|
+
2302 01826874
|
5
|
+
2201827013250317250317040072000000000074332011157110TRANSFERENCISEQURA
|
6
|
+
2301LAURA MARTINEZ PEREZ
|
7
|
+
2302 01822011
|
8
|
+
2201828510250317250317990512000000000082250000000000BIZUM
|
9
|
+
2301NAYARA;MARTINEZ RODRIGUEZ PEDIDO 322200000000
|
10
|
+
2302 15830001
|
11
|
+
2201828510250317250317990512000000000088940000000000BIZUM
|
12
|
+
2301DANIEL GARCIA GARCIA PEDIDO 322254909000
|
13
|
+
2302 21000900
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: norma43_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sequra engineering
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.9'
|
55
|
-
description:
|
55
|
+
description:
|
56
56
|
email:
|
57
57
|
- dev@sequra.es
|
58
58
|
executables: []
|
@@ -61,6 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".github/ISSUE_TEMPLATE.md"
|
63
63
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
64
|
+
- ".github/dependabot.yml"
|
64
65
|
- ".github/workflows/ci.yml"
|
65
66
|
- ".github/workflows/release.yml"
|
66
67
|
- ".rspec"
|
@@ -100,7 +101,9 @@ files:
|
|
100
101
|
- lib/norma43/version.rb
|
101
102
|
- norma43_parser.gemspec
|
102
103
|
- spec/example1_parse_spec.rb
|
104
|
+
- spec/example2_parse_spec.rb
|
103
105
|
- spec/fixtures/example1.n43
|
106
|
+
- spec/fixtures/example2.n43
|
104
107
|
- spec/norma43/line_parsers/account_end_spec.rb
|
105
108
|
- spec/norma43/line_parsers/account_start_spec.rb
|
106
109
|
- spec/norma43/line_parsers/additional_currency_spec.rb
|
@@ -128,7 +131,7 @@ homepage: https://github.com/sequra/norma43_parser
|
|
128
131
|
licenses:
|
129
132
|
- MIT
|
130
133
|
metadata: {}
|
131
|
-
post_install_message:
|
134
|
+
post_install_message:
|
132
135
|
rdoc_options: []
|
133
136
|
require_paths:
|
134
137
|
- lib
|
@@ -144,12 +147,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
147
|
version: '0'
|
145
148
|
requirements: []
|
146
149
|
rubygems_version: 3.4.19
|
147
|
-
signing_key:
|
150
|
+
signing_key:
|
148
151
|
specification_version: 4
|
149
152
|
summary: Parses banks transactions files specified in rule 43
|
150
153
|
test_files:
|
151
154
|
- spec/example1_parse_spec.rb
|
155
|
+
- spec/example2_parse_spec.rb
|
152
156
|
- spec/fixtures/example1.n43
|
157
|
+
- spec/fixtures/example2.n43
|
153
158
|
- spec/norma43/line_parsers/account_end_spec.rb
|
154
159
|
- spec/norma43/line_parsers/account_start_spec.rb
|
155
160
|
- spec/norma43/line_parsers/additional_currency_spec.rb
|