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

22063 - Allow multiple payment methods, also create multiple CFS accounts to support EFT/PAD switching #1597

Merged
merged 47 commits into from
Jul 12, 2024

Conversation

seeker25
Copy link
Collaborator

@seeker25 seeker25 commented Jul 2, 2024

Issue #:
bcgov/entity#22063

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).

Copy link
Collaborator

@ochiu ochiu left a comment

Choose a reason for hiding this comment

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

Looks good

@seeker25 seeker25 closed this Jul 5, 2024
@seeker25 seeker25 reopened this Jul 5, 2024
@seeker25 seeker25 changed the title 22063 - Fix update_account, so it doesn't set cfs_account to inactive 22063 - Allow multiple payment methods, also create multiple CFS accounts to support EFT/PAD switching Jul 5, 2024
@seeker25
Copy link
Collaborator Author

seeker25 commented Jul 8, 2024

Note: Need to do a few tests for this:

  1. Switching between BCOL / EFT / PAD
  2. Switching between ONLINE_BANKING / CREDIT CARD
  3. Routing Slip flows

@@ -175,13 +175,14 @@ def get_payment_methods_query(statement: StatementModel):
.select_from(subquery)
.where(
and_(
subquery.c.start_date != subquery.c.end_date,
Copy link
Collaborator Author

@seeker25 seeker25 Jul 11, 2024

Choose a reason for hiding this comment

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

Not sure if this is enough on the real system yet

Are the history rows 5ms away from each other or exact like the unit test?

func.lag(union_query.c.end_date)
.over(order_by=union_query.c.version.asc())
func.coalesce(func.lag(union_query.c.end_date)
.over(order_by=union_query.c.version.asc()), datetime.min.date())
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add in a default for start_date, being the min date

@@ -138,7 +138,7 @@ def get_payment_methods_query(statement: StatementModel):
PaymentAccountModel.id,
PaymentAccountModel.payment_method,
PaymentAccountModel.version,
literal(None).label('end_date')
literal(datetime.max.date()).label('end_date')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

default for end_date

@@ -702,11 +702,22 @@ def test_statement_various_payment_methods_history(db, app):
"""Unit test to test various payment methods over the life of a statement."""
# We aren't using the session fixture here because we want to test the history_cls
# history_cls wont work on scoped session flush.
# Freezegun etc doesn't work here.
changed_column = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not super fun here...

Copy link
Collaborator

@Jxio Jxio left a comment

Choose a reason for hiding this comment

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

LGTM

@seeker25
Copy link
Collaborator Author

Fixing pay jobs, then local testing

@seeker25 seeker25 merged commit ecfafc8 into bcgov:main Jul 12, 2024
15 of 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.

4 participants