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

20719- Interim Statements Settings Fix #1584

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

ochiu
Copy link
Collaborator

@ochiu ochiu commented Jun 26, 2024

Issue #:
bcgov/entity#20719

Description of changes:

  • fixes incorrect date ranges generated for interim statement settings
  • Add ability to generate statements filtered by account. This allows us to generate a monthly statement early on a specific account without affecting other accounts

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

@@ -156,6 +156,7 @@ def run(job_name, argument=None):
if __name__ == "__main__":
print('----------------------------Scheduler Ran With Argument--', sys.argv[1])
if (len(sys.argv) > 2):
run(sys.argv[1], sys.argv[2])
params = sys.argv[2:len(sys.argv)]
run(sys.argv[1], params)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update to allow any number of parameters to be passed in when running a job.

"""Generate statements.

Steps:
1. Get all payment accounts and it's active statement settings.
"""
date_override = arguments[0] if arguments and len(arguments) > 0 else None
auth_account_override = arguments[1] if arguments and len(arguments) > 1 else None
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

allow a specific account number to be filtered on. This allows us to generate a monthly statement using the interim statement settings before the month is up without affecting other accounts

Copy link
Collaborator

@seeker25 seeker25 Jun 26, 2024

Choose a reason for hiding this comment

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

Great idea, I was thinking about this the other day, when I had to regenerate statements for a client

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 72.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 82.62%. Comparing base (79924ce) to head (c5c54cf).
Report is 189 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1584      +/-   ##
==========================================
- Coverage   91.45%   82.62%   -8.84%     
==========================================
  Files         186       23     -163     
  Lines       11319     1974    -9345     
==========================================
- Hits        10352     1631    -8721     
+ Misses        967      343     -624     
Flag Coverage Δ
bcolapi ?
eventlistenerqueue ?
payapi ?
paymentjobs 82.62% <72.00%> (+2.40%) ⬆️
paymentreconciliationsqueue ?
reportapi ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
jobs/payment-jobs/tasks/statement_task.py 87.73% <72.00%> (+7.30%) ⬆️

... and 166 files with indirect coverage changes

@@ -322,6 +321,114 @@ def test_get_monthly_interim_statement(session, admin_users_mock):
assert monthly_invoices[0].invoice_id == monthly_invoice.id


def test_interim_statement_settings_eft(db, session, admin_users_mock):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ken found some anomalies which was more prevalent when swapping payment methods within the same day.
Fix was for this issue and added a test.

@ochiu ochiu merged commit 83c1a4c into bcgov:main Jun 26, 2024
9 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