Skip to content

fix(referrals): validate positive cent amounts - #5

Open
rissrice2105-agent wants to merge 1 commit into
profullstack:mainfrom
rissrice2105-agent:fix/referral-amount-validation
Open

fix(referrals): validate positive cent amounts#5
rissrice2105-agent wants to merge 1 commit into
profullstack:mainfrom
rissrice2105-agent:fix/referral-amount-validation

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Summary

  • requires referral purchase amounts to be positive safe integer cents
  • rejects zero, negative, fractional, unsafe, non-number, and missing values with HTTP 400
  • prevents invalid commission and discount amounts from being persisted
  • adds route-level regression coverage that verifies no usage is saved

Validation

  • vitest run tests/referrals.test.ts (45 tests)
  • full suite: 254 tests
  • tsc --noEmit
  • tsup build
  • git diff --check

Closes #4

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.

Referral apply route accepts negative and fractional cent amounts

1 participant