-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add discounts #182
base: dev
Are you sure you want to change the base?
Add discounts #182
Conversation
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
insalan/payment/models.py:442
- [nitpick] The error message 'Discount already used' could be more user-friendly. Consider changing it to 'This discount has already been used.'
raise DiscountAlreadyUsedError("Discount already used")
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
insalan/payment/models.py:442
- Add a test to cover the scenario where a discount is already used and the
DiscountAlreadyUsedError
is raised.
raise DiscountAlreadyUsedError("Discount already used")
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
insalan/payment/models.py:425
- [nitpick] Consider adding validation for the length and content of the reason field.
reason = models.CharField(max_length=200, verbose_name=_("Motif"))
insalan/payment/views.py:434
- The comment on line 434 should be aligned with the code block it describes for better readability.
# Check if the discount is applicable
Description
Add a way to create a discount for a given user + product.
Discount will then be subtracted from the payment total and marked as used when the payment is successful.
TODO : add documentation
Checklist
Related Issues
Fix #181
Screenshots