-
Notifications
You must be signed in to change notification settings - Fork 40
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
19875 - PAY Jobs - Disbursement Process handle Partial Refunds #1428
Merged
Merged
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
a8e7030
init code for partial refund disbursement
Jxio b099d8e
remove get partial refund invoice, replace with get partial refund pa…
Jxio 305d0f8
fix unit test
Jxio ade7598
lint fix
Jxio a0aa26b
code review fix
Jxio de3d012
add partial refund for disbursement instead of PLI
Jxio 8616928
lint fix
Jxio ea17880
partial_refund ejv disbursement updates from code review
Jxio d44db51
update ejv distribution task with generic ejv_invoice_link table
Jxio a7ba4ad
add migration file for changing ejv_invoice_links
Jxio 4a1e10e
update EJV_invoice_links table to generic ejv_links
Jxio 67bdc7a
rename ejv_invoice_link.py to ejv_link.py
Jxio bcac23a
ejv_content fix
Jxio 2368917
remove merge conflict
Jxio 42b0bc5
pylint fix
Jxio 216e12d
migration fix for code review
Jxio 256562a
fix merge conflict
Jxio c683987
update EJVLinkType enums
Jxio c57ab51
lint fix
Jxio 4f9b348
lint fix
Jxio 93853d1
update pay-api path for git unit testing
Jxio 8c00382
poetry lock --no-update and lint fix
Jxio 945077a
update UPDATE ejv_links set link_type='invoice' sql migration
Jxio 7fb39a5
poetry lock
Jxio 53e6100
run poetry lock for pay-queue to fix unit test error
Jxio 9ded21e
pay-queue update for EJVInvoiceLink table name change
Jxio 15f8108
fix for code review
Jxio be28451
lint fix
Jxio cf78266
payment jobs poetry lock change - fix payment jobs unit test
Jxio db2f862
remove ejv_invoice_links_invoice_id_fkey
Jxio b61b261
poetry update
Jxio 62ceadd
partial refund disbursement unit test fix
Jxio 0a3b76f
unit test fix
Jxio e32be38
code review fixing
Jxio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,13 @@ | |
from pay_api.models import DistributionCode as DistributionCodeModel | ||
from pay_api.models import EjvFile as EjvFileModel | ||
from pay_api.models import EjvHeader as EjvHeaderModel | ||
from pay_api.models import EjvInvoiceLink as EjvInvoiceLinkModel | ||
from pay_api.models import EjvLink as EjvLinkModel | ||
from pay_api.models import Invoice as InvoiceModel | ||
from pay_api.models import InvoiceReference as InvoiceReferenceModel | ||
from pay_api.models import PaymentAccount as PaymentAccountModel | ||
from pay_api.models import db | ||
from pay_api.utils.enums import DisbursementStatus, EjvFileType, InvoiceReferenceStatus, InvoiceStatus, PaymentMethod | ||
from pay_api.utils.enums import ( | ||
DisbursementStatus, EjvFileType, EJVLinkType, InvoiceReferenceStatus, InvoiceStatus, PaymentMethod) | ||
from pay_api.utils.util import generate_transaction_number | ||
|
||
from tasks.common.cgi_ejv import CgiEjv | ||
|
@@ -181,9 +182,10 @@ def _create_ejv_file_for_gov_account(cls, batch_type: str): # pylint:disable=to | |
for inv in invoices: | ||
current_app.logger.debug(f'Creating EJV Invoice Link for invoice id: {inv.id}') | ||
# Create Ejv file link and flush | ||
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. Remove this, it's useless |
||
ejv_invoice_link = EjvInvoiceLinkModel(invoice_id=inv.id, ejv_header_id=ejv_header_model.id, | ||
disbursement_status_code=DisbursementStatus.UPLOADED.value, | ||
sequence=sequence) | ||
ejv_invoice_link = EjvLinkModel(link_id=inv.id, link_type=EJVLinkType.INVOICE.value, | ||
ejv_header_id=ejv_header_model.id, | ||
disbursement_status_code=DisbursementStatus.UPLOADED.value, | ||
sequence=sequence) | ||
db.session.add(ejv_invoice_link) | ||
sequence += 1 | ||
# Set distribution status to invoice | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
|
||
from pay_api.models import ( | ||
CfsAccount, DistributionCode, DistributionCodeLink, EFTShortnames, Invoice, InvoiceReference, Payment, | ||
PaymentAccount, PaymentLineItem, Receipt, Refund, RoutingSlip, StatementRecipients, StatementSettings) | ||
PaymentAccount, PaymentLineItem, Receipt, Refund, RefundsPartial, RoutingSlip, StatementRecipients, | ||
StatementSettings) | ||
from pay_api.utils.enums import ( | ||
CfsAccountStatus, InvoiceReferenceStatus, InvoiceStatus, LineItemStatus, PaymentMethod, PaymentStatus, | ||
PaymentSystem, RoutingSlipStatus) | ||
|
@@ -334,3 +335,20 @@ def factory_refund_invoice( | |
requested_by='TEST', | ||
details=details | ||
).save() | ||
|
||
|
||
def factory_refund_partial( | ||
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. much better |
||
payment_line_item_id: int, | ||
refund_amount: float, | ||
refund_type: str, | ||
created_by='test', | ||
created_on: datetime = datetime.now() | ||
): | ||
"""Return Factory.""" | ||
return RefundsPartial( | ||
payment_line_item_id=payment_line_item_id, | ||
refund_amount=refund_amount, | ||
refund_type=refund_type, | ||
created_by=created_by, | ||
created_on=created_on | ||
).save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Probably need a method comment? just convert into that?
"""Create Ejv file link and flush."""