Skip to content

Commit

Permalink
Merge pull request #33 from PSNAppz/1.0.0
Browse files Browse the repository at this point in the history
Add reported_in_mt940 to AccountingLog
  • Loading branch information
venky-ganapathy authored Oct 7, 2024
2 parents 0d0bf96 + 10a2ea1 commit 9ffeb0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def account_statement_generator(account_statement_id: int):
account_logs = (
session.execute(
select(AccountingLog).where(
AccountingLog.account_number == account_statement.account_number
AccountingLog.account_number == account_statement.account_number,
AccountingLog.reported_in_mt940.is_(False),
)
)
.scalars()
Expand Down Expand Up @@ -115,6 +116,9 @@ def account_statement_generator(account_statement_id: int):
f"\n{account_log.narrative_5}\n{account_log.narrative_6}",
)
)
# Update the log to indicate that it has been reported in the MT940 statement
account_log.reported_in_mt940 = True


statement = mt940_writer.create_statement(
account_statement_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enum import Enum

from openg2p_fastapi_common.models import BaseORMModelWithTimes
from sqlalchemy import DateTime, Float, String, Text
from sqlalchemy import DateTime, Float, String, Text, Boolean
from sqlalchemy import Enum as SqlEnum
from sqlalchemy.orm import Mapped, mapped_column

Expand Down Expand Up @@ -43,3 +43,4 @@ class AccountingLog(BaseORMModelWithTimes):
narrative_6: Mapped[str] = mapped_column(
String, nullable=True
) # beneficiary phone number
reported_in_mt940: Mapped[bool] = mapped_column(Boolean, default=False)

0 comments on commit 9ffeb0f

Please sign in to comment.