-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathremittanceBeneficiary.go
631 lines (543 loc) · 24 KB
/
remittanceBeneficiary.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
// Copyright 2020 The Moov Authors
// Use of this source code is governed by an Apache License
// license that can be found in the LICENSE file.
package wire
import (
"encoding/json"
"strings"
"unicode/utf8"
)
// RemittanceBeneficiary is remittance beneficiary
type RemittanceBeneficiary struct {
// tag
tag string
// IdentificationType is identification type
IdentificationType string `json:"identificationType,omitempty"`
// IdentificationCode Organization Identification Codes * `BANK` - Bank Party Identification * `CUST` - Customer Number * `DUNS` - Data Universal Number System (Dun & Bradstreet) * `EMPL` - Employer Identification Number * `GS1G` - Global Location Number * `PROP` - Proprietary Identification Number * `SWBB` - SWIFT BIC or BEI * `TXID` - Tax Identification Number Private Identification Codes * `ARNU` - Alien Registration Number * `CCPT` - Passport Number * `CUST` - Customer Number * `DPOB` - Date & Place of Birth * `DRLC` - Driver’s License Number * `EMPL` - Employee Identification Number * `NIDN` - National Identity Number * `PROP` - Proprietary Identification Number * `SOSE` - Social Security Number * `TXID` - Tax Identification Number
IdentificationCode string `json:"identificationCode,omitempty"`
// IdentificationNumber
IdentificationNumber string `json:"identificationNumber,omitempty"`
// IdentificationNumberIssuer
IdentificationNumberIssuer string `json:"identificationNumberIssuer,omitempty"`
// RemittanceData
RemittanceData RemittanceData `json:"remittanceData,omitempty"`
// validator is composed for data validation
validator
// converters is composed for WIRE to GoLang Converters
converters
}
// NewRemittanceBeneficiary returns a new RemittanceBeneficiary
func NewRemittanceBeneficiary() *RemittanceBeneficiary {
rb := &RemittanceBeneficiary{
tag: TagRemittanceBeneficiary,
}
return rb
}
// Parse takes the input string and parses the RemittanceBeneficiary values
//
// Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm
// successful parsing and data validity.
func (rb *RemittanceBeneficiary) Parse(record string) error {
if utf8.RuneCountInString(record) < 24 {
return NewTagMinLengthErr(24, len(record))
}
rb.tag = record[:6]
length := 6
value, read, err := rb.parseVariableStringField(record[length:], 140)
if err != nil {
return fieldError("Name", err)
}
rb.RemittanceData.Name = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 2)
if err != nil {
return fieldError("IdentificationType", err)
}
rb.IdentificationType = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 4)
if err != nil {
return fieldError("IdentificationCode", err)
}
rb.IdentificationCode = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 35)
if err != nil {
return fieldError("IdentificationNumber", err)
}
rb.IdentificationNumber = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 35)
if err != nil {
return fieldError("IdentificationNumberIssuer", err)
}
rb.IdentificationNumberIssuer = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 82)
if err != nil {
return fieldError("DateBirthPlace", err)
}
rb.RemittanceData.DateBirthPlace = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 4)
if err != nil {
return fieldError("AddressType", err)
}
rb.RemittanceData.AddressType = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("Department", err)
}
rb.RemittanceData.Department = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("SubDepartment", err)
}
rb.RemittanceData.SubDepartment = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("StreetName", err)
}
rb.RemittanceData.StreetName = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 16)
if err != nil {
return fieldError("BuildingNumber", err)
}
rb.RemittanceData.BuildingNumber = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 16)
if err != nil {
return fieldError("PostCode", err)
}
rb.RemittanceData.PostCode = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 35)
if err != nil {
return fieldError("TownName", err)
}
rb.RemittanceData.TownName = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 35)
if err != nil {
return fieldError("CountrySubDivisionState", err)
}
rb.RemittanceData.CountrySubDivisionState = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 2)
if err != nil {
return fieldError("Country", err)
}
rb.RemittanceData.Country = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("AddressLineOne", err)
}
rb.RemittanceData.AddressLineOne = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("AddressLineTwo", err)
}
rb.RemittanceData.AddressLineTwo = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("AddressLineThree", err)
}
rb.RemittanceData.AddressLineThree = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("AddressLineFour", err)
}
rb.RemittanceData.AddressLineFour = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("AddressLineFive", err)
}
rb.RemittanceData.AddressLineFive = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("AddressLineSix", err)
}
rb.RemittanceData.AddressLineSix = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 70)
if err != nil {
return fieldError("AddressLineSeven", err)
}
rb.RemittanceData.AddressLineSeven = value
length += read
value, read, err = rb.parseVariableStringField(record[length:], 2)
if err != nil {
return fieldError("CountryOfResidence", err)
}
rb.RemittanceData.CountryOfResidence = value
length += read
if err := rb.verifyDataWithReadLength(record, length); err != nil {
return NewTagMaxLengthErr(err)
}
return nil
}
func (rb *RemittanceBeneficiary) UnmarshalJSON(data []byte) error {
type Alias RemittanceBeneficiary
aux := struct {
*Alias
}{
(*Alias)(rb),
}
if err := json.Unmarshal(data, &aux); err != nil {
return err
}
rb.tag = TagRemittanceBeneficiary
return nil
}
// String returns a fixed-width RemittanceBeneficiary record
func (rb *RemittanceBeneficiary) String() string {
return rb.Format(FormatOptions{
VariableLengthFields: false,
})
}
// Format returns a RemittanceBeneficiary record formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) Format(options FormatOptions) string {
var buf strings.Builder
buf.Grow(1114)
buf.WriteString(rb.tag)
buf.WriteString(rb.FormatName(options) + Delimiter)
buf.WriteString(rb.FormatIdentificationType(options) + Delimiter)
buf.WriteString(rb.FormatIdentificationCode(options) + Delimiter)
buf.WriteString(rb.FormatIdentificationNumber(options) + Delimiter)
buf.WriteString(rb.FormatIdentificationNumberIssuer(options) + Delimiter)
buf.WriteString(rb.FormatDateBirthPlace(options) + Delimiter)
buf.WriteString(rb.FormatAddressType(options) + Delimiter)
buf.WriteString(rb.FormatDepartment(options) + Delimiter)
buf.WriteString(rb.FormatSubDepartment(options) + Delimiter)
buf.WriteString(rb.FormatStreetName(options) + Delimiter)
buf.WriteString(rb.FormatBuildingNumber(options) + Delimiter)
buf.WriteString(rb.FormatPostCode(options) + Delimiter)
buf.WriteString(rb.FormatTownName(options) + Delimiter)
buf.WriteString(rb.FormatCountrySubDivisionState(options) + Delimiter)
buf.WriteString(rb.FormatCountry(options) + Delimiter)
buf.WriteString(rb.FormatAddressLineOne(options) + Delimiter)
buf.WriteString(rb.FormatAddressLineTwo(options) + Delimiter)
buf.WriteString(rb.FormatAddressLineThree(options) + Delimiter)
buf.WriteString(rb.FormatAddressLineFour(options) + Delimiter)
buf.WriteString(rb.FormatAddressLineFive(options) + Delimiter)
buf.WriteString(rb.FormatAddressLineSix(options) + Delimiter)
buf.WriteString(rb.FormatAddressLineSeven(options) + Delimiter)
buf.WriteString(rb.FormatCountryOfResidence(options) + Delimiter)
if options.VariableLengthFields {
return rb.stripDelimiters(buf.String())
} else {
return buf.String()
}
}
// Validate performs WIRE format rule checks on RemittanceBeneficiary and returns an error if not Validated
// The first error encountered is returned and stops that parsing.
// * Name is mandatory.
// * Identification Number
// - Not permitted unless Identification Type and Identification Code are present.
// - Not permitted for Identification Code PICDateBirthPlace.
//
// * Identification Number Issuer
// - Not permitted unless Identification Type, Identification Code and Identification Number are present.
// - Not permitted for Identification Code SWBB and PICDateBirthPlace.
//
// * Date & Place of Birth is only permitted for Identification Code PICDateBirthPlace.
func (rb *RemittanceBeneficiary) Validate() error {
if err := rb.fieldInclusion(); err != nil {
return err
}
if rb.tag != TagRemittanceBeneficiary {
return fieldError("tag", ErrValidTagForType, rb.tag)
}
if err := rb.isAlphanumeric(rb.RemittanceData.Name); err != nil {
return fieldError("Name", err, rb.RemittanceData.Name)
}
if err := rb.isIdentificationType(rb.IdentificationType); err != nil {
return fieldError("IdentificationType", err, rb.IdentificationType)
}
switch rb.IdentificationType {
case OrganizationID:
if err := rb.isOrganizationIdentificationCode(rb.IdentificationCode); err != nil {
return fieldError("IdentificationCode", err, rb.IdentificationCode)
}
case PrivateID:
if err := rb.isPrivateIdentificationCode(rb.IdentificationCode); err != nil {
return fieldError("IdentificationCode", err, rb.IdentificationCode)
}
}
if err := rb.isAlphanumeric(rb.IdentificationNumber); err != nil {
return fieldError("IdentificationNumber", err, rb.IdentificationNumber)
}
if err := rb.isAlphanumeric(rb.IdentificationNumberIssuer); err != nil {
return fieldError("IdentificationNumberIssuer", err, rb.IdentificationNumberIssuer)
}
if err := rb.isAddressType(rb.RemittanceData.AddressType); err != nil {
return fieldError("AddressType", err, rb.RemittanceData.AddressType)
}
if err := rb.isAlphanumeric(rb.RemittanceData.Department); err != nil {
return fieldError("Department", err, rb.RemittanceData.Department)
}
if err := rb.isAlphanumeric(rb.RemittanceData.SubDepartment); err != nil {
return fieldError("SubDepartment", err, rb.RemittanceData.SubDepartment)
}
if err := rb.isAlphanumeric(rb.RemittanceData.StreetName); err != nil {
return fieldError("StreetName", err, rb.RemittanceData.StreetName)
}
if err := rb.isAlphanumeric(rb.RemittanceData.BuildingNumber); err != nil {
return fieldError("BuildingNumber", err, rb.RemittanceData.BuildingNumber)
}
if err := rb.isAlphanumeric(rb.RemittanceData.PostCode); err != nil {
return fieldError("PostCode", err, rb.RemittanceData.PostCode)
}
if err := rb.isAlphanumeric(rb.RemittanceData.TownName); err != nil {
return fieldError("TownName", err, rb.RemittanceData.TownName)
}
if err := rb.isAlphanumeric(rb.RemittanceData.CountrySubDivisionState); err != nil {
return fieldError("CountrySubDivisionState", err, rb.RemittanceData.CountrySubDivisionState)
}
if err := rb.isAlphanumeric(rb.RemittanceData.Country); err != nil {
return fieldError("Country", err, rb.RemittanceData.Country)
}
if err := rb.isAlphanumeric(rb.RemittanceData.AddressLineOne); err != nil {
return fieldError("AddressLineOne", err, rb.RemittanceData.AddressLineOne)
}
if err := rb.isAlphanumeric(rb.RemittanceData.AddressLineTwo); err != nil {
return fieldError("AddressLineTwo", err, rb.RemittanceData.AddressLineTwo)
}
if err := rb.isAlphanumeric(rb.RemittanceData.AddressLineThree); err != nil {
return fieldError("AddressLineThree", err, rb.RemittanceData.AddressLineThree)
}
if err := rb.isAlphanumeric(rb.RemittanceData.AddressLineFour); err != nil {
return fieldError("AddressLineFour", err, rb.RemittanceData.AddressLineFour)
}
if err := rb.isAlphanumeric(rb.RemittanceData.AddressLineFive); err != nil {
return fieldError("AddressLineFive", err, rb.RemittanceData.AddressLineFive)
}
if err := rb.isAlphanumeric(rb.RemittanceData.AddressLineSix); err != nil {
return fieldError("AddressLineSix", err, rb.RemittanceData.AddressLineSix)
}
if err := rb.isAlphanumeric(rb.RemittanceData.AddressLineSeven); err != nil {
return fieldError("AddressLineSeven", err, rb.RemittanceData.AddressLineSeven)
}
if err := rb.isAlphanumeric(rb.RemittanceData.CountryOfResidence); err != nil {
return fieldError("CountryOfResidence", err, rb.RemittanceData.CountryOfResidence)
}
return nil
}
// fieldInclusion validate mandatory fields. If fields are
// invalid the WIRE will return an error.
func (rb *RemittanceBeneficiary) fieldInclusion() error {
if rb.RemittanceData.Name == "" {
return fieldError("Name", ErrFieldRequired)
}
if rb.IdentificationCode == PICDateBirthPlace {
if rb.IdentificationNumber != "" {
return fieldError("IdentificationNumber", ErrInvalidProperty, rb.IdentificationNumber)
}
}
if rb.IdentificationNumber == "" || rb.IdentificationCode == OICSWIFTBICORBEI ||
rb.IdentificationCode == PICDateBirthPlace {
if rb.IdentificationNumberIssuer != "" {
return fieldError("IdentificationNumberIssuer", ErrInvalidProperty, rb.IdentificationNumberIssuer)
}
}
if rb.IdentificationCode != PICDateBirthPlace {
if rb.RemittanceData.DateBirthPlace != "" {
return fieldError("DateBirthPlace", ErrInvalidProperty, rb.RemittanceData.DateBirthPlace)
}
}
return nil
}
// NameField gets a string of the Name field
func (rb *RemittanceBeneficiary) NameField() string {
return rb.alphaField(rb.RemittanceData.Name, 140)
}
// IdentificationTypeField gets a string of the IdentificationType field
func (rb *RemittanceBeneficiary) IdentificationTypeField() string {
return rb.alphaField(rb.IdentificationType, 2)
}
// IdentificationCodeField gets a string of the IdentificationCode field
func (rb *RemittanceBeneficiary) IdentificationCodeField() string {
return rb.alphaField(rb.IdentificationCode, 4)
}
// IdentificationNumberField gets a string of the IdentificationNumber field
func (rb *RemittanceBeneficiary) IdentificationNumberField() string {
return rb.alphaField(rb.IdentificationNumber, 35)
}
// IdentificationNumberIssuerField gets a string of the IdentificationNumberIssuer field
func (rb *RemittanceBeneficiary) IdentificationNumberIssuerField() string {
return rb.alphaField(rb.IdentificationNumberIssuer, 35)
}
// DateBirthPlaceField gets a string of the DateBirthPlace field
func (rb *RemittanceBeneficiary) DateBirthPlaceField() string {
return rb.alphaField(rb.RemittanceData.DateBirthPlace, 82)
}
// AddressTypeField gets a string of the AddressType field
func (rb *RemittanceBeneficiary) AddressTypeField() string {
return rb.alphaField(rb.RemittanceData.AddressType, 4)
}
// DepartmentField gets a string of the Department field
func (rb *RemittanceBeneficiary) DepartmentField() string {
return rb.alphaField(rb.RemittanceData.Department, 70)
}
// SubDepartmentField gets a string of the SubDepartment field
func (rb *RemittanceBeneficiary) SubDepartmentField() string {
return rb.alphaField(rb.RemittanceData.SubDepartment, 70)
}
// StreetNameField gets a string of the StreetName field
func (rb *RemittanceBeneficiary) StreetNameField() string {
return rb.alphaField(rb.RemittanceData.StreetName, 70)
}
// BuildingNumberField gets a string of the BuildingNumber field
func (rb *RemittanceBeneficiary) BuildingNumberField() string {
return rb.alphaField(rb.RemittanceData.BuildingNumber, 16)
}
// PostCodeField gets a string of the PostCode field
func (rb *RemittanceBeneficiary) PostCodeField() string {
return rb.alphaField(rb.RemittanceData.PostCode, 16)
}
// TownNameField gets a string of the TownName field
func (rb *RemittanceBeneficiary) TownNameField() string {
return rb.alphaField(rb.RemittanceData.TownName, 35)
}
// CountrySubDivisionStateField gets a string of the CountrySubDivisionState field
func (rb *RemittanceBeneficiary) CountrySubDivisionStateField() string {
return rb.alphaField(rb.RemittanceData.CountrySubDivisionState, 35)
}
// CountryField gets a string of the Country field
func (rb *RemittanceBeneficiary) CountryField() string {
return rb.alphaField(rb.RemittanceData.Country, 2)
}
// AddressLineOneField gets a string of the AddressLineOne field
func (rb *RemittanceBeneficiary) AddressLineOneField() string {
return rb.alphaField(rb.RemittanceData.AddressLineOne, 70)
}
// AddressLineTwoField gets a string of the AddressLineTwo field
func (rb *RemittanceBeneficiary) AddressLineTwoField() string {
return rb.alphaField(rb.RemittanceData.AddressLineTwo, 70)
}
// AddressLineThreeField gets a string of the AddressLineThree field
func (rb *RemittanceBeneficiary) AddressLineThreeField() string {
return rb.alphaField(rb.RemittanceData.AddressLineThree, 70)
}
// AddressLineFourField gets a string of the AddressLineFour field
func (rb *RemittanceBeneficiary) AddressLineFourField() string {
return rb.alphaField(rb.RemittanceData.AddressLineFour, 70)
}
// AddressLineFiveField gets a string of the AddressLineFive field
func (rb *RemittanceBeneficiary) AddressLineFiveField() string {
return rb.alphaField(rb.RemittanceData.AddressLineFive, 70)
}
// AddressLineSixField gets a string of the AddressLineSix field
func (rb *RemittanceBeneficiary) AddressLineSixField() string {
return rb.alphaField(rb.RemittanceData.AddressLineSix, 70)
}
// AddressLineSevenField gets a string of the AddressLineSeven field
func (rb *RemittanceBeneficiary) AddressLineSevenField() string {
return rb.alphaField(rb.RemittanceData.AddressLineSeven, 70)
}
// CountryOfResidenceField gets a string of the CountryOfResidence field
func (rb *RemittanceBeneficiary) CountryOfResidenceField() string {
return rb.alphaField(rb.RemittanceData.CountryOfResidence, 2)
}
// FormatName returns Name formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatName(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.Name, 140, options)
}
// FormatIdentificationType returns IdentificationType formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatIdentificationType(options FormatOptions) string {
return rb.formatAlphaField(rb.IdentificationType, 2, options)
}
// FormatIdentificationCode returns IdentificationCode formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatIdentificationCode(options FormatOptions) string {
return rb.formatAlphaField(rb.IdentificationCode, 4, options)
}
// FormatIdentificationNumber returns IdentificationNumber formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatIdentificationNumber(options FormatOptions) string {
return rb.formatAlphaField(rb.IdentificationNumber, 35, options)
}
// FormatIdentificationNumberIssuer returns IdentificationNumberIssuer formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatIdentificationNumberIssuer(options FormatOptions) string {
return rb.formatAlphaField(rb.IdentificationNumberIssuer, 35, options)
}
// FormatDateBirthPlace returns DateBirthPlace formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatDateBirthPlace(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.DateBirthPlace, 82, options)
}
// FormatAddressType returns AddressType formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatAddressType(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.AddressType, 4, options)
}
// FormatDepartment returns Department formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatDepartment(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.Department, 70, options)
}
// FormatSubDepartment returns SubDepartment formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatSubDepartment(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.SubDepartment, 70, options)
}
// FormatStreetName returns StreetName formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatStreetName(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.StreetName, 70, options)
}
// FormatBuildingNumber returns BuildingNumber formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatBuildingNumber(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.BuildingNumber, 16, options)
}
// FormatPostCode returns PostCode formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatPostCode(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.PostCode, 16, options)
}
// FormatTownName returns TownName formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatTownName(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.TownName, 35, options)
}
// FormatCountrySubDivisionState returns CountrySubDivisionState formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatCountrySubDivisionState(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.CountrySubDivisionState, 35, options)
}
// FormatCountry returns Country formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatCountry(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.Country, 2, options)
}
// FormatAddressLineOne returns AddressLineOne formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatAddressLineOne(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.AddressLineOne, 70, options)
}
// FormatAddressLineTwo returns AddressLineTwo formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatAddressLineTwo(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.AddressLineTwo, 70, options)
}
// FormatAddressLineThree returns AddressLineThree formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatAddressLineThree(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.AddressLineThree, 70, options)
}
// FormatAddressLineFour returns AddressLineFour formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatAddressLineFour(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.AddressLineFour, 70, options)
}
// FormatAddressLineFive returns AddressLineFive formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatAddressLineFive(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.AddressLineFive, 70, options)
}
// FormatAddressLineSix returns AddressLineSix formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatAddressLineSix(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.AddressLineSix, 70, options)
}
// FormatAddressLineSeven returns AddressLineSeven formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatAddressLineSeven(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.AddressLineSeven, 70, options)
}
// FormatCountryOfResidence returns CountryOfResidence formatted according to the FormatOptions
func (rb *RemittanceBeneficiary) FormatCountryOfResidence(options FormatOptions) string {
return rb.formatAlphaField(rb.RemittanceData.CountryOfResidence, 2, options)
}