Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

22391 - EFT Multi Account under payment #1738

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

ochiu
Copy link
Collaborator

@ochiu ochiu commented Sep 10, 2024

Issue #:
bcgov/entity#22391

Description of changes:

  • Add statement summary multi account under payment logic
  • short name service refactor for eft credit balance to avoid cyclic issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the sbc-pay license (Apache 2.0).

- short name service refactor for eft credit balance to avoid cyclic issue
@@ -75,16 +75,6 @@ class EFTShortnamesSearch: # pylint: disable=too-many-instance-attributes
class EFTShortnames: # pylint: disable=too-many-instance-attributes
"""Service to manage EFT short name model operations."""

@staticmethod
def get_eft_credit_balance(short_name_id: int) -> Decimal:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to model due to cyclic issues with statement service.

As previously discussed we will be refactoring this service to split it out later. Depending on the query some of these functions are probably better in the model.

InvoiceModel.invoice_status_code.in_([InvoiceStatus.APPROVED.value,
InvoiceStatus.OVERDUE.value])))
.filter(
InvoiceModel.payment_account_id.in_(accounts_query)).subquery())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested against several large accounts for this in clause, at once. Results came back in about 100ms

@seeker25
Copy link
Collaborator

Hold off for release

@ochiu
Copy link
Collaborator Author

ochiu commented Sep 10, 2024

Working on a test to set up multi account link to trigger under payment flag.

@classmethod
def find_by_short_name_id(cls, short_name_id: int):
def find_by_short_name_id(cls, short_name_id: int) -> Self:
Copy link
Collaborator

@seeker25 seeker25 Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool I think I was using futures, but this looks better

- under payment calculation fix
- PR feedback tweak
- unit tests
@ochiu ochiu marked this pull request as ready for review September 12, 2024 16:55
@ochiu ochiu merged commit 96cfc24 into bcgov:main Sep 12, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants