diff --git a/CHANGELOG.md b/CHANGELOG.md index ea16969..c3b4a15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [0.6.0] + +### Changed + +- Added AMEX transaction_id as `transaction_id` in AMEX Parser. + ## [0.5.0] ### Changed diff --git a/README.md b/README.md index 9f242ff..5823067 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Check implemented parsers for examples. ### Run tests ``` -chmod +x text.sh +chmod +x test.sh ./test.sh ``` diff --git a/card_data_parsers/models/amex_transaction.py b/card_data_parsers/models/amex_transaction.py index 8fd03ca..0a9bd58 100644 --- a/card_data_parsers/models/amex_transaction.py +++ b/card_data_parsers/models/amex_transaction.py @@ -18,3 +18,4 @@ class AmexTransaction(Transaction): airline_travel_agency_name: str = None airline_ticket_number: str = None airline_type: str = None + transaction_id: str = None diff --git a/card_data_parsers/parsers/amex_parser.py b/card_data_parsers/parsers/amex_parser.py index ea1d949..6079590 100644 --- a/card_data_parsers/parsers/amex_parser.py +++ b/card_data_parsers/parsers/amex_parser.py @@ -150,6 +150,9 @@ def __extract_transactions(txn_lines, account_number_mask_begin, account_number_ txn.account_number = mask_card_number(txn.account_number, account_number_mask_begin, account_number_mask_end) + # adding actual AMEX transaction_id before modifying it + txn.transaction_id = txn.external_id + external_id = str(txn.external_id + txn.account_number + txn.transaction_dt + txn.description + txn.currency + txn.amount) if txn.foreign_currency is not None and txn.foreign_amount is not None: external_id = str(external_id + txn.foreign_currency + txn.foreign_amount) diff --git a/setup.py b/setup.py index b17b06d..b2532e1 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='card_data_parsers', - version='0.5.0', + version='0.6.0', author='Siva Narayanan', author_email='siva@fyle.in', url='https://www.fylehq.com', diff --git a/tests/card_data_parsers/amex/p1/expected.json b/tests/card_data_parsers/amex/p1/expected.json index ef78e2b..0077075 100644 --- a/tests/card_data_parsers/amex/p1/expected.json +++ b/tests/card_data_parsers/amex/p1/expected.json @@ -12,6 +12,7 @@ "external_id": "0d3eaafa0c8f934f362c53bb2d3ccd67", "merchant_category_code": "10", "vendor": "5", - "bank_name": "Test Bank" + "bank_name": "Test Bank", + "transaction_id": "0914600172007637906017110005010001521" } ] \ No newline at end of file