From 79685a7501758a9a62f49e303c64f3f1a8b57ccc Mon Sep 17 00:00:00 2001 From: Benjamin Dornel <{{ .email }}> Date: Wed, 22 Nov 2023 15:33:24 +0000 Subject: [PATCH] refactor(statement): treat credit card transactions as debit entry --- src/monopoly/processor.py | 2 +- src/monopoly/statement.py | 25 ++- tests/integration/banks/citibank/raw.csv | 172 +++++++++--------- .../banks/citibank/transformed.csv | 172 +++++++++--------- tests/integration/banks/dbs/raw.csv | 146 +++++++-------- tests/integration/banks/dbs/transformed.csv | 146 +++++++-------- tests/integration/banks/example/raw.csv | 106 +++++------ .../integration/banks/example/transformed.csv | 106 +++++------ tests/integration/banks/hsbc/raw.csv | 38 ++-- tests/integration/banks/hsbc/transformed.csv | 38 ++-- tests/integration/banks/ocbc/raw.csv | 106 +++++------ tests/integration/banks/ocbc/transformed.csv | 106 +++++------ .../banks/standard_chartered/raw.csv | 54 +++--- .../banks/standard_chartered/transformed.csv | 54 +++--- tests/integration/banks/test_banks.py | 12 +- tests/unit/test_statement_refund.py | 29 +++ tests/unit/test_transaction.py | 2 +- 17 files changed, 678 insertions(+), 636 deletions(-) create mode 100644 tests/unit/test_statement_refund.py diff --git a/src/monopoly/processor.py b/src/monopoly/processor.py index 63d183a9..938fb6b0 100644 --- a/src/monopoly/processor.py +++ b/src/monopoly/processor.py @@ -84,7 +84,7 @@ def _perform_safety_check(self, statement: Statement) -> bool: for page in self.document: lines = page.get_textpage().extractText().split("\n") decimal_numbers.update(statement.get_decimal_numbers(lines)) - total_amount = round(statement.df[StatementFields.AMOUNT].sum(), 2) + total_amount = abs(round(statement.df[StatementFields.AMOUNT].sum(), 2)) result = total_amount in decimal_numbers if not result: diff --git a/src/monopoly/statement.py b/src/monopoly/statement.py index ef7fa2b3..82a85d27 100644 --- a/src/monopoly/statement.py +++ b/src/monopoly/statement.py @@ -2,11 +2,12 @@ import re from datetime import datetime from functools import cached_property -from typing import Optional +from typing import Any, Optional from pandas import DataFrame from pydantic import field_validator, model_validator from pydantic.dataclasses import dataclass +from pydantic_core import ArgsKwargs from monopoly.config import StatementConfig, TransactionConfig from monopoly.constants import StatementFields @@ -15,6 +16,7 @@ logger = logging.getLogger(__name__) +# pylint: disable=bad-classmethod-argument @dataclass class Transaction: """ @@ -44,18 +46,30 @@ def prepare_amount_for_float_coercion(cls, amount: str) -> str: (-1.56 ) -> -1.56 """ if isinstance(amount, str): - # change cashback to negative transaction - if amount.startswith("(") and amount.endswith(")"): - amount = "-" + amount return re.sub(r"[,)(\s]", "", amount) return amount + @model_validator(mode="before") # type: ignore + def treat_parenthesis_enclosure_as_credit(self: ArgsKwargs | Any) -> "ArgsKwargs": + """ + Treat amounts enclosed by parentheses (e.g. cashback) as a credit entry + """ + if self.kwargs: + amount: str = self.kwargs["amount"] + if isinstance(amount, str): + if amount.startswith("(") and amount.endswith(")"): + self.kwargs["suffix"] = "CR" + return self + @model_validator(mode="after") - def convert_credit_amount_to_negative(self) -> "Transaction": + def convert_credit_amount_to_negative(self: "Transaction") -> "Transaction": """ Converts transactions with a suffix of "CR" to negative """ if self.suffix == "CR": + self.amount = abs(self.amount) + + else: self.amount = -abs(self.amount) return self @@ -77,7 +91,6 @@ class Statement: @cached_property def transactions(self) -> list[Transaction]: transactions: list[Transaction] = [] - for page in self.pages: lines = self.process_lines(page) for i, line in enumerate(lines): diff --git a/tests/integration/banks/citibank/raw.csv b/tests/integration/banks/citibank/raw.csv index 307511bd..e9ad812b 100644 --- a/tests/integration/banks/citibank/raw.csv +++ b/tests/integration/banks/citibank/raw.csv @@ -1,87 +1,87 @@ transaction_date,description,amount -17 OCT,BALANCE PREVIOUS STATEMENT,1089.65 -17 OCT,FAST INCOMING PAYMENT,-1089.65 -12 OCT,Sandwich Shop @ Goldview SINGAPORE SG,2.36 -14 OCT,Public Transport 191582785 SINGAPORE SG,11.80 -14 OCT,Grocery Store-Parkside S SINGAPORE SG,6.45 -14 OCT,Cafeteria S Singapore SG,16.40 -15 OCT,Bagel House SINGAPORE SG,34.24 -15 OCT,Grocery Store-Meadowside S SINGAPORE SG,14.90 -15 OCT,Great Toast SINGAPORE SG,6.00 -16 OCT,Tea Shop Amsterdam NL,4.59 -16 OCT,Great Toast SINGAPORE SG,2.20 -16 OCT,CAFE DELIGHT - GS SINGAPORE SG,9.80 -16 OCT,GROCER MARKET-PARKWAY S SINGAPORE SG,22.30 -17 OCT,COFFEE HOUSE@BMLB(MB) SINGAPORE SG,7.20 -17 OCT,ITALIAN CUISINE S Singapore SG,16.90 -17 OCT,PUBLIC TRANSIT 197215138 SINGAPORE SG,13.09 -18 OCT,SUNSET HOTEL DINER SINGAPORE SG,61.20 -19 OCT,TOASTY DELIGHT CAFÉ SINGAPORE SG,3.10 -19 OCT,GOURMET TREATS S Singapore SG,16.40 -19 OCT,ONLINE SHOPPING MALL SINGAPORE SG,37.49 -20 OCT,TOASTY DELIGHT CAFÉ SINGAPORE SG,3.10 -21 OCT,ID:1234567890 CITI SMS CASH REBATE,-10.0 -21 OCT,FROZEN FOODS EXPRESS SINGAPORE SG,12.80 -21 OCT,GOURMET TREATS S Singapore SG,16.90 -22 OCT,SUSHI SENSE SINGAPORE SG,46.37 -22 OCT,BURGER KING & GRILL S SINGAPORE SG,10.00 -22 OCT,BURGER KING & GRILL S SINGAPORE SG,8.00 -22 OCT,FASHION HOUSE SINGAPORE PTE SINGAPORE SG,29.80 -22 OCT,PUBLIC TRANSIT 9876543210 SINGAPORE SG,5.02 -23 OCT,FAVEPAYFavePay - Foodie Express Singapore SG,13.50 -23 OCT,TOASTY DELIGHT CAFÉ SINGAPORE SG,13.20 -24 OCT,GOURMET TREATS S Singapore SG,16.40 -24 OCT,DEPARTMENTAL STORE SINGAPORE SG,10.80 -25 OCT,FAVEPAYFavePay - Sushi Delights Singapore SG,8.55 -25 OCT,TOASTY DELIGHT CAFÉ SINGAPORE SG,2.20 -25 OCT,CHILLED GOODS STORE SINGAPORE SG,5.34 -25 OCT,NET*DELICIOUS EATS @ URBAN V SINGAPORE SG,11.80 -26 OCT,SILVER GYM SINGAPORE SG,210.00 -27 OCT,FOOD BAKERY SINGAPORE SG,3.40 -27 OCT,BUS/MRT 12345678 SINGAPORE SG,13.24 -28 OCT,AWESOME TOAST SINGAPORE SG,3.10 -28 OCT,DELUXE MART SINGAPORE SG,16.45 -28 OCT,E-MART EXPRESS SINGAPORE SG,69.92 -28 OCT,TASTY BITES & CO. Pte. Ltd Singapore SG,21.78 -28 OCT,URBAN REFRESHMENTS SINGAPORE SG,9.80 -29 OCT,CULINARY DELIGHTS S Singapore SG,18.04 -29 OCT,TOASTY CAFE SINGAPORE SG,2.90 -29 OCT,Crave & Co. SINGAPORE SG,127.70 -31 OCT,FAVEPAYFavePay - Don K Singapore SG,13.49 -31 OCT,WWW.PIZZAEXPRESS.SG SINGAPORE SG,18.83 -31 OCT,COLD STORAGE SINGAPORE SG,4.60 -01 NOV,ID:1234567890 CITI SMS CASH REBATE,-10.0 -01 NOV,TEA PURCHASE SEATTLE DE,12.10 -02 NOV,TOASTY CAFE SINGAPORE SG,5.80 -02 NOV,TOASTY CAFE SINGAPORE SG,3.10 -02 NOV,TOASTY CAFE SINGAPORE SG,5.40 -02 NOV,Northern Garden Pub SINGAPORE SG,6.50 -02 NOV,Urban Drive Shop Singapore SG,1.00 -02 NOV,BUS/MRT 1234567 SINGAPORE SG,9.47 -03 NOV,TOASTY CAFE SINGAPORE SG,3.10 -03 NOV,URBAN EATS @ GOLDEN GATE SINGAPORE SG,11.80 -03 NOV,Delicious Delights S Singapore SG,16.40 -03 NOV,Tasty Bites SINGAPORE SG,16.90 -04 NOV,Currency Exchange Fee SGD 12.10,16.39 -04 NOV,Flavors Galore S Singapore SG,0.12 -05 NOV,Online Shopper's Paradise SINGAPORE SG,14.90 -05 NOV,FAVEPAYFavePay - Gourmet Singapore SG,21.74 -06 NOV,VIRTUAL MARKETPLACE SINGAPORE SG,13.50 -06 NOV,Delicious Delights S Singapore SG,22.00 -07 NOV,Quick Mart - CORNER STREET SINGAPORE SG,6.50 -07 NOV,SINGAPORE FOODIE HUB SINGAPORE SG,16.90 -07 NOV,Savory Bites S Singapore SG,37.49 -08 NOV,Currency Exchange SGD Fee 12.10,3.10 -09 NOV,Gourmet Haven S Singapore SG,16.40 -09 NOV,Cyber Shopping Zone SINGAPORE SG,2.90 -09 NOV,CCY CONVERSION FEE SGD 22.00,0.22 -10 NOV,YUMMY EATS EXPRESS SINGAPORE SG,10.40 -10 NOV,HEALTHY HARVEST CAFÉ SINGAPORE SG,9.80 -11 NOV,DELIGHTFUL MORNING BAKES SINGAPORE SG,2.20 -12 NOV,FREEZER FRESH MARKET SINGAPORE SG,6.50 -12 NOV,SWIFT AUTO MART SINGAPORE SG,5.50 -12 NOV,ARTISAN'S GOURMET STOP SINGAPORE SG,62.90 -13 NOV,GREAT TOAST SINGAPORE SG,3.10 -14 NOV,Ice Cream Shop SINGAPORE SG,16.39 -14 NOV,John's Gastronomia Singapore SG,16.90 -14 NOV,GREAT TOAST SINGAPORE SG,3.20 +17 OCT,BALANCE PREVIOUS STATEMENT,-1089.65 +17 OCT,FAST INCOMING PAYMENT,1089.65 +12 OCT,Sandwich Shop @ Goldview SINGAPORE SG,-2.36 +14 OCT,Public Transport 191582785 SINGAPORE SG,-11.8 +14 OCT,Grocery Store-Parkside S SINGAPORE SG,-6.45 +14 OCT,Cafeteria S Singapore SG,-16.4 +15 OCT,Bagel House SINGAPORE SG,-34.24 +15 OCT,Grocery Store-Meadowside S SINGAPORE SG,-14.9 +15 OCT,Great Toast SINGAPORE SG,-6.0 +16 OCT,Tea Shop Amsterdam NL,-4.59 +16 OCT,Great Toast SINGAPORE SG,-2.2 +16 OCT,CAFE DELIGHT - GS SINGAPORE SG,-9.8 +16 OCT,GROCER MARKET-PARKWAY S SINGAPORE SG,-22.3 +17 OCT,COFFEE HOUSE@BMLB(MB) SINGAPORE SG,-7.2 +17 OCT,ITALIAN CUISINE S Singapore SG,-16.9 +17 OCT,PUBLIC TRANSIT 197215138 SINGAPORE SG,-13.09 +18 OCT,SUNSET HOTEL DINER SINGAPORE SG,-61.2 +19 OCT,TOASTY DELIGHT CAFÉ SINGAPORE SG,-3.1 +19 OCT,GOURMET TREATS S Singapore SG,-16.4 +19 OCT,ONLINE SHOPPING MALL SINGAPORE SG,-37.49 +20 OCT,TOASTY DELIGHT CAFÉ SINGAPORE SG,-3.1 +21 OCT,ID:1234567890 CITI SMS CASH REBATE,10.0 +21 OCT,FROZEN FOODS EXPRESS SINGAPORE SG,-12.8 +21 OCT,GOURMET TREATS S Singapore SG,-16.9 +22 OCT,SUSHI SENSE SINGAPORE SG,-46.37 +22 OCT,BURGER KING & GRILL S SINGAPORE SG,-10.0 +22 OCT,BURGER KING & GRILL S SINGAPORE SG,-8.0 +22 OCT,FASHION HOUSE SINGAPORE PTE SINGAPORE SG,-29.8 +22 OCT,PUBLIC TRANSIT 9876543210 SINGAPORE SG,-5.02 +23 OCT,FAVEPAYFavePay - Foodie Express Singapore SG,-13.5 +23 OCT,TOASTY DELIGHT CAFÉ SINGAPORE SG,-13.2 +24 OCT,GOURMET TREATS S Singapore SG,-16.4 +24 OCT,DEPARTMENTAL STORE SINGAPORE SG,-10.8 +25 OCT,FAVEPAYFavePay - Sushi Delights Singapore SG,-8.55 +25 OCT,TOASTY DELIGHT CAFÉ SINGAPORE SG,-2.2 +25 OCT,CHILLED GOODS STORE SINGAPORE SG,-5.34 +25 OCT,NET*DELICIOUS EATS @ URBAN V SINGAPORE SG,-11.8 +26 OCT,SILVER GYM SINGAPORE SG,-210.0 +27 OCT,FOOD BAKERY SINGAPORE SG,-3.4 +27 OCT,BUS/MRT 12345678 SINGAPORE SG,-13.24 +28 OCT,AWESOME TOAST SINGAPORE SG,-3.1 +28 OCT,DELUXE MART SINGAPORE SG,-16.45 +28 OCT,E-MART EXPRESS SINGAPORE SG,-69.92 +28 OCT,TASTY BITES & CO. Pte. Ltd Singapore SG,-21.78 +28 OCT,URBAN REFRESHMENTS SINGAPORE SG,-9.8 +29 OCT,CULINARY DELIGHTS S Singapore SG,-18.04 +29 OCT,TOASTY CAFE SINGAPORE SG,-2.9 +29 OCT,Crave & Co. SINGAPORE SG,-127.7 +31 OCT,FAVEPAYFavePay - Don K Singapore SG,-13.49 +31 OCT,WWW.PIZZAEXPRESS.SG SINGAPORE SG,-18.83 +31 OCT,COLD STORAGE SINGAPORE SG,-4.6 +01 NOV,ID:1234567890 CITI SMS CASH REBATE,10.0 +01 NOV,TEA PURCHASE SEATTLE DE,-12.1 +02 NOV,TOASTY CAFE SINGAPORE SG,-5.8 +02 NOV,TOASTY CAFE SINGAPORE SG,-3.1 +02 NOV,TOASTY CAFE SINGAPORE SG,-5.4 +02 NOV,Northern Garden Pub SINGAPORE SG,-6.5 +02 NOV,Urban Drive Shop Singapore SG,-1.0 +02 NOV,BUS/MRT 1234567 SINGAPORE SG,-9.47 +03 NOV,TOASTY CAFE SINGAPORE SG,-3.1 +03 NOV,URBAN EATS @ GOLDEN GATE SINGAPORE SG,-11.8 +03 NOV,Delicious Delights S Singapore SG,-16.4 +03 NOV,Tasty Bites SINGAPORE SG,-16.9 +04 NOV,Currency Exchange Fee SGD 12.10,-16.39 +04 NOV,Flavors Galore S Singapore SG,-0.12 +05 NOV,Online Shopper's Paradise SINGAPORE SG,-14.9 +05 NOV,FAVEPAYFavePay - Gourmet Singapore SG,-21.74 +06 NOV,VIRTUAL MARKETPLACE SINGAPORE SG,-13.5 +06 NOV,Delicious Delights S Singapore SG,-22.0 +07 NOV,Quick Mart - CORNER STREET SINGAPORE SG,-6.5 +07 NOV,SINGAPORE FOODIE HUB SINGAPORE SG,-16.9 +07 NOV,Savory Bites S Singapore SG,-37.49 +08 NOV,Currency Exchange SGD Fee 12.10,-3.1 +09 NOV,Gourmet Haven S Singapore SG,-16.4 +09 NOV,Cyber Shopping Zone SINGAPORE SG,-2.9 +09 NOV,CCY CONVERSION FEE SGD 22.00,-0.22 +10 NOV,YUMMY EATS EXPRESS SINGAPORE SG,-10.4 +10 NOV,HEALTHY HARVEST CAFÉ SINGAPORE SG,-9.8 +11 NOV,DELIGHTFUL MORNING BAKES SINGAPORE SG,-2.2 +12 NOV,FREEZER FRESH MARKET SINGAPORE SG,-6.5 +12 NOV,SWIFT AUTO MART SINGAPORE SG,-5.5 +12 NOV,ARTISAN'S GOURMET STOP SINGAPORE SG,-62.9 +13 NOV,GREAT TOAST SINGAPORE SG,-3.1 +14 NOV,Ice Cream Shop SINGAPORE SG,-16.39 +14 NOV,John's Gastronomia Singapore SG,-16.9 +14 NOV,GREAT TOAST SINGAPORE SG,-3.2 diff --git a/tests/integration/banks/citibank/transformed.csv b/tests/integration/banks/citibank/transformed.csv index 6a9e98d8..4e9b4c34 100644 --- a/tests/integration/banks/citibank/transformed.csv +++ b/tests/integration/banks/citibank/transformed.csv @@ -1,87 +1,87 @@ transaction_date,description,amount -2022-10-17,BALANCE PREVIOUS STATEMENT,1089.65 -2022-10-17,FAST INCOMING PAYMENT,-1089.65 -2022-10-12,Sandwich Shop @ Goldview SINGAPORE SG,2.36 -2022-10-14,Public Transport 191582785 SINGAPORE SG,11.8 -2022-10-14,Grocery Store-Parkside S SINGAPORE SG,6.45 -2022-10-14,Cafeteria S Singapore SG,16.4 -2022-10-15,Bagel House SINGAPORE SG,34.24 -2022-10-15,Grocery Store-Meadowside S SINGAPORE SG,14.9 -2022-10-15,Great Toast SINGAPORE SG,6.0 -2022-10-16,Tea Shop Amsterdam NL,4.59 -2022-10-16,Great Toast SINGAPORE SG,2.2 -2022-10-16,CAFE DELIGHT - GS SINGAPORE SG,9.8 -2022-10-16,GROCER MARKET-PARKWAY S SINGAPORE SG,22.3 -2022-10-17,COFFEE HOUSE@BMLB(MB) SINGAPORE SG,7.2 -2022-10-17,ITALIAN CUISINE S Singapore SG,16.9 -2022-10-17,PUBLIC TRANSIT 197215138 SINGAPORE SG,13.09 -2022-10-18,SUNSET HOTEL DINER SINGAPORE SG,61.2 -2022-10-19,TOASTY DELIGHT CAFÉ SINGAPORE SG,3.1 -2022-10-19,GOURMET TREATS S Singapore SG,16.4 -2022-10-19,ONLINE SHOPPING MALL SINGAPORE SG,37.49 -2022-10-20,TOASTY DELIGHT CAFÉ SINGAPORE SG,3.1 -2022-10-21,ID:1234567890 CITI SMS CASH REBATE,-10.0 -2022-10-21,FROZEN FOODS EXPRESS SINGAPORE SG,12.8 -2022-10-21,GOURMET TREATS S Singapore SG,16.9 -2022-10-22,SUSHI SENSE SINGAPORE SG,46.37 -2022-10-22,BURGER KING & GRILL S SINGAPORE SG,10.0 -2022-10-22,BURGER KING & GRILL S SINGAPORE SG,8.0 -2022-10-22,FASHION HOUSE SINGAPORE PTE SINGAPORE SG,29.8 -2022-10-22,PUBLIC TRANSIT 9876543210 SINGAPORE SG,5.02 -2022-10-23,FAVEPAYFavePay - Foodie Express Singapore SG,13.5 -2022-10-23,TOASTY DELIGHT CAFÉ SINGAPORE SG,13.2 -2022-10-24,GOURMET TREATS S Singapore SG,16.4 -2022-10-24,DEPARTMENTAL STORE SINGAPORE SG,10.8 -2022-10-25,FAVEPAYFavePay - Sushi Delights Singapore SG,8.55 -2022-10-25,TOASTY DELIGHT CAFÉ SINGAPORE SG,2.2 -2022-10-25,CHILLED GOODS STORE SINGAPORE SG,5.34 -2022-10-25,NET*DELICIOUS EATS @ URBAN V SINGAPORE SG,11.8 -2022-10-26,SILVER GYM SINGAPORE SG,210.0 -2022-10-27,FOOD BAKERY SINGAPORE SG,3.4 -2022-10-27,BUS/MRT 12345678 SINGAPORE SG,13.24 -2022-10-28,AWESOME TOAST SINGAPORE SG,3.1 -2022-10-28,DELUXE MART SINGAPORE SG,16.45 -2022-10-28,E-MART EXPRESS SINGAPORE SG,69.92 -2022-10-28,TASTY BITES & CO. Pte. Ltd Singapore SG,21.78 -2022-10-28,URBAN REFRESHMENTS SINGAPORE SG,9.8 -2022-10-29,CULINARY DELIGHTS S Singapore SG,18.04 -2022-10-29,TOASTY CAFE SINGAPORE SG,2.9 -2022-10-29,Crave & Co. SINGAPORE SG,127.7 -2022-10-31,FAVEPAYFavePay - Don K Singapore SG,13.49 -2022-10-31,WWW.PIZZAEXPRESS.SG SINGAPORE SG,18.83 -2022-10-31,COLD STORAGE SINGAPORE SG,4.6 -2022-11-01,ID:1234567890 CITI SMS CASH REBATE,-10.0 -2022-11-01,TEA PURCHASE SEATTLE DE,12.1 -2022-11-02,TOASTY CAFE SINGAPORE SG,5.8 -2022-11-02,TOASTY CAFE SINGAPORE SG,3.1 -2022-11-02,TOASTY CAFE SINGAPORE SG,5.4 -2022-11-02,Northern Garden Pub SINGAPORE SG,6.5 -2022-11-02,Urban Drive Shop Singapore SG,1.0 -2022-11-02,BUS/MRT 1234567 SINGAPORE SG,9.47 -2022-11-03,TOASTY CAFE SINGAPORE SG,3.1 -2022-11-03,URBAN EATS @ GOLDEN GATE SINGAPORE SG,11.8 -2022-11-03,Delicious Delights S Singapore SG,16.4 -2022-11-03,Tasty Bites SINGAPORE SG,16.9 -2022-11-04,Currency Exchange Fee SGD 12.10,16.39 -2022-11-04,Flavors Galore S Singapore SG,0.12 -2022-11-05,Online Shopper's Paradise SINGAPORE SG,14.9 -2022-11-05,FAVEPAYFavePay - Gourmet Singapore SG,21.74 -2022-11-06,VIRTUAL MARKETPLACE SINGAPORE SG,13.5 -2022-11-06,Delicious Delights S Singapore SG,22.0 -2022-11-07,Quick Mart - CORNER STREET SINGAPORE SG,6.5 -2022-11-07,SINGAPORE FOODIE HUB SINGAPORE SG,16.9 -2022-11-07,Savory Bites S Singapore SG,37.49 -2022-11-08,Currency Exchange SGD Fee 12.10,3.1 -2022-11-09,Gourmet Haven S Singapore SG,16.4 -2022-11-09,Cyber Shopping Zone SINGAPORE SG,2.9 -2022-11-09,CCY CONVERSION FEE SGD 22.00,0.22 -2022-11-10,YUMMY EATS EXPRESS SINGAPORE SG,10.4 -2022-11-10,HEALTHY HARVEST CAFÉ SINGAPORE SG,9.8 -2022-11-11,DELIGHTFUL MORNING BAKES SINGAPORE SG,2.2 -2022-11-12,FREEZER FRESH MARKET SINGAPORE SG,6.5 -2022-11-12,SWIFT AUTO MART SINGAPORE SG,5.5 -2022-11-12,ARTISAN'S GOURMET STOP SINGAPORE SG,62.9 -2022-11-13,GREAT TOAST SINGAPORE SG,3.1 -2022-11-14,Ice Cream Shop SINGAPORE SG,16.39 -2022-11-14,John's Gastronomia Singapore SG,16.9 -2022-11-14,GREAT TOAST SINGAPORE SG,3.2 +2022-10-17,BALANCE PREVIOUS STATEMENT,-1089.65 +2022-10-17,FAST INCOMING PAYMENT,1089.65 +2022-10-12,Sandwich Shop @ Goldview SINGAPORE SG,-2.36 +2022-10-14,Public Transport 191582785 SINGAPORE SG,-11.8 +2022-10-14,Grocery Store-Parkside S SINGAPORE SG,-6.45 +2022-10-14,Cafeteria S Singapore SG,-16.4 +2022-10-15,Bagel House SINGAPORE SG,-34.24 +2022-10-15,Grocery Store-Meadowside S SINGAPORE SG,-14.9 +2022-10-15,Great Toast SINGAPORE SG,-6.0 +2022-10-16,Tea Shop Amsterdam NL,-4.59 +2022-10-16,Great Toast SINGAPORE SG,-2.2 +2022-10-16,CAFE DELIGHT - GS SINGAPORE SG,-9.8 +2022-10-16,GROCER MARKET-PARKWAY S SINGAPORE SG,-22.3 +2022-10-17,COFFEE HOUSE@BMLB(MB) SINGAPORE SG,-7.2 +2022-10-17,ITALIAN CUISINE S Singapore SG,-16.9 +2022-10-17,PUBLIC TRANSIT 197215138 SINGAPORE SG,-13.09 +2022-10-18,SUNSET HOTEL DINER SINGAPORE SG,-61.2 +2022-10-19,TOASTY DELIGHT CAFÉ SINGAPORE SG,-3.1 +2022-10-19,GOURMET TREATS S Singapore SG,-16.4 +2022-10-19,ONLINE SHOPPING MALL SINGAPORE SG,-37.49 +2022-10-20,TOASTY DELIGHT CAFÉ SINGAPORE SG,-3.1 +2022-10-21,ID:1234567890 CITI SMS CASH REBATE,10.0 +2022-10-21,FROZEN FOODS EXPRESS SINGAPORE SG,-12.8 +2022-10-21,GOURMET TREATS S Singapore SG,-16.9 +2022-10-22,SUSHI SENSE SINGAPORE SG,-46.37 +2022-10-22,BURGER KING & GRILL S SINGAPORE SG,-10.0 +2022-10-22,BURGER KING & GRILL S SINGAPORE SG,-8.0 +2022-10-22,FASHION HOUSE SINGAPORE PTE SINGAPORE SG,-29.8 +2022-10-22,PUBLIC TRANSIT 9876543210 SINGAPORE SG,-5.02 +2022-10-23,FAVEPAYFavePay - Foodie Express Singapore SG,-13.5 +2022-10-23,TOASTY DELIGHT CAFÉ SINGAPORE SG,-13.2 +2022-10-24,GOURMET TREATS S Singapore SG,-16.4 +2022-10-24,DEPARTMENTAL STORE SINGAPORE SG,-10.8 +2022-10-25,FAVEPAYFavePay - Sushi Delights Singapore SG,-8.55 +2022-10-25,TOASTY DELIGHT CAFÉ SINGAPORE SG,-2.2 +2022-10-25,CHILLED GOODS STORE SINGAPORE SG,-5.34 +2022-10-25,NET*DELICIOUS EATS @ URBAN V SINGAPORE SG,-11.8 +2022-10-26,SILVER GYM SINGAPORE SG,-210.0 +2022-10-27,FOOD BAKERY SINGAPORE SG,-3.4 +2022-10-27,BUS/MRT 12345678 SINGAPORE SG,-13.24 +2022-10-28,AWESOME TOAST SINGAPORE SG,-3.1 +2022-10-28,DELUXE MART SINGAPORE SG,-16.45 +2022-10-28,E-MART EXPRESS SINGAPORE SG,-69.92 +2022-10-28,TASTY BITES & CO. Pte. Ltd Singapore SG,-21.78 +2022-10-28,URBAN REFRESHMENTS SINGAPORE SG,-9.8 +2022-10-29,CULINARY DELIGHTS S Singapore SG,-18.04 +2022-10-29,TOASTY CAFE SINGAPORE SG,-2.9 +2022-10-29,Crave & Co. SINGAPORE SG,-127.7 +2022-10-31,FAVEPAYFavePay - Don K Singapore SG,-13.49 +2022-10-31,WWW.PIZZAEXPRESS.SG SINGAPORE SG,-18.83 +2022-10-31,COLD STORAGE SINGAPORE SG,-4.6 +2022-11-01,ID:1234567890 CITI SMS CASH REBATE,10.0 +2022-11-01,TEA PURCHASE SEATTLE DE,-12.1 +2022-11-02,TOASTY CAFE SINGAPORE SG,-5.8 +2022-11-02,TOASTY CAFE SINGAPORE SG,-3.1 +2022-11-02,TOASTY CAFE SINGAPORE SG,-5.4 +2022-11-02,Northern Garden Pub SINGAPORE SG,-6.5 +2022-11-02,Urban Drive Shop Singapore SG,-1.0 +2022-11-02,BUS/MRT 1234567 SINGAPORE SG,-9.47 +2022-11-03,TOASTY CAFE SINGAPORE SG,-3.1 +2022-11-03,URBAN EATS @ GOLDEN GATE SINGAPORE SG,-11.8 +2022-11-03,Delicious Delights S Singapore SG,-16.4 +2022-11-03,Tasty Bites SINGAPORE SG,-16.9 +2022-11-04,Currency Exchange Fee SGD 12.10,-16.39 +2022-11-04,Flavors Galore S Singapore SG,-0.12 +2022-11-05,Online Shopper's Paradise SINGAPORE SG,-14.9 +2022-11-05,FAVEPAYFavePay - Gourmet Singapore SG,-21.74 +2022-11-06,VIRTUAL MARKETPLACE SINGAPORE SG,-13.5 +2022-11-06,Delicious Delights S Singapore SG,-22.0 +2022-11-07,Quick Mart - CORNER STREET SINGAPORE SG,-6.5 +2022-11-07,SINGAPORE FOODIE HUB SINGAPORE SG,-16.9 +2022-11-07,Savory Bites S Singapore SG,-37.49 +2022-11-08,Currency Exchange SGD Fee 12.10,-3.1 +2022-11-09,Gourmet Haven S Singapore SG,-16.4 +2022-11-09,Cyber Shopping Zone SINGAPORE SG,-2.9 +2022-11-09,CCY CONVERSION FEE SGD 22.00,-0.22 +2022-11-10,YUMMY EATS EXPRESS SINGAPORE SG,-10.4 +2022-11-10,HEALTHY HARVEST CAFÉ SINGAPORE SG,-9.8 +2022-11-11,DELIGHTFUL MORNING BAKES SINGAPORE SG,-2.2 +2022-11-12,FREEZER FRESH MARKET SINGAPORE SG,-6.5 +2022-11-12,SWIFT AUTO MART SINGAPORE SG,-5.5 +2022-11-12,ARTISAN'S GOURMET STOP SINGAPORE SG,-62.9 +2022-11-13,GREAT TOAST SINGAPORE SG,-3.1 +2022-11-14,Ice Cream Shop SINGAPORE SG,-16.39 +2022-11-14,John's Gastronomia Singapore SG,-16.9 +2022-11-14,GREAT TOAST SINGAPORE SG,-3.2 diff --git a/tests/integration/banks/dbs/raw.csv b/tests/integration/banks/dbs/raw.csv index 602404b6..5fe5adcc 100644 --- a/tests/integration/banks/dbs/raw.csv +++ b/tests/integration/banks/dbs/raw.csv @@ -1,74 +1,74 @@ transaction_date,description,amount -05 OCT,PREVIOUS BALANCE,6492.54 -05 OCT,PAYMENT - DBS INTERNET/WIRELESS,-6492.54 -13 SEP,GALACTIC GOODS,14.44 -14 SEP,ZETA DELIGHTS,22.55 -14 SEP,COSMIC CUISINE,22.09 -15 SEP,ESPRESSO UNIVERSE,52.87 -16 SEP,FUSION JUNCTION,30.1 -16 SEP,NEBULA MARKETPLACE,54.43 -16 SEP,MYSTIC AMAZONIA,19.15 -16 SEP,MYSTIC DELICACIES,22.0 -17 SEP,PASTA GALAXY,97.42 -17 SEP,COSMIC CONFECTIONS,10000.0 -18 SEP,ASTRAL BAKEHOUSE,23.29 -18 SEP,NOVA GROCERY,30.21 -19 SEP,ASTRAL TREATS,152.91 -19 SEP,ORBITAL DINER,7.86 -19 SEP,COSMIC COFFEE,8.4 -19 SEP,INTERSTELLAR EATS,6.55 -19 SEP,GALAXY GOURMET,107.69 -19 SEP,ZENITH SNACKS,12.9 -19 SEP,CELESTIAL CAFÉ,15.9 -20 SEP,SOLAR DELIGHTS,32.08 -20 SEP,AURA MART,46.76 -21 SEP,GALAXY TREATS,8.7 -21 SEP,COSMIC FEAST,21.49 -22 SEP,STAR BISTRO,13.65 -22 SEP,ECLIPSE EATS,46.2 -22 SEP,NEBULA NOOK,17.65 -23 SEP,NOVA DELI,57.38 -23 SEP,ZENITH GROCER,42.91 -24 SEP,ASTRA CAFÉ,111.95 -25 SEP,METEOR MUNCH,15.44 -25 SEP,ORBITAL BITE,0.12 -25 SEP,LUNAR GOURMET,32.68 -26 SEP,CELESTIAL CUISINE,8.0 -26 SEP,VENUSIAN SNACKS,11.4 -27 SEP,COSMO DELIGHTS,409.32 -27 SEP,COMET CAFETERIA,44.5 -27 SEP,STARLIGHT DINER,129.65 -27 SEP,GALACTIC GRUB,25.08 -28 SEP,SATELLITE SUPPLY,10.0 -28 SEP,ASTRAL APPETITE,6.8 -28 SEP,SPACEWAY MARKET,8.7 -29 SEP,SOLAR SUSTENANCE,5.35 -29 SEP,METEORITE MEALS,22.0 -02 OCT,ZODIAC ZESTS,40.27 -02 OCT,INTERSTELLAR EATS,48.0 -02 OCT,CONSTELLATION CAFÉ,27.0 -03 OCT,COSMIC CULINARY,17.3 -03 OCT,GALAXY GUSTO,75.0 -03 OCT,AURORA BITES,14.0 -03 OCT,INFINITY INGREDIENTS,249.9 -04 OCT,NOVA NOURISH,25.0 -04 OCT,SOLAR SNACKS,129.48 -05 OCT,MOONLIT MEALS,71.06 -05 OCT,COMET CUISINE,6.3 -05 OCT,METEOR MUNCHIES,14.45 -05 OCT,STARLIGHT BITES,13.82 -06 OCT,CELESTIAL KITCHEN,11.95 -07 OCT,ZENITH ZESTS,21.38 -08 OCT,ASTRAL APPETIZERS,57.83 -08 OCT,GALACTIC GROCERY,56.2 -09 OCT,NEBULA NOURISH,28.39 -09 OCT,ASTRO SNACKS,23.07 -10 OCT,COSMIC CAFTERIA,15.44 -10 OCT,STELLAR SUPPLY,26.61 -10 OCT,MOONBEAM MUNCH,256.41 -10 OCT,ASTRAL GOURMET,63.75 -11 OCT,METEORITE MEALS,17.58 -12 OCT,GALAXY GUSTATION,1400.0 -12 OCT,ZODIAC ZESTS,55.09 -13 OCT,COMET CUISINE,97.95 -13 OCT,NEBULA NOURISH,2277.37 +05 OCT,PREVIOUS BALANCE,-6492.54 +05 OCT,PAYMENT - DBS INTERNET/WIRELESS,6492.54 +13 SEP,GALACTIC GOODS,-14.44 +14 SEP,ZETA DELIGHTS,-22.55 +14 SEP,COSMIC CUISINE,-22.09 +15 SEP,ESPRESSO UNIVERSE,-52.87 +16 SEP,FUSION JUNCTION,-30.1 +16 SEP,NEBULA MARKETPLACE,-54.43 +16 SEP,MYSTIC AMAZONIA,-19.15 +16 SEP,MYSTIC DELICACIES,-22.0 +17 SEP,PASTA GALAXY,-97.42 +17 SEP,COSMIC CONFECTIONS,-10000.0 +18 SEP,ASTRAL BAKEHOUSE,-23.29 +18 SEP,NOVA GROCERY,-30.21 +19 SEP,ASTRAL TREATS,-152.91 +19 SEP,ORBITAL DINER,-7.86 +19 SEP,COSMIC COFFEE,-8.4 +19 SEP,INTERSTELLAR EATS,-6.55 +19 SEP,GALAXY GOURMET,-107.69 +19 SEP,ZENITH SNACKS,-12.9 +19 SEP,CELESTIAL CAFÉ,-15.9 +20 SEP,SOLAR DELIGHTS,-32.08 +20 SEP,AURA MART,-46.76 +21 SEP,GALAXY TREATS,-8.7 +21 SEP,COSMIC FEAST,-21.49 +22 SEP,STAR BISTRO,-13.65 +22 SEP,ECLIPSE EATS,-46.2 +22 SEP,NEBULA NOOK,-17.65 +23 SEP,NOVA DELI,-57.38 +23 SEP,ZENITH GROCER,-42.91 +24 SEP,ASTRA CAFÉ,-111.95 +25 SEP,METEOR MUNCH,-15.44 +25 SEP,ORBITAL BITE,-0.12 +25 SEP,LUNAR GOURMET,-32.68 +26 SEP,CELESTIAL CUISINE,-8.0 +26 SEP,VENUSIAN SNACKS,-11.4 +27 SEP,COSMO DELIGHTS,-409.32 +27 SEP,COMET CAFETERIA,-44.5 +27 SEP,STARLIGHT DINER,-129.65 +27 SEP,GALACTIC GRUB,-25.08 +28 SEP,SATELLITE SUPPLY,-10.0 +28 SEP,ASTRAL APPETITE,-6.8 +28 SEP,SPACEWAY MARKET,-8.7 +29 SEP,SOLAR SUSTENANCE,-5.35 +29 SEP,METEORITE MEALS,-22.0 +02 OCT,ZODIAC ZESTS,-40.27 +02 OCT,INTERSTELLAR EATS,-48.0 +02 OCT,CONSTELLATION CAFÉ,-27.0 +03 OCT,COSMIC CULINARY,-17.3 +03 OCT,GALAXY GUSTO,-75.0 +03 OCT,AURORA BITES,-14.0 +03 OCT,INFINITY INGREDIENTS,-249.9 +04 OCT,NOVA NOURISH,-25.0 +04 OCT,SOLAR SNACKS,-129.48 +05 OCT,MOONLIT MEALS,-71.06 +05 OCT,COMET CUISINE,-6.3 +05 OCT,METEOR MUNCHIES,-14.45 +05 OCT,STARLIGHT BITES,-13.82 +06 OCT,CELESTIAL KITCHEN,-11.95 +07 OCT,ZENITH ZESTS,-21.38 +08 OCT,ASTRAL APPETIZERS,-57.83 +08 OCT,GALACTIC GROCERY,-56.2 +09 OCT,NEBULA NOURISH,-28.39 +09 OCT,ASTRO SNACKS,-23.07 +10 OCT,COSMIC CAFTERIA,-15.44 +10 OCT,STELLAR SUPPLY,-26.61 +10 OCT,MOONBEAM MUNCH,-256.41 +10 OCT,ASTRAL GOURMET,-63.75 +11 OCT,METEORITE MEALS,-17.58 +12 OCT,GALAXY GUSTATION,-1400.0 +12 OCT,ZODIAC ZESTS,-55.09 +13 OCT,COMET CUISINE,-97.95 +13 OCT,NEBULA NOURISH,-2277.37 diff --git a/tests/integration/banks/dbs/transformed.csv b/tests/integration/banks/dbs/transformed.csv index cf2c42c8..0004c3ab 100644 --- a/tests/integration/banks/dbs/transformed.csv +++ b/tests/integration/banks/dbs/transformed.csv @@ -1,74 +1,74 @@ transaction_date,description,amount -2023-10-05,PREVIOUS BALANCE,6492.54 -2023-10-05,PAYMENT - DBS INTERNET/WIRELESS,-6492.54 -2023-09-13,GALACTIC GOODS,14.44 -2023-09-14,ZETA DELIGHTS,22.55 -2023-09-14,COSMIC CUISINE,22.09 -2023-09-15,ESPRESSO UNIVERSE,52.87 -2023-09-16,FUSION JUNCTION,30.1 -2023-09-16,NEBULA MARKETPLACE,54.43 -2023-09-16,MYSTIC AMAZONIA,19.15 -2023-09-16,MYSTIC DELICACIES,22.0 -2023-09-17,PASTA GALAXY,97.42 -2023-09-17,COSMIC CONFECTIONS,10000.0 -2023-09-18,ASTRAL BAKEHOUSE,23.29 -2023-09-18,NOVA GROCERY,30.21 -2023-09-19,ASTRAL TREATS,152.91 -2023-09-19,ORBITAL DINER,7.86 -2023-09-19,COSMIC COFFEE,8.4 -2023-09-19,INTERSTELLAR EATS,6.55 -2023-09-19,GALAXY GOURMET,107.69 -2023-09-19,ZENITH SNACKS,12.9 -2023-09-19,CELESTIAL CAFÉ,15.9 -2023-09-20,SOLAR DELIGHTS,32.08 -2023-09-20,AURA MART,46.76 -2023-09-21,GALAXY TREATS,8.7 -2023-09-21,COSMIC FEAST,21.49 -2023-09-22,STAR BISTRO,13.65 -2023-09-22,ECLIPSE EATS,46.2 -2023-09-22,NEBULA NOOK,17.65 -2023-09-23,NOVA DELI,57.38 -2023-09-23,ZENITH GROCER,42.91 -2023-09-24,ASTRA CAFÉ,111.95 -2023-09-25,METEOR MUNCH,15.44 -2023-09-25,ORBITAL BITE,0.12 -2023-09-25,LUNAR GOURMET,32.68 -2023-09-26,CELESTIAL CUISINE,8.0 -2023-09-26,VENUSIAN SNACKS,11.4 -2023-09-27,COSMO DELIGHTS,409.32 -2023-09-27,COMET CAFETERIA,44.5 -2023-09-27,STARLIGHT DINER,129.65 -2023-09-27,GALACTIC GRUB,25.08 -2023-09-28,SATELLITE SUPPLY,10.0 -2023-09-28,ASTRAL APPETITE,6.8 -2023-09-28,SPACEWAY MARKET,8.7 -2023-09-29,SOLAR SUSTENANCE,5.35 -2023-09-29,METEORITE MEALS,22.0 -2023-10-02,ZODIAC ZESTS,40.27 -2023-10-02,INTERSTELLAR EATS,48.0 -2023-10-02,CONSTELLATION CAFÉ,27.0 -2023-10-03,COSMIC CULINARY,17.3 -2023-10-03,GALAXY GUSTO,75.0 -2023-10-03,AURORA BITES,14.0 -2023-10-03,INFINITY INGREDIENTS,249.9 -2023-10-04,NOVA NOURISH,25.0 -2023-10-04,SOLAR SNACKS,129.48 -2023-10-05,MOONLIT MEALS,71.06 -2023-10-05,COMET CUISINE,6.3 -2023-10-05,METEOR MUNCHIES,14.45 -2023-10-05,STARLIGHT BITES,13.82 -2023-10-06,CELESTIAL KITCHEN,11.95 -2023-10-07,ZENITH ZESTS,21.38 -2023-10-08,ASTRAL APPETIZERS,57.83 -2023-10-08,GALACTIC GROCERY,56.2 -2023-10-09,NEBULA NOURISH,28.39 -2023-10-09,ASTRO SNACKS,23.07 -2023-10-10,COSMIC CAFTERIA,15.44 -2023-10-10,STELLAR SUPPLY,26.61 -2023-10-10,MOONBEAM MUNCH,256.41 -2023-10-10,ASTRAL GOURMET,63.75 -2023-10-11,METEORITE MEALS,17.58 -2023-10-12,GALAXY GUSTATION,1400.0 -2023-10-12,ZODIAC ZESTS,55.09 -2023-10-13,COMET CUISINE,97.95 -2023-10-13,NEBULA NOURISH,2277.37 +2023-10-05,PREVIOUS BALANCE,-6492.54 +2023-10-05,PAYMENT - DBS INTERNET/WIRELESS,6492.54 +2023-09-13,GALACTIC GOODS,-14.44 +2023-09-14,ZETA DELIGHTS,-22.55 +2023-09-14,COSMIC CUISINE,-22.09 +2023-09-15,ESPRESSO UNIVERSE,-52.87 +2023-09-16,FUSION JUNCTION,-30.1 +2023-09-16,NEBULA MARKETPLACE,-54.43 +2023-09-16,MYSTIC AMAZONIA,-19.15 +2023-09-16,MYSTIC DELICACIES,-22.0 +2023-09-17,PASTA GALAXY,-97.42 +2023-09-17,COSMIC CONFECTIONS,-10000.0 +2023-09-18,ASTRAL BAKEHOUSE,-23.29 +2023-09-18,NOVA GROCERY,-30.21 +2023-09-19,ASTRAL TREATS,-152.91 +2023-09-19,ORBITAL DINER,-7.86 +2023-09-19,COSMIC COFFEE,-8.4 +2023-09-19,INTERSTELLAR EATS,-6.55 +2023-09-19,GALAXY GOURMET,-107.69 +2023-09-19,ZENITH SNACKS,-12.9 +2023-09-19,CELESTIAL CAFÉ,-15.9 +2023-09-20,SOLAR DELIGHTS,-32.08 +2023-09-20,AURA MART,-46.76 +2023-09-21,GALAXY TREATS,-8.7 +2023-09-21,COSMIC FEAST,-21.49 +2023-09-22,STAR BISTRO,-13.65 +2023-09-22,ECLIPSE EATS,-46.2 +2023-09-22,NEBULA NOOK,-17.65 +2023-09-23,NOVA DELI,-57.38 +2023-09-23,ZENITH GROCER,-42.91 +2023-09-24,ASTRA CAFÉ,-111.95 +2023-09-25,METEOR MUNCH,-15.44 +2023-09-25,ORBITAL BITE,-0.12 +2023-09-25,LUNAR GOURMET,-32.68 +2023-09-26,CELESTIAL CUISINE,-8.0 +2023-09-26,VENUSIAN SNACKS,-11.4 +2023-09-27,COSMO DELIGHTS,-409.32 +2023-09-27,COMET CAFETERIA,-44.5 +2023-09-27,STARLIGHT DINER,-129.65 +2023-09-27,GALACTIC GRUB,-25.08 +2023-09-28,SATELLITE SUPPLY,-10.0 +2023-09-28,ASTRAL APPETITE,-6.8 +2023-09-28,SPACEWAY MARKET,-8.7 +2023-09-29,SOLAR SUSTENANCE,-5.35 +2023-09-29,METEORITE MEALS,-22.0 +2023-10-02,ZODIAC ZESTS,-40.27 +2023-10-02,INTERSTELLAR EATS,-48.0 +2023-10-02,CONSTELLATION CAFÉ,-27.0 +2023-10-03,COSMIC CULINARY,-17.3 +2023-10-03,GALAXY GUSTO,-75.0 +2023-10-03,AURORA BITES,-14.0 +2023-10-03,INFINITY INGREDIENTS,-249.9 +2023-10-04,NOVA NOURISH,-25.0 +2023-10-04,SOLAR SNACKS,-129.48 +2023-10-05,MOONLIT MEALS,-71.06 +2023-10-05,COMET CUISINE,-6.3 +2023-10-05,METEOR MUNCHIES,-14.45 +2023-10-05,STARLIGHT BITES,-13.82 +2023-10-06,CELESTIAL KITCHEN,-11.95 +2023-10-07,ZENITH ZESTS,-21.38 +2023-10-08,ASTRAL APPETIZERS,-57.83 +2023-10-08,GALACTIC GROCERY,-56.2 +2023-10-09,NEBULA NOURISH,-28.39 +2023-10-09,ASTRO SNACKS,-23.07 +2023-10-10,COSMIC CAFTERIA,-15.44 +2023-10-10,STELLAR SUPPLY,-26.61 +2023-10-10,MOONBEAM MUNCH,-256.41 +2023-10-10,ASTRAL GOURMET,-63.75 +2023-10-11,METEORITE MEALS,-17.58 +2023-10-12,GALAXY GUSTATION,-1400.0 +2023-10-12,ZODIAC ZESTS,-55.09 +2023-10-13,COMET CUISINE,-97.95 +2023-10-13,NEBULA NOURISH,-2277.37 diff --git a/tests/integration/banks/example/raw.csv b/tests/integration/banks/example/raw.csv index cbe3591b..3ff3e24f 100644 --- a/tests/integration/banks/example/raw.csv +++ b/tests/integration/banks/example/raw.csv @@ -1,54 +1,54 @@ transaction_date,description,amount -02/07,LAST MONTH'S BALANCE,412.16 -02/07,PAYMENT BY INTERNET,-412.16 -03/07,DELIGHTFUL BREAKFAST SINGAPORE SG,4.20 -06/07,URBAN TRANSIT CO. SINGAPORE SG,1.38 -07/07,MORNING BITES CAFE SINGAPORE SG,4.20 -13/07,SUNRISE TOAST HAVEN SINGAPORE SG,3.20 -15/07,ARCTIC MARKET SINGAPORE SG,7.00 -16/07,SPEEDY DRIVE SHOP SINGAPORE SG,11.90 -16/07,TRAVELEATS EXPRESS SINGAPORE SG,1.00 -17/07,FROSTED PANTRY SINGAPORE SG,2.51 -18/07,COMMUTE & GO MART SINGAPORE SG,9.90 -18/07,CULINARY CONNECT SINGAPORE SG,6.95 -18/07,NATURE'S OVEN SINGAPORE SG,1.29 -18/07,CHILLED URBAN MART SINGAPORE SG,2.64 -19/07,GLOBAL FLAVORS SINGAPORE SG,5.50 -19/07,FITLIFE ACCESS SINGAPORE SG,17.40 -20/07,MORNING BITE CAFE SINGAPORE SG,8.30 -20/07,FOODIE EXPRESS SINGAPORE 239 SG,36.25 -20/07,GASTRONOMIC OASIS SINGAPORE SG,2.28 -21/07,TRANQUIL TRANSIT SINGAPORE SG,11.90 -21/07,URBAN HARVEST SINGAPORE SG,7.30 -21/07,ENCHANTED CAFE SINGAPORE SG,11.90 -22/07,FROZEN WONDERS SINGAPORE SG,6.10 -22/07,DRIVE-THRU DELIGHTS SINGAPORE SG,238.79 -22/07,FLAVORFUL MARKETPLAC SINGAPORE SG,2.71 -23/07,GOURMET PANTRY SINGAPORE SG,8.50 -23/07,TRAVELER'S PROVISION SINGAPORE SG,59.00 -23/07,EPICUREAN CONNECT SINGAPORE SG,3.20 -23/07,NATURAL BAZAAR SINGAPORE SG,12.90 -24/07,WHOLESOME LIFE SINGAPORE SG,27.75 -24/07,SAVORY MORNING SINGAPORE SG,2.90 -25/07,METRO TRANSIT SINGAPORE SG,17.16 -25/07,SUNNY CAFE SINGAPORE SG,17.40 -25/07,GOLDEN TOAST SINGAPORE SG,13.45 -25/07,-1234 SNOWY MART SINGAPORE SG,1.45 -25/07,DRIVE EXPRESS SINGAPORE SG,3.43 -26/07,GOURMET SHOP SINGAPORE SG,7.30 -26/07,URBAN EATS SINGAPORE SG,11.90 -26/07,FOOD HUB SINGAPORE SG,6.50 -26/07,FRESH FINDS SINGAPORE SG,2.44 -26/07,COZY CAFE SINGAPORE SG,1.29 -27/07,PANTRY PICKS SINGAPORE SG,17.90 -27/07,TRAVEL DELI SINGAPORE SG,3.70 -28/07,GLOBAL GRUB SINGAPORE SG,12.00 -28/07,FITNESS PASS SINGAPORE SG,4.20 -28/07,NATURE FARE SINGAPORE SG,3.04 -29/07,FAST FEAST SINGAPORE SG,15.60 -30/07,QUICK MART SINGAPORE SG,13.52 -30/07,CULINARY WAY SINGAPORE SG,8.95 -30/07,COLD STORAGE SINGAPORE SG,4.20 -31/07,BUS RIDE SINGAPORE SG,11.90 -31/07,EATERY STOP SINGAPORE SG,7.30 -18/07,CASH REBATE,-1.38 +02/07,LAST MONTH'S BALANCE,-412.16 +02/07,PAYMENT BY INTERNET,412.16 +03/07,DELIGHTFUL BREAKFAST SINGAPORE SG,-4.2 +06/07,URBAN TRANSIT CO. SINGAPORE SG,-1.38 +07/07,MORNING BITES CAFE SINGAPORE SG,-4.2 +13/07,SUNRISE TOAST HAVEN SINGAPORE SG,-3.2 +15/07,ARCTIC MARKET SINGAPORE SG,-7.0 +16/07,SPEEDY DRIVE SHOP SINGAPORE SG,-11.9 +16/07,TRAVELEATS EXPRESS SINGAPORE SG,-1.0 +17/07,FROSTED PANTRY SINGAPORE SG,-2.51 +18/07,COMMUTE & GO MART SINGAPORE SG,-9.9 +18/07,CULINARY CONNECT SINGAPORE SG,-6.95 +18/07,NATURE'S OVEN SINGAPORE SG,-1.29 +18/07,CHILLED URBAN MART SINGAPORE SG,-2.64 +19/07,GLOBAL FLAVORS SINGAPORE SG,-5.5 +19/07,FITLIFE ACCESS SINGAPORE SG,-17.4 +20/07,MORNING BITE CAFE SINGAPORE SG,-8.3 +20/07,FOODIE EXPRESS SINGAPORE 239 SG,-36.25 +20/07,GASTRONOMIC OASIS SINGAPORE SG,-2.28 +21/07,TRANQUIL TRANSIT SINGAPORE SG,-11.9 +21/07,URBAN HARVEST SINGAPORE SG,-7.3 +21/07,ENCHANTED CAFE SINGAPORE SG,-11.9 +22/07,FROZEN WONDERS SINGAPORE SG,-6.1 +22/07,DRIVE-THRU DELIGHTS SINGAPORE SG,-238.79 +22/07,FLAVORFUL MARKETPLAC SINGAPORE SG,-2.71 +23/07,GOURMET PANTRY SINGAPORE SG,-8.5 +23/07,TRAVELER'S PROVISION SINGAPORE SG,-59.0 +23/07,EPICUREAN CONNECT SINGAPORE SG,-3.2 +23/07,NATURAL BAZAAR SINGAPORE SG,-12.9 +24/07,WHOLESOME LIFE SINGAPORE SG,-27.75 +24/07,SAVORY MORNING SINGAPORE SG,-2.9 +25/07,METRO TRANSIT SINGAPORE SG,-17.16 +25/07,SUNNY CAFE SINGAPORE SG,-17.4 +25/07,GOLDEN TOAST SINGAPORE SG,-13.45 +25/07,-1234 SNOWY MART SINGAPORE SG,-1.45 +25/07,DRIVE EXPRESS SINGAPORE SG,-3.43 +26/07,GOURMET SHOP SINGAPORE SG,-7.3 +26/07,URBAN EATS SINGAPORE SG,-11.9 +26/07,FOOD HUB SINGAPORE SG,-6.5 +26/07,FRESH FINDS SINGAPORE SG,-2.44 +26/07,COZY CAFE SINGAPORE SG,-1.29 +27/07,PANTRY PICKS SINGAPORE SG,-17.9 +27/07,TRAVEL DELI SINGAPORE SG,-3.7 +28/07,GLOBAL GRUB SINGAPORE SG,-12.0 +28/07,FITNESS PASS SINGAPORE SG,-4.2 +28/07,NATURE FARE SINGAPORE SG,-3.04 +29/07,FAST FEAST SINGAPORE SG,-15.6 +30/07,QUICK MART SINGAPORE SG,-13.52 +30/07,CULINARY WAY SINGAPORE SG,-8.95 +30/07,COLD STORAGE SINGAPORE SG,-4.2 +31/07,BUS RIDE SINGAPORE SG,-11.9 +31/07,EATERY STOP SINGAPORE SG,-7.3 +18/07,CASH REBATE,1.38 diff --git a/tests/integration/banks/example/transformed.csv b/tests/integration/banks/example/transformed.csv index dd67eabf..e2c683ac 100644 --- a/tests/integration/banks/example/transformed.csv +++ b/tests/integration/banks/example/transformed.csv @@ -1,54 +1,54 @@ transaction_date,description,amount -2023-07-02,LAST MONTH'S BALANCE,412.16 -2023-07-02,PAYMENT BY INTERNET,-412.16 -2023-07-03,DELIGHTFUL BREAKFAST SINGAPORE SG,4.2 -2023-07-06,URBAN TRANSIT CO. SINGAPORE SG,1.38 -2023-07-07,MORNING BITES CAFE SINGAPORE SG,4.2 -2023-07-13,SUNRISE TOAST HAVEN SINGAPORE SG,3.2 -2023-07-15,ARCTIC MARKET SINGAPORE SG,7.0 -2023-07-16,SPEEDY DRIVE SHOP SINGAPORE SG,11.9 -2023-07-16,TRAVELEATS EXPRESS SINGAPORE SG,1.0 -2023-07-17,FROSTED PANTRY SINGAPORE SG,2.51 -2023-07-18,COMMUTE & GO MART SINGAPORE SG,9.9 -2023-07-18,CULINARY CONNECT SINGAPORE SG,6.95 -2023-07-18,NATURE'S OVEN SINGAPORE SG,1.29 -2023-07-18,CHILLED URBAN MART SINGAPORE SG,2.64 -2023-07-19,GLOBAL FLAVORS SINGAPORE SG,5.5 -2023-07-19,FITLIFE ACCESS SINGAPORE SG,17.4 -2023-07-20,MORNING BITE CAFE SINGAPORE SG,8.3 -2023-07-20,FOODIE EXPRESS SINGAPORE 239 SG,36.25 -2023-07-20,GASTRONOMIC OASIS SINGAPORE SG,2.28 -2023-07-21,TRANQUIL TRANSIT SINGAPORE SG,11.9 -2023-07-21,URBAN HARVEST SINGAPORE SG,7.3 -2023-07-21,ENCHANTED CAFE SINGAPORE SG,11.9 -2023-07-22,FROZEN WONDERS SINGAPORE SG,6.1 -2023-07-22,DRIVE-THRU DELIGHTS SINGAPORE SG,238.79 -2023-07-22,FLAVORFUL MARKETPLAC SINGAPORE SG,2.71 -2023-07-23,GOURMET PANTRY SINGAPORE SG,8.5 -2023-07-23,TRAVELER'S PROVISION SINGAPORE SG,59.0 -2023-07-23,EPICUREAN CONNECT SINGAPORE SG,3.2 -2023-07-23,NATURAL BAZAAR SINGAPORE SG,12.9 -2023-07-24,WHOLESOME LIFE SINGAPORE SG,27.75 -2023-07-24,SAVORY MORNING SINGAPORE SG,2.9 -2023-07-25,METRO TRANSIT SINGAPORE SG,17.16 -2023-07-25,SUNNY CAFE SINGAPORE SG,17.4 -2023-07-25,GOLDEN TOAST SINGAPORE SG,13.45 -2023-07-25,-1234 SNOWY MART SINGAPORE SG,1.45 -2023-07-25,DRIVE EXPRESS SINGAPORE SG,3.43 -2023-07-26,GOURMET SHOP SINGAPORE SG,7.3 -2023-07-26,URBAN EATS SINGAPORE SG,11.9 -2023-07-26,FOOD HUB SINGAPORE SG,6.5 -2023-07-26,FRESH FINDS SINGAPORE SG,2.44 -2023-07-26,COZY CAFE SINGAPORE SG,1.29 -2023-07-27,PANTRY PICKS SINGAPORE SG,17.9 -2023-07-27,TRAVEL DELI SINGAPORE SG,3.7 -2023-07-28,GLOBAL GRUB SINGAPORE SG,12.0 -2023-07-28,FITNESS PASS SINGAPORE SG,4.2 -2023-07-28,NATURE FARE SINGAPORE SG,3.04 -2023-07-29,FAST FEAST SINGAPORE SG,15.6 -2023-07-30,QUICK MART SINGAPORE SG,13.52 -2023-07-30,CULINARY WAY SINGAPORE SG,8.95 -2023-07-30,COLD STORAGE SINGAPORE SG,4.2 -2023-07-31,BUS RIDE SINGAPORE SG,11.9 -2023-07-31,EATERY STOP SINGAPORE SG,7.3 -2023-07-18,CASH REBATE,-1.38 +2023-07-02,LAST MONTH'S BALANCE,-412.16 +2023-07-02,PAYMENT BY INTERNET,412.16 +2023-07-03,DELIGHTFUL BREAKFAST SINGAPORE SG,-4.2 +2023-07-06,URBAN TRANSIT CO. SINGAPORE SG,-1.38 +2023-07-07,MORNING BITES CAFE SINGAPORE SG,-4.2 +2023-07-13,SUNRISE TOAST HAVEN SINGAPORE SG,-3.2 +2023-07-15,ARCTIC MARKET SINGAPORE SG,-7.0 +2023-07-16,SPEEDY DRIVE SHOP SINGAPORE SG,-11.9 +2023-07-16,TRAVELEATS EXPRESS SINGAPORE SG,-1.0 +2023-07-17,FROSTED PANTRY SINGAPORE SG,-2.51 +2023-07-18,COMMUTE & GO MART SINGAPORE SG,-9.9 +2023-07-18,CULINARY CONNECT SINGAPORE SG,-6.95 +2023-07-18,NATURE'S OVEN SINGAPORE SG,-1.29 +2023-07-18,CHILLED URBAN MART SINGAPORE SG,-2.64 +2023-07-19,GLOBAL FLAVORS SINGAPORE SG,-5.5 +2023-07-19,FITLIFE ACCESS SINGAPORE SG,-17.4 +2023-07-20,MORNING BITE CAFE SINGAPORE SG,-8.3 +2023-07-20,FOODIE EXPRESS SINGAPORE 239 SG,-36.25 +2023-07-20,GASTRONOMIC OASIS SINGAPORE SG,-2.28 +2023-07-21,TRANQUIL TRANSIT SINGAPORE SG,-11.9 +2023-07-21,URBAN HARVEST SINGAPORE SG,-7.3 +2023-07-21,ENCHANTED CAFE SINGAPORE SG,-11.9 +2023-07-22,FROZEN WONDERS SINGAPORE SG,-6.1 +2023-07-22,DRIVE-THRU DELIGHTS SINGAPORE SG,-238.79 +2023-07-22,FLAVORFUL MARKETPLAC SINGAPORE SG,-2.71 +2023-07-23,GOURMET PANTRY SINGAPORE SG,-8.5 +2023-07-23,TRAVELER'S PROVISION SINGAPORE SG,-59.0 +2023-07-23,EPICUREAN CONNECT SINGAPORE SG,-3.2 +2023-07-23,NATURAL BAZAAR SINGAPORE SG,-12.9 +2023-07-24,WHOLESOME LIFE SINGAPORE SG,-27.75 +2023-07-24,SAVORY MORNING SINGAPORE SG,-2.9 +2023-07-25,METRO TRANSIT SINGAPORE SG,-17.16 +2023-07-25,SUNNY CAFE SINGAPORE SG,-17.4 +2023-07-25,GOLDEN TOAST SINGAPORE SG,-13.45 +2023-07-25,-1234 SNOWY MART SINGAPORE SG,-1.45 +2023-07-25,DRIVE EXPRESS SINGAPORE SG,-3.43 +2023-07-26,GOURMET SHOP SINGAPORE SG,-7.3 +2023-07-26,URBAN EATS SINGAPORE SG,-11.9 +2023-07-26,FOOD HUB SINGAPORE SG,-6.5 +2023-07-26,FRESH FINDS SINGAPORE SG,-2.44 +2023-07-26,COZY CAFE SINGAPORE SG,-1.29 +2023-07-27,PANTRY PICKS SINGAPORE SG,-17.9 +2023-07-27,TRAVEL DELI SINGAPORE SG,-3.7 +2023-07-28,GLOBAL GRUB SINGAPORE SG,-12.0 +2023-07-28,FITNESS PASS SINGAPORE SG,-4.2 +2023-07-28,NATURE FARE SINGAPORE SG,-3.04 +2023-07-29,FAST FEAST SINGAPORE SG,-15.6 +2023-07-30,QUICK MART SINGAPORE SG,-13.52 +2023-07-30,CULINARY WAY SINGAPORE SG,-8.95 +2023-07-30,COLD STORAGE SINGAPORE SG,-4.2 +2023-07-31,BUS RIDE SINGAPORE SG,-11.9 +2023-07-31,EATERY STOP SINGAPORE SG,-7.3 +2023-07-18,CASH REBATE,1.38 diff --git a/tests/integration/banks/hsbc/raw.csv b/tests/integration/banks/hsbc/raw.csv index aa2d83a2..380f962f 100644 --- a/tests/integration/banks/hsbc/raw.csv +++ b/tests/integration/banks/hsbc/raw.csv @@ -1,20 +1,20 @@ transaction_date,description,amount -17 Jul,Previous Statement Balance,1627.37 -17 Jul,PUBLIC BUS 123 SINGAPORE SG,1.45 -22 Jul,POSB VPP VISA DIRECT SG,-1627.37 -22 Jul,AMZN Mktp US*12345 Amzn.com/bill WA,34.61 -24 Jul,DCC FEE,0.35 -24 Jul,"CO., LRD.123456 SEOULKIN KR",544.40 -27 Jul,DCC FEE,5.44 -27 Jul,F21 - HAW PAR VILLA SINGAPORE SG,25.00 -30 Jul,AIRBNB * 1234567 123-345-6789 GB,197.39 -01 Aug,DCC FEE,1.97 -02 Aug,AMAZON MKTPLC SG SINGAPORE SG,99.17 -02 Aug,SHOPEE SINGAPORE MP SINGAPORE SG,5.95 -05 Aug,SHOPEE SINGAPORE MP SINGAPORE SG,44.83 -05 Aug,TRIP.COM HOTEL REGE Internet SG,93.10 -09 Aug,Shopee Singapore SINGAPORE SG,31.45 -12 Aug,UNIQLO SINGAPORE PTE. SINGAPORE SG,29.80 -12 Aug,MOS BURGER SINGAPORE SG,23.80 -12 Aug,AMAZON MKTPLC SG SINGAPORE SG,20.99 -13 Aug,AMAZON SG SINGAPORE SG,58.50 +17 Jul,Previous Statement Balance,-1627.37 +17 Jul,PUBLIC BUS 123 SINGAPORE SG,-1.45 +22 Jul,POSB VPP VISA DIRECT SG,1627.37 +22 Jul,AMZN Mktp US*12345 Amzn.com/bill WA,-34.61 +24 Jul,DCC FEE,-0.35 +24 Jul,"CO., LRD.123456 SEOULKIN KR",-544.4 +27 Jul,DCC FEE,-5.44 +27 Jul,F21 - HAW PAR VILLA SINGAPORE SG,-25.0 +30 Jul,AIRBNB * 1234567 123-345-6789 GB,-197.39 +01 Aug,DCC FEE,-1.97 +02 Aug,AMAZON MKTPLC SG SINGAPORE SG,-99.17 +02 Aug,SHOPEE SINGAPORE MP SINGAPORE SG,-5.95 +05 Aug,SHOPEE SINGAPORE MP SINGAPORE SG,-44.83 +05 Aug,TRIP.COM HOTEL REGE Internet SG,-93.1 +09 Aug,Shopee Singapore SINGAPORE SG,-31.45 +12 Aug,UNIQLO SINGAPORE PTE. SINGAPORE SG,-29.8 +12 Aug,MOS BURGER SINGAPORE SG,-23.8 +12 Aug,AMAZON MKTPLC SG SINGAPORE SG,-20.99 +13 Aug,AMAZON SG SINGAPORE SG,-58.5 diff --git a/tests/integration/banks/hsbc/transformed.csv b/tests/integration/banks/hsbc/transformed.csv index cd507265..bbd8c272 100644 --- a/tests/integration/banks/hsbc/transformed.csv +++ b/tests/integration/banks/hsbc/transformed.csv @@ -1,20 +1,20 @@ transaction_date,description,amount -2023-07-17,Previous Statement Balance,1627.37 -2023-07-17,PUBLIC BUS 123 SINGAPORE SG,1.45 -2023-07-22,POSB VPP VISA DIRECT SG,-1627.37 -2023-07-22,AMZN Mktp US*12345 Amzn.com/bill WA,34.61 -2023-07-24,DCC FEE,0.35 -2023-07-24,"CO., LRD.123456 SEOULKIN KR",544.4 -2023-07-27,DCC FEE,5.44 -2023-07-27,F21 - HAW PAR VILLA SINGAPORE SG,25.0 -2023-07-30,AIRBNB * 1234567 123-345-6789 GB,197.39 -2023-08-01,DCC FEE,1.97 -2023-08-02,AMAZON MKTPLC SG SINGAPORE SG,99.17 -2023-08-02,SHOPEE SINGAPORE MP SINGAPORE SG,5.95 -2023-08-05,SHOPEE SINGAPORE MP SINGAPORE SG,44.83 -2023-08-05,TRIP.COM HOTEL REGE Internet SG,93.1 -2023-08-09,Shopee Singapore SINGAPORE SG,31.45 -2023-08-12,UNIQLO SINGAPORE PTE. SINGAPORE SG,29.8 -2023-08-12,MOS BURGER SINGAPORE SG,23.8 -2023-08-12,AMAZON MKTPLC SG SINGAPORE SG,20.99 -2023-08-13,AMAZON SG SINGAPORE SG,58.5 +2023-07-17,Previous Statement Balance,-1627.37 +2023-07-17,PUBLIC BUS 123 SINGAPORE SG,-1.45 +2023-07-22,POSB VPP VISA DIRECT SG,1627.37 +2023-07-22,AMZN Mktp US*12345 Amzn.com/bill WA,-34.61 +2023-07-24,DCC FEE,-0.35 +2023-07-24,"CO., LRD.123456 SEOULKIN KR",-544.4 +2023-07-27,DCC FEE,-5.44 +2023-07-27,F21 - HAW PAR VILLA SINGAPORE SG,-25.0 +2023-07-30,AIRBNB * 1234567 123-345-6789 GB,-197.39 +2023-08-01,DCC FEE,-1.97 +2023-08-02,AMAZON MKTPLC SG SINGAPORE SG,-99.17 +2023-08-02,SHOPEE SINGAPORE MP SINGAPORE SG,-5.95 +2023-08-05,SHOPEE SINGAPORE MP SINGAPORE SG,-44.83 +2023-08-05,TRIP.COM HOTEL REGE Internet SG,-93.1 +2023-08-09,Shopee Singapore SINGAPORE SG,-31.45 +2023-08-12,UNIQLO SINGAPORE PTE. SINGAPORE SG,-29.8 +2023-08-12,MOS BURGER SINGAPORE SG,-23.8 +2023-08-12,AMAZON MKTPLC SG SINGAPORE SG,-20.99 +2023-08-13,AMAZON SG SINGAPORE SG,-58.5 diff --git a/tests/integration/banks/ocbc/raw.csv b/tests/integration/banks/ocbc/raw.csv index 3596bd5d..855fca13 100644 --- a/tests/integration/banks/ocbc/raw.csv +++ b/tests/integration/banks/ocbc/raw.csv @@ -1,54 +1,54 @@ transaction_date,description,amount -02/07,LAST MONTH'S BALANCE,412.16 -02/07,PAYMENT BY INTERNET,-412.16 -03/07,DELIGHTFUL BREAKFAST SINGAPORE SG,4.20 -06/07,URBAN TRANSIT CO. SINGAPORE SG,1.38 -07/07,MORNING BITES CAFÉ SINGAPORE SG,4.20 -13/07,SUNRISE TOAST HAVEN SINGAPORE SG,3.20 -15/07,ARCTIC MARKET SINGAPORE SG,7.00 -16/07,SPEEDY DRIVE SHOP SINGAPORE SG,11.90 -16/07,TRAVELEATS EXPRESS SINGAPORE SG,1.00 -17/07,FROSTED PANTRY SINGAPORE SG,2.51 -18/07,COMMUTE & GO MART SINGAPORE SG,9.90 -18/07,CULINARY CONNECT SINGAPORE SG,6.95 -18/07,NATURE'S OVEN SINGAPORE SG,1.29 -18/07,CHILLED URBAN MART SINGAPORE SG,2.64 -19/07,GLOBAL FLAVORS SINGAPORE SG,5.50 -19/07,FITLIFE ACCESS SINGAPORE SG,17.40 -20/07,MORNING BITE CAFÉ SINGAPORE SG,8.30 -20/07,FOODIE EXPRESS SINGAPORE 239 SG,36.25 -20/07,GASTRONOMIC OASIS SINGAPORE SG,2.28 -21/07,TRANQUIL TRANSIT SINGAPORE SG,11.90 -21/07,URBAN HARVEST SINGAPORE SG,7.30 -21/07,ENCHANTED CAFÉ SINGAPORE SG,11.90 -22/07,FROZEN WONDERS SINGAPORE SG,6.10 -22/07,DRIVE-THRU DELIGHTS SINGAPORE SG,238.79 -22/07,FLAVORFUL MARKETPLAC SINGAPORE SG,2.71 -23/07,GOURMET PANTRY SINGAPORE SG,8.50 -23/07,TRAVELER'S PROVISION SINGAPORE SG,59.00 -23/07,EPICUREAN CONNECT SINGAPORE SG,3.20 -23/07,NATURAL BAZAAR SINGAPORE SG,12.90 -24/07,WHOLESOME LIFE SINGAPORE SG,27.75 -24/07,SAVORY MORNING SINGAPORE SG,2.90 -25/07,METRO TRANSIT SINGAPORE SG,17.16 -25/07,SUNNY CAFÉ SINGAPORE SG,17.40 -25/07,GOLDEN TOAST SINGAPORE SG,13.45 -25/07,-1234 SNOWY MART SINGAPORE SG,1.45 -25/07,DRIVE EXPRESS SINGAPORE SG,3.43 -26/07,GOURMET SHOP SINGAPORE SG,7.30 -26/07,URBAN EATS SINGAPORE SG,11.90 -26/07,FOOD HUB SINGAPORE SG,6.50 -26/07,FRESH FINDS SINGAPORE SG,2.44 -26/07,COZY CAFÉ SINGAPORE SG,1.29 -27/07,PANTRY PICKS SINGAPORE SG,17.90 -27/07,TRAVEL DELI SINGAPORE SG,3.70 -28/07,GLOBAL GRUB SINGAPORE SG,12.00 -28/07,FITNESS PASS SINGAPORE SG,4.20 -28/07,NATURE FARE SINGAPORE SG,3.04 -29/07,FAST FEAST SINGAPORE SG,15.60 -30/07,QUICK MART SINGAPORE SG,13.52 -30/07,CULINARY WAY SINGAPORE SG,8.95 -30/07,COLD STORAGE SINGAPORE SG,4.20 -31/07,BUS RIDE SINGAPORE SG,11.90 -31/07,EATERY STOP SINGAPORE SG,7.30 -18/07,CASH REBATE,-1.38 +02/07,LAST MONTH'S BALANCE,-412.16 +02/07,PAYMENT BY INTERNET,412.16 +03/07,DELIGHTFUL BREAKFAST SINGAPORE SG,-4.2 +06/07,URBAN TRANSIT CO. SINGAPORE SG,-1.38 +07/07,MORNING BITES CAFÉ SINGAPORE SG,-4.2 +13/07,SUNRISE TOAST HAVEN SINGAPORE SG,-3.2 +15/07,ARCTIC MARKET SINGAPORE SG,-7.0 +16/07,SPEEDY DRIVE SHOP SINGAPORE SG,-11.9 +16/07,TRAVELEATS EXPRESS SINGAPORE SG,-1.0 +17/07,FROSTED PANTRY SINGAPORE SG,-2.51 +18/07,COMMUTE & GO MART SINGAPORE SG,-9.9 +18/07,CULINARY CONNECT SINGAPORE SG,-6.95 +18/07,NATURE'S OVEN SINGAPORE SG,-1.29 +18/07,CHILLED URBAN MART SINGAPORE SG,-2.64 +19/07,GLOBAL FLAVORS SINGAPORE SG,-5.5 +19/07,FITLIFE ACCESS SINGAPORE SG,-17.4 +20/07,MORNING BITE CAFÉ SINGAPORE SG,-8.3 +20/07,FOODIE EXPRESS SINGAPORE 239 SG,-36.25 +20/07,GASTRONOMIC OASIS SINGAPORE SG,-2.28 +21/07,TRANQUIL TRANSIT SINGAPORE SG,-11.9 +21/07,URBAN HARVEST SINGAPORE SG,-7.3 +21/07,ENCHANTED CAFÉ SINGAPORE SG,-11.9 +22/07,FROZEN WONDERS SINGAPORE SG,-6.1 +22/07,DRIVE-THRU DELIGHTS SINGAPORE SG,-238.79 +22/07,FLAVORFUL MARKETPLAC SINGAPORE SG,-2.71 +23/07,GOURMET PANTRY SINGAPORE SG,-8.5 +23/07,TRAVELER'S PROVISION SINGAPORE SG,-59.0 +23/07,EPICUREAN CONNECT SINGAPORE SG,-3.2 +23/07,NATURAL BAZAAR SINGAPORE SG,-12.9 +24/07,WHOLESOME LIFE SINGAPORE SG,-27.75 +24/07,SAVORY MORNING SINGAPORE SG,-2.9 +25/07,METRO TRANSIT SINGAPORE SG,-17.16 +25/07,SUNNY CAFÉ SINGAPORE SG,-17.4 +25/07,GOLDEN TOAST SINGAPORE SG,-13.45 +25/07,-1234 SNOWY MART SINGAPORE SG,-1.45 +25/07,DRIVE EXPRESS SINGAPORE SG,-3.43 +26/07,GOURMET SHOP SINGAPORE SG,-7.3 +26/07,URBAN EATS SINGAPORE SG,-11.9 +26/07,FOOD HUB SINGAPORE SG,-6.5 +26/07,FRESH FINDS SINGAPORE SG,-2.44 +26/07,COZY CAFÉ SINGAPORE SG,-1.29 +27/07,PANTRY PICKS SINGAPORE SG,-17.9 +27/07,TRAVEL DELI SINGAPORE SG,-3.7 +28/07,GLOBAL GRUB SINGAPORE SG,-12.0 +28/07,FITNESS PASS SINGAPORE SG,-4.2 +28/07,NATURE FARE SINGAPORE SG,-3.04 +29/07,FAST FEAST SINGAPORE SG,-15.6 +30/07,QUICK MART SINGAPORE SG,-13.52 +30/07,CULINARY WAY SINGAPORE SG,-8.95 +30/07,COLD STORAGE SINGAPORE SG,-4.2 +31/07,BUS RIDE SINGAPORE SG,-11.9 +31/07,EATERY STOP SINGAPORE SG,-7.3 +18/07,CASH REBATE,1.38 diff --git a/tests/integration/banks/ocbc/transformed.csv b/tests/integration/banks/ocbc/transformed.csv index 8bb9b5bc..5b8799b3 100644 --- a/tests/integration/banks/ocbc/transformed.csv +++ b/tests/integration/banks/ocbc/transformed.csv @@ -1,54 +1,54 @@ transaction_date,description,amount -2023-07-02,LAST MONTH'S BALANCE,412.16 -2023-07-02,PAYMENT BY INTERNET,-412.16 -2023-07-03,DELIGHTFUL BREAKFAST SINGAPORE SG,4.2 -2023-07-06,URBAN TRANSIT CO. SINGAPORE SG,1.38 -2023-07-07,MORNING BITES CAFÉ SINGAPORE SG,4.2 -2023-07-13,SUNRISE TOAST HAVEN SINGAPORE SG,3.2 -2023-07-15,ARCTIC MARKET SINGAPORE SG,7.0 -2023-07-16,SPEEDY DRIVE SHOP SINGAPORE SG,11.9 -2023-07-16,TRAVELEATS EXPRESS SINGAPORE SG,1.0 -2023-07-17,FROSTED PANTRY SINGAPORE SG,2.51 -2023-07-18,COMMUTE & GO MART SINGAPORE SG,9.9 -2023-07-18,CULINARY CONNECT SINGAPORE SG,6.95 -2023-07-18,NATURE'S OVEN SINGAPORE SG,1.29 -2023-07-18,CHILLED URBAN MART SINGAPORE SG,2.64 -2023-07-19,GLOBAL FLAVORS SINGAPORE SG,5.5 -2023-07-19,FITLIFE ACCESS SINGAPORE SG,17.4 -2023-07-20,MORNING BITE CAFÉ SINGAPORE SG,8.3 -2023-07-20,FOODIE EXPRESS SINGAPORE 239 SG,36.25 -2023-07-20,GASTRONOMIC OASIS SINGAPORE SG,2.28 -2023-07-21,TRANQUIL TRANSIT SINGAPORE SG,11.9 -2023-07-21,URBAN HARVEST SINGAPORE SG,7.3 -2023-07-21,ENCHANTED CAFÉ SINGAPORE SG,11.9 -2023-07-22,FROZEN WONDERS SINGAPORE SG,6.1 -2023-07-22,DRIVE-THRU DELIGHTS SINGAPORE SG,238.79 -2023-07-22,FLAVORFUL MARKETPLAC SINGAPORE SG,2.71 -2023-07-23,GOURMET PANTRY SINGAPORE SG,8.5 -2023-07-23,TRAVELER'S PROVISION SINGAPORE SG,59.0 -2023-07-23,EPICUREAN CONNECT SINGAPORE SG,3.2 -2023-07-23,NATURAL BAZAAR SINGAPORE SG,12.9 -2023-07-24,WHOLESOME LIFE SINGAPORE SG,27.75 -2023-07-24,SAVORY MORNING SINGAPORE SG,2.9 -2023-07-25,METRO TRANSIT SINGAPORE SG,17.16 -2023-07-25,SUNNY CAFÉ SINGAPORE SG,17.4 -2023-07-25,GOLDEN TOAST SINGAPORE SG,13.45 -2023-07-25,-1234 SNOWY MART SINGAPORE SG,1.45 -2023-07-25,DRIVE EXPRESS SINGAPORE SG,3.43 -2023-07-26,GOURMET SHOP SINGAPORE SG,7.3 -2023-07-26,URBAN EATS SINGAPORE SG,11.9 -2023-07-26,FOOD HUB SINGAPORE SG,6.5 -2023-07-26,FRESH FINDS SINGAPORE SG,2.44 -2023-07-26,COZY CAFÉ SINGAPORE SG,1.29 -2023-07-27,PANTRY PICKS SINGAPORE SG,17.9 -2023-07-27,TRAVEL DELI SINGAPORE SG,3.7 -2023-07-28,GLOBAL GRUB SINGAPORE SG,12.0 -2023-07-28,FITNESS PASS SINGAPORE SG,4.2 -2023-07-28,NATURE FARE SINGAPORE SG,3.04 -2023-07-29,FAST FEAST SINGAPORE SG,15.6 -2023-07-30,QUICK MART SINGAPORE SG,13.52 -2023-07-30,CULINARY WAY SINGAPORE SG,8.95 -2023-07-30,COLD STORAGE SINGAPORE SG,4.2 -2023-07-31,BUS RIDE SINGAPORE SG,11.9 -2023-07-31,EATERY STOP SINGAPORE SG,7.3 -2023-07-18,CASH REBATE,-1.38 +2023-07-02,LAST MONTH'S BALANCE,-412.16 +2023-07-02,PAYMENT BY INTERNET,412.16 +2023-07-03,DELIGHTFUL BREAKFAST SINGAPORE SG,-4.2 +2023-07-06,URBAN TRANSIT CO. SINGAPORE SG,-1.38 +2023-07-07,MORNING BITES CAFÉ SINGAPORE SG,-4.2 +2023-07-13,SUNRISE TOAST HAVEN SINGAPORE SG,-3.2 +2023-07-15,ARCTIC MARKET SINGAPORE SG,-7.0 +2023-07-16,SPEEDY DRIVE SHOP SINGAPORE SG,-11.9 +2023-07-16,TRAVELEATS EXPRESS SINGAPORE SG,-1.0 +2023-07-17,FROSTED PANTRY SINGAPORE SG,-2.51 +2023-07-18,COMMUTE & GO MART SINGAPORE SG,-9.9 +2023-07-18,CULINARY CONNECT SINGAPORE SG,-6.95 +2023-07-18,NATURE'S OVEN SINGAPORE SG,-1.29 +2023-07-18,CHILLED URBAN MART SINGAPORE SG,-2.64 +2023-07-19,GLOBAL FLAVORS SINGAPORE SG,-5.5 +2023-07-19,FITLIFE ACCESS SINGAPORE SG,-17.4 +2023-07-20,MORNING BITE CAFÉ SINGAPORE SG,-8.3 +2023-07-20,FOODIE EXPRESS SINGAPORE 239 SG,-36.25 +2023-07-20,GASTRONOMIC OASIS SINGAPORE SG,-2.28 +2023-07-21,TRANQUIL TRANSIT SINGAPORE SG,-11.9 +2023-07-21,URBAN HARVEST SINGAPORE SG,-7.3 +2023-07-21,ENCHANTED CAFÉ SINGAPORE SG,-11.9 +2023-07-22,FROZEN WONDERS SINGAPORE SG,-6.1 +2023-07-22,DRIVE-THRU DELIGHTS SINGAPORE SG,-238.79 +2023-07-22,FLAVORFUL MARKETPLAC SINGAPORE SG,-2.71 +2023-07-23,GOURMET PANTRY SINGAPORE SG,-8.5 +2023-07-23,TRAVELER'S PROVISION SINGAPORE SG,-59.0 +2023-07-23,EPICUREAN CONNECT SINGAPORE SG,-3.2 +2023-07-23,NATURAL BAZAAR SINGAPORE SG,-12.9 +2023-07-24,WHOLESOME LIFE SINGAPORE SG,-27.75 +2023-07-24,SAVORY MORNING SINGAPORE SG,-2.9 +2023-07-25,METRO TRANSIT SINGAPORE SG,-17.16 +2023-07-25,SUNNY CAFÉ SINGAPORE SG,-17.4 +2023-07-25,GOLDEN TOAST SINGAPORE SG,-13.45 +2023-07-25,-1234 SNOWY MART SINGAPORE SG,-1.45 +2023-07-25,DRIVE EXPRESS SINGAPORE SG,-3.43 +2023-07-26,GOURMET SHOP SINGAPORE SG,-7.3 +2023-07-26,URBAN EATS SINGAPORE SG,-11.9 +2023-07-26,FOOD HUB SINGAPORE SG,-6.5 +2023-07-26,FRESH FINDS SINGAPORE SG,-2.44 +2023-07-26,COZY CAFÉ SINGAPORE SG,-1.29 +2023-07-27,PANTRY PICKS SINGAPORE SG,-17.9 +2023-07-27,TRAVEL DELI SINGAPORE SG,-3.7 +2023-07-28,GLOBAL GRUB SINGAPORE SG,-12.0 +2023-07-28,FITNESS PASS SINGAPORE SG,-4.2 +2023-07-28,NATURE FARE SINGAPORE SG,-3.04 +2023-07-29,FAST FEAST SINGAPORE SG,-15.6 +2023-07-30,QUICK MART SINGAPORE SG,-13.52 +2023-07-30,CULINARY WAY SINGAPORE SG,-8.95 +2023-07-30,COLD STORAGE SINGAPORE SG,-4.2 +2023-07-31,BUS RIDE SINGAPORE SG,-11.9 +2023-07-31,EATERY STOP SINGAPORE SG,-7.3 +2023-07-18,CASH REBATE,1.38 diff --git a/tests/integration/banks/standard_chartered/raw.csv b/tests/integration/banks/standard_chartered/raw.csv index ba2f3b6d..86a3d5f1 100644 --- a/tests/integration/banks/standard_chartered/raw.csv +++ b/tests/integration/banks/standard_chartered/raw.csv @@ -1,28 +1,28 @@ transaction_date,description,amount -17 Apr,BALANCE FROM PREVIOUS STATEMENT,83.74 -17 Apr,BUS/MRT 253656688 SINGAPORE SG,3.66 -17 Apr,BUS/MRT 254457586 SINGAPORE SG,1.15 -17 Apr,BUS/MRT 254374218 SINGAPORE SG,1.45 -18 Apr,BUS/MRT 254725212 SINGAPORE SG,3.43 -18 Apr,BUS/MRT 255094675 SINGAPORE SG,3.97 -19 Apr,BUS/MRT 255699004 SINGAPORE SG,3.13 -21 Apr,BUS/MRT 256315508 SINGAPORE SG,4.17 -24 Apr,BUS/MRT 256711470 SINGAPORE SG,3.43 -25 Apr,BUS/MRT 257089114 SINGAPORE SG,4.13 -25 Apr,BUS/MRT 257475565 SINGAPORE SG,3.98 -25 Apr,BUS/MRT 257873840 SINGAPORE SG,4.51 -26 Apr,BUS/MRT 258504364 SINGAPORE SG,3.32 -24 Apr,PAYMENT - THANK YOU,-83.74 -28 Apr,BUS/MRT 259104495 SINGAPORE SG,4.43 -29 Apr,BUS/MRT 259469982 SINGAPORE SG,4.39 -02 May,BUS/MRT 259868441 SINGAPORE SG,2.27 -03 May,BUS/MRT 260260348 SINGAPORE SG,2.67 -03 May,BUS/MRT 260658884 SINGAPORE SG,4.46 -09 May,BUS/MRT 263205220 SINGAPORE SG,2.6 -09 May,BUS/MRT 263553121 SINGAPORE SG,3.43 -10 May,BUS/MRT 263937279 SINGAPORE SG,3.73 -12 May,BUS/MRT 264586616 SINGAPORE SG,2.6 -13 May,BUS/MRT 264969195 SINGAPORE SG,2.44 -15 May,BUS/MRT 265375918 SINGAPORE SG,2.6 -16 May,BUS/MRT 266113941 SINGAPORE SG,3.97 -16 May,BUS/MRT 266517209 SINGAPORE SG,2.53 +17 Apr,BALANCE FROM PREVIOUS STATEMENT,-83.74 +17 Apr,BUS/MRT 253656688 SINGAPORE SG,-3.66 +17 Apr,BUS/MRT 254457586 SINGAPORE SG,-1.15 +17 Apr,BUS/MRT 254374218 SINGAPORE SG,-1.45 +18 Apr,BUS/MRT 254725212 SINGAPORE SG,-3.43 +18 Apr,BUS/MRT 255094675 SINGAPORE SG,-3.97 +19 Apr,BUS/MRT 255699004 SINGAPORE SG,-3.13 +21 Apr,BUS/MRT 256315508 SINGAPORE SG,-4.17 +24 Apr,BUS/MRT 256711470 SINGAPORE SG,-3.43 +25 Apr,BUS/MRT 257089114 SINGAPORE SG,-4.13 +25 Apr,BUS/MRT 257475565 SINGAPORE SG,-3.98 +25 Apr,BUS/MRT 257873840 SINGAPORE SG,-4.51 +26 Apr,BUS/MRT 258504364 SINGAPORE SG,-3.32 +24 Apr,PAYMENT - THANK YOU,83.74 +28 Apr,BUS/MRT 259104495 SINGAPORE SG,-4.43 +29 Apr,BUS/MRT 259469982 SINGAPORE SG,-4.39 +02 May,BUS/MRT 259868441 SINGAPORE SG,-2.27 +03 May,BUS/MRT 260260348 SINGAPORE SG,-2.67 +03 May,BUS/MRT 260658884 SINGAPORE SG,-4.46 +09 May,BUS/MRT 263205220 SINGAPORE SG,-2.6 +09 May,BUS/MRT 263553121 SINGAPORE SG,-3.43 +10 May,BUS/MRT 263937279 SINGAPORE SG,-3.73 +12 May,BUS/MRT 264586616 SINGAPORE SG,-2.6 +13 May,BUS/MRT 264969195 SINGAPORE SG,-2.44 +15 May,BUS/MRT 265375918 SINGAPORE SG,-2.6 +16 May,BUS/MRT 266113941 SINGAPORE SG,-3.97 +16 May,BUS/MRT 266517209 SINGAPORE SG,-2.53 diff --git a/tests/integration/banks/standard_chartered/transformed.csv b/tests/integration/banks/standard_chartered/transformed.csv index 2493b558..7504def9 100644 --- a/tests/integration/banks/standard_chartered/transformed.csv +++ b/tests/integration/banks/standard_chartered/transformed.csv @@ -1,28 +1,28 @@ transaction_date,description,amount -2023-04-17,BALANCE FROM PREVIOUS STATEMENT,83.74 -2023-04-17,BUS/MRT 253656688 SINGAPORE SG,3.66 -2023-04-17,BUS/MRT 254457586 SINGAPORE SG,1.15 -2023-04-17,BUS/MRT 254374218 SINGAPORE SG,1.45 -2023-04-18,BUS/MRT 254725212 SINGAPORE SG,3.43 -2023-04-18,BUS/MRT 255094675 SINGAPORE SG,3.97 -2023-04-19,BUS/MRT 255699004 SINGAPORE SG,3.13 -2023-04-21,BUS/MRT 256315508 SINGAPORE SG,4.17 -2023-04-24,BUS/MRT 256711470 SINGAPORE SG,3.43 -2023-04-25,BUS/MRT 257089114 SINGAPORE SG,4.13 -2023-04-25,BUS/MRT 257475565 SINGAPORE SG,3.98 -2023-04-25,BUS/MRT 257873840 SINGAPORE SG,4.51 -2023-04-26,BUS/MRT 258504364 SINGAPORE SG,3.32 -2023-04-24,PAYMENT - THANK YOU,-83.74 -2023-04-28,BUS/MRT 259104495 SINGAPORE SG,4.43 -2023-04-29,BUS/MRT 259469982 SINGAPORE SG,4.39 -2023-05-02,BUS/MRT 259868441 SINGAPORE SG,2.27 -2023-05-03,BUS/MRT 260260348 SINGAPORE SG,2.67 -2023-05-03,BUS/MRT 260658884 SINGAPORE SG,4.46 -2023-05-09,BUS/MRT 263205220 SINGAPORE SG,2.6 -2023-05-09,BUS/MRT 263553121 SINGAPORE SG,3.43 -2023-05-10,BUS/MRT 263937279 SINGAPORE SG,3.73 -2023-05-12,BUS/MRT 264586616 SINGAPORE SG,2.6 -2023-05-13,BUS/MRT 264969195 SINGAPORE SG,2.44 -2023-05-15,BUS/MRT 265375918 SINGAPORE SG,2.6 -2023-05-16,BUS/MRT 266113941 SINGAPORE SG,3.97 -2023-05-16,BUS/MRT 266517209 SINGAPORE SG,2.53 +2023-04-17,BALANCE FROM PREVIOUS STATEMENT,-83.74 +2023-04-17,BUS/MRT 253656688 SINGAPORE SG,-3.66 +2023-04-17,BUS/MRT 254457586 SINGAPORE SG,-1.15 +2023-04-17,BUS/MRT 254374218 SINGAPORE SG,-1.45 +2023-04-18,BUS/MRT 254725212 SINGAPORE SG,-3.43 +2023-04-18,BUS/MRT 255094675 SINGAPORE SG,-3.97 +2023-04-19,BUS/MRT 255699004 SINGAPORE SG,-3.13 +2023-04-21,BUS/MRT 256315508 SINGAPORE SG,-4.17 +2023-04-24,BUS/MRT 256711470 SINGAPORE SG,-3.43 +2023-04-25,BUS/MRT 257089114 SINGAPORE SG,-4.13 +2023-04-25,BUS/MRT 257475565 SINGAPORE SG,-3.98 +2023-04-25,BUS/MRT 257873840 SINGAPORE SG,-4.51 +2023-04-26,BUS/MRT 258504364 SINGAPORE SG,-3.32 +2023-04-24,PAYMENT - THANK YOU,83.74 +2023-04-28,BUS/MRT 259104495 SINGAPORE SG,-4.43 +2023-04-29,BUS/MRT 259469982 SINGAPORE SG,-4.39 +2023-05-02,BUS/MRT 259868441 SINGAPORE SG,-2.27 +2023-05-03,BUS/MRT 260260348 SINGAPORE SG,-2.67 +2023-05-03,BUS/MRT 260658884 SINGAPORE SG,-4.46 +2023-05-09,BUS/MRT 263205220 SINGAPORE SG,-2.6 +2023-05-09,BUS/MRT 263553121 SINGAPORE SG,-3.43 +2023-05-10,BUS/MRT 263937279 SINGAPORE SG,-3.73 +2023-05-12,BUS/MRT 264586616 SINGAPORE SG,-2.6 +2023-05-13,BUS/MRT 264969195 SINGAPORE SG,-2.44 +2023-05-15,BUS/MRT 265375918 SINGAPORE SG,-2.6 +2023-05-16,BUS/MRT 266113941 SINGAPORE SG,-3.97 +2023-05-16,BUS/MRT 266517209 SINGAPORE SG,-2.53 diff --git a/tests/integration/banks/test_banks.py b/tests/integration/banks/test_banks.py index e4d6f8b1..059e6643 100644 --- a/tests/integration/banks/test_banks.py +++ b/tests/integration/banks/test_banks.py @@ -15,12 +15,12 @@ @pytest.mark.parametrize( "bank_class, total_amount, statement_date", [ - (Citibank, 1414.07, datetime(2022, 11, 15)), - (Dbs, 16969.17, datetime(2023, 10, 15)), - (Hsbc, 1218.2, datetime(2023, 7, 21)), - (Ocbc, 702.1, datetime(2023, 8, 1)), - (StandardChartered, 82.45, datetime(2023, 5, 16)), - (MonopolyBank, 702.1, datetime(2023, 7, 1)), + (Citibank, -1414.07, datetime(2022, 11, 15)), + (Dbs, -16969.17, datetime(2023, 10, 15)), + (Hsbc, -1218.2, datetime(2023, 7, 21)), + (Ocbc, -702.1, datetime(2023, 8, 1)), + (StandardChartered, -82.45, datetime(2023, 5, 16)), + (MonopolyBank, -702.1, datetime(2023, 7, 1)), ], ) def test_bank_operations( diff --git a/tests/unit/test_statement_refund.py b/tests/unit/test_statement_refund.py new file mode 100644 index 00000000..5517ad92 --- /dev/null +++ b/tests/unit/test_statement_refund.py @@ -0,0 +1,29 @@ +from monopoly.constants import TransactionPatterns +from monopoly.pdf import PdfPage +from monopoly.statement import Statement, Transaction + + +def test_statement_process_refund(statement: Statement): + page_content = ( + "08 SEP AIRBNB * FOO123 456 GB (343.01)\n" + "14 AUG AIRBNB * FOO123 456 GB 343.01\n" + "" + ) + page = PdfPage(raw_text=page_content) + statement.transaction_config.pattern = TransactionPatterns.CITIBANK + statement.pages = [page] + expected_transactions = [ + Transaction( + transaction_date="08 SEP", + description="AIRBNB * FOO123 456 GB", + amount=343.01, + suffix="CR", + ), + Transaction( + transaction_date="14 AUG", + description="AIRBNB * FOO123 456 GB", + amount=-343.01, + suffix=None, + ), + ] + assert statement.transactions == expected_transactions diff --git a/tests/unit/test_transaction.py b/tests/unit/test_transaction.py index d16eff68..6b87e3e4 100644 --- a/tests/unit/test_transaction.py +++ b/tests/unit/test_transaction.py @@ -3,7 +3,7 @@ def test_transaction_handles_comma(): transaction = Transaction("2099-09-10", "foo", "123,123.12") - assert transaction.amount == 123123.12 + assert transaction.amount == -123123.12 def test_transaction_handles_whitespace():