Feature #376
opennuvita-admin: internal audit-events endpoint bound the wrong DTO (found testing D35)
0%
Description
Found while testing D35's IPD<->Canteen dietary-order flow end to end: nuvita-admin failed to build against current kernel dev (needed for the real IDietaryOrderReadContract) with a CS1503 on InternalAuditEventsController -- record.Action used as string against the kernel's now-typed AuditRecord.Action (AuditAction struct).
Real bug, not just a build nuisance: every real caller (HttpAuditPublisher, HttpAuditBatchTransport) sends AuditRecordWire JSON over the wire to POST /api/internal/audit-events -- a flat string action field, deliberately kept string-shaped so a module on an older kernel stays compatible. The controller's [FromBody] parameter was typed as the kernel's internal AuditRecord (struct Action), not AuditRecordWire -- a JSON shape mismatch that would silently mis-bind record.Action on every real audit write. Latent until now because nothing had rebuilt admin against a kernel new enough to even compile it.
Fixed: controller now binds AuditRecordWire. 15/15 InternalAuditEventsController tests pass unchanged (they already exercised the real wire shape), full admin suite 2733/2733 green. Fixed on its own branch (fix/internal-audit-events-typed-action), not dev.
NP Updated by Navya P. about 1 month ago
- Status changed from New to Resolved
- Resolved By set to Navya P.
Done. Commit 5cbcdedc on nuvita-admin branch fix/internal-audit-events-typed-action (not dev). Full admin suite 2733/2733.