Feature #345
openCanteen: Patient charges Task 2 -- ListForDateAsync read path + ChargesController
0%
Description
New IDietChargeAccrualService.ListForDateAsync(DateOnly serviceDate, ct): queries existing DietChargeAccrual rows for CurrentHospitalId + date (no synthesizing rows that do not exist yet, same posture as MealSheet.GetAsync), enriched with patient name (IPatientServiceContract.GetPatientNamesByIdsAsync, batched) and admission number (IAdmissionServiceContract.GetAdmissionNumberAsync). New DietChargeLineDto carries PatientName/AdmissionNumber/DietTypeCode alongside the existing charge fields; DietChargeAccrualDto (PostAsync return type) stays untouched so its tests keep passing.
ChargesController at api/canteen/dietary/charges, RequireCapability(CanteenCapabilities.Dietary) -- permission-keys.json already covers patient charges under canteen.dietary:
- GET (canteen.charges.read) -> ListForDateAsync
- POST /post-pending (canteen.charges.post) -> AccrueActiveOrdersAsync (task 1), returns a count. Catches up orders with no row yet today; does not retry rows already Pending-with-no-patient (PostAsyncs existing short-circuit).
Auth matrix tests mirroring MealSheetAuthorizationMatrixTests.cs.
NP Updated by Navya P. about 1 month ago
- Status changed from New to Resolved
- Resolved By set to Navya P.
Done. ListForDateAsync + DietChargeLineDto + ChargesController (GET, POST post-pending). Added FakeExternalReads.cs to CanteenApiFixture for IAdmissionServiceContract/IPatientServiceContract, which this is the first endpoint to reach. 9 service tests + 6 auth matrix tests, all new. 563 unit + 826/828 integration (2 pre-existing unrelated Coupon_liability failures). nuvita-canteen-management@bd07811, pushed to integration/canteen-v1.
NP Updated by Navya P. about 1 month ago
- Assignee set to Navya P.