diff --git a/test/CareTogether.TestData/TestDataProvider.cs b/test/CareTogether.TestData/TestDataProvider.cs index b4caeb0b..f0e7ed45 100644 --- a/test/CareTogether.TestData/TestDataProvider.cs +++ b/test/CareTogether.TestData/TestDataProvider.cs @@ -80,9 +80,8 @@ public static class TestDataProvider static readonly Guid guidB = Id('b'); static readonly Guid guidC = Id('c'); static readonly Guid adminId = Guid.Parse("2b87864a-63e3-4406-bcbc-c0068a13ac05"); - 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 +89,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 +142,9 @@ 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: volunteerId, OrganizationId: guid1, LocationId: guid2, PersonId: guid4)), new AccountEvent(SystemConstants.SystemUserId, FIXED_DATE, - new LinkPersonToAcccount(UserId: volunteerId, OrganizationId: guid1, LocationId: guid2, PersonId: guid4)) + new LinkPersonToAcccount(UserId: volunteerId2, OrganizationId: guid1, LocationId: guid2, PersonId: eldaBrambleswiftVolunteerGuid)) }; var existingGlobalEvents = await accountsEventLog.GetAllEventsAsync(guid0, guid0).ToListAsync(); var testEventsToAppend = testEventsNeeded @@ -161,7 +160,9 @@ await personAccessEventLog.AppendEventsAsync(guid1, guid2, new PersonAccessEvent(SystemConstants.SystemUserId, SetupMonth(1), new ChangePersonRoles(PersonId: guid0, Roles: [SystemConstants.ORGANIZATION_ADMINISTRATOR])), new PersonAccessEvent(SystemConstants.SystemUserId, SetupMonth(1), - new ChangePersonRoles(PersonId: guid4, Roles: ["Volunteer"])) + new ChangePersonRoles(PersonId: guid4, Roles: ["Volunteer"])), + new PersonAccessEvent(SystemConstants.SystemUserId, SetupMonth(1), + new ChangePersonRoles(PersonId: eldaBrambleswiftVolunteerGuid, Roles: ["Volunteer"])) ); await personAccessEventLog.AppendEventsAsync(guid1, guid3, new PersonAccessEvent(SystemConstants.SystemUserId, SetupMonth(1), @@ -174,8 +175,6 @@ public static async Task PopulateDirectoryEvents(IEventLog direc await directoryEventLog.AppendEventsAsync(guid1, guid2, new PersonCommandExecuted(adminId, SetupMonth(1), new CreatePerson(guid0, "Administrator", "McTester", Gender.Male, YearsOld(30), "Ethnic", [], null, [], null, [], null, "Test", "ABC")), - new PersonCommandExecuted(adminId2, SetupMonth(1), new CreatePerson(administratorMcDebugger, "Administrator", "McDebugger", Gender.Male, YearsOld(35), "Ethnic", - [], null, [], null, [], null, null, null)), new FamilyCommandExecuted(adminId, SetupMonth(1), new CreateFamily(guid0, guid0, [(guid0, new FamilyAdultRelationshipInfo("Single", true))], [], [])), @@ -308,7 +307,7 @@ await directoryEventLog.AppendEventsAsync(guid1, guid2, [], null, [], null, [], null, "Marine Biologist", null)), new PersonCommandExecuted(adminId, ApprovalsMonth(1), new CreatePerson(nemoFisherGuid, "Nemo", "Fisher", Gender.Male, YearsOld(7), "Caucasian", [], null, [], null, [], null, null, null)), - new FamilyCommandExecuted(adminId2, ApprovalsMonth(1), new CreateFamily(fisherFamilyGuid, michaelFisherGuid, + new FamilyCommandExecuted(adminId, ApprovalsMonth(1), new CreateFamily(fisherFamilyGuid, michaelFisherGuid, [ (michaelFisherGuid, new FamilyAdultRelationshipInfo("Dad", true)), (sarahFisherGuid, new FamilyAdultRelationshipInfo("Mom", true)), @@ -318,34 +317,34 @@ await directoryEventLog.AppendEventsAsync(guid1, guid2, new CustodialRelationship(nemoFisherGuid, michaelFisherGuid, CustodialRelationshipType.ParentWithCustody), new CustodialRelationship(nemoFisherGuid, sarahFisherGuid, CustodialRelationshipType.ParentWithCustody), ])), - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new AddPersonAddress(michaelFisherGuid, + new PersonCommandExecuted(adminId, ApprovalsMonth(1), new AddPersonAddress(michaelFisherGuid, new Address(guid4, "42 Coral Reef Lane", null, "Atlantis", null, "OC", "12345"), true)), - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new AddPersonPhoneNumber(michaelFisherGuid, + new PersonCommandExecuted(adminId, ApprovalsMonth(1), new AddPersonPhoneNumber(michaelFisherGuid, new PhoneNumber(guid4, "5551234567", PhoneNumberType.Mobile), true)), - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new AddPersonEmailAddress(michaelFisherGuid, + new PersonCommandExecuted(adminId, ApprovalsMonth(1), new AddPersonEmailAddress(michaelFisherGuid, new EmailAddress(guid4, "michael.fisher@example.com", EmailAddressType.Personal), true)), // Add new volunteer family - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new CreatePerson(berrinBrambleswiftGuid, "Berrin", "Brambleswift", Gender.Male, YearsOld(40), "Caucasian", + new PersonCommandExecuted(adminId, 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(adminId, 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, + new FamilyCommandExecuted(adminId, ApprovalsMonth(1), new CreateFamily(brambleswiftFamilyGuid, berrinBrambleswiftGuid, [ (berrinBrambleswiftGuid, new FamilyAdultRelationshipInfo("Dad", true)), (eldaBrambleswiftVolunteerGuid, new FamilyAdultRelationshipInfo("Mom", true)), ], [], [])), - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new AddPersonAddress(berrinBrambleswiftGuid, + new PersonCommandExecuted(adminId, ApprovalsMonth(1), new AddPersonAddress(berrinBrambleswiftGuid, new Address(guid5, "789 Helper St", null, "Voluntown", null, "VS", "54321"), true)), - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new AddPersonPhoneNumber(berrinBrambleswiftGuid, + new PersonCommandExecuted(adminId, ApprovalsMonth(1), new AddPersonPhoneNumber(berrinBrambleswiftGuid, new PhoneNumber(guid5, "5559876543", PhoneNumberType.Mobile), true)), - new PersonCommandExecuted(adminId2, ApprovalsMonth(1), new AddPersonEmailAddress(berrinBrambleswiftGuid, + new PersonCommandExecuted(adminId, ApprovalsMonth(1), new AddPersonEmailAddress(berrinBrambleswiftGuid, new EmailAddress(guid5, "john.volunteer@example.com", EmailAddressType.Personal), true)) ); @@ -398,22 +397,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(adminId, 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)) ); @@ -478,21 +477,21 @@ await approvalsEventLog.AppendEventsAsync(guid1, guid2, // Add approval events for new volunteer family new VolunteerFamilyCommandExecuted(adminId, ApprovalsMonth(5), - new UploadVolunteerFamilyDocument(guid7, guid6, "volunteer_family_application.pdf")), + new UploadVolunteerFamilyDocument(brambleswiftFamilyGuid, guid6, "volunteer_family_application.pdf")), new VolunteerFamilyCommandExecuted(adminId, ApprovalsMonth(5), - new CompleteVolunteerFamilyRequirement(guid7, guid1, "Host Family Application", ApprovalsMonth(5), guid6, null)), + new CompleteVolunteerFamilyRequirement(brambleswiftFamilyGuid, 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 CompleteVolunteerRequirement(brambleswiftFamilyGuid, 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 CompleteVolunteerRequirement(brambleswiftFamilyGuid, 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 CompleteVolunteerFamilyRequirement(brambleswiftFamilyGuid, 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 CompleteVolunteerFamilyRequirement(brambleswiftFamilyGuid, 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 CompleteVolunteerRequirement(brambleswiftFamilyGuid, 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 CompleteVolunteerRequirement(brambleswiftFamilyGuid, eldaBrambleswiftVolunteerGuid, guidA, "Host Family Training", ApprovalsMonth(9), null, null)) ); } @@ -952,6 +951,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); }