Skip to content

Add helper for normalizing creator ID param to consistent type before database lookup #468

Description

@Chucks1093

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

  • Valid positive integer string parses correctly
  • All invalid inputs throw a 400-shaped error
  • Helper used consistently across all creator ID params

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions