fix(ack-pay): validate string payment amounts - #159
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
WalkthroughThe payment option schemas now restrict string amounts to positive integers. Valibot and Zod accept large positive integer strings and reject malformed, fractional, zero, negative, empty, and nonnumeric values. Tests cover both implementations, and a patch changeset records the update. ChangesPayment amount validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change restricts string payment amounts to positive integer representations while preserving large-integer support; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Tighten
paymentOptionSchema.amountvalidation so string amounts follow the same positive-integer contract as numeric amounts.Currently the numeric branch requires a positive integer, while the string branch accepts any string. This allows values such as
"","0","-1","1.5", and"abc"through schema validation even though payment amounts are expressed as integers in the smallest currency unit.Changes
@agentcommercekit/ack-paypatch changesetValidation
The regression tests cover positive numeric/string integers and reject zero, negative, fractional, empty, and non-numeric values in both schema implementations.
Summary by CodeRabbit
Bug Fixes
Tests
Chores