@med-travel/contracts
v0.0.5
Published
Shared contracts (types and enums) between Med Traveling backend and frontend
Readme
@med-travel/contracts
Shared types and enums between the Med Traveling backend (NestJS) and frontend (Next.js).
- Enum keys use
UPPER_SNAKE_CASEfor readable referencing in code. - Enum values use
camelCase— this is what actually travels in JSON payloads. - Database stores the same semantic values as
UPPER_SNAKE_CASE; conversion is transparent on the backend.
Install (frontend)
npm install @med-travel/contractsBuild locally
npm install
npm run generate
npm run buildGenerate Prisma enums
This package can generate shared enum contracts directly from prisma/schema.prisma.
npm run generateUse from another repo after publish/install:
import { UserRole, InvoiceStatus } from '@med-travel/contracts/prisma';