---
description: Sync OpenAPI/Prisma output to shared TypeScript types.
argument-hint: [source]
---

# /generate-types

## Purpose

Regenerate shared types so frontend + backend stay contract-aligned.

## Required context

- `packages/api-contracts/`, `prisma/schema.prisma`, the .NET Swagger doc

## Inputs

- `$1` — `prisma` | `openapi` | `all` (default)

## Execution steps

1. `pnpm db:generate` (Prisma client).
2. Generate TS types from the .NET OpenAPI doc into `packages/api-contracts/src/openapi/` (Phase 8 wires the generator).
3. Reconcile against hand-written Zod schemas; flag drift.

## Validation checklist

- [ ] `pnpm --filter @loma-portal/api-contracts typecheck` passes
- [ ] No drift between Zod + generated types
- [ ] Consumers still typecheck

## Expected output

Up-to-date generated types.

## Failure handling

If generated types contradict Zod, the API contract changed — update both + note in the PR.
