-
Notifications
You must be signed in to change notification settings - Fork 39
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
19334 - Adding Find EFT Accounts Endpoint #1392
Conversation
commit ef9265c5a623edc516843c8c84237f19af033e78 Merge: 440bc022 3954c24 Author: Rodrigo Barraza <hello@rod.dev> Date: Tue Jan 30 14:11:01 2024 -0800 Merge branch 'main' into feature/19934 commit 440bc02284e78881bf0b366a289cb2ae99137e64 Author: Rodrigo Barraza <hello@rod.dev> Date: Tue Jan 30 14:10:24 2024 -0800 Find Eft accounts
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1392 +/- ##
==========================================
+ Coverage 91.45% 92.10% +0.64%
==========================================
Files 186 193 +7
Lines 11319 12732 +1413
==========================================
+ Hits 10352 11727 +1375
- Misses 967 1005 +38
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -652,6 +654,34 @@ def find_by_id(cls, account_id: int): | |||
account._dao = PaymentAccountModel.find_by_id(account_id) # pylint: disable=protected-access | |||
return account | |||
|
|||
@classmethod | |||
def find_eft_accounts(cls, page: int, limit: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_unlinked_eft_accounts or have the state as a filter param?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup need this otherwise pagination wont work that well for the two screens
query = query.order_by(PaymentAccountModel.id) | ||
pagination = query.paginate(per_page=eft_accounts_search.limit, page=eft_accounts_search.page) | ||
|
||
total = pagination.total |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'total': pagination.total
eft_accounts_list = [PaymentAccountSearchModel.from_row(eft_account) for eft_account in pagination.items]
|
||
eft_accounts_list = [PaymentAccountSearchModel.from_row(eft_account) for eft_account in eft_accounts] | ||
converter = Converter() | ||
eft_accounts_list = converter.unstructure(eft_accounts_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converter().unstructure(eft_accounts_list)
Issue #:19334
bcgov/entity#19334
Description of changes:
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).