Description — what to implement and the why/impact.
Group expense creation currently lacks robust request payload validation at the Fastify route boundary. Adding a strict Zod schema for expense creation ensures that descriptions, amounts, currency types, and participant split shares are thoroughly validated before hitting business logic or database queries.
Context & Requirements — background, constraints, design references, edge cases;
- Grounded in
src/ modules where Fastify routes are registered.
- Must validate numeric amounts (must be positive), supported currency codes (XLM, USDC), and ensure participant split percentages or exact shares sum correctly.
- Follow TypeScript strict rules and use Zod for validation schemas matching existing API conventions.
Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".
Implementation Guidance — likely files/modules to touch
- Likely files:
src/schemas/expense.ts (or equivalent schema directory) and associated route files under src/routes/.
- Suggested approach: Define the schema using
z.object(), attach it to Fastify route options, and write unit tests using Vitest.
Testing & Validation — how the contributor should prove it works
- Run
npm test to verify all tests pass, including new validation unit tests.
Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting.
Wave complexity: Trivial
Description — what to implement and the why/impact.
Group expense creation currently lacks robust request payload validation at the Fastify route boundary. Adding a strict Zod schema for expense creation ensures that descriptions, amounts, currency types, and participant split shares are thoroughly validated before hitting business logic or database queries.
Context & Requirements — background, constraints, design references, edge cases;
src/modules where Fastify routes are registered.Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".
Implementation Guidance — likely files/modules to touch
src/schemas/expense.ts(or equivalent schema directory) and associated route files undersrc/routes/.z.object(), attach it to Fastify route options, and write unit tests using Vitest.Testing & Validation — how the contributor should prove it works
npm testto verify all tests pass, including new validation unit tests.Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting.
Wave complexity: Trivial