Skip to content

Commit

Permalink
refactor(banks): use enums for transaction pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Oct 8, 2023
1 parent 038bfc3 commit b5eee68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions monopoly/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ class EmailSubjectRegex(str, Enum):
class TransactionPatterns(str, Enum):
OCBC = r"^(?P<date>\d+/\d+)\s*(?P<description>.*?)\s*(?P<amount>[\d.,]+)$"
CITIBANK = (
r"^(?P<date>\b\d{2}\s\w{3}\b)\s*(?P<description>.*?)\s*(?P<amount>[\d.,]+)$"
r"^(?P<date>\b\d{2}\s\w{3}\b)\s*"
r"(?P<description>.*?)\s*"
r"(?P<amount>[\d.,]+)$"
)
HSBC = (
r"\d{2}\s\w{3}\s*"
r"^\d{2}\s\w{3}\s*"
r"(?P<date>\d{2}\s\w{3})\s.*?"
r"(?P<description>\w.*?)\s*"
r"(?P<amount>[\d.,]+)$"
Expand Down

0 comments on commit b5eee68

Please sign in to comment.