Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
james-hollinger committed Apr 1, 2024
2 parents 99ee87b + eced918 commit 614261a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
17 changes: 14 additions & 3 deletions backend/services.plr-intake/Models/PlrRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,19 @@ public class PlrRecord : BaseAuditable

public static bool ComputeGoodStanding(string? statusCode, string? statusReasonCode)
{
var goodStandingReasons = new[] { "GS", "PRAC", "TEMPPER", "TI" };
return statusCode == "ACTIVE"
&& goodStandingReasons.Contains(statusReasonCode);
// A Licence is in good standing if the Status is "ACTIVE" and the StatusReason is one of a few allowable values.
// Additionally, "TI" (Temporary Inactive) and "VW" (Voluntary Withdrawn) are "SUSPENDED" in PLR rather than "ACTIVE", but are still considered to be in good standing.
var goodStandingReasons = new[] { "GS", "PRAC", "TEMPPER", "TI", "VW" };
var suspendedAllowed = new[] { "TI", "VW" };

if (statusCode == "ACTIVE")
{
return goodStandingReasons.Contains(statusReasonCode);
}
else if (statusCode == "SUSPENDED")
{
return suspendedAllowed.Contains(statusReasonCode);
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,20 @@ public class PlrRecord

public virtual bool IsGoodStanding()
{
var goodStatndingReasons = new[] { "GS", "PRAC", "TEMPPER", "TI" };
return this.StatusCode == "ACTIVE"
&& goodStatndingReasons.Contains(this.StatusReasonCode);
// A Licence is in good standing if the Status is "ACTIVE" and the StatusReason is one of a few allowable values.
// Additionally, "TI" (Temporary Inactive) and "VW" (Voluntary Withdrawn) are "SUSPENDED" in PLR rather than "ACTIVE", but are still considered to be in good standing.
var goodStandingReasons = new[] { "GS", "PRAC", "TEMPPER", "TI", "VW" };
var suspendedAllowed = new[] { "TI", "VW" };

if (this.StatusCode == "ACTIVE")
{
return goodStandingReasons.Contains(this.StatusReasonCode);
}
else if (this.StatusCode == "SUSPENDED")
{
return suspendedAllowed.Contains(this.StatusReasonCode);
}
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ export class EndorsementsResource {
)
.pipe(
NoContentResponse,
tap(() =>
this.toastService.openSuccessToast(
'Endorsement Request has been approved successfully',
),
),
catchError((error: HttpErrorResponse) => {
if (error.status === HttpStatusCode.BadRequest) {
return of(void 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
map,
of,
switchMap,
tap,
} from 'rxjs';

import { FaIconComponent } from '@fortawesome/angular-fontawesome';
Expand All @@ -30,7 +31,11 @@ import {
faUser,
faUserGroup,
} from '@fortawesome/free-solid-svg-icons';
import { NavigationService } from '@pidp/presentation';
import {
LOADING_OVERLAY_DEFAULT_MESSAGE,
LoadingOverlayService,
NavigationService,
} from '@pidp/presentation';

import { NoContent } from '@bcgov/shared/data-access';
import {
Expand Down Expand Up @@ -115,6 +120,7 @@ export class EndorsementsPage
viewportService: ViewportService,
private utilsService: UtilsService,
fb: FormBuilder,
private loadingOverlayService: LoadingOverlayService,
) {
super(dependenciesService);

Expand Down Expand Up @@ -149,6 +155,7 @@ export class EndorsementsPage
}

public onApprove(requestId: number): void {
this.loadingOverlayService.open(LOADING_OVERLAY_DEFAULT_MESSAGE);
this.resource
.approveEndorsementRequest(this.partyService.partyId, requestId)
.pipe(
Expand Down Expand Up @@ -279,6 +286,7 @@ export class EndorsementsPage
): Observable<EndorsementRequest[]> {
return this.resource.getEndorsementRequests(partyId).pipe(
map((response: EndorsementRequest[] | null) => response ?? []),
tap((_) => this.loadingOverlayService.close()),
map((response: EndorsementRequest[]) =>
response.filter((res) => res.actionable === true),
),
Expand Down

0 comments on commit 614261a

Please sign in to comment.