Skip to content

Cap structured revenue shares at 100% - #73

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
zaguzovmaksim0-hue:fix/revenue-share-max-100
Sep 11, 2026
Merged

Cap structured revenue shares at 100%#73
ralyodio merged 1 commit into
profullstack:masterfrom
zaguzovmaksim0-hue:fix/revenue-share-max-100

Conversation

@zaguzovmaksim0-hue

Copy link
Copy Markdown
Contributor

What changed

  • enforce the same 100% ceiling for structured revenue_share pay objects that the text parser already enforces
  • add regression coverage for a 150% single value, a 50–150% range, and a valid 10–25% range

Reproduction

Before this fix:

parsePayLine('150% revenue share')
=> "A revenue share is at most 100%."

normalisePay({ pay: [{ type: 'revenue_share', amount: 150 }] })
=> accepted as 150%

That allowed REST/MCP/CLI structured callers to persist a shape rejected by the human-readable parser.

Tests

  • node --test test/pay.test.ts — 11/11 pass
  • pnpm test — pass on Android/Termux; the database-dependent API suite skips when local Postgres is unavailable, as designed

Closes #72

@ralyodio
ralyodio merged commit bdfb867 into profullstack:master Sep 11, 2026
4 checks passed
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.

Structured revenue-share pay accepts values above 100%

2 participants