cfonb 0.0.7 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cfonb/line_parser/base.rb +1 -1
  3. data/lib/cfonb/line_parser/operation.rb +1 -1
  4. data/lib/cfonb/line_parser/{operation_detail.rb → operation_details.rb} +1 -1
  5. data/lib/cfonb/operation.rb +6 -1
  6. data/lib/cfonb/operation_details/base.rb +32 -0
  7. data/lib/cfonb/operation_details/fee.rb +18 -0
  8. data/lib/cfonb/operation_details/ibe.rb +16 -0
  9. data/lib/cfonb/operation_details/ipy.rb +16 -0
  10. data/lib/cfonb/operation_details/lc2.rb +15 -0
  11. data/lib/cfonb/operation_details/lcc.rb +15 -0
  12. data/lib/cfonb/operation_details/lcs.rb +15 -0
  13. data/lib/cfonb/operation_details/lib.rb +15 -0
  14. data/lib/cfonb/operation_details/mmo.rb +26 -0
  15. data/lib/cfonb/operation_details/nbe.rb +15 -0
  16. data/lib/cfonb/operation_details/nbu.rb +15 -0
  17. data/lib/cfonb/operation_details/npo.rb +15 -0
  18. data/lib/cfonb/operation_details/npy.rb +15 -0
  19. data/lib/cfonb/operation_details/rcn.rb +18 -0
  20. data/lib/cfonb/operation_details/ref.rb +17 -0
  21. data/lib/cfonb/operation_details/unknown.rb +23 -0
  22. data/lib/cfonb/{operation_detail.rb → operation_details.rb} +5 -3
  23. data/lib/cfonb.rb +18 -12
  24. data/spec/cfonb/line_parser/{operation_detail_spec.rb → operation_details_spec.rb} +1 -1
  25. data/spec/cfonb/operation_spec.rb +120 -16
  26. data/spec/cfonb/parser_spec.rb +125 -41
  27. metadata +23 -17
  28. data/lib/cfonb/operation_detail/fee.rb +0 -18
  29. data/lib/cfonb/operation_detail/lc2.rb +0 -13
  30. data/lib/cfonb/operation_detail/lcc.rb +0 -13
  31. data/lib/cfonb/operation_detail/lcs.rb +0 -13
  32. data/lib/cfonb/operation_detail/lib.rb +0 -13
  33. data/lib/cfonb/operation_detail/mmo.rb +0 -28
  34. data/lib/cfonb/operation_detail/nbe.rb +0 -15
  35. data/lib/cfonb/operation_detail/npy.rb +0 -15
  36. data/lib/cfonb/operation_detail/rcn.rb +0 -22
  37. data/lib/cfonb/operation_detail/ref.rb +0 -20
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'cfonb'
4
+ require 'securerandom'
4
5
  require 'ostruct'
5
6
 
6
7
  describe CFONB::Operation do
@@ -36,6 +37,9 @@ describe CFONB::Operation do
36
37
 
37
38
  expect(operation.label).to eq(<<~TXT.strip)
38
39
  A random operation label
40
+ TXT
41
+
42
+ expect(operation.details.free_label).to eq(<<~TXT.strip)
39
43
  Extra label
40
44
  TXT
41
45
  end
@@ -49,6 +53,9 @@ describe CFONB::Operation do
49
53
 
50
54
  expect(operation.label).to eq(<<~TXT.strip)
51
55
  A random operation label
56
+ TXT
57
+
58
+ expect(operation.details.unstructured_label).to eq(<<~TXT.strip)
52
59
  Extra label
53
60
  TXT
54
61
  end
@@ -62,6 +69,9 @@ describe CFONB::Operation do
62
69
 
63
70
  expect(operation.label).to eq(<<~TXT.strip)
64
71
  A random operation label
72
+ TXT
73
+
74
+ expect(operation.details.unstructured_label_2).to eq(<<~TXT.strip)
65
75
  Extra label
66
76
  TXT
67
77
  end
@@ -75,6 +85,9 @@ describe CFONB::Operation do
75
85
 
76
86
  expect(operation.label).to eq(<<~TXT.strip)
77
87
  A random operation label
88
+ TXT
89
+
90
+ expect(operation.details.structured_label).to eq(<<~TXT.strip)
78
91
  Extra label
79
92
  TXT
80
93
  end
@@ -86,9 +99,9 @@ describe CFONB::Operation do
86
99
  it 'Adds the original currency information' do
87
100
  operation.merge_detail(detail)
88
101
 
89
- expect(operation).to have_attributes(
102
+ expect(operation.details).to have_attributes(
90
103
  original_currency: 'USD',
91
- original_amount: -12.34,
104
+ original_amount: 12.34,
92
105
  exchange_rate: nil,
93
106
  )
94
107
  end
@@ -99,9 +112,9 @@ describe CFONB::Operation do
99
112
  it 'Adds the original currency information' do
100
113
  operation.merge_detail(detail)
101
114
 
102
- expect(operation).to have_attributes(
115
+ expect(operation.details).to have_attributes(
103
116
  original_currency: 'USD',
104
- original_amount: -8358,
117
+ original_amount: 8358,
105
118
  exchange_rate: 1.077,
106
119
  )
107
120
  end
@@ -112,10 +125,9 @@ describe CFONB::Operation do
112
125
 
113
126
  it 'Adds the original currency information' do
114
127
  operation.merge_detail(detail)
115
-
116
- expect(operation).to have_attributes(
128
+ expect(operation.details).to have_attributes(
117
129
  original_currency: 'EUR',
118
- original_amount: -18_756.25,
130
+ original_amount: 18_756.25,
119
131
  exchange_rate: nil,
120
132
  )
121
133
  end
@@ -128,7 +140,7 @@ describe CFONB::Operation do
128
140
  it 'Adds the debtor information' do
129
141
  operation.merge_detail(detail)
130
142
 
131
- expect(operation).to have_attributes(debtor: 'Patrick')
143
+ expect(operation.details).to have_attributes(debtor: 'Patrick')
132
144
  end
133
145
  end
134
146
 
@@ -138,7 +150,7 @@ describe CFONB::Operation do
138
150
  it 'Adds the creditor information' do
139
151
  operation.merge_detail(detail)
140
152
 
141
- expect(operation).to have_attributes(creditor: 'Jean-Pierre')
153
+ expect(operation.details).to have_attributes(creditor: 'Jean-Pierre')
142
154
  end
143
155
  end
144
156
 
@@ -151,11 +163,11 @@ describe CFONB::Operation do
151
163
  )
152
164
  end
153
165
 
154
- it 'adds the reference information' do
166
+ it 'adds the client reference information' do
155
167
  operation.merge_detail(detail)
156
168
 
157
- expect(operation.reference).to eq('42 - SWILE-CMD-TR-YPDHMA')
158
- expect(operation.purpose).to eq('TICKET RESTO')
169
+ expect(operation.details.client_reference).to eq('SWILE-CMD-TR-YPDHMA')
170
+ expect(operation.details.purpose).to eq('TICKET RESTO')
159
171
  end
160
172
  end
161
173
 
@@ -168,10 +180,10 @@ describe CFONB::Operation do
168
180
  )
169
181
  end
170
182
 
171
- it 'adds the reference information' do
183
+ it 'adds the operation reference information' do
172
184
  operation.merge_detail(detail)
173
185
 
174
- expect(operation.reference).to eq('42 - PENNYLANE B13A93908C36C82DF5C319/1')
186
+ expect(operation.details.operation_reference).to eq('PENNYLANE B13A93908C36C82DF5C319/1')
175
187
  end
176
188
  end
177
189
 
@@ -187,8 +199,100 @@ describe CFONB::Operation do
187
199
  it 'adds the fee information' do
188
200
  operation.merge_detail(detail)
189
201
 
190
- expect(operation.fee_currency).to eq('EUR')
191
- expect(operation.fee).to eq(7.4)
202
+ expect(operation.details.fee_currency).to eq('EUR')
203
+ expect(operation.details.fee).to eq(7.4)
204
+ end
205
+ end
206
+
207
+ context 'with a IPY detail' do
208
+ let(:debtor_identifier) { SecureRandom.alphanumeric(35) }
209
+ let(:debtor_identifier_type) { SecureRandom.alphanumeric(35) }
210
+
211
+ let(:detail) do
212
+ OpenStruct.new(
213
+ body: "0530004411001871EUR2 0001016255614090823 IPY#{debtor_identifier}#{debtor_identifier_type}",
214
+ detail_code: 'IPY',
215
+ detail: "#{debtor_identifier}#{debtor_identifier_type}",
216
+ )
217
+ end
218
+
219
+ it 'adds the debtor_identifier' do
220
+ operation.merge_detail(detail)
221
+
222
+ expect(operation.details.debtor_identifier).to eq(debtor_identifier)
223
+ expect(operation.details.debtor_identifier_type).to eq(debtor_identifier_type)
224
+ end
225
+ end
226
+
227
+ context 'with a IBE detail' do
228
+ let(:creditor_identifier) { SecureRandom.alphanumeric(35) }
229
+ let(:creditor_identifier_type) { SecureRandom.alphanumeric(35) }
230
+
231
+ let(:detail) do
232
+ OpenStruct.new(
233
+ detail_code: 'IBE',
234
+ detail: "#{creditor_identifier}#{creditor_identifier_type}",
235
+ )
236
+ end
237
+
238
+ it 'adds the IBE information' do
239
+ operation.merge_detail(detail)
240
+
241
+ expect(operation.details.creditor_identifier).to eq(creditor_identifier)
242
+ expect(operation.details.creditor_identifier_type).to eq(creditor_identifier_type)
243
+ end
244
+ end
245
+
246
+ context 'with a NPO detail' do
247
+ let(:detail) do
248
+ OpenStruct.new(
249
+ detail_code: 'NPO',
250
+ detail: 'Patrick ',
251
+ )
252
+ end
253
+
254
+ it 'adds the NPO information' do
255
+ operation.merge_detail(detail)
256
+
257
+ expect(operation.details.ultimate_debtor).to eq('Patrick')
258
+ end
259
+ end
260
+
261
+ context 'with a NBU detail' do
262
+ let(:detail) do
263
+ OpenStruct.new(
264
+ detail_code: 'NBU',
265
+ detail: 'Patrick ',
266
+ )
267
+ end
268
+
269
+ it 'adds the NBU information' do
270
+ operation.merge_detail(detail)
271
+
272
+ expect(operation.details.ultimate_creditor).to eq('Patrick')
273
+ end
274
+ end
275
+
276
+ context 'with an unknown detail' do
277
+ let(:detail) do
278
+ OpenStruct.new(
279
+ body: '0530004411001871EUR2 0001016255614090823 AAAEUR200000000000740',
280
+ detail_code: 'AAA',
281
+ detail: 'EUR200000000000740',
282
+ )
283
+ end
284
+
285
+ it 'adds the detail to the unknown details hash' do
286
+ operation.merge_detail(detail)
287
+
288
+ expect(operation.details.unknown).to eq({ 'AAA' => 'EUR200000000000740' })
289
+ end
290
+
291
+ it 'updates the current details in case of duplicated codes' do
292
+ operation.merge_detail(detail)
293
+ operation.merge_detail(detail)
294
+
295
+ expect(operation.details.unknown).to eq({ 'AAA' => "EUR200000000000740\nEUR200000000000740" })
192
296
  end
193
297
  end
194
298
  end
@@ -35,17 +35,25 @@ describe CFONB::Parser do
35
35
  exoneration_code: '0',
36
36
  interbank_code: 'B1',
37
37
  internal_code: '9162',
38
- label: "PRLV SEPA TEST CABINET\nMENSUEAUHTR13133",
38
+ label: 'PRLV SEPA TEST CABINET',
39
39
  number: 0,
40
- reference: 'REFERENCE - OTHER REFERENCE',
41
- purpose: 'PURPOSE',
42
40
  rejection_code: '',
43
41
  unavailability_code: '0',
44
42
  value_date: Date.new(2019, 5, 16),
43
+ reference: '',
44
+ )
45
+ expect(statements[0].operations[0].details).to have_attributes(
46
+ free_label: "MENSUEAUHTR13133\nMENSUEAUHTR13DUP",
45
47
  original_currency: nil,
46
48
  original_amount: nil,
47
49
  exchange_rate: nil,
50
+ purpose: 'PURPOSE',
48
51
  debtor: 'INTERNET SFR',
52
+ unknown: {
53
+ 'AAA' => "INTERNETA AAA\nINTERNETA ABB",
54
+ 'BBB' => 'INTERNETE BBB',
55
+ 'CCC' => 'INTERNETI CCC',
56
+ },
49
57
  )
50
58
 
51
59
  expect(statements[0].operations[1]).to have_attributes(
@@ -57,14 +65,19 @@ describe CFONB::Parser do
57
65
  internal_code: '9162',
58
66
  label: 'VIR SEPA DEMONSTRATION',
59
67
  number: 0,
60
- reference: 'REFERENCE',
61
68
  rejection_code: '',
62
69
  unavailability_code: '0',
63
70
  value_date: Date.new(2019, 5, 16),
71
+ reference: 'REFERENCE',
72
+ )
73
+
74
+ expect(statements[0].operations[1].details).to have_attributes(
75
+ debtor: 'ELEC ERDF',
76
+ free_label: nil,
64
77
  original_currency: nil,
65
78
  original_amount: nil,
66
79
  exchange_rate: nil,
67
- debtor: 'ELEC ERDF',
80
+ purpose: nil,
68
81
  )
69
82
 
70
83
  expect(statements[0].operations[2]).to have_attributes(
@@ -76,10 +89,15 @@ describe CFONB::Parser do
76
89
  internal_code: '0117',
77
90
  label: 'F COMMISSION D INTERVENTION',
78
91
  number: 0,
79
- reference: '',
80
92
  rejection_code: '',
81
93
  unavailability_code: '0',
82
94
  value_date: Date.new(2019, 5, 15),
95
+ reference: '',
96
+ )
97
+
98
+ expect(statements[0].operations[2].details).to have_attributes(
99
+ free_label: nil,
100
+ purpose: nil,
83
101
  original_currency: nil,
84
102
  original_amount: nil,
85
103
  exchange_rate: nil,
@@ -105,15 +123,21 @@ describe CFONB::Parser do
105
123
  exoneration_code: '',
106
124
  interbank_code: 'A3',
107
125
  internal_code: '0158',
108
- label: "PRLV SEPA GROUPAMA CEN\nP051928612 22793301700040",
126
+ label: 'PRLV SEPA GROUPAMA CEN',
109
127
  number: 0,
110
- reference: '',
111
128
  rejection_code: '',
112
129
  unavailability_code: '0',
113
130
  value_date: Date.new(2019, 5, 15),
131
+ reference: '',
132
+ )
133
+
134
+ expect(statements[1].operations[0].details).to have_attributes(
135
+ free_label: 'P051928612 22793301700040',
114
136
  original_currency: nil,
115
137
  original_amount: nil,
116
138
  exchange_rate: nil,
139
+ purpose: nil,
140
+ debtor: nil,
117
141
  )
118
142
 
119
143
  expect(statements[1].operations[1]).to have_attributes(
@@ -125,13 +149,19 @@ describe CFONB::Parser do
125
149
  internal_code: '0337',
126
150
  label: 'F FRAIS PRLV IMP 97 49EUR',
127
151
  number: 0,
128
- reference: '',
129
152
  rejection_code: '',
130
153
  unavailability_code: '0',
131
154
  value_date: Date.new(2019, 5, 15),
155
+ reference: '',
156
+ )
157
+
158
+ expect(statements[1].operations[1].details).to have_attributes(
159
+ free_label: nil,
132
160
  original_currency: nil,
133
161
  original_amount: nil,
134
162
  exchange_rate: nil,
163
+ purpose: nil,
164
+ debtor: nil,
135
165
  )
136
166
 
137
167
  expect(statements[1].operations[2]).to have_attributes(
@@ -143,13 +173,19 @@ describe CFONB::Parser do
143
173
  internal_code: '0117',
144
174
  label: 'F COMMISSION D INTERVENTION',
145
175
  number: 0,
146
- reference: '',
147
176
  rejection_code: '',
148
177
  unavailability_code: '0',
149
178
  value_date: Date.new(2019, 5, 16),
179
+ reference: '',
180
+ )
181
+
182
+ expect(statements[1].operations[2].details).to have_attributes(
183
+ free_label: nil,
150
184
  original_currency: nil,
151
185
  original_amount: nil,
152
186
  exchange_rate: nil,
187
+ purpose: nil,
188
+ debtor: nil,
153
189
  )
154
190
  end
155
191
  end
@@ -232,18 +268,22 @@ describe CFONB::Parser do
232
268
  exoneration_code: '0',
233
269
  interbank_code: 'B1',
234
270
  internal_code: '9162',
235
- label: "PRLV SEPA TEST CABINET\nMENSUEAUHTR13133",
271
+ label: 'PRLV SEPA TEST CABINET',
236
272
  number: 0,
237
- reference: 'REFERENCE - OTHER REFERENCE',
238
273
  rejection_code: '',
239
274
  unavailability_code: '0',
240
275
  value_date: Date.new(2019, 5, 16),
276
+ )
277
+
278
+ expect(statements[0].operations[0].details).to have_attributes(
279
+ operation_reference: 'REFERENCE',
280
+ free_label: "MENSUEAUHTR13133\nMENSUEAUHTR13DUP",
281
+ debtor: 'INTERNET SFR',
282
+ client_reference: 'OTHER REFERENCE',
241
283
  original_currency: nil,
242
284
  original_amount: nil,
243
285
  exchange_rate: nil,
244
- debtor: 'INTERNET SFR',
245
286
  )
246
-
247
287
  expect(statements[0].operations[1]).to have_attributes(
248
288
  amount: -10.7,
249
289
  currency: 'EUR',
@@ -253,10 +293,13 @@ describe CFONB::Parser do
253
293
  internal_code: '9162',
254
294
  label: 'VIR SEPA DEMONSTRATION',
255
295
  number: 0,
256
- reference: 'REFERENCE',
257
296
  rejection_code: '',
258
297
  unavailability_code: '0',
259
298
  value_date: Date.new(2019, 5, 16),
299
+ reference: 'REFERENCE',
300
+ )
301
+
302
+ expect(statements[0].operations[1].details).to have_attributes(
260
303
  original_currency: nil,
261
304
  original_amount: nil,
262
305
  exchange_rate: nil,
@@ -272,10 +315,13 @@ describe CFONB::Parser do
272
315
  internal_code: '0117',
273
316
  label: 'F COMMISSION D INTERVENTION',
274
317
  number: 0,
275
- reference: '',
276
318
  rejection_code: '',
277
319
  unavailability_code: '0',
278
320
  value_date: Date.new(2019, 5, 15),
321
+ reference: '',
322
+ )
323
+
324
+ expect(statements[0].operations[2].details).to have_attributes(
279
325
  original_currency: nil,
280
326
  original_amount: nil,
281
327
  exchange_rate: nil,
@@ -301,12 +347,16 @@ describe CFONB::Parser do
301
347
  exoneration_code: '',
302
348
  interbank_code: 'A3',
303
349
  internal_code: '0158',
304
- label: "PRLV SEPA GROUPAMA CEN\nP051928612 22793301700040",
350
+ label: 'PRLV SEPA GROUPAMA CEN',
305
351
  number: 0,
306
- reference: '',
307
352
  rejection_code: '',
308
353
  unavailability_code: '0',
309
354
  value_date: Date.new(2019, 5, 15),
355
+ reference: '',
356
+ )
357
+
358
+ expect(statements[1].operations[0].details).to have_attributes(
359
+ free_label: 'P051928612 22793301700040',
310
360
  original_currency: nil,
311
361
  original_amount: nil,
312
362
  exchange_rate: nil,
@@ -321,10 +371,13 @@ describe CFONB::Parser do
321
371
  internal_code: '0337',
322
372
  label: 'F FRAIS PRLV IMP 97 49EUR',
323
373
  number: 0,
324
- reference: '',
325
374
  rejection_code: '',
326
375
  unavailability_code: '0',
327
376
  value_date: Date.new(2019, 5, 15),
377
+ reference: '',
378
+ )
379
+
380
+ expect(statements[1].operations[1].details).to have_attributes(
328
381
  original_currency: nil,
329
382
  original_amount: nil,
330
383
  exchange_rate: nil,
@@ -339,10 +392,13 @@ describe CFONB::Parser do
339
392
  internal_code: '0117',
340
393
  label: 'F COMMISSION D INTERVENTION',
341
394
  number: 0,
342
- reference: '',
343
395
  rejection_code: '',
344
396
  unavailability_code: '0',
345
397
  value_date: Date.new(2019, 5, 16),
398
+ reference: '',
399
+ )
400
+
401
+ expect(statements[1].operations[2].details).to have_attributes(
346
402
  original_currency: nil,
347
403
  original_amount: nil,
348
404
  exchange_rate: nil,
@@ -365,14 +421,17 @@ describe CFONB::Parser do
365
421
  internal_code: '9162',
366
422
  label: 'VIR SEPA DEMONSTRATION',
367
423
  number: 0,
368
- reference: '',
369
424
  rejection_code: '',
370
425
  unavailability_code: '0',
371
426
  value_date: Date.new(2019, 5, 16),
427
+ reference: '',
428
+ )
429
+
430
+ expect(statements[0].operations[0].details).to have_attributes(
431
+ debtor: 'ELEC ERDF',
372
432
  original_currency: nil,
373
433
  original_amount: nil,
374
434
  exchange_rate: nil,
375
- debtor: 'ELEC ERDF',
376
435
  )
377
436
  end
378
437
  end
@@ -392,14 +451,16 @@ describe CFONB::Parser do
392
451
  internal_code: '9162',
393
452
  label: 'VIR SEPA DEMONSTRATION',
394
453
  number: 0,
395
- reference: '',
396
454
  rejection_code: '',
397
455
  unavailability_code: '0',
398
456
  value_date: Date.new(2019, 5, 16),
457
+ reference: '',
458
+ )
459
+ expect(statements[0].operations[0].details).to have_attributes(
460
+ debtor: 'ELEC ERDF',
399
461
  original_currency: nil,
400
462
  original_amount: nil,
401
463
  exchange_rate: nil,
402
- debtor: 'ELEC ERDF',
403
464
  )
404
465
  end
405
466
  end
@@ -419,14 +480,16 @@ describe CFONB::Parser do
419
480
  internal_code: '9162',
420
481
  label: 'VIR SEPA DEMONSTRATION',
421
482
  number: 0,
422
- reference: '',
423
483
  rejection_code: '',
424
484
  unavailability_code: '0',
425
485
  value_date: Date.new(2019, 5, 16),
486
+ reference: '',
487
+ )
488
+ expect(statements[0].operations[0].details).to have_attributes(
489
+ debtor: 'ELEC ERDF',
426
490
  original_currency: nil,
427
491
  original_amount: nil,
428
492
  exchange_rate: nil,
429
- debtor: 'ELEC ERDF',
430
493
  )
431
494
  end
432
495
  end
@@ -446,14 +509,16 @@ describe CFONB::Parser do
446
509
  internal_code: '9162',
447
510
  label: 'VIR SEPA DEMONSTRATION',
448
511
  number: 0,
449
- reference: '',
450
512
  rejection_code: '',
451
513
  unavailability_code: '0',
452
514
  value_date: Date.new(2019, 5, 16),
515
+ reference: '',
516
+ )
517
+ expect(statements[0].operations[0].details).to have_attributes(
518
+ debtor: 'ELEC ERDF',
453
519
  original_currency: nil,
454
520
  original_amount: nil,
455
521
  exchange_rate: nil,
456
- debtor: 'ELEC ERDF',
457
522
  )
458
523
  expect(statements[0].operations[1]).to have_attributes(
459
524
  amount: -7.9,
@@ -464,10 +529,12 @@ describe CFONB::Parser do
464
529
  internal_code: '0117',
465
530
  label: 'F COMMISSION D INTERVENTION',
466
531
  number: 0,
467
- reference: '',
468
532
  rejection_code: '',
469
533
  unavailability_code: '0',
470
534
  value_date: Date.new(2019, 5, 16),
535
+ reference: '',
536
+ )
537
+ expect(statements[0].operations[1].details).to have_attributes(
471
538
  original_currency: nil,
472
539
  original_amount: nil,
473
540
  exchange_rate: nil,
@@ -503,16 +570,20 @@ describe CFONB::Parser do
503
570
  exoneration_code: '0',
504
571
  interbank_code: 'B1',
505
572
  internal_code: '9162',
506
- label: "PRLV SEPA TEST CABINET\nMENSUEAUHTR13133",
573
+ label: 'PRLV SEPA TEST CABINET',
507
574
  number: 0,
508
- reference: 'REFERENCE - OTHER REFERENCE',
509
575
  rejection_code: '',
510
576
  unavailability_code: '0',
511
577
  value_date: Date.new(2019, 5, 16),
578
+ )
579
+ expect(operation.details).to have_attributes(
580
+ operation_reference: 'REFERENCE',
581
+ client_reference: 'OTHER REFERENCE',
582
+ debtor: 'INTERNET SFR',
583
+ free_label: 'MENSUEAUHTR13133',
512
584
  original_currency: nil,
513
585
  original_amount: nil,
514
586
  exchange_rate: nil,
515
- debtor: 'INTERNET SFR',
516
587
  )
517
588
  end
518
589
  end
@@ -563,16 +634,20 @@ describe CFONB::Parser do
563
634
  exoneration_code: '0',
564
635
  interbank_code: 'B1',
565
636
  internal_code: '9162',
566
- label: "PRLV SEPA TEST CABINET\nMENSUEAUHTR13133",
637
+ label: 'PRLV SEPA TEST CABINET',
567
638
  number: 0,
568
- reference: 'REFERENCE - OTHER REFERENCE',
569
639
  rejection_code: '',
570
640
  unavailability_code: '0',
571
641
  value_date: Date.new(2019, 5, 16),
642
+ )
643
+ expect(operation.details).to have_attributes(
644
+ operation_reference: 'REFERENCE',
645
+ client_reference: 'OTHER REFERENCE',
646
+ free_label: 'MENSUEAUHTR13133',
647
+ debtor: 'INTERNET SFR',
572
648
  original_currency: nil,
573
649
  original_amount: nil,
574
650
  exchange_rate: nil,
575
- debtor: 'INTERNET SFR',
576
651
  )
577
652
  end
578
653
  end
@@ -588,16 +663,20 @@ describe CFONB::Parser do
588
663
  exoneration_code: '0',
589
664
  interbank_code: 'B1',
590
665
  internal_code: '9162',
591
- label: "PRLV SEPA TEST CABINET\nMENSUEAUHTR13133",
666
+ label: 'PRLV SEPA TEST CABINET',
592
667
  number: 0,
593
- reference: 'REFERENCE - OTHER REFERENCE',
594
668
  rejection_code: '',
595
669
  unavailability_code: '0',
596
670
  value_date: Date.new(2019, 5, 16),
671
+ )
672
+ expect(operation.details).to have_attributes(
673
+ client_reference: 'OTHER REFERENCE',
674
+ operation_reference: 'REFERENCE',
675
+ free_label: 'MENSUEAUHTR13133',
676
+ debtor: 'INTERNET SFR',
597
677
  original_currency: nil,
598
678
  original_amount: nil,
599
679
  exchange_rate: nil,
600
- debtor: 'INTERNET SFR',
601
680
  )
602
681
  end
603
682
  end
@@ -621,16 +700,21 @@ describe CFONB::Parser do
621
700
  exoneration_code: '0',
622
701
  interbank_code: 'B1',
623
702
  internal_code: '9162',
624
- label: "PRLV SEPA TEST CABINET\nMENSUEAUHTR13133\nP051928612 22793301700040",
703
+ label: 'PRLV SEPA TEST CABINET',
625
704
  number: 0,
626
- reference: 'REFERENCE - OTHER REFERENCE',
627
705
  rejection_code: '',
628
706
  unavailability_code: '0',
629
707
  value_date: Date.new(2019, 5, 16),
708
+ )
709
+
710
+ expect(operation.details).to have_attributes(
711
+ operation_reference: 'REFERENCE',
712
+ client_reference: 'OTHER REFERENCE',
713
+ free_label: "MENSUEAUHTR13133\nMENSUEAUHTR13DUP\nP051928612 22793301700040",
714
+ debtor: 'ELEC ERDF',
630
715
  original_currency: nil,
631
716
  original_amount: nil,
632
717
  exchange_rate: nil,
633
- debtor: 'ELEC ERDF',
634
718
  )
635
719
  end
636
720
  end