Summary
Creator ID params arrive as strings from the URL but are stored as integers in the database. Each handler currently coerces the type independently. A shared helper that parses and validates a creator ID string should be used at the start of every handler that accepts a creator ID.
Scope
- Add
parseCreatorId(raw: string): number helper that parses to integer and throws a 400 error if the value is not a positive integer
- Use the helper in: creator detail, creator holders, creator webhooks, buyback quote endpoints
- Add unit tests for: valid integer string, float string, negative number, non-numeric string, empty string
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Creator ID params arrive as strings from the URL but are stored as integers in the database. Each handler currently coerces the type independently. A shared helper that parses and validates a creator ID string should be used at the start of every handler that accepts a creator ID.
Scope
parseCreatorId(raw: string): numberhelper that parses to integer and throws a 400 error if the value is not a positive integerAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram