-
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
Changes from 4 commits
d9cc82d
7b1257d
cbdfefc
cadaf7c
baf1678
7699601
a8449dc
9d0385a
98a4e3f
9b3b5c3
6bd564c
5b9735f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""18099-eft allowed flag | ||
|
||
Revision ID: 2ef58b39cafc | ||
Revises: 194cdd7cf986 | ||
Create Date: 2023-10-26 13:31:50.959562 | ||
|
||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '2ef58b39cafc' | ||
down_revision = '194cdd7cf986' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.execute("set statement_timeout=20000;") | ||
op.add_column('payment_accounts', sa.Column('eft_enable', sa.Boolean, nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
op.execute("set statement_timeout=20000;") | ||
op.drop_column('payment_accounts', 'eft_enable') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""18099-eft allowed flag | ||
|
||
Revision ID: 7d5231f2b9ac | ||
Revises: 2ef58b39cafc | ||
Create Date: 2023-10-26 13:55:46.291450 | ||
|
||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '7d5231f2b9ac' | ||
down_revision = '2ef58b39cafc' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
"""Update eft_enable in payment_accounts table.""" | ||
# 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I removed this file, it gonna handle by ticket 18100 |
||
SET eft_enable = true \ | ||
WHERE id IN ( \ | ||
SELECT pa.id \ | ||
FROM payment_accounts pa \ | ||
RIGHT JOIN invoices i ON i.payment_account_id = pa.id \ | ||
WHERE i.payment_method_code IN (\'EFT\', \'DIRECT_PAY\') \ | ||
)') | ||
|
||
def downgrade(): | ||
pass |
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