-
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
19760 - initial partial refunds model persistence #1415
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1415 +/- ##
==========================================
+ Coverage 91.45% 91.93% +0.48%
==========================================
Files 186 193 +7
Lines 11319 12975 +1656
==========================================
+ Hits 10352 11929 +1577
- Misses 967 1046 +79
Flags with carried forward coverage won't be shown. Click here to find out more.
|
aaa597a
to
e8179bf
Compare
# Conflicts: # pay-api/src/pay_api/models/refunds_partial.py # pay-api/src/pay_api/services/refund.py # pay-api/src/pay_api/utils/converter.py
- test update - fix converter structure enum issue
|
||
|
||
class Converter(cattrs.Converter): | ||
"""Addon to cattr converter.""" | ||
|
||
def __init__(self): | ||
def __init__(self, camel_to_snake_case: bool = False, enum_to_value: bool = False): |
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 should probably convert this into a data class for ConverterOptions if we start adding more configurations in the future
def find_by_invoice_id(cls, invoice_id: int): | ||
"""Return refund partials by invoice id.""" | ||
return db.session.query(RefundsPartial)\ | ||
.join(PaymentLineItem, PaymentLineItem.id == RefundsPartial.payment_line_item_id)\ | ||
.filter(PaymentLineItem.invoice_id == invoice_id).all() |
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 better to put this in the service and keep the models barebones?
You reference to payment_line_item
in the model, which could cause some pain of circular dependencies in the future
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.
agreed, good call
Quality Gate passedIssues Measures |
Issue #:
bcgov/entity#19760
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).