Skip to content

Fixes and enhancements for Cashier checkout service - #1

Merged
nelsonmfinda merged 5 commits into
mainfrom
develop
Apr 16, 2026
Merged

nelsonmfinda merged 5 commits into
mainfrom
develop

Conversation

@nelsonmfinda

Copy link
Copy Markdown
Owner

Bug fixes:

  • Remove double rounding (rules + total) → single rounding point
  • Add zero/negative quantity handling in pricing rules
  • Validate rule configuration (duplicate codes, threshold, denominator, numerator)

Performance:

  • Cache total in session state (O(1) instead of O(n) per total() call)
  • Pre-build rule index at session creation

Validation:

  • Add price upper bound (£999,999.99)
  • Validate product codes (non-empty, non-whitespace)
  • Make validate_rules!/1 public for testing

Testing:

  • Add doctests for documentation examples
  • Add comprehensive Defaults validation tests

@nelsonmfinda nelsonmfinda self-assigned this Apr 16, 2026
@nelsonmfinda nelsonmfinda added the bug Something isn't working label Apr 16, 2026
@nelsonmfinda
nelsonmfinda merged commit 3d16f29 into main Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant