Implement owner-scoped Observation lifecycle with serialized patches

This commit is contained in:
Steffen committed 2026-10-14 11:46:03 +02:00
1 parent bfe6ebf5af
commit 3a70e3e296
37 files changed
+31249 -9

No files matched your search

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+4
View File
@@ -31,3 +31,7 @@ Single ASP.NET host, Contracts and Guidance projects; framework login/accounts/a
### Stage 2 — Profile checkpoint
Profile facade/owned schema/immutable DTOs; account unique/non-null, durable atomic insert and locked updates. Shared request transaction uses repeatable-read for reads and read-committed for locked writes. Runtime DB role restricted to DML, no runtime migration. Module-owned versioned SQL migration (applied twice) implements schema lifecycle; EF Core retains data access. Original create/update tests copied with namespace adaptation only; relative Location regression fixed in production controller, not assertions. Added concurrent create/retry/restart/persistent-ticket and runtime DDL-denial tests. 29/29 cases passed. Remaining all-endpoint authorization and Observation schema checks proceed with Stage 3. Stage 1 commit `523cfbf`.
### Stage 3 checkpoint — passed
Observation module owns its private EF context/entities and versioned schema SQL; patient FK restricted, positive/category/rest checks, patient/time/original/UUID index. Typed Profile existence query inside write transaction. API resolves actual observation owner, authorizes, and uses owner-scoped read/locked patch/delete. Original patch application retained; omitted/clear semantics unchanged. Original US-04–09 suites run with one HTTP host/one DB and namespaces updated. Q1 lookup failure test uses DB outage and 503 instead of service stop/502; no-write assertion unchanged. Empty-404 regression fixed in production adapters. 138/138 tests passed including controlled two-patch row-lock barrier and orphan FK rejection; zero build warnings/errors. Private types exposed only to test assembly via InternalsVisibleTo. Stage 2 commit `bfe6ebf`.
+12
View File
@@ -0,0 +1,12 @@
# Architecture-dependent test adaptations
Authority: approval Q1. Unmodified originals remain under Reference/ArchitectureA. Functional assertions stay intact except explicitly approved architecture-dependent conditions below.
| Original scenario / infrastructure | B replacement / reason |
| --- | --- |
| PatientApiFixture / ObservationApiFixture: multiple hosts/two databases | One real Kestrel host and one isolated database, module-owned schemas. Test-admin contexts remain available solely to establish Given and inspect persistence. Runtime uses restricted DML role |
| All adopted suites: service namespaces | Module/shared immutable value namespaces; JSON expectation vocabulary preserved |
| RecordObservationTests.Failed_patient_lookup_is_rejected_without_saving | StopPatientService helper now configures unusable shared DB endpoint; 502 assertion becomes approved 503; persisted count assertion unchanged |
| Guidance tests: ApiGateway host | HealthApp host; all original instructions/source/applicability/side-effect assertions and upstream traps unchanged |
| ViewObservationContextTests / filtered access | Empty denied 404 preserved, corrected implementation after tests caught accidental Problem Details |
| New concurrency checks | Hold row lock, prove both patches wait, release, verify both disjoint changes and unchanged owner/time/note; new architecture obligation |