AEROSIM-TS-17
Define the pilot-owned Prisma schema
A minimal Prisma schema defines governed pilot identity linkage and one representative pilot-owned transactional record.
- Verified flow state
- Done
- Owner
- AeroSim Architecture and Delivery
- Feature
- AEROSIM-FT-43
- Component
- Pilot Data Store — Prisma schema
- Repository
- corp-v1-aerosim/corp-v1-aerosim
Delivery scope
Define PilotRecord as the representative pilot-owned entity with UUID id, Keycloak subject ownerSubject, clientRequestId, JSON payload, createdAt, and updatedAt; add uniqueness on (ownerSubject, clientRequestId) and an owner lookup index. Primary files: applications/api/prisma/schema.prisma, applications/api/src/persistence/pilot-record.ts, applications/api/tests/schema/pilot-record-schema.test.ts.
Implementation contract
Implementation artifacts
- applications/api/prisma/schema.prisma
- applications/api/src/persistence/pilot-record.ts
- applications/api/tests/schema/pilot-record-schema.test.ts
Inputs
- DATABASE_URL for PostgreSQL
- PilotRecordCreate {ownerSubject,clientRequestId,payload} domain shape
Outputs
- Generated Prisma PilotRecord client types
- Database constraints for UUID identity, non-null owner linkage, idempotency key, and timestamps
Failure boundaries
- Prisma validation rejects a missing ownerSubject, clientRequestId, or payload before SQL execution.
- The compound unique key rejects a duplicate clientRequestId only within the same ownerSubject.
Excluded scope
- User passwords, Keycloak accounts, flight telemetry streams, and generalized document storage are not database models in this task.
Verification steps
- pnpm --filter @aerosim/api prisma validate && pnpm --filter @aerosim/api prisma generate
- pnpm --filter @aerosim/api test -- pilot-record-schema.test.ts
Traceability
Dependencies
- AEROSIM-TS-16Canonical ID: TASK-0016
UI/UX applicability
non_visual
This Task owns technical or behavioral acceptance and does not claim direct visual conformance to the approved UI/UX package.
Acceptance evidence
Verified delivery: application PR #26 reviewed head 06be8575935837f6f0f51af22763286407bd2837, exact-head validation task 1809 succeeded, merged as 9d5a55642fb6a6ed1ecbdcf6e80e1a2ce6013476; Wave 4 integrated application head e8bfe781d3295d445cbc46b297874f066cac8301 passed publish task 1832 and validate task 1833. Release completion verified on product 1.0.0.0 at GitOps revision 5d3712d89dfbf7dacd993348e55f497d126c7bf9 with Argo Synced/Healthy, exact image digests, authenticated API/database access, and three-world configured-flight acceptance.
Current evidence boundary
No current implementation, acceptance, release, or deployment evidence is claimed for this planned Task. Any prior implementation may be used only as prototype and discovery evidence.