feature: RBAC + Clinical Audit Logging

This commit is contained in:
voltsrage
2026-06-21 15:46:55 +08:00
parent a43db52813
commit 5af6ab490e
83 changed files with 4281 additions and 70 deletions
@@ -15,6 +15,7 @@ public class AlertLifecycleTests : IAsyncLifetime
{
_fixture = fixture;
_client = fixture.CreateClient();
_client.AsNurse();
}
public async Task InitializeAsync()
@@ -56,14 +57,14 @@ public class AlertLifecycleTests : IAsyncLifetime
{
var resp = await _client.PostAsJsonAsync(
$"/api/v1/alerts/{_alertId}/acknowledge",
new { clinicianId = "DR-OSEI", note = "Reviewing now, ordering repeat labs." });
new AcknowledgeAlertRequest("Reviewing now, ordering repeat labs."));
resp.StatusCode.Should().Be(HttpStatusCode.OK);
var body = await resp.Content.ReadFromJsonAsync<JsonDocument>();
body!.RootElement.GetProperty("data").GetProperty("status").GetString()
.Should().Be("Acknowledged");
body.RootElement.GetProperty("data").GetProperty("acknowledgedBy").GetString()
.Should().Be("DR-OSEI");
.Should().Be("Test NURSE");
}
[Fact]
@@ -81,7 +82,7 @@ public class AlertLifecycleTests : IAsyncLifetime
{
await _client.PostAsJsonAsync(
$"/api/v1/alerts/{_alertId}/acknowledge",
new { clinicianId = "DR-PATEL", note = "Treated." });
new AcknowledgeAlertRequest("Treated."));
var resolveResp = await _client.PostAsync(
$"/api/v1/alerts/{_alertId}/resolve", null);