feature: RBAC + Clinical Audit Logging
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
public static class UserSeeder
|
||||
{
|
||||
public static async Task SeedAsync(AppDbContext db)
|
||||
{
|
||||
if (await db.ClinicalUsers.AnyAsync())
|
||||
return;
|
||||
|
||||
db.ClinicalUsers.AddRange(
|
||||
new ClinicalUser
|
||||
{
|
||||
Id = Guid.Parse("11111111-1111-1111-1111-111111111111"),
|
||||
Username = "nurse.demo",
|
||||
PasswordHash = BCrypt.Net.BCrypt.HashPassword("DemoNurse1!"),
|
||||
DisplayName = "Demo Nurse",
|
||||
Role = ClinicalRole.Nurse,
|
||||
CreatedAt = DateTimeOffset.UtcNow
|
||||
},
|
||||
new ClinicalUser
|
||||
{
|
||||
Id = Guid.Parse("22222222-2222-2222-2222-222222222222"),
|
||||
Username = "physician.demo",
|
||||
PasswordHash = BCrypt.Net.BCrypt.HashPassword("DemoPhysician1!"),
|
||||
DisplayName = "Dr. Demo Physician",
|
||||
Role = ClinicalRole.Physician,
|
||||
CreatedAt = DateTimeOffset.UtcNow
|
||||
},
|
||||
new ClinicalUser
|
||||
{
|
||||
Id = Guid.Parse("33333333-3333-3333-3333-333333333333"),
|
||||
Username = "admin.demo",
|
||||
PasswordHash = BCrypt.Net.BCrypt.HashPassword("DemoAdmin1!"),
|
||||
DisplayName = "Demo Admin",
|
||||
Role = ClinicalRole.Admin,
|
||||
CreatedAt = DateTimeOffset.UtcNow
|
||||
},
|
||||
new ClinicalUser
|
||||
{
|
||||
Id = Guid.Parse("44444444-4444-4444-4444-444444444444"),
|
||||
Username = "integration.mirth",
|
||||
PasswordHash = BCrypt.Net.BCrypt.HashPassword("MirthIntegration1!"),
|
||||
DisplayName = "Mirth Connect",
|
||||
Role = ClinicalRole.Integration,
|
||||
CreatedAt = DateTimeOffset.UtcNow
|
||||
});
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user