From 280bfb53ef249a4f096c534bb3ba1e434cedaf11 Mon Sep 17 00:00:00 2001 From: TimaQT <158625845+TimaQT@users.noreply.github.com> Date: Fri, 12 Apr 2024 07:50:47 -0700 Subject: [PATCH] EMBCESSMOD-4989: Enable shelter allowance support (#2009) --- .../DynamicsTestData.cs | 2 +- .../RegistrationsController.Supports.cs | 1 + .../embc-responder/src/app/core/api/models.ts | 1 + .../api/models/lodging-allowance-support.ts | 13 + .../app/core/models/support-details.model.ts | 11 +- .../src/app/core/services/global-constants.ts | 26 ++ .../ess-file-supports.component.html | 138 +++--- .../ess-file-supports.component.ts | 4 + .../referral-creation.service.ts | 38 +- .../step-supports/step-supports.service.ts | 21 +- .../clone-support-details.service.ts | 12 + .../existing-support-details.component.html | 43 +- .../existing-support-details.component.ts | 7 +- .../existing-support-details.service.ts | 15 +- .../review-support.component.html | 285 +++++-------- .../review-support.component.ts | 13 +- .../review-support/review-support.service.ts | 3 +- .../shelter-allowance-delivery.component.html | 108 +++++ .../shelter-allowance-delivery.component.scss | 4 + .../shelter-allowance-delivery.component.ts | 55 +++ .../support-delivery.component.ts | 59 ++- .../support-delivery.module.ts | 2 + .../support-referral.component.html | 29 +- .../shelter-allowance.component.html | 77 ++++ .../shelter-allowance.component.scss | 9 + .../shelter-allowance.component.ts | 112 +++++ .../support-details.component.html | 398 ++++++------------ .../support-details/support-details.module.ts | 4 +- .../support-details.service.ts | 31 +- .../supports-table.component.ts | 9 +- .../view-supports/view-supports.component.ts | 1 + .../app/unit-tests/mockEvacueeList.service.ts | 6 + 32 files changed, 1002 insertions(+), 535 deletions(-) create mode 100644 responders/src/UI/embc-responder/src/app/core/api/models/lodging-allowance-support.ts create mode 100644 responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.html create mode 100644 responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.scss create mode 100644 responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.ts create mode 100644 responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.html create mode 100644 responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.scss create mode 100644 responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.ts diff --git a/ess/src/API/EMBC.Tests.Integration.ESS/DynamicsTestData.cs b/ess/src/API/EMBC.Tests.Integration.ESS/DynamicsTestData.cs index da7dd43ba..724659c06 100644 --- a/ess/src/API/EMBC.Tests.Integration.ESS/DynamicsTestData.cs +++ b/ess/src/API/EMBC.Tests.Integration.ESS/DynamicsTestData.cs @@ -453,4 +453,4 @@ private void AssignSupplierToTeam(EssContext essContext, era_supplier supplier, essContext.SetLink(ts, nameof(era_essteamsupplier.era_ESSTeamID), team); } } -} \ No newline at end of file +} diff --git a/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Supports.cs b/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Supports.cs index 78d578993..118cf8232 100644 --- a/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Supports.cs +++ b/responders/src/API/EMBC.Responders.API/Controllers/RegistrationsController.Supports.cs @@ -253,6 +253,7 @@ public class ProcessPaperReferralsRequest [KnownType(typeof(LodgingBilletingSupport))] [KnownType(typeof(LodgingGroupSupport))] [KnownType(typeof(LodgingHotelSupport))] + [KnownType(typeof(LodgingAllowanceSupport))] [KnownType(typeof(TransportationOtherSupport))] [KnownType(typeof(TransportationTaxiSupport))] public abstract class Support diff --git a/responders/src/UI/embc-responder/src/app/core/api/models.ts b/responders/src/UI/embc-responder/src/app/core/api/models.ts index 3670d0118..92a87f091 100644 --- a/responders/src/UI/embc-responder/src/app/core/api/models.ts +++ b/responders/src/UI/embc-responder/src/app/core/api/models.ts @@ -43,6 +43,7 @@ export { FoodRestaurantSupport } from './models/food-restaurant-support'; export { LodgingBilletingSupport } from './models/lodging-billeting-support'; export { LodgingGroupSupport } from './models/lodging-group-support'; export { LodgingHotelSupport } from './models/lodging-hotel-support'; +export { LodgingAllowanceSupport } from './models/lodging-allowance-support'; export { TransportationOtherSupport } from './models/transportation-other-support'; export { TransportationTaxiSupport } from './models/transportation-taxi-support'; export { EvacuationFileStatus } from './models/evacuation-file-status'; diff --git a/responders/src/UI/embc-responder/src/app/core/api/models/lodging-allowance-support.ts b/responders/src/UI/embc-responder/src/app/core/api/models/lodging-allowance-support.ts new file mode 100644 index 000000000..b6fe8dc1f --- /dev/null +++ b/responders/src/UI/embc-responder/src/app/core/api/models/lodging-allowance-support.ts @@ -0,0 +1,13 @@ +/* tslint:disable */ +/* eslint-disable */ +import { Support } from './support'; +import { SupportCategory } from './support-category'; +import { SupportSubCategory } from './support-sub-category'; +export type LodgingAllowanceSupport = Support & { +'category': SupportCategory; +'subCategory': SupportSubCategory; +'numberOfNights': number; +'contactEmail'?: string; +'contactPhone'?: string; +'totalAmount': number; +}; diff --git a/responders/src/UI/embc-responder/src/app/core/models/support-details.model.ts b/responders/src/UI/embc-responder/src/app/core/models/support-details.model.ts index cf7a6c306..953cd9ad4 100644 --- a/responders/src/UI/embc-responder/src/app/core/models/support-details.model.ts +++ b/responders/src/UI/embc-responder/src/app/core/models/support-details.model.ts @@ -21,7 +21,8 @@ export class SupportDetailsModel { | GroupLodging | HotelMotel | Incidentals - | Clothing; + | Clothing + | ShelterAllowance; } export class SupportDeliveryModel { @@ -81,6 +82,14 @@ export class GroupLodging { noOfNights: number; } +export class ShelterAllowance { + noOfNights: number; + totalAmount: number; + contactEmail: string; + contactPhone: string; + fullName: string; +} + export class Incidentals { approvedItems: string; totalAmount: number; diff --git a/responders/src/UI/embc-responder/src/app/core/services/global-constants.ts b/responders/src/UI/embc-responder/src/app/core/services/global-constants.ts index 2722fee7e..c910b14ab 100644 --- a/responders/src/UI/embc-responder/src/app/core/services/global-constants.ts +++ b/responders/src/UI/embc-responder/src/app/core/services/global-constants.ts @@ -59,6 +59,12 @@ export const billeting = { child: 5 }; +export const shelterAllowanceRate = { + rate: 30, + adult: 10, + child: 5 +}; + export const noOfRooms = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; export const supportNoOfDays = [ @@ -142,6 +148,11 @@ export const hotelRateSheet: DialogContent = { cancelButton: 'Close' }; +export const needsShelterAllowanceRateSheet: DialogContent = { + title: 'ESS Rate Sheet - Shelter Allowance', + text: '

To be issued when evacuees want to source their own shelter whilst evacuated.


$30 per night (single occupancy)

+ $10 for each additional adult

+ $5 for each additional child


', +}; + export const billetingRateSheet: DialogContent = { title: 'ESS Rate Sheet - Lodging', text: `

Billeting in Private Homes

The referral form for billeting is issued to the billeting host (supplier). Billeting rate does not include meals.

\$${billeting.rate.toFixed( @@ -180,6 +191,21 @@ export const duplicateSupportMessage: DialogContent = { cancelButton: 'No, Cancel' }; +export const needsShelterAllowanceMessage: DialogContent = { + title: 'Shelter', + text: '

A shelter allowance of $30 per night based on single occupancy ($10 for each additional adult and youth, and $5 for each child).


The shelter allowance can be provided to eligible evacuees via e-Transfer.

', +}; + +export const needsShelterReferralMessage: DialogContent = { + title: 'Referral', + text: '

A paper form provided by an ESS responder, directing evacuated individuals to specific suppliers or facilities for essential needs like food, shelter, clothing, or other necessary items during the evacuation.

', +}; + +export const needsIncidentalMessage: DialogContent = { + title: 'Incidentals', + text: '

Incidentals could include miscellaneous items such as personal hygiene products such as toothpaste, laundry soap and/or pet food.

', +}; + export const saveMessage: DialogContent = { text: '

Support successfully saved.

', cancelButton: 'Close' diff --git a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-supports/ess-file-supports.component.html b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-supports/ess-file-supports.component.html index 8684d8a4b..6c6a12a6d 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-supports/ess-file-supports.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-supports/ess-file-supports.component.html @@ -12,17 +12,10 @@ added for this ESS File.

-
+
{{ filter?.label.description }} - + {{ filter?.label.description }}
@@ -43,8 +36,7 @@

-

+ }"> {{ getStatusDescription(support?.status) }}

-

+ " class="bold supplier-align"> {{ - getReferral(support)?.method === supportMethod.Referral - ? getReferral(support)?.supplierName - : getReferral(support)?.method === supportMethod.ETransfer - ? 'e-Transfer' - : '' + getReferral(support)?.method === supportMethod.Referral + ? getReferral(support)?.supplierName + : getReferral(support)?.method === supportMethod.ETransfer + ? 'e-Transfer' + : '' }}

-

+

{{ getBilletingReferral(support)?.hostName }}

-

+

{{ getGroupReferral(support)?.facilityName }}

@@ -129,7 +111,9 @@
-

Up to a Total of:

+
+

Up to a Total of:

+
${{ getGroceryReferral(support)?.totalAmount }}
@@ -138,28 +122,36 @@
-

# Breakfasts:

+
+

# Breakfasts:

+
{{ getMealReferral(support)?.numberOfBreakfastsPerPerson }}
-

# Lunches:

+
+

# Lunches:

+
{{ getMealReferral(support)?.numberOfLunchesPerPerson }}
-

# Dinners:

+
+

# Dinners:

+
{{ getMealReferral(support)?.numberOfDinnersPerPerson }}
-

Up to a Total of:

+
+

Up to a Total of:

+
${{ getMealReferral(support)?.totalAmount }}
@@ -168,14 +160,18 @@
-

# Nights:

+
+

# Nights:

+
{{ getHotelReferral(support)?.numberOfNights }}
-

# Rooms:

+
+

# Rooms:

+
{{ getHotelReferral(support)?.numberOfRooms }}
@@ -184,7 +180,9 @@
-

# Nights

+
+

# Nights

+
{{ getBilletingReferral(support)?.numberOfNights }}
@@ -193,23 +191,48 @@
-

# Nights

+
+

# Nights

+
{{ getGroupReferral(support)?.numberOfNights }}
+ +
+
+
+

# Nights

+
+
+ {{ getShelterAllowanceReferral(support)?.numberOfNights }} +
+
+
+
+

Total Amount

+
+
+ ${{ getShelterAllowanceReferral(support)?.totalAmount }} +
+
+
-

From (address):

+
+

From (address):

+
{{ getTaxiReferral(support)?.fromAddress }}
-

To (address):

+
+

To (address):

+
{{ getTaxiReferral(support)?.toAddress }}
@@ -218,14 +241,18 @@
-

Mode of Transport:

+
+

Mode of Transport:

+
{{ getOtherReferral(support)?.transportMode }}
-

Up to a total of:

+
+

Up to a total of:

+
${{ getOtherReferral(support)?.totalAmount }}
@@ -235,14 +262,18 @@
-

Approved Items:

+
+

Approved Items:

+
{{ getIncidentalReferral(support)?.approvedItems }}
-

Up to a total of:

+
+

Up to a total of:

+
${{ getIncidentalReferral(support)?.totalAmount }}
@@ -252,14 +283,18 @@
-

Winter Conditions:

+
+

Winter Conditions:

+
{{ getClothingReferral(support)?.extremeWinterConditions }}
-

Up to a total of:

+
+

Up to a total of:

+
${{ getClothingReferral(support)?.totalAmount }}
@@ -279,10 +314,7 @@
- +
- + \ No newline at end of file diff --git a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-supports/ess-file-supports.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-supports/ess-file-supports.component.ts index 0e032cb5c..b2e7ddeb6 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-supports/ess-file-supports.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/search/essfile-dashboard/ess-file-supports/ess-file-supports.component.ts @@ -22,6 +22,7 @@ import { LodgingGroupSupport, LodgingHotelSupport, Referral, + LodgingAllowanceSupport, Support, SupportMethod, SupportStatus, @@ -186,6 +187,9 @@ export class EssFileSupportsComponent implements OnInit, AfterViewInit { return selectedSupport as LodgingGroupSupport; } + getShelterAllowanceReferral(selectedSupport: Support): LodgingAllowanceSupport { + return selectedSupport as LodgingAllowanceSupport; + } getIncidentalReferral(selectedSupport: Support): IncidentalsSupport { return selectedSupport as IncidentalsSupport; } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/referral-creation.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/referral-creation.service.ts index 147e65e9c..fc94dfbe9 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/referral-creation.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/referral-creation.service.ts @@ -8,6 +8,7 @@ import { LodgingBilletingSupport, LodgingGroupSupport, LodgingHotelSupport, + LodgingAllowanceSupport, Referral, Support, SupportCategory, @@ -24,7 +25,8 @@ import { RestaurantMeal, SupportDeliveryModel, SupportDetailsModel, - Taxi + Taxi, + ShelterAllowance } from 'src/app/core/models/support-details.model'; import { CacheService } from 'src/app/core/services/cache.service'; import { @@ -41,6 +43,7 @@ export class ReferralCreationService { private hotelReferralVal: LodgingHotelSupport; private billetingReferralVal: LodgingBilletingSupport; private groupReferralVal: LodgingGroupSupport; + private lodgingAllowanceReferralVal: LodgingAllowanceSupport; private clothingReferralVal: ClothingSupport; private incidentalsReferralVal: IncidentalsSupport; private draftSupportVal: Support[] = []; @@ -156,6 +159,18 @@ export class ReferralCreationService { : JSON.parse(this.cacheService.get('clothingReferralVal')); } + set lodgingAllowanceReferral(lodgingAllowanceReferralVal: LodgingAllowanceSupport) { + this.lodgingAllowanceReferralVal = lodgingAllowanceReferralVal; + this.cacheService.set('lodgingAllowanceReferralVal', lodgingAllowanceReferralVal); + this.setDraftSupport(lodgingAllowanceReferralVal); + } + + get lodgingAllowanceReferral(): LodgingAllowanceSupport { + return this.lodgingAllowanceReferralVal + ? this.lodgingAllowanceReferralVal + : JSON.parse(this.cacheService.get('lodgingAllowanceReferral')); + } + set incidentalsReferral(incidentalsReferralVal: IncidentalsSupport) { this.incidentalsReferralVal = incidentalsReferralVal; this.setDraftSupport(incidentalsReferralVal); @@ -282,6 +297,27 @@ export class ReferralCreationService { this.groupReferral = groupReferral; } + createShelterAllowanceReferral( + referral: Support, + supportDetails: SupportDetailsModel, + supportDelivery: SupportDeliveryModel + ) { + const lodgingAllowanceReferral: LodgingAllowanceSupport = { + ...referral, + category: SupportCategory.Lodging, + contactEmail:supportDelivery.details.emailAddress, + contactPhone: supportDelivery.details.hostPhone, + numberOfNights: (supportDetails.referral as ShelterAllowance).noOfNights, + totalAmount: this.parseTextNumber( + (supportDetails.referral as ShelterAllowance).totalAmount + ? (supportDetails.referral as ShelterAllowance).totalAmount + : 0 + ), + subCategory: SupportSubCategory.Lodging_Allowance + }; + this.lodgingAllowanceReferral = lodgingAllowanceReferral; + } + createClothingReferral( referral: Support, supportDetails: SupportDetailsModel diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/step-supports.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/step-supports.service.ts index de4f505df..ccf4dced0 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/step-supports.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-supports/step-supports.service.ts @@ -168,7 +168,6 @@ export class StepSupportsService { const members: Array = this.supportDetails.members.map((value) => { return value.id; }); - const referral: Referral | Interac = method === SupportMethod.Referral ? { @@ -177,11 +176,14 @@ export class StepSupportsService { ? 'R' + this.supportDetails.externalReferenceId : '', issuedToPersonName: + (this.supportTypeToAdd.value === SupportSubCategory.Lodging_Allowance) ? (this.supportDelivery.details.hostName) :( this.supportDelivery.issuedTo !== 'Someone else' ? this.supportDelivery.issuedTo.lastName + ', ' + this.supportDelivery.issuedTo.firstName - : this.supportDelivery.name, + : this.supportDelivery.name) + + , supplierAddress: this.supportDelivery.supplier.address, supplierId: this.supportDelivery.supplier.id, supplierName: this.supportDelivery.supplier.name, @@ -215,6 +217,7 @@ export class StepSupportsService { subCategory: null, supportDelivery: referral }; + if (this.supportTypeToAdd.value === SupportSubCategory.Food_Restaurant) { this.referralService.createMealReferral(support, this.supportDetails); } else if ( @@ -240,6 +243,14 @@ export class StepSupportsService { this.supportDetails, this.supportDelivery ); + } else if ( + this.supportTypeToAdd.value === SupportSubCategory.Lodging_Allowance + ) { + this.referralService.createShelterAllowanceReferral( + support, + this.supportDetails, + this.supportDelivery + ); } else if ( this.supportTypeToAdd.value === SupportSubCategory.Lodging_Group ) { @@ -287,7 +298,11 @@ export class StepSupportsService { } else if ( this.supportTypeToAdd.value === SupportSubCategory.Lodging_Hotel ) { - return globalConst.hotelRateSheet; + return globalConst.hotelRateSheet; + } else if ( + this.supportTypeToAdd.value === SupportSubCategory.Lodging_Allowance + ) { + return globalConst.needsShelterAllowanceRateSheet; } else if (this.supportTypeToAdd.value === SupportCategory.Incidentals) { return globalConst.incidentalsRateSheet; } else if (this.supportTypeToAdd.value === SupportCategory.Clothing) { diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/clone-support-details.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/clone-support-details.service.ts index 7be4544f7..30cfc35a4 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/clone-support-details.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/clone-support-details.service.ts @@ -24,6 +24,7 @@ import { Incidentals, OtherTransport, RestaurantMeal, + ShelterAllowance, SupplierDetailsModel, Taxi } from 'src/app/core/models/support-details.model'; @@ -177,6 +178,7 @@ export class CloneSupportDetailsService { | OtherTransport | Billeting | GroupLodging + | ShelterAllowance | HotelMotel | Incidentals | Clothing { @@ -224,6 +226,16 @@ export class CloneSupportDetailsService { noOfNights: 1 }; } else if ( + selectedSupport.subCategory === SupportSubCategory.Lodging_Allowance + ) { + return { + noOfNights: 1, + totalAmount: null, + contactEmail: null, + contactPhone: null, + fullName: null + }; + } else if ( selectedSupport.subCategory === SupportSubCategory.Lodging_Hotel ) { return { diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.html index fb84425d9..310cfe59b 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.html @@ -501,6 +501,21 @@
{{ groupReferral?.numberOfNights }}
+ +
+
+
# Nights:
+
+ {{ shelterAllowanceReferral?.numberOfNights }} +
+
+
+
Up to a Maximum Value of:
+
+ ${{ shelterAllowanceReferral?.totalAmount }} +
+
+
@@ -579,7 +594,8 @@
-
+
Person Responsible for Purchasing Goods:
@@ -591,7 +607,8 @@
+
+
Payee Details:
+
+ {{ referral?.issuedToPersonName | uppercase }} +
+
+
+
Contact Information:
+
+
+
-
+
Notes for Supplier:
{{ referral?.supplierNotes }}
diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.ts index 192d0d6f6..b0ee01ebd 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.component.ts @@ -12,7 +12,8 @@ import { LodgingBilletingSupport, LodgingGroupSupport, Referral, - Interac + Interac, + LodgingAllowanceSupport } from 'src/app/core/api/models'; import { StepSupportsService } from '../../step-supports/step-supports.service'; import * as globalConst from '../../../../core/services/global-constants'; @@ -150,6 +151,10 @@ export class ExistingSupportDetailsComponent implements OnInit { return this.selectedSupport as LodgingGroupSupport; } + get shelterAllowanceReferral(): LodgingAllowanceSupport { + return this.selectedSupport as LodgingAllowanceSupport; + } + get incidentalReferral(): IncidentalsSupport { return this.selectedSupport as IncidentalsSupport; } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.service.ts index 70f236790..f6298d765 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/existing-support-details/existing-support-details.service.ts @@ -10,6 +10,7 @@ import { LodgingBilletingSupport, LodgingGroupSupport, LodgingHotelSupport, + LodgingAllowanceSupport, Referral, ReferralPrintRequestResponse, Support, @@ -29,6 +30,7 @@ import { Clothing, Groceries, GroupLodging, + ShelterAllowance, HotelMotel, Incidentals, OtherTransport, @@ -274,6 +276,7 @@ export class ExistingSupportDetailsService { | OtherTransport | Billeting | GroupLodging + | ShelterAllowance | HotelMotel | Incidentals | Clothing { @@ -330,7 +333,17 @@ export class ExistingSupportDetailsService { noOfNights: (selectedSupport as LodgingHotelSupport).numberOfNights, noOfRooms: (selectedSupport as LodgingHotelSupport).numberOfRooms }; - } else if (selectedSupport.category === SupportCategory.Incidentals) { + } else if ( + selectedSupport.subCategory === SupportSubCategory.Lodging_Allowance + ) { + return { + noOfNights: (selectedSupport as LodgingAllowanceSupport).numberOfNights, + totalAmount: (selectedSupport as LodgingAllowanceSupport).totalAmount, + contactEmail: (selectedSupport as LodgingAllowanceSupport).contactEmail, + contactPhone: (selectedSupport as LodgingAllowanceSupport).contactPhone, + fullName: (selectedSupport.supportDelivery as Referral).issuedToPersonName + }; + }else if (selectedSupport.category === SupportCategory.Incidentals) { return { approvedItems: (selectedSupport as IncidentalsSupport).approvedItems, totalAmount: (selectedSupport as IncidentalsSupport).totalAmount, diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.component.html index 285478650..b280b1d32 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.component.html @@ -1,12 +1,8 @@
@@ -24,113 +20,62 @@
-
+ + +
+
# Nights:
+
+ {{ getShelterAllowanceReferral(support)?.numberOfNights }} +
+
+
+
Total Amount:
+
+ ${{ getShelterAllowanceReferral(support)?.totalAmount + | number: '1.2-2':'en-CA' + }} +
+
+
+
@@ -297,9 +248,7 @@
- +
Mode of Transport:
@@ -311,8 +260,8 @@
Total Amount:
${{ - getOtherReferral(support)?.totalAmount - | number: '1.2-2':'en-CA' + getOtherReferral(support)?.totalAmount + | number: '1.2-2':'en-CA' }}
@@ -332,31 +281,22 @@
Total Amount:
${{ - getClothingReferral(support)?.totalAmount - | number: '1.2-2':'en-CA' + getClothingReferral(support)?.totalAmount + | number: '1.2-2':'en-CA' }}
-
+
- + - Total monetary value exceeds the recommended ESS rate + Total monetary value exceeds the recommended ESS rate Authorization to exceed recommended ESS rate provided by: {{ getClothingReferral(support)?.approverName - }} + }}
@@ -375,45 +315,34 @@
Total Amount:
${{ - getIncidentalReferral(support)?.totalAmount - | number: '1.2-2':'en-CA' + getIncidentalReferral(support)?.totalAmount + | number: '1.2-2':'en-CA' }}
-
+
- + - Total monetary value exceeds the recommended ESS rate + Total monetary value exceeds the recommended ESS rate Authorization to exceed recommended ESS rate provided by: {{ getIncidentalReferral(support)?.approverName - }} + }}
-
+ "> Support Delivery

@@ -426,13 +355,10 @@

-
+ "> Support Delivery

@@ -446,14 +372,28 @@

{{ getReferral(support)?.supplierNotes }}

+ + +
+ + Support Delivery +

+ {{ getReferral(support)?.issuedToPersonName }} +

+

+ {{ getShelterAllowanceReferral(support)?.contactEmail }} +

+

{{ getShelterAllowanceReferral(support)?.contactPhone }}

+
+
-
+ "> Support Delivery

@@ -470,23 +410,18 @@

-
+
- Support Delivery - e-Transfer + Support Delivery - e-Transfer

e-Transfer Recipient

{{ - appBaseService?.appModel?.selectedProfile?.selectedEvacueeInContext?.personalDetails?.lastName?.toUpperCase() + appBaseService?.appModel?.selectedProfile?.selectedEvacueeInContext?.personalDetails?.lastName?.toUpperCase() }}, {{ - appBaseService?.appModel?.selectedProfile - ?.selectedEvacueeInContext?.personalDetails?.firstName + appBaseService?.appModel?.selectedProfile + ?.selectedEvacueeInContext?.personalDetails?.firstName }}

@@ -510,10 +445,8 @@
- I certify that a supervisor or ESSD has checked my work and approved + I certify that a supervisor or + ESSD has checked my work and approved the above supports for distribution to the evacuee.
@@ -521,11 +454,7 @@
- + Some required fields have not been completed.
@@ -535,18 +464,10 @@ -
-
+
\ No newline at end of file diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.component.ts index 0b20fefa0..3d30f9079 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.component.ts @@ -14,7 +14,8 @@ import { Referral, Support, SupportMethod, - Interac + Interac, + LodgingAllowanceSupport } from 'src/app/core/api/models'; import { AddressModel } from 'src/app/core/models/address.model'; import { LocationsService } from 'src/app/core/services/locations.service'; @@ -130,6 +131,16 @@ export class ReviewSupportComponent implements OnInit { return support as FoodGroceriesSupport; } + /** + * Returns the current support as a ShelterAllowanceReferral + * + * @param support the support to cast as ShelterAllowanceReferral + * @returns a ShelterAllowanceReferral object + */ + getShelterAllowanceReferral(support: Support): LodgingAllowanceSupport { + return support as LodgingAllowanceSupport; + } + /** * Returns the current support as a FoodRestaurantReferral * diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.service.ts index d315a02a1..73cf7887a 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/review-support/review-support.service.ts @@ -81,7 +81,8 @@ export class ReviewSupportService { file.supports.forEach((support) => { if ( support.subCategory === 'Lodging_Group' || - support.subCategory === 'Lodging_Billeting' + support.subCategory === 'Lodging_Billeting'|| + support.subCategory === 'Lodging_Allowance' ) { supportModel.push(support); } else { diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.html new file mode 100644 index 000000000..fca83fe59 --- /dev/null +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.html @@ -0,0 +1,108 @@ +
+
+
+

Payee Details

+
+
+ +
+
+

Full Name (including middle name if applicable)

+

+ Please provide the name and address of the individual to whom reimbursement should be issued for the shelter expenses incurred. +

+
+
+ +
+
+ + Full Name + + + Full Name is required + +
+
+ + +
+
+

Contact Information

+

+ Please provide at least 1 point of contact for the individual to whom reimbursement should be issued. +

+
+
+ +
+
+ + Telephone + + + Telephone is required + + Telephone must have 10 digits + +
+
+ +
+
+ + Email Address + + + Email is required + Invalid email + +
+
+
diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.scss b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.scss new file mode 100644 index 000000000..0d41b399e --- /dev/null +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.scss @@ -0,0 +1,4 @@ +.question-heading { + color: #234075; + font-size: 21px; +} diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.ts new file mode 100644 index 000000000..3ef74f952 --- /dev/null +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component.ts @@ -0,0 +1,55 @@ +import { + Component, + Input, + OnChanges, + OnInit, + SimpleChanges +} from '@angular/core'; +import { AbstractControl, UntypedFormGroup } from '@angular/forms'; +import { distinctUntilChanged } from 'rxjs/operators'; +import * as globalConst from '../../../../../../core/services/global-constants'; + +@Component({ + selector: 'app-shelter-allowance-delivery', + templateUrl: './shelter-allowance-delivery.component.html', + styleUrls: ['./shelter-allowance-delivery.component.scss'] +}) +export class ShelterAllowanceDeliveryComponent implements OnInit, OnChanges { + @Input() supportDeliveryForm: UntypedFormGroup; + detailsForm: UntypedFormGroup; + + readonly phoneMask = globalConst.phoneMask; + + constructor() {} + + ngOnInit(): void { + this.detailsForm + .get('hostPhone') + .valueChanges.pipe(distinctUntilChanged()) + .subscribe((value) => { + this.detailsForm.get('emailAddress').updateValueAndValidity(); + }); + + this.detailsForm + .get('emailAddress') + .valueChanges.pipe(distinctUntilChanged()) + .subscribe((value) => { + this.detailsForm.get('hostPhone').updateValueAndValidity(); + }); + } + + ngOnChanges(changes: SimpleChanges): void { + if (changes.supportDeliveryForm) { + this.detailsForm = this.supportDeliveryForm.get( + 'details' + ) as UntypedFormGroup; + } + } + + /** + * Returns the control of the form + */ + get supportDeliveryFormControl(): { [key: string]: AbstractControl } { + return this.detailsForm.controls; + } +} diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.component.ts index 1ec58a7e5..288e7af41 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.component.ts @@ -264,6 +264,10 @@ export class SupportDeliveryComponent implements OnInit, AfterViewChecked { this.stepSupportsService?.supportTypeToAdd?.value === 'Lodging_Group' ) { return this.groupLodgingSupplierForm(); + }else if ( + this.stepSupportsService?.supportTypeToAdd?.value === 'Lodging_Allowance' + ) { + return this.groupShelterAllowanceSupplierForm(); } } @@ -349,7 +353,6 @@ export class SupportDeliveryComponent implements OnInit, AfterViewChecked { setSupportMethod(method: SupportMethod) { this.selectedSupportMethod = method; - if (method === SupportMethod.Referral) { this.supportDeliveryForm.get('notificationPreference').patchValue(''); this.supportDeliveryForm.get('notificationEmail').patchValue(''); @@ -361,6 +364,15 @@ export class SupportDeliveryComponent implements OnInit, AfterViewChecked { this.supportDeliveryForm.get('name').patchValue(''); this.supportDeliveryForm.get('supplier').patchValue(''); this.supportDeliveryForm.get('supplierNote').patchValue(''); + if (this.stepSupportsService?.supportTypeToAdd?.value === 'Lodging_Allowance') + { + this.supportDeliveryForm.get('details').disable(); + } + } + if (this.stepSupportsService?.supportTypeToAdd?.value === 'Lodging_Allowance') { + this.supportDeliveryForm.get('supplier').disable(); + this.supportDeliveryForm.get('issuedTo').disable(); + this.supportDeliveryForm.get('name').setValue(this.supportDeliveryForm.get('details').get('hostName').value); } } @@ -443,4 +455,49 @@ export class SupportDeliveryComponent implements OnInit, AfterViewChecked { ] }); } + + private groupShelterAllowanceSupplierForm(): UntypedFormGroup { + return this.formBuilder.group({ + hostName: [ + this.stepSupportsService?.supportDelivery?.details?.hostName ?? '', + [this.customValidation.whitespaceValidator()] + ], + hostPhone: [ + this.stepSupportsService?.supportDelivery?.details?.hostPhone ?? '', + [ + this.customValidation + .maskedNumberLengthValidator() + .bind(this.customValidation), + this.customValidation + .conditionalValidation( + () => + (this.supportDeliveryForm.get('details.emailAddress') === null || + this.supportDeliveryForm.get('details.emailAddress').value === + '' || + this.supportDeliveryForm.get('details.emailAddress').value === + undefined), + this.customValidation.whitespaceValidator() + ) + .bind(this.customValidation) + ] + ], + emailAddress: [ + this.stepSupportsService?.supportDelivery?.details?.emailAddress ?? '', + [ + Validators.email, + this.customValidation + .conditionalValidation( + () => + (this.supportDeliveryForm.get('details.hostPhone') === null || + this.supportDeliveryForm.get('details.hostPhone').value === + '' || + this.supportDeliveryForm.get('details.hostPhone').value === + undefined), + this.customValidation.whitespaceValidator() + ) + .bind(this.customValidation) + ] + ] + }); + } } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.module.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.module.ts index 017444df2..71867dda6 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.module.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-delivery.module.ts @@ -9,6 +9,7 @@ import { CustomPipeModule } from 'src/app/shared/pipes/customPipe.module'; import { SharedModule } from 'src/app/shared/shared.module'; import { TextMaskModule } from 'angular2-text-mask'; import { BilletingDeliveryComponent } from './delivery-types/billeting-delivery/billeting-delivery.component'; +import { ShelterAllowanceDeliveryComponent } from './delivery-types/shelter-allowance-delivery/shelter-allowance-delivery.component'; import { GroupLodgingDeliveryComponent } from './delivery-types/group-lodging-delivery/group-lodging-delivery.component'; import { SupportReferralComponent } from './support-referral/support-referral.component'; import { SupportEtransferComponent } from './support-etransfer/support-etransfer.component'; @@ -17,6 +18,7 @@ import { SupportEtransferComponent } from './support-etransfer/support-etransfer declarations: [ SupportDeliveryComponent, BilletingDeliveryComponent, + ShelterAllowanceDeliveryComponent, GroupLodgingDeliveryComponent, SupportReferralComponent, SupportEtransferComponent diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-referral/support-referral.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-referral/support-referral.component.html index 3e63f4b55..26f86f759 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-referral/support-referral.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-delivery/support-referral/support-referral.component.html @@ -1,12 +1,16 @@
-
+

Who will be responsible for the purchasing of goods?

-
+
@@ -156,6 +161,16 @@ >
+ + +
+ +
+
-
+

Supplier Support Notes

-
+

These notes are for the supplier and will be visible on the referral diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.html new file mode 100644 index 000000000..555aaaa74 --- /dev/null +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.html @@ -0,0 +1,77 @@ + +

+
+

+
+
+
+
+

Number of Nights

+
+
+
+
+ + Number of Nights + + + {{ no }} + + + + Number of Nights is required + +
+
+ + + +
+
+

Total Amount

+
+
+ +
+
+

+ ${{ totalAmount | number: '1.2-2' }} +

+
+
+ + + +
+
+

+ Acknowledgement to be read by Responder before completing page: +
+
+ +
+
+

+ By accepting Shelter Allowance, you acknowledge that you will not be able to receive any other sheltering supports during the valid timeframe noted on the referral. +

+

+ If the evacuee no longer wants to receive the Shelter Allowance, please select cancel and return to the Supports Page. +

+
+
+ +
+
+ Evacuee confirms they understand the above statement. + +
+
+ \ No newline at end of file diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.scss b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.scss new file mode 100644 index 000000000..dff9ed2d1 --- /dev/null +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.scss @@ -0,0 +1,9 @@ +.time-heading { + color: #234075; + font-size: 21px; +} + +.amount { + color: #234075; + font-weight: bold; +} \ No newline at end of file diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.ts new file mode 100644 index 000000000..a77daa385 --- /dev/null +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/details-type/shelter-allowance/shelter-allowance.component.ts @@ -0,0 +1,112 @@ +import { + AfterViewInit, + ChangeDetectorRef, + Component, + Input, + OnChanges, + OnInit, + SimpleChanges +} from '@angular/core'; +import { AbstractControl, UntypedFormGroup } from '@angular/forms'; +import * as globalConst from '../../../../../../core/services/global-constants'; +import { AppBaseService } from 'src/app/core/services/helper/appBase.service'; + +@Component({ + selector: 'app-shelter-allowance', + templateUrl: './shelter-allowance.component.html', + styleUrls: ['./shelter-allowance.component.scss'] +}) +export class ShelterAllowanceGroupComponent implements OnInit, OnChanges, AfterViewInit { + @Input() supportDetailsForm: UntypedFormGroup; + @Input() noOfDays: number; + referralForm: UntypedFormGroup; + days: number; + totalAmount = 0; + constructor(private cd: ChangeDetectorRef, private appBaseService: AppBaseService) { } + @Input() SelectedHouseholdMembers: any[]; + nofNight = 0; + members: any[]; + + ngAfterViewInit(): void { + this.cd.detectChanges(); + } + + ngOnChanges(changes: SimpleChanges): void { + if (changes.supportDetailsForm) { + this.referralForm = this.supportDetailsForm.get( + 'referral' + ) as UntypedFormGroup; + } + + if (changes.noOfDays) { + this.days = this.noOfDays; + this.referralForm.get('noOfNights').patchValue(this.noOfDays); + this.updateTotalAmount(); + } + if (changes.SelectedHouseholdMembers) { + this.updateTotalAmount(); + } + + this.referralForm.get('noOfNights').valueChanges.subscribe( () => {this.updateTotalAmount()}); + } + updateTotalAmount() { + this.members = this.supportDetailsForm.get('members').value; + this.nofNight = this.referralForm.get('noOfNights').value; + + this.totalAmount = 0; + if (this.members != null && this.members.length === 1) { + this.totalAmount = + this.nofNight * globalConst.shelterAllowanceRate.rate; + + } + else if (this.members != null && this.members.length > 1) { + const count = this.members.reduce((acc, member) => { + if (member.isMinor) { + acc.minorCount++; + } else { + acc.adultCount++; + } + return acc; + }, { minorCount: 0, adultCount: 0 }); + + if (count.adultCount === 0) { + this.totalAmount = + this.nofNight * (globalConst.shelterAllowanceRate.rate + (count.minorCount - 1) * globalConst.shelterAllowanceRate.child); + } + else { + this.totalAmount = + this.nofNight * + (globalConst.shelterAllowanceRate.rate + + count.minorCount * globalConst.shelterAllowanceRate.child + + (count.adultCount - 1) * globalConst.shelterAllowanceRate.adult); + } + if (this.totalAmount < 0) + this.totalAmount = 0; + } + this.referralForm.get('totalAmount').patchValue(this.totalAmount); + + this.checkOverlimit(this.totalAmount); + } + ngOnInit(): void { } + + /** + * Returns the control of the form + */ + get referralFormControl(): { [key: string]: AbstractControl } { + return this.referralForm.controls; + } + + checkOverlimit(totalAmount) { + const exceedsLimit = totalAmount > globalConst.etransferLimt; + + if (exceedsLimit) { + this.appBaseService.etransferProperties = { + isTotalAmountOverlimit: true + }; + } else { + this.appBaseService.etransferProperties = { + isTotalAmountOverlimit: false + }; + } + } +} \ No newline at end of file diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.html index fe38a33de..8ff5bde31 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.component.html @@ -1,12 +1,8 @@
@@ -17,16 +13,14 @@
{{ stepSupportsService?.supportTypeToAdd?.description - }} + }}
@@ -47,12 +41,12 @@

{{ - evacueeSessionService?.evacFile?.task?.from - | date: 'dd-MMM-yyyy' + evacueeSessionService?.evacFile?.task?.from + | date: 'dd-MMM-yyyy' }} at {{ - evacueeSessionService?.evacFile?.task?.from | date: 'hh:mm a' + evacueeSessionService?.evacFile?.task?.from | date: 'hh:mm a' }}

@@ -63,19 +57,16 @@

Task Number End Date & Time:

-

+ }"> {{ - evacueeSessionService?.evacFile?.task?.to | date: 'dd-MMM-yyyy' + evacueeSessionService?.evacFile?.task?.to | date: 'dd-MMM-yyyy' }} at {{ evacueeSessionService?.evacFile?.task?.to | date: 'hh:mm a' }} @@ -106,66 +97,43 @@

- + R - - Support Number is required - + Support Number is required + - Support Number must be 6 to 10 digits in length - + Support Number must be 6 to 10 digits in length + - Only digits allowed - + Only digits allowed + + "> Paper Referral Number already exists for the same Support type: {{ - stepSupportsService?.supportTypeToAdd?.description - }} + stepSupportsService?.supportTypeToAdd?.description + }}
- +
@@ -180,49 +148,32 @@
Interviewer first name - - + - Interviewer first name is required + "> + Interviewer first name is required
Initial of their last name - - + - Initial is required + "> + Initial is required
@@ -238,41 +189,26 @@
- - + + - - Please enter a valid date + "> + Please enter a valid date - - Completed on date is required + "> + Completed on date is required
@@ -296,63 +232,40 @@
Valid From Date - - + + - - Please enter a valid date + "> + Please enter a valid date - - From Date is required + "> + From Date is required
Valid From Time - - + - From Time is required + "> + From Time is required
@@ -362,23 +275,17 @@ Number of Days - + {{ no }} - - Required + "> + Required
@@ -387,71 +294,43 @@
Valid To Date - - + + - - Please enter a valid date + "> + Please enter a valid date - - To Date is required + "> + To Date is required - + Valid To Date cannot be greater then the 30 days - from the Valid From Date + from the Valid From Date
Valid To Time - - + - To Time Required + "> + To Time Required
@@ -464,13 +343,13 @@ Valid From: {{ originalSupport?.from | date: 'dd-MMM-yyyy' - }} + }}

Valid To: {{ originalSupport?.to | date: 'dd-MMM-yyyy' - }} + }}

@@ -481,135 +360,100 @@

Which people in your household require - {{ - stepSupportsService?.supportTypeToAdd?.description + {{ + stepSupportsService?.supportTypeToAdd?.description }} - ? + ?

- All household members + All household + members
-
+ ">
- + {{ member.lastName | uppercase }}, - {{ member.firstName | titlecase }} + {{ member.firstName | titlecase }}
- - Required - -
+ "> + Required + +
+ + +
+ +
+
- + ">
- + ">
- +
- +
- +
- +
- +
- + " [supportDetailsForm]="supportDetailsForm">
- + " [supportDetailsForm]="supportDetailsForm">
@@ -634,4 +478,4 @@
-
+
\ No newline at end of file diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.module.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.module.ts index 5adf69e49..daa8e6f1a 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.module.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.module.ts @@ -18,6 +18,7 @@ import { ClothingComponent } from './details-type/clothing/clothing.component'; import { IncidentalsComponent } from './details-type/incidentals/incidentals.component'; import { CustomDirectiveModule } from 'src/app/shared/directives/customDirective.module'; import { SharedModule } from 'src/app/shared/shared.module'; +import {ShelterAllowanceGroupComponent } from './details-type/shelter-allowance/shelter-allowance.component'; @NgModule({ declarations: [ @@ -31,7 +32,8 @@ import { SharedModule } from 'src/app/shared/shared.module'; LodgingBilletingComponent, LodgingGroupComponent, ClothingComponent, - IncidentalsComponent + IncidentalsComponent, + ShelterAllowanceGroupComponent ], imports: [ CommonModule, diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.service.ts index 04252b80a..61123512a 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/support-details/support-details.service.ts @@ -15,6 +15,7 @@ import { Groceries, GroupLodging, HotelMotel, + ShelterAllowance, Incidentals, OtherTransport, RestaurantMeal, @@ -35,7 +36,7 @@ export class SupportDetailsService { public stepSupportsService: StepSupportsService, private registrationService: RegistrationsService, private evacueeSessionService: EvacueeSessionService - ) {} + ) { } generateDynamicForm(supportType: string): UntypedFormGroup { if (supportType === SupportSubCategory.Food_Restaurant) { @@ -52,6 +53,8 @@ export class SupportDetailsService { return this.billetingForm(); } else if (supportType === SupportSubCategory.Lodging_Group) { return this.groupLodgingForm(); + } else if (supportType === SupportSubCategory.Lodging_Allowance) { + return this.shelterAllowanceLodgingForm(); } else if (supportType === SupportCategory.Incidentals) { return this.incidentalsForm(); } else if (supportType === SupportCategory.Clothing) { @@ -199,6 +202,32 @@ export class SupportDetailsService { }); } + shelterAllowanceLodgingForm(): UntypedFormGroup { + return this.formBuilder.group({ + noOfNights: [ + (this.stepSupportsService?.supportDetails?.referral as ShelterAllowance) + ?.noOfNights ?? '', + [Validators.required] + ], + totalAmount: [ + (this.stepSupportsService?.supportDetails?.referral as ShelterAllowance) + ?.totalAmount ?? '', + [ + Validators.required, + Validators.pattern(globalConst.currencyPattern), + this.customValidation.totalZeroValidator() + ] + ], + processEvacueeCert: [ + '', + [ + Validators.requiredTrue + ] + ] + + }); + } + incidentalsForm(): UntypedFormGroup { const incidentalsForm = this.formBuilder.group({ approvedItems: [ diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/supports-table/supports-table.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/supports-table/supports-table.component.ts index d390e8940..235a83905 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/supports-table/supports-table.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/supports-table/supports-table.component.ts @@ -25,7 +25,8 @@ import { SupportCategory, ClothingSupport, IncidentalsSupport, - FoodGroceriesSupport + FoodGroceriesSupport, + LodgingAllowanceSupport } from 'src/app/core/api/models'; import { TableFilterValueModel } from 'src/app/core/models/table-filter-value.model'; import { LoadEvacueeListService } from 'src/app/core/services/load-evacuee-list.service'; @@ -85,7 +86,9 @@ export class SupportsTableComponent return (item as LodgingBilletingSupport).hostName.toLowerCase(); } else if (item.subCategory === SupportSubCategory.Lodging_Group) { return (item as LodgingGroupSupport).facilityName.toLowerCase(); - } else { + } else if (item.subCategory === SupportSubCategory.Lodging_Allowance) { + return (item.supportDelivery as Referral).issuedToPersonName.toLowerCase(); + }else { return ( item.supportDelivery as Referral ).supplierName.toLowerCase(); @@ -193,6 +196,8 @@ export class SupportsTableComponent return (element as LodgingBilletingSupport).hostName; } else if (element.subCategory === SupportSubCategory.Lodging_Group) { return (element as LodgingGroupSupport).facilityName; + } else if (element.subCategory === SupportSubCategory.Lodging_Allowance) { + return (element.supportDelivery as Referral).issuedToPersonName; } else { return (element.supportDelivery as Referral).supplierName; } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/view-supports.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/view-supports.component.ts index 2ec0c552b..2bf87890f 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/view-supports.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/support-components/view-supports/view-supports.component.ts @@ -111,6 +111,7 @@ export class ViewSupportsComponent implements OnInit, OnDestroy { if ( support.subCategory === 'Lodging_Group' || support.subCategory === 'Lodging_Billeting' || + support.subCategory === 'Lodging_Allowance' || support.method === 'ETransfer' ) { supportModel.push(support); diff --git a/responders/src/UI/embc-responder/src/app/unit-tests/mockEvacueeList.service.ts b/responders/src/UI/embc-responder/src/app/unit-tests/mockEvacueeList.service.ts index e5d26e687..e3d923fb5 100644 --- a/responders/src/UI/embc-responder/src/app/unit-tests/mockEvacueeList.service.ts +++ b/responders/src/UI/embc-responder/src/app/unit-tests/mockEvacueeList.service.ts @@ -69,6 +69,12 @@ export class MockEvacueeListService extends LoadEvacueeListService { description: 'Lodging - Group Lodging', parentCode: null }, + { + type: 'SupportSubCategory', + value: 'Lodging_Allowance', + description: 'Shelter - Allowance', + parentCode: null + }, { type: 'SupportSubCategory', value: 'Food_Groceries',