-
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
18099 - PAY API - endpoint to add EFT Allowed flag to an account #1307
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1307 +/- ##
==========================================
+ Coverage 91.45% 92.02% +0.56%
==========================================
Files 186 199 +13
Lines 11319 11750 +431
==========================================
+ Hits 10352 10813 +461
+ Misses 967 937 -30
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Shouldn't this be an endpoint you can use to enable EFT on a user's account? Aka they can't choose EFT until someone goes into the backend and flips the switch via notebook?
a resource should be built that can be called via notebook that sets |
|
@Jxio @seeker25 caused by a recent change to the invoice model to have a default for the overdue_date and it uses the current_local_time() function requiring the LEGISLATIVE_TIMEZONE. @Jxio would you be able to add the below to the config.py for the event_listener in this PR please? If preferred I can also submit another PR. Just let me know thanks!
|
I figured as much |
@seeker25 |
Yeah but we don't want to enable eft for every client only the 300 in the list mostly. Thus why we need a flag to enable or disable on an account basis. |
|
|
||
def upgrade(): | ||
op.execute("set statement_timeout=20000;") | ||
op.add_column('payment_accounts', sa.Column('eft_enable', sa.Boolean, nullable=True)) |
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.
We can probably default the new flag to false and make it not nullable.
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.
ok sounds good
# eft_enable set to true when it has invoices paid with EFT/DIRECT_PAY payment method historically | ||
op.execute("set statement_timeout=20000;") | ||
conn = op.get_bind() | ||
conn.execute('UPDATE payment_accounts \ |
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.
I don't think this is necessary, we want to enable specific accounts via notebook. It will also give us flexibility to enable a subset of accounts if we want and we want to send a welcome email when we enable it for accounts.
A new route/endpoint is beneficial as we can secure it differently than the existing payment account endpoints and have separate logic like the welcome email when we enable this flag.
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.
I removed this file, it gonna handle by ticket 18100
lint + unit tests before merging pls |
@@ -564,6 +577,7 @@ def asdict(self, **kwargs): | |||
# to handle PAD 3 day period..UI needs bank details even if PAD is not activated | |||
is_future_pad = (self.payment_method == PaymentMethod.DRAWDOWN.value) and (self._is_pad_in_pending_activation()) | |||
show_cfs_details = is_ob_or_pad or is_future_pad | |||
d['eft_enable'] = self._dao.eft_enable |
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.
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.
I tested with postman, when the eft_enable is false, it doesn't show up. I'm removing eft_enable = fields.Boolean(...)
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.
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.
Might be able to mess with something in here -^
Something else I noticed, what about the route? |
That's the GET, we still need a PATCH route so we can set It needs to check for the SYSTEM role |
@classmethod | ||
def enable_eft(cls, auth_account_id: str) -> PaymentAccount: | ||
"""Enable EFT on the payment account.""" | ||
current_app.logger.debug('<patch_account') |
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.
This isn't part of patch account, this is enable_eft - patch account calls enable_eft
except ServiceUnavailableException as exception: | ||
return exception.response() | ||
|
||
status = HTTPStatus.ACCEPTED \ |
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.
Why would this be ACCEPTED or OK? I don't see you providing any option to disable eft
I'd just return OK
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Issue #:
bcgov/entity#18099
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).