Skip to content

Commit

Permalink
Merge pull request #2314 from bcgov/master
Browse files Browse the repository at this point in the history
master->R3.3.0
  • Loading branch information
ytqsl authored Jun 7, 2024
2 parents 212c728 + fb0268b commit c0798dc
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,23 @@
} @else {
Groceries
}
@if (!hasSelfServeFoodGroceriesSupport) {
@if (
!hasSelfServeFoodGroceriesSupport &&
supportEligibilityStateSettings[SelfServeSupportType.FoodGroceries] !==
SelfServeSupportEligibilityState.UnavailableOneTimeUsed
) {
<mat-error> Not available via self-serve </mat-error>
}
</mat-radio-button>
<div class="show-one-time-used-message">
<div
[style.color]="'red'"
[style.display]="
supportEligibilityStateSettings[SelfServeSupportType.FoodGroceries] ===
SelfServeSupportEligibilityState.UnavailableOneTimeUsed
? 'block'
: 'none'
"
>
<p><b>Groceries is only provided once during the evacuation period.</b></p>
<p>Your household has already been provided support for Groceries</p>
</div>
Expand All @@ -95,11 +107,23 @@
} @else {
Restaurant Meals
}
@if (!hasSelfServiceFoodRestaurantSupport) {
@if (
!hasSelfServiceFoodRestaurantSupport &&
supportEligibilityStateSettings[SelfServeSupportType.FoodRestaurant] !==
SelfServeSupportEligibilityState.UnavailableOneTimeUsed
) {
<mat-error> Not available via self-serve </mat-error>
}
</mat-radio-button>
<div class="show-one-time-used-message">
<div
[style.color]="'red'"
[style.display]="
supportEligibilityStateSettings[SelfServeSupportType.FoodRestaurant] ===
SelfServeSupportEligibilityState.UnavailableOneTimeUsed
? 'block'
: 'none'
"
>
<p><b>Restaurant Meals is only provided once during the evacuation period.</b></p>
<p>Your household has already been provided support for Restaurant Meals</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export const billeting = {
};

export const shelterAllowanceRate = {
rate: 200
rate: 200,
rateOverMaxMembers: 400,
maxMembers: 5
};

export const noOfRooms = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
Expand Down Expand Up @@ -144,7 +146,7 @@ export const hotelRateSheet: DialogContent = {

export const needsShelterAllowanceRateSheet: DialogContent = {
title: '<b>ESS Rate Sheet - <span class="dialog-title">Shelter Allowance</span></b>',
text: '<p>To be issued when evacuees want to source their own shelter whilst evacuated.</p></br><p><span class="bold">$200 per night</span> per household</p>',
text: '<p>To be issued when evacuees want to source their own shelter whilst evacuated.</p></br><p><span class="bold">$200 per night</span> per household of 1 to 5 members</p><p><span class="bold">$400 per night</span> per household of 6 or more members</p>',
cancelButton: 'Close'
};

Expand Down Expand Up @@ -186,7 +188,7 @@ export const duplicateSupportMessage: DialogContent = {

export const needsShelterAllowanceMessage: DialogContent = {
title: 'Shelter',
text: '<p>A shelter allowance of $200 per night per household.</p></br><p>The shelter allowance can be provided to eligible evacuees via e-Transfer.</p>'
text: '<p>A shelter allowance of $200 per night per household of 1 to 5 members.</p><p>A shelter allowance of $400 per night per household of 6 or more members.</p></br><p>The shelter allowance can be provided to eligible evacuees via e-Transfer.</p>'
};

export const needsShelterReferralMessage: DialogContent = {
Expand Down Expand Up @@ -630,7 +632,7 @@ export const caseNotesCompleteText: DashboardBanner = {

export const shelterAllowanceNeedDialog: DialogContent = {
title: 'Shelter',
text: '<p>A shelter allowance of $200 per night per household.</p> <br/>The shelter allowance can be provided to eligible evacuees via e-Transfer.'
text: '<p>A shelter allowance of $200 per night per household of 1 to 5 members.</p><p>A shelter allowance of $400 per night per household of 6 or more members.</p> <br/>The shelter allowance can be provided to eligible evacuees via e-Transfer.'
};

export const shelterReferralNeedDialog: DialogContent = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,27 @@ export class ShelterAllowanceGroupComponent implements OnChanges, AfterViewInit
this.referralForm.get('noOfNights').patchValue(this.noOfDays);
this.updateTotalAmount();
}

if (changes.selectedHouseholdMembers) {
this.updateTotalAmount();
}
this.referralForm.get('noOfNights').valueChanges.subscribe(() => {
this.updateTotalAmount();
});
}
updateTotalAmount() {
this.nofNight = this.referralForm.get('noOfNights').value;
this.totalAmount = this.nofNight * globalConst.shelterAllowanceRate.rate;
this.members = this.supportDetailsForm.get('members').value;

this.totalAmount = 0;
if (
this.members != null &&
this.members.length > 0 &&
this.members.length <= globalConst.shelterAllowanceRate.maxMembers
) {
this.totalAmount = this.nofNight * globalConst.shelterAllowanceRate.rate;
} else if (this.members != null && this.members.length > globalConst.shelterAllowanceRate.maxMembers) {
this.totalAmount = this.nofNight * globalConst.shelterAllowanceRate.rateOverMaxMembers;
}

if (this.totalAmount < 0) this.totalAmount = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Splunk" Version="4.1.0" />
<PackageReference Include="SerilogTraceListener" Version="3.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.IO.Abstractions" Version="21.0.2" />
<PackageReference Include="Xrm.Tools.CRMWebAPI" Version="1.0.25" />
</ItemGroup>
Expand Down

0 comments on commit c0798dc

Please sign in to comment.