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

16843 - Add in condition to not create NSF invoices if the account is already… #1202

Merged
merged 3 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 41 additions & 28 deletions queue_services/payment-reconciliations/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-e git+https://github.com/bcgov/lear.git@757ebe62916fe4e9467cf8505ddd41e15ae3282e#egg=entity_queue_common&subdirectory=queue_services/common
-e git+https://github.com/bcgov/sbc-common-components.git@a8a2074b12dbf36cc23634206e37d57ccfa5a33d#egg=sbc_common_components&subdirectory=python
-e git+https://github.com/bcgov/sbc-pay.git@858402b14285103f9c2f168d9541531893184b04#egg=pay_api&subdirectory=pay-api
-e git+https://github.com/bcgov/lear.git@30dba30463c99aaedfdcfd463213e71ba0d35b51#egg=entity_queue_common&subdirectory=queue_services/common
-e git+https://github.com/bcgov/sbc-common-components.git@b93585ea3ac273b9e51c4dd5ddbc8190fd95da6a#egg=sbc_common_components&subdirectory=python
-e git+https://github.com/bcgov/sbc-pay.git@3cc3fc5685a6f419bf92bf6601834b24cab290b1#egg=pay_api&subdirectory=pay-api
Flask-Caching==2.0.2
Flask-Migrate==2.7.0
Flask-Moment==1.0.5
Expand All @@ -10,71 +10,84 @@ Flask-Script==2.0.6
Flask==1.1.2
Jinja2==3.0.3
Mako==1.2.4
MarkupSafe==2.1.2
SQLAlchemy-Continuum==1.3.14
SQLAlchemy-Utils==0.40.0
MarkupSafe==2.1.3
PyMeeus==0.5.12
SQLAlchemy-Continuum==1.3.15
SQLAlchemy-Utils==0.41.1
SQLAlchemy==1.3.24
Werkzeug==1.0.1
aiohttp==3.8.4
aiosignal==1.3.1
alembic==1.10.2
alembic==1.11.1
aniso8601==9.0.1
async-timeout==4.0.2
asyncio-nats-client==0.11.5
asyncio-nats-streaming==0.4.0
attrs==22.2.0
blinker==1.5
attrs==23.1.0
blinker==1.6.2
cachelib==0.9.0
cattrs==22.2.0
certifi==2022.12.7
cachetools==5.3.1
cattrs==23.1.2
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.3
croniter==1.3.8
cryptography==41.0.0
dpath==2.1.5
convertdate==2.4.0
croniter==1.4.1
cryptography==41.0.1
dpath==2.1.6
ecdsa==0.18.0
exceptiongroup==1.1.1
expiringdict==1.2.2
flask-jwt-oidc==0.3.0
flask-marshmallow==0.11.0
flask-restx==1.1.0
frozenlist==1.3.3
google-api-core==2.11.1
google-auth==2.18.1
google-cloud-pubsub==2.17.0
googleapis-common-protos==1.59.1
grpc-google-iam-v1==0.12.6
grpcio-status==1.48.2
grpcio==1.54.2
gunicorn==20.1.0
hijri-converter==2.3.1
holidays==0.23
idna==3.4
importlib-metadata==6.1.0
importlib-resources==5.12.0
itsdangerous==2.0.1
jaeger-client==4.8.0
jsonschema==4.17.3
launchdarkly-server-sdk==8.1.1
korean-lunar-calendar==0.3.1
launchdarkly-server-sdk==8.1.4
marshmallow-sqlalchemy==0.25.0
marshmallow==3.19.0
minio==7.1.14
minio==7.1.15
multidict==6.0.4
opentracing==2.4.0
packaging==23.0
pkgutil_resolve_name==1.3.10
packaging==23.1
proto-plus==1.22.2
protobuf==3.19.6
psycopg2-binary==2.9.5
psycopg2-binary==2.9.6
pyRFC3339==1.1
pyasn1==0.4.8
pyasn1-modules==0.3.0
pyasn1==0.5.0
pycountry==22.3.5
pycparser==2.21
pyrsistent==0.19.3
python-dateutil==2.8.2
python-dotenv==1.0.0
python-jose==3.3.0
pytz==2023.2
pytz==2023.3
requests==2.31.0
rsa==4.9
semver==2.13.0
sentry-sdk==1.18.0
sentry-sdk==1.26.0
simple-cloudevent @ git+https://github.com/daxiom/simple-cloudevent.py.git@447cabb988202206ac69e71177d7cd11b6c0b002
six==1.16.0
strict-rfc3339==0.7
threadloop==1.0.2
thrift==0.16.0
tornado==6.3.2
typing_extensions==4.5.0
urllib3==1.26.15
yarl==1.8.2
zipp==3.15.0
typing_extensions==4.6.3
urllib3==1.26.16
yarl==1.9.2
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
-e git+https://github.com/bcgov/sbc-common-components.git#egg=sbc-common-components&subdirectory=python
# -e git+https://github.com/bcgov/sbc-pay.git@refunds#egg=pay-api&subdirectory=pay-api
-e git+https://github.com/bcgov/sbc-pay.git@main#egg=pay-api&subdirectory=pay-api
git+https://github.com/daxiom/simple-cloudevent.py.git
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,14 @@ def _process_failed_payments(row):
# Set CFS Account Status.
payment_account: PaymentAccountModel = _get_payment_account(row)
cfs_account: CfsAccountModel = CfsAccountModel.find_effective_by_account_id(payment_account.id)
is_already_frozen = cfs_account.status == CfsAccountStatus.FREEZE.value
logger.info('setting payment account id : %s status as FREEZE', payment_account.id)
cfs_account.status = CfsAccountStatus.FREEZE.value
# Call CFS to stop any further PAD transactions on this account.
CFSService.suspend_cfs_account(cfs_account)
if is_already_frozen:
logger.info('Ignoring NSF message for invoice : %s as the account is already FREEZE', inv_number)
return False
# Find the invoice_reference for this invoice and mark it as ACTIVE.
inv_references: List[InvoiceReferenceModel] = db.session.query(InvoiceReferenceModel). \
filter(InvoiceReferenceModel.status_code == InvoiceReferenceStatus.COMPLETED.value). \
Expand Down