« NAB/BPAY/Remittance/File/HeaderRecord.pm
↑ Summary
NAB/Australian/DirectEntry/Report/PaymentRecord.pm »
| 1 | package Business::NAB::Australian::DirectEntry::Report::HeaderRecord; | ||||||||||
| 2 | 2 | $Business::NAB::Australian::DirectEntry::Report::HeaderRecord::VERSION = '0.11'; | |||||||||
| 3 | =head1 NAME | ||||||||||
| 4 | |||||||||||
| 5 | Business::NAB::Australian::DirectEntry::Report::HeaderRecord | ||||||||||
| 6 | |||||||||||
| 7 | =head1 SYNOPSIS | ||||||||||
| 8 | |||||||||||
| 9 | =head1 DESCRIPTION | ||||||||||
| 10 | |||||||||||
| 11 | Class for header record in the Australian Direct Entry Report file | ||||||||||
| 12 | |||||||||||
| 13 | =cut; | ||||||||||
| 14 | |||||||||||
| 15 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 2 | ▶ | use feature qw/ signatures /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 2 | extends 'Business::NAB::CSV'; | |||||||||
| 21 | 2 | ▶ | no warnings qw/ experimental::signatures /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | |||||||||||
| 23 | 2 | ▶ | use Business::NAB::Types qw/ | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | add_max_string_attribute | ||||||||||
| 25 | 2 | /; | |||||||||
| 26 | |||||||||||
| 27 | =head1 ATTRIBUTES | ||||||||||
| 28 | |||||||||||
| 29 | All are Str types, required, except where stated | ||||||||||
| 30 | |||||||||||
| 31 | =over | ||||||||||
| 32 | |||||||||||
| 33 | =item bank_name | ||||||||||
| 34 | |||||||||||
| 35 | =item product_name | ||||||||||
| 36 | |||||||||||
| 37 | =item report_name | ||||||||||
| 38 | |||||||||||
| 39 | =item run_date (NAB::Type::Date) | ||||||||||
| 40 | |||||||||||
| 41 | =item run_time | ||||||||||
| 42 | |||||||||||
| 43 | =item fund_id | ||||||||||
| 44 | |||||||||||
| 45 | =item customer_name | ||||||||||
| 46 | |||||||||||
| 47 | =item import_file_name | ||||||||||
| 48 | |||||||||||
| 49 | =item payment_date (NAB::Type::Date) | ||||||||||
| 50 | |||||||||||
| 51 | =item batch_no_links | ||||||||||
| 52 | |||||||||||
| 53 | =item export_file_name | ||||||||||
| 54 | |||||||||||
| 55 | =item de_user_id | ||||||||||
| 56 | |||||||||||
| 57 | =item me_id | ||||||||||
| 58 | |||||||||||
| 59 | =item report_file_name | ||||||||||
| 60 | |||||||||||
| 61 | =back | ||||||||||
| 62 | |||||||||||
| 63 | =cut | ||||||||||
| 64 | |||||||||||
| 65 | 7 | ▶ | sub _record_type { '00' } | ||||||||
|
Subroutine
_record_type: called CC=1 SCAR=0.0
| |||||||||||
| 66 | |||||||||||
| 67 | 9 | ▶ | sub _attributes { | ||||||||
|
Subroutine
_attributes: called CC=1 SCAR=0.0
| |||||||||||
| 68 | 9 | return qw/ | |||||||||
| 69 | bank_name | ||||||||||
| 70 | product_name | ||||||||||
| 71 | report_name | ||||||||||
| 72 | run_date | ||||||||||
| 73 | run_time | ||||||||||
| 74 | fund_id | ||||||||||
| 75 | customer_name | ||||||||||
| 76 | import_file_name | ||||||||||
| 77 | payment_date | ||||||||||
| 78 | batch_no_links | ||||||||||
| 79 | export_file_name | ||||||||||
| 80 | de_user_id | ||||||||||
| 81 | me_id | ||||||||||
| 82 | report_file_name | ||||||||||
| 83 | /; | ||||||||||
| 84 | } | ||||||||||
| 85 | |||||||||||
| 86 | 2 | has [ | |||||||||
| 87 | qw/ | ||||||||||
| 88 | run_date payment_date | ||||||||||
| 89 | / | ||||||||||
| 90 | ] => ( | ||||||||||
| 91 | is => 'ro', | ||||||||||
| 92 | isa => 'NAB::Type::Date', | ||||||||||
| 93 | required => 1, | ||||||||||
| 94 | coerce => 1, | ||||||||||
| 95 | ); | ||||||||||
| 96 | |||||||||||
| 97 | 2 | foreach my $str_attr ( | |||||||||
| 98 | 28 | grep { $_ !~ /date/ } __PACKAGE__->_attributes | |||||||||
| 99 | ) { | ||||||||||
| 100 | 24 | __PACKAGE__->add_max_string_attribute( | |||||||||
| 101 | $str_attr, | ||||||||||
| 102 | is => 'ro', | ||||||||||
| 103 | required => 1, | ||||||||||
| 104 | ); | ||||||||||
| 105 | } | ||||||||||
| 106 | |||||||||||
| 107 | 4 | ▶ | sub to_record ( $self ) { | ||||||||
|
Subroutine
to_record: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 108 | |||||||||||
| 109 | my $aoa = [ [ | ||||||||||
| 110 | map { | ||||||||||
| 111 | 4 | ▶ | $_ =~ /date/ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 112 | ? $self->$_->dmy( '' ) | ||||||||||
| 113 | : $self->$_ | ||||||||||
| 114 | ; | ||||||||||
| 115 | } '_record_type', | ||||||||||
| 116 | $self->_attributes, | ||||||||||
| 117 | ] ]; | ||||||||||
| 118 | |||||||||||
| 119 | 4 | return $self->SUPER::to_record( $aoa ); | |||||||||
| 120 | } | ||||||||||
| 121 | |||||||||||
| 122 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||