diff --git a/test/CareTogether.TestData/TestDataProvider.cs b/test/CareTogether.TestData/TestDataProvider.cs index b4caeb0b..0d9f0d87 100644 --- a/test/CareTogether.TestData/TestDataProvider.cs +++ b/test/CareTogether.TestData/TestDataProvider.cs @@ -83,6 +83,7 @@ public static class TestDataProvider static readonly Guid adminId2 = Guid.Parse("8b892720-f0ff-4504-818c-d54fe14de6b4"); static readonly Guid administratorMcDebugger = Guid.Parse("63a83e38-f066-48d6-9e1e-fb59f625b838"); static readonly Guid volunteerId = Guid.Parse("e3aaef77-0e97-47a6-b788-a67c237c781e"); + static readonly Guid volunteerId2 = Guid.Parse("ca662f2b-270a-4a8b-baa7-c109eadbb133"); // Fisher family @@ -90,14 +91,14 @@ public static class TestDataProvider static readonly Guid sarahFisherGuid = Guid.Parse("7dc7e4f8-99cc-4076-9c3c-8229768f8b66"); static readonly Guid nemoFisherGuid = Guid.Parse("4a43d33e-e9a6-4045-b374-17ebc223daa7"); - static readonly Guid fisherFamilyGuid = guid6; - static readonly Guid fisherFamilyReferral1Guid = guid1; - static readonly Guid fisherFamilyArrangement1Guid = guid1; + static readonly Guid fisherFamilyGuid = Guid.Parse("18ca8eb0-d441-44fc-82c2-f7f29b0959fb"); + static readonly Guid fisherFamilyReferral1Guid = Guid.Parse("6d3c3034-d63d-4fc8-a12e-4ea7a8322818"); + static readonly Guid fisherFamilyArrangement1Guid = Guid.Parse("a108cc01-c899-49ea-9e7a-36eefc90e4f1"); // Brambleswift family static readonly Guid berrinBrambleswiftGuid = Guid.Parse("11768904-7738-430a-81b8-fbd7b4168f11"); static readonly Guid eldaBrambleswiftVolunteerGuid = Guid.Parse("3d49cfb8-af1e-429b-82dc-484559782118"); - static readonly Guid brambleswiftFamilyGuid = guid7; + static readonly Guid brambleswiftFamilyGuid = Guid.Parse("3ec519ec-a262-4047-b8ef-5ad8c00a2495"); @@ -143,9 +144,11 @@ public static async Task PopulateAccountEvents(IEventLog accountsE new AccountEvent(SystemConstants.SystemUserId, FIXED_DATE, new LinkPersonToAcccount(UserId: adminId, OrganizationId: guid1, LocationId: guid3, PersonId: guid0)), new AccountEvent(SystemConstants.SystemUserId, FIXED_DATE, - new LinkPersonToAcccount(UserId: adminId2, OrganizationId: guid1, LocationId: guid3, PersonId: administratorMcDebugger)), + new LinkPersonToAcccount(UserId: adminId2, OrganizationId: guid1, LocationId: guid4, PersonId: guid0)), new AccountEvent(SystemConstants.SystemUserId, FIXED_DATE, - new LinkPersonToAcccount(UserId: volunteerId, OrganizationId: guid1, LocationId: guid2, PersonId: guid4)) + new LinkPersonToAcccount(UserId: volunteerId, OrganizationId: guid1, LocationId: guid2, PersonId: guid4)), + new AccountEvent(SystemConstants.SystemUserId, FIXED_DATE, + new LinkPersonToAcccount(UserId: volunteerId2, OrganizationId: guid1, LocationId: guid4, PersonId: eldaBrambleswiftVolunteerGuid)) }; var existingGlobalEvents = await accountsEventLog.GetAllEventsAsync(guid0, guid0).ToListAsync(); var testEventsToAppend = testEventsNeeded @@ -167,6 +170,13 @@ await personAccessEventLog.AppendEventsAsync(guid1, guid3, new PersonAccessEvent(SystemConstants.SystemUserId, SetupMonth(1), new ChangePersonRoles(PersonId: guid0, Roles: [SystemConstants.ORGANIZATION_ADMINISTRATOR])) ); + await personAccessEventLog.AppendEventsAsync(guid1, guid4, + new PersonAccessEvent(SystemConstants.SystemUserId, SetupMonth(1), + new ChangePersonRoles(PersonId: guid0, Roles: [SystemConstants.ORGANIZATION_ADMINISTRATOR]) + ), + new PersonAccessEvent(SystemConstants.SystemUserId, SetupMonth(1), + new ChangePersonRoles(PersonId: eldaBrambleswiftVolunteerGuid, Roles: ["Volunteer"])) + ); } public static async Task PopulateDirectoryEvents(IEventLog directoryEventLog) @@ -329,9 +339,9 @@ await directoryEventLog.AppendEventsAsync(guid1, guid2, true)), // Add new volunteer family - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new CreatePerson(berrinBrambleswiftGuid, "Berrin", "Brambleswift", Gender.Male, YearsOld(40), "Caucasian", + new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new CreatePerson(berrinBrambleswiftGuid, "Berrin", "Brambleswift", Gender.Male, YearsOld(40), "Giant", [], null, [], null, [], null, null, null)), - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new CreatePerson(eldaBrambleswiftVolunteerGuid, "Elda", "Brambleswift", Gender.Female, YearsOld(38), "Caucasian", + new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new CreatePerson(eldaBrambleswiftVolunteerGuid, "Elda", "Brambleswift", Gender.Female, YearsOld(38), "Giant", [], null, [], null, [], null, null, null)), new FamilyCommandExecuted(adminId2, ApprovalsMonth(1), new CreateFamily(brambleswiftFamilyGuid, berrinBrambleswiftGuid, [ @@ -398,22 +408,22 @@ await referralsEventLog.AppendEventsAsync(guid1, guid2, new ReferralCommandExecuted(adminId, ReferralsMonth(21, 20, 38, 0), new CreateReferral(guid5, guid3, ReferralsMonth(21, 20, 38, 0))), // Fisher family - new ReferralCommandExecuted(adminId2, ReferralsMonth(1, 12, 0, 0), new CreateReferral(fisherFamilyGuid, fisherFamilyReferral1Guid, ReferralsMonth(1, 12, 0, 0))) - - // new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 10, 0, 0), - // new CreateArrangement(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], "Friending", ReferralsMonth(4), michaelFisherGuid, "Respite")), - // new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), - // new AssignIndividualVolunteer(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], brambleswiftFamilyGuid, berrinBrambleswiftGuid, "Family Coach", null)), - // new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), - // new AssignIndividualVolunteer(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], brambleswiftFamilyGuid, berrinBrambleswiftGuid, "Family Friend", null)), - // new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), - // new AssignIndividualVolunteer(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], guid0, guid0, "Staff Supervision", null)), - // new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), - // new ExemptArrangementRequirement(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], "Advocacy Agreement", null, "Not needed", null)), - // new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), - // new StartArrangements(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], ReferralsMonth(1, 15, 0, 0))), - // new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), - // new CompleteArrangementRequirement(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], guid3, "Family Coach Checkin", ReferralsMonth(4, 2, 59, 0), null, null)) + new ReferralCommandExecuted(adminId2, ReferralsMonth(1, 12, 0, 0), new CreateReferral(fisherFamilyGuid, fisherFamilyReferral1Guid, ReferralsMonth(1, 12, 0, 0))), + + new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 10, 0, 0), + new CreateArrangement(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], "Friending", ReferralsMonth(4), michaelFisherGuid, "Respite")), + new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), + new AssignIndividualVolunteer(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], brambleswiftFamilyGuid, berrinBrambleswiftGuid, "Family Coach", null)), + new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), + new AssignIndividualVolunteer(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], brambleswiftFamilyGuid, berrinBrambleswiftGuid, "Family Friend", null)), + new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), + new AssignIndividualVolunteer(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], guid0, guid0, "Staff Supervision", null)), + new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), + new ExemptArrangementRequirement(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], "Advocacy Agreement", null, "Not needed", null)), + new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), + new StartArrangements(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], ReferralsMonth(1, 15, 0, 0))), + new ArrangementsCommandExecuted(adminId, ReferralsMonth(3, 11, 0, 0), + new CompleteArrangementRequirement(fisherFamilyGuid, fisherFamilyReferral1Guid, [fisherFamilyArrangement1Guid], guid3, "Family Coach Checkin", ReferralsMonth(4, 2, 59, 0), null, null)) ); @@ -477,22 +487,22 @@ await approvalsEventLog.AppendEventsAsync(guid1, guid2, new CompleteVolunteerRequirement(guid3, guid9, new Guid(), "Comprehensive Background Check", ApprovalsMonth(25), null, null)), // Add approval events for new volunteer family - new VolunteerFamilyCommandExecuted(adminId, ApprovalsMonth(5), - new UploadVolunteerFamilyDocument(guid7, guid6, "volunteer_family_application.pdf")), - new VolunteerFamilyCommandExecuted(adminId, ApprovalsMonth(5), - new CompleteVolunteerFamilyRequirement(guid7, guid1, "Host Family Application", ApprovalsMonth(5), guid6, null)), - new VolunteerCommandExecuted(adminId, ApprovalsMonth(6), - new CompleteVolunteerRequirement(guid7, berrinBrambleswiftGuid, guid7, "Background Check", ApprovalsMonth(6), guid7, null)), - new VolunteerCommandExecuted(adminId, ApprovalsMonth(6), - new CompleteVolunteerRequirement(guid7, eldaBrambleswiftVolunteerGuid, guid8, "Background Check", ApprovalsMonth(6), guid8, null)), - new VolunteerFamilyCommandExecuted(adminId, ApprovalsMonth(7), - new CompleteVolunteerFamilyRequirement(guid7, guid2, "Home Screening Checklist", ApprovalsMonth(7), Guid.Empty, null)), - new VolunteerFamilyCommandExecuted(adminId, ApprovalsMonth(8), - new CompleteVolunteerFamilyRequirement(guid7, guid3, "Host Family Interview", ApprovalsMonth(8), Guid.Empty, null)), - new VolunteerCommandExecuted(adminId, ApprovalsMonth(9), - new CompleteVolunteerRequirement(guid7, berrinBrambleswiftGuid, guid9, "Host Family Training", ApprovalsMonth(9), null, null)), - new VolunteerCommandExecuted(adminId, ApprovalsMonth(9), - new CompleteVolunteerRequirement(guid7, eldaBrambleswiftVolunteerGuid, guidA, "Host Family Training", ApprovalsMonth(9), null, null)) + new VolunteerFamilyCommandExecuted(adminId2, ApprovalsMonth(5), + new UploadVolunteerFamilyDocument(brambleswiftFamilyGuid, guid6, "volunteer_family_application.pdf")), + new VolunteerFamilyCommandExecuted(adminId2, ApprovalsMonth(5), + new CompleteVolunteerFamilyRequirement(brambleswiftFamilyGuid, guid1, "Host Family Application", ApprovalsMonth(5), guid6, null)), + new VolunteerCommandExecuted(adminId2, ApprovalsMonth(6), + new CompleteVolunteerRequirement(brambleswiftFamilyGuid, berrinBrambleswiftGuid, guid7, "Background Check", ApprovalsMonth(6), guid7, null)), + new VolunteerCommandExecuted(adminId2, ApprovalsMonth(6), + new CompleteVolunteerRequirement(brambleswiftFamilyGuid, eldaBrambleswiftVolunteerGuid, guid8, "Background Check", ApprovalsMonth(6), guid8, null)), + new VolunteerFamilyCommandExecuted(adminId2, ApprovalsMonth(7), + new CompleteVolunteerFamilyRequirement(brambleswiftFamilyGuid, guid2, "Home Screening Checklist", ApprovalsMonth(7), Guid.Empty, null)), + new VolunteerFamilyCommandExecuted(adminId2, ApprovalsMonth(8), + new CompleteVolunteerFamilyRequirement(brambleswiftFamilyGuid, guid3, "Host Family Interview", ApprovalsMonth(8), Guid.Empty, null)), + new VolunteerCommandExecuted(adminId2, ApprovalsMonth(9), + new CompleteVolunteerRequirement(brambleswiftFamilyGuid, berrinBrambleswiftGuid, guid9, "Host Family Training", ApprovalsMonth(9), null, null)), + new VolunteerCommandExecuted(adminId2, ApprovalsMonth(9), + new CompleteVolunteerRequirement(brambleswiftFamilyGuid, eldaBrambleswiftVolunteerGuid, guidA, "Host Family Training", ApprovalsMonth(9), null, null)) ); } @@ -574,6 +584,11 @@ await configurationStore.UpsertAsync(guid1, Guid.Empty, "config", [.. new[] { "Single", "Spouse", "Partner", "Dad", "Mom", "Relative", "Domestic Worker" } ], ["Crisis", "Assistance", "Respite"], sourcePhoneNumbers), + new LocationConfiguration(guid4, "Narnia", + [.. new[] { "Centaur", "Faun", "Giant" } ], + [.. new[] { "Single", "Spouse", "Partner", "Dad", "Mom", "Relative", "Domestic Worker" } ], + ["Crisis", "Assistance", "Respite"], + sourcePhoneNumbers), ], [new RoleDefinition("Volunteer", IsProtected: false, [ @@ -952,6 +967,7 @@ public static async Task PopulatePolicies(IObjectStore await policiesStore.UpsertAsync(guid1, guid2, "policy", policy); await policiesStore.UpsertAsync(guid1, guid3, "policy", policy); + await policiesStore.UpsertAsync(guid1, guid3, "policy", policy); }