From 3e871dc7049d2700b3402ca5c4120e6fae66ff55 Mon Sep 17 00:00:00 2001 From: TimA Date: Wed, 13 Mar 2024 15:26:20 -0700 Subject: [PATCH] Removed 2 questions regarding pets --- .../RegistrationsController.Files.cs | 18 +----- .../FakeGenerator.cs | 1 - .../ess-file-details.component.html | 14 ----- .../ess-file-details.component.spec.ts | 2 - .../animals/animals.component.html | 57 +------------------ .../animals/animals.component.ts | 19 ------- .../ess-file-review.component.html | 18 +----- .../household-members-pets.component.html | 11 +++- .../household-members-pets.component.ts | 2 +- .../household-members.component.html | 10 +--- .../step-ess-file/step-ess-file.service.ts | 39 ------------- .../wizard/wizard.service.ts | 11 +--- .../app/unit-tests/mockDashboard.service.ts | 2 - .../unit-tests/mockHouseholdMember.service.ts | 2 - .../app/unit-tests/mockStepEssFile.service.ts | 2 - .../Events/EvacuationFiles.cs | 4 +- 16 files changed, 18 insertions(+), 194 deletions(-) diff --git a/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Files.cs b/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Files.cs index d99a12e3e..e7641e694 100644 --- a/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Files.cs +++ b/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Files.cs @@ -349,13 +349,10 @@ public class NeedsAssessment [Required] public InsuranceOption Insurance { get; set; } - public string? PetCarePlans { get; set; } - [Required] public IEnumerable HouseholdMembers { get; set; } = Array.Empty(); public IEnumerable Pets { get; set; } = Array.Empty(); - public bool? HavePetsFood { get; set; } public bool? CanProvideFood { get; set; } public bool? CanProvideLodging { get; set; } public bool? CanProvideClothing { get; set; } @@ -406,10 +403,7 @@ public class Note public enum NoteType { [Description("General")] - General, - - [Description("Pet Care Plans")] - PetCarePlans + General } /// @@ -547,7 +541,6 @@ public EvacuationFileMapping() .ForMember(d => d.ModifiedOn, opts => opts.MapFrom(s => s.CompletedOn)) .ForMember(d => d.ReviewingTeamMemberId, opts => opts.MapFrom(s => s.CompletedBy == null ? null : s.CompletedBy.Id)) .ForMember(d => d.ReviewingTeamMemberDisplayName, opts => opts.MapFrom(s => s.CompletedBy == null ? null : s.CompletedBy.DisplayName)) - .ForMember(d => d.PetCarePlans, opts => opts.MapFrom(s => s.Notes.SingleOrDefaultProperty(n => n.Type == EMBC.ESS.Shared.Contracts.Events.NoteType.PetCarePlans, n => n.Content))) ; CreateMap() @@ -592,15 +585,6 @@ public class NeedsAssessmentNotesConverter : IValueConverter ret = new List(); - if (!string.IsNullOrEmpty(sourceMember.PetCarePlans)) - { - ret.Add(new EMBC.ESS.Shared.Contracts.Events.Note - { - Content = sourceMember.PetCarePlans, - Type = EMBC.ESS.Shared.Contracts.Events.NoteType.PetCarePlans, - }); - } - return ret; } } diff --git a/responders/src/API/EMBC.Tests.Unit.Responders.API/FakeGenerator.cs b/responders/src/API/EMBC.Tests.Unit.Responders.API/FakeGenerator.cs index 598787368..b1461bc3f 100644 --- a/responders/src/API/EMBC.Tests.Unit.Responders.API/FakeGenerator.cs +++ b/responders/src/API/EMBC.Tests.Unit.Responders.API/FakeGenerator.cs @@ -99,7 +99,6 @@ private static NeedsAssessment CreateNeedsAssessment() .RuleFor(o => o.CanProvideIncidentals, f => f.Random.NullableBool()) .RuleFor(o => o.CanProvideLodging, f => f.Random.NullableBool()) .RuleFor(o => o.CanProvideTransportation, f => f.Random.NullableBool()) - .RuleFor(o => o.HavePetsFood, f => f.Random.NullableBool()) .RuleFor(o => o.Insurance, f => f.Random.Enum()) .RuleFor(o => o.Type, f => f.Random.Enum()) .RuleFor(o => o.Notes, f => f.Make(f.Random.Int(0, 20), CreateNote)) diff --git a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.html b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.html index 7986f3876..991bd3514 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.html @@ -170,20 +170,6 @@ - -
-
Sufficient pet food?
-
- {{ essFile?.needsAssessment?.havePetsFood ? 'Yes' : 'No' }} -
-
- -
-
Pet Care Plan
-
- {{ essFile?.needsAssessment?.petCarePlans }} -
-
diff --git a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.spec.ts b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.spec.ts index d74fcc024..a27b9fb33 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.spec.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-details/ess-file-details.component.spec.ts @@ -62,7 +62,6 @@ describe('EssFileDetailsComponent', () => { reviewingTeamMemberId: '8d955446-de73-ec11-b830-00505683fbf4', reviewingTeamMemberDisplayName: 'ESS D.', insurance: InsuranceOption.Unsure, - petCarePlans: null, householdMembers: [ { id: '42ab5087-ce1c-48ec-b339-1b1c173842d7', @@ -97,7 +96,6 @@ describe('EssFileDetailsComponent', () => { } ], pets: [], - havePetsFood: false, canProvideFood: false, canProvideLodging: true, canProvideClothing: true, diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.html index 166355d6b..a2ffed4c8 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.html @@ -1,5 +1,3 @@ -
-
@@ -142,59 +140,6 @@
- -
-
-
- - - - - {{ option.name }} - - - Pet food is required - - -
- - - - - - -
-
-
@@ -241,4 +186,4 @@ - + diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.ts index ac491aac7..185cb97e0 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.ts @@ -62,7 +62,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { // Update Value and Validity for pets form if hasPets changes this.animalsForm.get('hasPets').valueChanges.subscribe(() => { - this.animalsForm.get('hasPetsFood').updateValueAndValidity(); this.animalsForm.get('pets').updateValueAndValidity(); this.ValidPetsIndicator.emit(this.animalsForm.valid); @@ -107,8 +106,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { this.pets = []; this.petSource.next(this.pets); this.animalsForm.get('pets').setValue(this.pets); - this.animalsForm.get('hasPetsFood').reset(); - this.animalsForm.get('petCareDetails').reset(); } else { this.animalsForm.get('hasPets').setValue('Yes'); } @@ -186,8 +183,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { this.animalsForm.get('addPetIndicator').setValue(false); if (this.pets.length === 0) { - this.animalsForm.get('hasPetsFood').reset(); - this.animalsForm.get('petCareDetails').reset(); this.animalsForm.get('hasPets').setValue('No'); } } @@ -251,16 +246,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { ) .bind(this.customValidation) ], - hasPetsFood: [ - this.stepEssFileService.havePetsFood, - this.customValidation - .conditionalValidation( - () => this.animalsForm.get('hasPets').value === 'Yes', - Validators.required - ) - .bind(this.customValidation) - ], - petCareDetails: [this.stepEssFileService.petCarePlans], pet: this.createPetForm(), addPetIndicator: [false] }); @@ -334,10 +319,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { private saveFormData() { this.stepEssFileService.havePets = this.animalsForm.get('hasPets').value; this.stepEssFileService.petsList = this.animalsForm.get('pets').value; - this.stepEssFileService.havePetsFood = - this.animalsForm.get('hasPetsFood').value; - this.stepEssFileService.petCarePlans = - this.animalsForm.get('petCareDetails').value; this.stepEssFileService.addPetIndicator = this.animalsForm.get('addPetIndicator').value; } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/ess-file-review/ess-file-review.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/ess-file-review/ess-file-review.component.html index e18491e00..c9a0cd7e2 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/ess-file-review/ess-file-review.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/ess-file-review/ess-file-review.component.html @@ -92,7 +92,7 @@
- +
@@ -229,7 +229,7 @@
Pets?
- {{ stepEssFileService?.havePets }} + {{ stepEssFileService?.havePets ? stepEssFileService?.havePets : "No" }}
@@ -269,20 +269,6 @@
- -
-
Sufficient pet food?
-
- {{ stepEssFileService?.havePetsFood }} -
-
- -
-
Pet Care Plan
-
- {{ stepEssFileService?.petCarePlans }} -
-
diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.html index 7b59f65ab..4a5db07b3 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.html @@ -1,4 +1,13 @@
+
+
+
+ Household Members & Pets +
+
+
+ + @@ -15,4 +24,4 @@
- \ No newline at end of file + diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.ts index 5ec9085fa..6bc11c04b 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.ts @@ -16,7 +16,7 @@ import { WizardService } from "../../wizard.service"; export class HouseholdMembersPetsComponent implements OnInit { - + petsValid = true; householdMembersValid = true; tabMetaData: TabModel; diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.html index c0f16c739..d67206efc 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.html @@ -1,11 +1,3 @@ -
-
-
-
- Household Members & Pets -
-
-
@@ -377,4 +369,4 @@
-
+ diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-ess-file/step-ess-file.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-ess-file/step-ess-file.service.ts index 8cc1163d0..6d40cd11a 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-ess-file/step-ess-file.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-ess-file/step-ess-file.service.ts @@ -69,9 +69,6 @@ export class StepEssFileService { private petsListVal: Pet[]; private addPetIndicatorVal: boolean; - private havePetsFoodVal: string; - private petCarePlansVal: string; - // Needs tab private canRegistrantProvideClothingVal: string; private canRegistrantProvideFoodVal: string; @@ -280,20 +277,6 @@ export class StepEssFileService { this.addPetIndicatorVal = addPetIndicatorVal; } - public get havePetsFood(): string { - return this.havePetsFoodVal; - } - public set havePetsFood(havePetsFoodVal: string) { - this.havePetsFoodVal = havePetsFoodVal; - } - - public get petCarePlans(): string { - return this.petCarePlansVal; - } - public set petCarePlans(petCarePlansVal: string) { - this.petCarePlansVal = petCarePlansVal; - } - // Needs tab public get canRegistrantProvideClothing(): string { return this.canRegistrantProvideClothingVal; @@ -395,11 +378,6 @@ export class StepEssFileService { public createEvacFileDTO(): EvacuationFile { // Get Correct API values for Household Members selections - // Get correct API values for Animals selections - const havePetsFoodDTO = globalConst.radioButtonOptions.find( - (ins) => ins.value === this.havePetsFood - )?.apiValue; - // Get correct API values for Needs Assessment selections const needsClothingDTO = globalConst.needsOptions.find( (ins) => ins.value === this.canRegistrantProvideClothing @@ -427,8 +405,6 @@ export class StepEssFileService { householdMembers: this.householdMembers, pets: this.petsList, - havePetsFood: havePetsFoodDTO, - petCarePlans: this.petCarePlans, canProvideFood: needsFoodDTO, canProvideLodging: needsLodgingDTO, @@ -470,11 +446,6 @@ export class StepEssFileService { public updateEvacFileDTO(): EvacuationFile { // Get Correct API values for Household Members selections - // Get correct API values for Animals selections - const havePetsFoodDTO = globalConst.radioButtonOptions.find( - (ins) => ins.value === this.havePetsFood - )?.apiValue; - // Get correct API values for Needs Assessment selections const needsClothingDTO = globalConst.needsOptions.find( (ins) => ins.value === this.canRegistrantProvideClothing @@ -502,8 +473,6 @@ export class StepEssFileService { householdMembers: this.selectedHouseholdMembers, pets: this.petsList, - havePetsFood: havePetsFoodDTO, - petCarePlans: this.petCarePlans, canProvideFood: needsFoodDTO, canProvideLodging: needsLodgingDTO, @@ -575,9 +544,6 @@ export class StepEssFileService { this.petsList = undefined; this.addPetIndicator = undefined; - this.havePetsFood = undefined; - this.petCarePlans = undefined; - // Needs tab this.canRegistrantProvideClothing = undefined; this.canRegistrantProvideFood = undefined; @@ -656,11 +622,6 @@ export class StepEssFileService { (ins) => ins.apiValue === essNeeds.pets?.length > 0 )?.value; - this.havePetsFood = globalConst.radioButtonOptions.find( - (ins) => ins.apiValue === essNeeds.havePetsFood - )?.value; - this.petCarePlans = essNeeds.petCarePlans; - // Needs tab this.canRegistrantProvideFood = globalConst.needsOptions.find( (ins) => ins.apiValue === essNeeds.canProvideFood diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/wizard.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/wizard.service.ts index 782de1fc2..6f730a1b1 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/wizard.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/wizard.service.ts @@ -380,16 +380,7 @@ export class WizardService { } comparePets(initialValue: EvacuationFileModel, form) { - if ( - globalConst.radioButtonOptions.find( - (ins) => ins.value === form.hasPetsFood.value - )?.apiValue === initialValue.needsAssessment.havePetsFood && - form.petCareDetails.value === initialValue.needsAssessment.petCarePlans - ) { - return false; - } else { - return true; - } + return false; } compareNeeds(initialValue: EvacuationFileModel, form) { diff --git a/responders/src/UI/embc-responder/src/app/unit-tests/mockDashboard.service.ts b/responders/src/UI/embc-responder/src/app/unit-tests/mockDashboard.service.ts index cb0856012..36da212ab 100644 --- a/responders/src/UI/embc-responder/src/app/unit-tests/mockDashboard.service.ts +++ b/responders/src/UI/embc-responder/src/app/unit-tests/mockDashboard.service.ts @@ -227,7 +227,6 @@ export class MockDashboardService extends SearchDataService { reviewingTeamMemberId: '8d955446-de73-ec11-b830-00505683fbf4', reviewingTeamMemberDisplayName: 'ESS D.', insurance: InsuranceOption.Unsure, - petCarePlans: null, householdMembers: [ { id: '42ab5087-ce1c-48ec-b339-1b1c173842d7', @@ -262,7 +261,6 @@ export class MockDashboardService extends SearchDataService { } ], pets: [], - havePetsFood: false, canProvideFood: false, canProvideLodging: true, canProvideClothing: true, diff --git a/responders/src/UI/embc-responder/src/app/unit-tests/mockHouseholdMember.service.ts b/responders/src/UI/embc-responder/src/app/unit-tests/mockHouseholdMember.service.ts index 17bd358a5..36f5819c5 100644 --- a/responders/src/UI/embc-responder/src/app/unit-tests/mockHouseholdMember.service.ts +++ b/responders/src/UI/embc-responder/src/app/unit-tests/mockHouseholdMember.service.ts @@ -75,7 +75,6 @@ export class MockHouseholdMemberService extends HouseholdMemberService { reviewingTeamMemberId: '8d955446-de73-ec11-b830-00505683fbf4', reviewingTeamMemberDisplayName: 'ESS D.', insurance: InsuranceOption.Unsure, - petCarePlans: null, householdMembers: [ { id: '42ab5087-ce1c-48ec-b339-1b1c173842d7', @@ -110,7 +109,6 @@ export class MockHouseholdMemberService extends HouseholdMemberService { } ], pets: [], - havePetsFood: false, canProvideFood: false, canProvideLodging: true, canProvideClothing: true, diff --git a/responders/src/UI/embc-responder/src/app/unit-tests/mockStepEssFile.service.ts b/responders/src/UI/embc-responder/src/app/unit-tests/mockStepEssFile.service.ts index 2726a6a6d..3714599cf 100644 --- a/responders/src/UI/embc-responder/src/app/unit-tests/mockStepEssFile.service.ts +++ b/responders/src/UI/embc-responder/src/app/unit-tests/mockStepEssFile.service.ts @@ -161,7 +161,6 @@ export class MockStepEssFileService extends StepEssFileService { reviewingTeamMemberId: '49475fd6-df73-ec11-b830-00505683fbf4', reviewingTeamMemberDisplayName: 'Sue T.', insurance: InsuranceOption.Unsure, - petCarePlans: null, householdMembers: [ { id: '76d303d5-7466-47ad-9df8-0c117fa56980', @@ -180,7 +179,6 @@ export class MockStepEssFileService extends StepEssFileService { } ], pets: [], - havePetsFood: false, canProvideFood: true, canProvideLodging: true, canProvideClothing: true, diff --git a/shared/src/EMBC.ESS.Shared.Contracts/Events/EvacuationFiles.cs b/shared/src/EMBC.ESS.Shared.Contracts/Events/EvacuationFiles.cs index 423aa3298..60e6e1180 100644 --- a/shared/src/EMBC.ESS.Shared.Contracts/Events/EvacuationFiles.cs +++ b/shared/src/EMBC.ESS.Shared.Contracts/Events/EvacuationFiles.cs @@ -96,7 +96,6 @@ public class NeedsAssessment public bool? CanProvideIncidentals { get; set; } public IEnumerable HouseholdMembers { get; set; } = Array.Empty(); public IEnumerable Pets { get; set; } = Array.Empty(); - public bool? HavePetsFood { get; set; } public IEnumerable Notes { get; set; } = Array.Empty(); } @@ -149,8 +148,7 @@ public class Note public enum NoteType { - General, - PetCarePlans + General } public enum NoteStatus