AEROSIM-TS-62
Implement pilot-scoped preference read and update operations
An authenticated pilot can save supported preference values and retrieve only that pilot's last valid values.
- Verified flow state
- Done
- Owner
- AeroSim Architecture and Delivery
- Feature
- AEROSIM-FT-32
- Component
- API Service — Pilot profile service, Fastify HTTP boundary, and Prisma data adapter
- Repository
- corp-v1-aerosim/corp-v1-aerosim
Delivery scope
Implement typed preference read and update routes through the Pilot profile service and Prisma adapter, derive ownership only from authenticated context, validate an allowlist of supported keys and values, apply updates transactionally, and return stable validation and authorization errors. Concrete artifacts are prisma/schema.prisma and tests/integration/pilot-preferences-api.test.ts; ownership is limited to the listed artifacts and their focused verification.
Implementation contract
Implementation artifacts
- prisma/schema.prisma
- prisma/migrations/implement-pilot-scoped-preference-read-and-update-oper/migration.sql
- tests/integration/pilot-preferences-api.test.ts
Inputs
- Authenticated pilot context resolved by the profile service
- Typed preference read request or key/value update from the supported allowlist
- Current persisted preference set and application defaults
Outputs
- An authenticated pilot can save supported preference values and retrieve only that pilot's last valid values.
Failure boundaries
- Reject unsupported keys, malformed values, subject substitution, and updates without an authenticated pilot before opening a write transaction
- On transaction failure, retain the prior valid value and return a stable validation or persistence error
Excluded scope
- Bulk replacement of another pilot’s settings
- Persisting unsupported UI state or accepting arbitrary JSON preference payloads
Verification steps
- Run tests/integration/pilot-preferences-api.test.ts against the exact implementation revision and retain the complete passing result.
- Exercise the positive contract with authenticated pilot context resolved by the profile service, then assert: An authenticated pilot can save supported preference values and retrieve only that pilot's last valid values.
- Exercise every negative boundary: Reject unsupported keys, malformed values, subject substitution, and updates without an authenticated pilot before opening a write transaction; On transaction failure, retain the prior valid value and return a stable validation or persistence error
Traceability
Dependencies
- AEROSIM-TS-61Canonical ID: TASK-0061
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 #106 implemented pilot-scoped preference read and update operations; forward fixes #109 and #110 repaired exact-head validation artifact transfer. Current integrated application test head 5f57f5b7059c47d7d2632748eeb687f3e9376a72 contains all three merge chains. tests/integration/pilot-preferences-api.test.ts passed 20 tests within the exact-head integration suite. Actions runs 4080 and 4081 passed tasks 3101, 3102, 3103, and 3104 for required validation, full validation, image build, publication, and registry readback. 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.