Skip to content

Commit

Permalink
refactor(banks): rename auto_polarity to transaction_auto_polarity
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Nov 15, 2024
1 parent 10236b4 commit 6553b98
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/monopoly/banks/bank_of_america/boa.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BankOfAmerica(BankBase):
transaction_pattern=CreditTransactionPatterns.BANK_OF_AMERICA,
multiline_transactions=True,
safety_check=False,
auto_polarity=False,
transaction_auto_polarity=False,
)

identifiers = [
Expand Down
2 changes: 1 addition & 1 deletion src/monopoly/banks/chase/chase.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Chase(BankBase):
header_pattern=regex(r"(.*Transaction.*Merchant Name .*\$ Amount)"),
transaction_pattern=CreditTransactionPatterns.CHASE,
multiline_transactions=True,
auto_polarity=False,
transaction_auto_polarity=False,
)

identifiers = [
Expand Down
4 changes: 2 additions & 2 deletions src/monopoly/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class StatementConfig:
number of spaces will be ignored. For example, if `transaction_bound` = 32:
"01 NOV BALANCE B/F 190.77" (will be ignored)
"01 NOV YA KUN KAYA TOAST 12.00 " (will be kept)
- `auto_polarity` controls whether transaction amounts are set as negative.
- `transaction_auto_polarity` controls whether transaction amounts are set as negative.
or positive if they have 'CR' or '+' as a suffix. Enabled by default.
If enabled, only 'CR' or '+' will make a transaction positive. Disabled by default.
- `safety_check` controls whether the safety check for banks. Use
Expand All @@ -65,7 +65,7 @@ class StatementConfig:
transaction_bound: Optional[int] = None
prev_balance_pattern: Optional[Pattern[str] | RegexEnum] = None
safety_check: bool = True
auto_polarity: bool = True
transaction_auto_polarity: bool = True


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion src/monopoly/statements/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_transactions(self) -> list[Transaction] | None:
)
transaction = Transaction(
**processed_match.groupdict,
auto_polarity=self.config.auto_polarity,
auto_polarity=self.config.transaction_auto_polarity,
)
transactions.append(transaction)

Expand Down

0 comments on commit 6553b98

Please sign in to comment.