Skip to content

Commit

Permalink
Rename AvtaleGiro notification enum names
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Mar 16, 2017
1 parent 52c2050 commit 74558a2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ netsgiro's low level API parses OCR files into a list of records::
TransactionAmountItem2(service_code=<ServiceCode.AVTALEGIRO: 21>, record_type=<RecordType.TRANSACTION_AMOUNT_2: 31>, transaction_type=<TransactionType.PURCHASE_WITH_TEXT: 21>, transaction_number='0000005', reference=None, form_number=None, bank_date=None, debit_account=None, payer_name='NAVN'),
TransactionSpecification(service_code=<ServiceCode.AVTALEGIRO: 21>, record_type=<RecordType.TRANSACTION_SPECIFICATION: 49>, transaction_type=<TransactionType.PURCHASE_WITH_TEXT: 21>, transaction_number='0000005', line_number=1, column_number=1, text=' Gjelder Faktura: 168841 Dato: 19/03/04'),
TransactionSpecification(service_code=<ServiceCode.AVTALEGIRO: 21>, record_type=<RecordType.TRANSACTION_SPECIFICATION: 49>, transaction_type=<TransactionType.PURCHASE_WITH_TEXT: 21>, transaction_number='0000005', line_number=1, column_number=2, text=' ForfallsDato: 17/06/04'),
TransactionAmountItem1(service_code=<ServiceCode.AVTALEGIRO: 21>, record_type=<RecordType.TRANSACTION_AMOUNT_1: 30>, transaction_type=<TransactionType.AVTALEGIRO_NO_NOTIFICATION_FROM_BANK: 2>, transaction_number='0000006', nets_date=datetime.date(2004, 6, 17), amount=100, kid='008000061688422', centre_id=None, day_code=None, partial_settlement_number=None, partial_settlement_serial_number=None, sign=None),
TransactionAmountItem2(service_code=<ServiceCode.AVTALEGIRO: 21>, record_type=<RecordType.TRANSACTION_AMOUNT_2: 31>, transaction_type=<TransactionType.AVTALEGIRO_NO_NOTIFICATION_FROM_BANK: 2>, transaction_number='0000006', reference=None, form_number=None, bank_date=None, debit_account=None, payer_name='NAVN'),
TransactionAmountItem1(service_code=<ServiceCode.AVTALEGIRO: 21>, record_type=<RecordType.TRANSACTION_AMOUNT_1: 30>, transaction_type=<TransactionType.AVTALEGIRO_WITH_PAYEE_NOTIFICATION: 2>, transaction_number='0000006', nets_date=datetime.date(2004, 6, 17), amount=100, kid='008000061688422', centre_id=None, day_code=None, partial_settlement_number=None, partial_settlement_serial_number=None, sign=None),
TransactionAmountItem2(service_code=<ServiceCode.AVTALEGIRO: 21>, record_type=<RecordType.TRANSACTION_AMOUNT_2: 31>, transaction_type=<TransactionType.AVTALEGIRO_WITH_PAYEE_NOTIFICATION: 2>, transaction_number='0000006', reference=None, form_number=None, bank_date=None, debit_account=None, payer_name='NAVN'),
AssignmentEnd(service_code=<ServiceCode.AVTALEGIRO: 21>, record_type=<RecordType.ASSIGNMENT_END: 88>, assignment_type=<AssignmentType.TRANSACTIONS: 0>, num_transactions=6, num_records=20, total_amount=600, nets_date=datetime.date(2004, 6, 17), nets_date_earliest=datetime.date(2004, 6, 17), nets_date_latest=None),
TransmissionEnd(service_code=<ServiceCode.NONE: 0>, record_type=<RecordType.TRANSMISSION_END: 89>, transmission_type=0, num_transactions=6, num_records=22, total_amount=600, nets_date=datetime.date(2004, 6, 17))]

Expand Down Expand Up @@ -134,7 +134,7 @@ netsgiro's high level API parses OCR files into a tree of objects::
'reference': None,
'service_code': <ServiceCode.AVTALEGIRO: 21>,
'specification_text': '',
'type': <TransactionType.AVTALEGIRO_NO_NOTIFICATION_FROM_BANK: 2>}],
'type': <TransactionType.AVTALEGIRO_WITH_PAYEE_NOTIFICATION: 2>}],
'type': <AssignmentType.TRANSACTIONS: 0>}],
'data_recipient': '00008080',
'data_transmitter': '55555555',
Expand Down
4 changes: 2 additions & 2 deletions netsgiro/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class TransactionType(IntEnum):
REVERSING_WITH_TEXT = 20
PURCHASE_WITH_TEXT = 21

AVTALEGIRO_NO_NOTIFICATION_FROM_BANK = 2 # TODO Better name?
AVTALEGIRO_NOTIFICATION_FROM_BANK = 21 # TODO Better name?
AVTALEGIRO_WITH_PAYEE_NOTIFICATION = 2
AVTALEGIRO_WITH_BANK_NOTIFICATION = 21
AVTALEGIRO_CANCELLATION = 93
AVTALEGIRO_AGREEMENTS = 94

Expand Down
4 changes: 2 additions & 2 deletions tests/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_parse_payment_request(payment_request_data):
assert isinstance(transaction, netsgiro.Transaction)
assert transaction.service_code == netsgiro.ServiceCode.AVTALEGIRO
assert transaction.type == (
netsgiro.TransactionType.AVTALEGIRO_NOTIFICATION_FROM_BANK)
netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION)
assert transaction.number == '0000001'
assert transaction.nets_date == date(2004, 6, 17)
assert transaction.amount == Decimal('1.00')
Expand Down Expand Up @@ -75,7 +75,7 @@ def make_specification_records(num_lines, num_columns=2):
netsgiro.TransactionSpecification(
service_code=netsgiro.ServiceCode.AVTALEGIRO,
transaction_type=(
netsgiro.TransactionType.AVTALEGIRO_NOTIFICATION_FROM_BANK),
netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION),
record_type=netsgiro.RecordType.TRANSACTION_SPECIFICATION,
transaction_number='0000001',
line_number=line,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_transaction_amount_item_1_for_avtalegiro_payment_request():
assert record.record_type == netsgiro.RecordType.TRANSACTION_AMOUNT_1

assert record.transaction_type == (
netsgiro.TransactionType.AVTALEGIRO_NOTIFICATION_FROM_BANK)
netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION)
assert record.transaction_number == '0000001'

assert record.nets_date == date(2004, 6, 17)
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_transaction_amount_item_2_for_avtalegiro_payment_request():
assert record.record_type == netsgiro.RecordType.TRANSACTION_AMOUNT_2

assert record.transaction_type == (
netsgiro.TransactionType.AVTALEGIRO_NOTIFICATION_FROM_BANK)
netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION)
assert record.transaction_number == '0000001'

assert record.payer_name == 'NAVN'
Expand Down Expand Up @@ -318,7 +318,7 @@ def test_transaction_specification_for_avtalegiro_payment_request():
assert record.record_type == netsgiro.RecordType.TRANSACTION_SPECIFICATION

assert record.transaction_type == (
netsgiro.TransactionType.AVTALEGIRO_NOTIFICATION_FROM_BANK)
netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION)
assert record.transaction_number == '0000001'

assert record.line_number == 1
Expand Down

0 comments on commit 74558a2

Please sign in to comment.