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

chore: add payments by product backend validation #7077

Merged
merged 11 commits into from
Feb 14, 2024

Conversation

tshuli
Copy link
Contributor

@tshuli tshuli commented Feb 12, 2024

Problem

  • There is currently no backend validation for payments by product.

Solution

Bug Fixes:

  • Adds backend validation for payments by product

Tests

  • Create payments by product. Can submit normally.
    • Load the form. Change the payment amount in form definition. Submission should fail.
    • Load the form. Delete the product in form definition and add another product. Submission should fail.
    • Load the form. Change to multi quantity of 2 to 5. Submission with qty 1 should fail.
    • Load the form. Submission with Qty 6 should fail
    • Load the form. Now disable multi quantity. Submission with qty 4 should fail.
  • Create payments by amount form. Can submit normally.

data: {
...mockValidProduct,
max_qty: 5,
_id: new ObjectId(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove _id since we only want to test rejection from max_qty changed instead of _id

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks for catching

@KenLSM KenLSM enabled auto-merge (squash) February 14, 2024 03:15
@KenLSM KenLSM merged commit 1a19628 into develop Feb 14, 2024
24 checks passed
@KenLSM KenLSM deleted the fix/payments-be-validation branch February 14, 2024 03:40
@tshuli tshuli mentioned this pull request Feb 14, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants