You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unified invoice DTO and OpenAPI-style contract published for FE and BE #446
Shared types exist, but create, list, detail, verify payloads and errors can still drift between Express and Next.js.
Goal
Publish a complete invoice API contract (create, get, list, cancel, verify, stats) as shared schemas with TypeScript types used by handlers and the frontend client.
Work
Define request/response shapes and a shared error envelope in shared/
Validate inbound API bodies against the contract
Point frontend forms and the API client at the same types/parsers
Add contract tests that fail when required fields diverge
Keep the in-memory MVP server compatible
Areas involved
Shared schemas, backend validation and handlers, frontend API client and forms, error mapping, fixtures, and contract tests.
Done when
Invalid create payloads fail consistently on client and server
List, detail, and verify responses parse with shared schemas
Contract tests run with the same commands used locally for CI
No parallel invoice type system remains in app code
The create-path validation introduced for #436 is already a shared module used by both sides, so I would generalise that rather than start a second type system:
Schemas in shared/: one module defining create, get, list, cancel, verify and stats, each with its request shape, response shape and a parser that returns typed data or a typed error. Field names and requiredness stay in one place, so a rename cannot land on one side only.
One error envelope: { code, message, field? } with a stable code list, mapped once from the API's rejection reasons and once from the client's, so the same invalid payload produces the same code and message on both sides. The existing create-parity tests keep passing and become one case in the wider contract test.
Validation at the edge: handlers parse inbound bodies with the shared parser instead of ad-hoc checks, and the frontend forms and API client consume the same parsers, so a payload that passes locally cannot fail server-side.
Contract tests that fail when a required field, a response key or an error code diverges: a fixture per endpoint driven through the parser, plus a test that compares the handler's response shape against the schema. They run under the repo's existing test commands so CI picks them up unchanged.
In-memory MVP stays valid: the DTO layer sits above both the in-memory and Postgres paths, so nothing about the demo server changes except that its responses are now schema-checked.
I would land it in slices rather than one large PR: shared schemas plus the error envelope first, then handlers, then the frontend client and forms, then the contract tests, keeping each mergeable on its own.
For context on how much is already there: #457 moved create validation into shared code and both sides now use it, #440 scoped the dashboard queries, and #442 made the wallet session a single source of truth across create, pay and dashboard.
I’m interested in this issue and confident I can contribute effectively. I’ve reviewed the requirements and can deliver a clean, reliable solution within the expected timeframe.
I am working on this implementation: establishing unified invoice request/response contracts and shared error envelopes in shared/, connecting handlers and frontend client/forms, ensuring backward compatibility with the MVP server, and adding contract tests.
Senior Full-Stack TypeScript engineer specialized in shared-schema monorepos, Zod contract validation, and unified DTO design across Express and Next.js App Router.
Proposed Implementation
Shared Contract Schemas (\shared/):
Expand the shared module to define complete request/response schemas for all invoice actions: \create, \get, \list, \cancel, \�erify, and \stats.
Export strongly-typed TypeScript interfaces derived directly from the schemas (\z.infer).
Standardized Error Envelope:
Define a shared error contract { code: ErrorCode, message: string, field?: string }\ with an exhaustive error taxonomy enum, ensuring client and server map failures to identical error representations.
End-to-End Validation:
Enforce schema parsing on inbound Express request bodies before entering controller handlers.
Wire frontend forms and the client API layer to consume the exact same validation schemas, preventing client-server drift.
Preserve In-Memory & DB Compatibility:
Implement the DTO layer at the boundary level so the in-memory MVP server continues operating seamlessly without regressions.
Contract Parity Tests:
Add contract test suites that run under existing test commands (
pm test), validating each endpoint fixture against its schema and asserting that breaking field changes fail CI immediately.
Estimate: PR ready in 24-48h (structured in clean, reviewable commits).
I am the original contributor of the completed issue #446 implementation in #571. Please review this existing PR for acceptance and any eligible GrantFox OSS reward under published program terms. If an award is approved, please confirm its actual amount, allocation, payment route and expected settlement date. No fixed amount or prior payment is being asserted.
Activity
rudrasatani13 commentedon Sep 14, 2026
I'd like to take this one.
The create-path validation introduced for #436 is already a shared module used by both sides, so I would generalise that rather than start a second type system:
shared/: one module defining create, get, list, cancel, verify and stats, each with its request shape, response shape and a parser that returns typed data or a typed error. Field names and requiredness stay in one place, so a rename cannot land on one side only.{ code, message, field? }with a stable code list, mapped once from the API's rejection reasons and once from the client's, so the same invalid payload produces the same code and message on both sides. The existing create-parity tests keep passing and become one case in the wider contract test.I would land it in slices rather than one large PR: shared schemas plus the error envelope first, then handlers, then the frontend client and forms, then the contract tests, keeping each mergeable on its own.
For context on how much is already there: #457 moved create validation into shared code and both sides now use it, #440 scoped the dashboard queries, and #442 made the wallet session a single source of truth across create, pay and dashboard.
davidtanko48-create commentedon Sep 15, 2026
I’m interested in this issue and confident I can contribute effectively. I’ve reviewed the requirements and can deliver a clean, reliable solution within the expected timeframe.
s6pa1rta3n-lab commentedon Sep 17, 2026
I am working on this implementation: establishing unified invoice request/response contracts and shared error envelopes in shared/, connecting handlers and frontend client/forms, ensuring backward compatibility with the MVP server, and adding contract tests.
Rodrigoue9 commentedon Sep 18, 2026
Hi @CemAyyildiz, applying to resolve #446.
Relevant Experience
Proposed Implementation
pm test), validating each endpoint fixture against its schema and asserting that breaking field changes fail CI immediately.
Estimate: PR ready in 24-48h (structured in clean, reviewable commits).
Ranjeet2063 commentedon Oct 4, 2026
Hi,
I have experience with similar implementations and would like to take this on.
Solution overview:
Please assign this to me if the plan looks good. Thanks!
woahwhattheheck commentedon Oct 9, 2026
/claim #446
I am the original contributor of the completed issue #446 implementation in #571. Please review this existing PR for acceptance and any eligible GrantFox OSS reward under published program terms. If an award is approved, please confirm its actual amount, allocation, payment route and expected settlement date. No fixed amount or prior payment is being asserted.