Skip to content

Commit

Permalink
Merge branch 'release/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
peggy-quartech committed Oct 21, 2024
2 parents 366ea56 + f4007b0 commit 219ec6d
Show file tree
Hide file tree
Showing 17 changed files with 57,276 additions and 53,910 deletions.
3 changes: 2 additions & 1 deletion src/Spd.Manager.Screening/ApplicationContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ public enum ApplicationPortalStatisticsCode
CancelledByApplicant,
CancelledByOrganization,
ClearedLastSevenDays,
NotClearedLastSevenDays
NotClearedLastSevenDays,
Completed
}

public enum ApplicationOriginTypeCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface AnonymousOrgRegistrationCreateRequest {
mailingPostalCode?: string | null;
mailingProvince?: string | null;
operatingBudgetFlag?: FundsFromBcGovtExceedsThresholdCode;
organizationLegalName?: string | null;
organizationName?: string | null;
payerPreference?: PayerPreferenceTypeCode;
portalUserIdentityTypeCode?: IdentityProviderTypeCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export interface ApplicationStatisticsResponse {
'CancelledByOrganization'?: number;
'ClearedLastSevenDays'?: number;
'NotClearedLastSevenDays'?: number;
'Completed'?: number;
}) | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface OrgRegistrationCreateRequest {
mailingPostalCode?: string | null;
mailingProvince?: string | null;
operatingBudgetFlag?: FundsFromBcGovtExceedsThresholdCode;
organizationLegalName?: string | null;
organizationName?: string | null;
payerPreference?: PayerPreferenceTypeCode;
portalUserIdentityTypeCode?: IdentityProviderTypeCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export enum ApplicationPortalStatisticsTypeCode {
CancelledByOrganization = 'CancelledByOrganization',
ClearedLastSevenDays = 'ClearedLastSevenDays',
NotClearedLastSevenDays = 'NotClearedLastSevenDays',
Completed = 'Completed',
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export {
ApplicationPortalStatisticsTypes,
ApplicationPortalStatusTypes,
CaseSubStatuses,
ContactAuthorizationTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
PayerPreferenceTypeCode,
ServiceTypeCode,
} from 'src/app/api/models';
import { ScreeningTypeCode } from './code-types.models';
import { ApplicationPortalStatisticsTypeCode, ScreeningTypeCode } from './code-types.models';
import { CountryTypeCode } from './country-type.model';

export interface SelectOptions<k = string | number | boolean> {
Expand Down Expand Up @@ -113,69 +113,95 @@ export const ContactAuthorizationTypes: SelectOptions[] = [

export const ApplicationPortalStatusTypes: SelectOptions[] = [
{ desc: 'Draft', code: ApplicationPortalStatusCode.Draft },
{ desc: 'Verify Identity', code: ApplicationPortalStatusCode.VerifyIdentity },
{ desc: 'In Progress', code: ApplicationPortalStatusCode.InProgress },
{ desc: 'Payment Pending', code: ApplicationPortalStatusCode.AwaitingPayment },
{ desc: 'Awaiting Third Party', code: ApplicationPortalStatusCode.AwaitingThirdParty },
{ desc: 'Awaiting Applicant', code: ApplicationPortalStatusCode.AwaitingApplicant },
{ desc: 'Under Assessment', code: ApplicationPortalStatusCode.UnderAssessment },
{ desc: 'Incomplete', code: ApplicationPortalStatusCode.Incomplete },
{ desc: 'Completed', code: ApplicationPortalStatusCode.Completed },
{ desc: 'Completed - Cleared', code: ApplicationPortalStatusCode.CompletedCleared },
{ desc: 'Completed - Risk Found', code: ApplicationPortalStatusCode.RiskFound },
{ desc: 'Closed - No Response', code: ApplicationPortalStatusCode.ClosedNoResponse },
{ desc: 'Closed - No Consent', code: ApplicationPortalStatusCode.ClosedNoConsent },
{ desc: 'Cancelled by Organization', code: ApplicationPortalStatusCode.CancelledByOrganization },
{ desc: 'Cancelled by Applicant', code: ApplicationPortalStatusCode.CancelledByApplicant },
{ desc: 'Refund Requested', code: ApplicationPortalStatusCode.RefundRequested },
];

export const ApplicationPortalStatisticsTypes: SelectOptions[] = [
{ desc: 'Draft', code: ApplicationPortalStatisticsTypeCode.Draft },
{
desc: 'Verify Identity',
code: ApplicationPortalStatusCode.VerifyIdentity,
code: ApplicationPortalStatisticsTypeCode.VerifyIdentity,
extra: `The applicant has submitted their CRC application, and the organization must confirm they have checked the applicant's government-issued photo ID`,
},
{
desc: 'In Progress',
code: ApplicationPortalStatusCode.InProgress,
code: ApplicationPortalStatisticsTypeCode.InProgress,
extra: 'The application is currently undergoing the screening process',
},
{
desc: 'Payment Pending',
code: ApplicationPortalStatusCode.AwaitingPayment,
code: ApplicationPortalStatisticsTypeCode.AwaitingPayment,
extra: 'The organization or the applicant must pay the application fee',
},
{
desc: 'Awaiting Third Party',
code: ApplicationPortalStatusCode.AwaitingThirdParty,
code: ApplicationPortalStatisticsTypeCode.AwaitingThirdParty,
extra: 'Waiting for information from an external party',
},
{
desc: 'Awaiting Applicant',
code: ApplicationPortalStatusCode.AwaitingApplicant,
code: ApplicationPortalStatisticsTypeCode.AwaitingApplicant,
extra: 'Waiting for the applicant to provide additional information',
},
{
desc: 'Under Assessment',
code: ApplicationPortalStatusCode.UnderAssessment,
code: ApplicationPortalStatisticsTypeCode.UnderAssessment,
extra: 'The application is in risk assessment',
},
{ desc: 'Incomplete', code: ApplicationPortalStatusCode.Incomplete, extra: 'Incomplete application received' },
{ desc: 'Completed', code: ApplicationPortalStatusCode.Completed },
{
desc: 'Incomplete',
code: ApplicationPortalStatisticsTypeCode.Incomplete,
extra: 'Incomplete application received',
},
{
desc: 'Completed',
code: ApplicationPortalStatisticsTypeCode.Completed,
extra: 'Criminal record check completed',
},
{
desc: 'Completed - Cleared',
code: ApplicationPortalStatusCode.CompletedCleared,
code: ApplicationPortalStatisticsTypeCode.CompletedCleared,
extra: 'Criminal record check completed - no risk',
},
{
desc: 'Completed - Risk Found',
code: ApplicationPortalStatusCode.RiskFound,
code: ApplicationPortalStatisticsTypeCode.RiskFound,
extra: 'The applicant is not cleared due to risk found',
},
{
desc: 'Closed - No Response',
code: ApplicationPortalStatusCode.ClosedNoResponse,
code: ApplicationPortalStatisticsTypeCode.ClosedNoResponse,
extra: 'No response from applicant',
},
{
desc: 'Closed - No Consent',
code: ApplicationPortalStatusCode.ClosedNoConsent,
code: ApplicationPortalStatisticsTypeCode.ClosedNoConsent,
extra: 'The applicant did not consent to the CRC',
},
{
desc: 'Cancelled by Organization',
code: ApplicationPortalStatusCode.CancelledByOrganization,
code: ApplicationPortalStatisticsTypeCode.CancelledByOrganization,
extra: 'Organization cancelled the application',
},
{
desc: 'Cancelled by Applicant',
code: ApplicationPortalStatusCode.CancelledByApplicant,
code: ApplicationPortalStatisticsTypeCode.CancelledByApplicant,
extra: 'The applicant cancelled their application',
},
{ desc: 'Refund Requested', code: ApplicationPortalStatusCode.RefundRequested },
];

export const CountryTypes: SelectOptions[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import * as moment from 'moment';
import { ApplicationPortalStatusCode, PaginationResponse, ScreeningTypeCode } from 'src/app/api/models';
import * as CodeDescTypes from 'src/app/core/code-types/code-desc-types.models';
import { CaptchaResponse, CaptchaResponseType } from 'src/app/shared/components/captcha-v2.component';
import { ApplicationPortalStatusTypes, ScreeningTypes, SelectOptions } from '../code-types/model-desc.models';
import {
ApplicationPortalStatisticsTypes,
ApplicationPortalStatusTypes,
ScreeningTypes,
SelectOptions,
} from '../code-types/model-desc.models';
import { SPD_CONSTANTS } from '../constants/constants';

@Injectable({ providedIn: 'root' })
Expand Down Expand Up @@ -182,8 +187,12 @@ export class UtilService {
return (ApplicationPortalStatusTypes.find((item: SelectOptions) => item.code == code)?.desc as string) ?? '';
}

getApplicationPortalStatusHint(code: string): string {
return (ApplicationPortalStatusTypes.find((item: SelectOptions) => item.code == code)?.extra as string) ?? '';
getApplicationPortalStatisticsDesc(code: string): string {
return (ApplicationPortalStatisticsTypes.find((item: SelectOptions) => item.code == code)?.desc as string) ?? '';
}

getApplicationPortalStatisticsHint(code: string): string {
return (ApplicationPortalStatisticsTypes.find((item: SelectOptions) => item.code == code)?.extra as string) ?? '';
}

getDateString(date: Date): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export class ScreeningStatusFilterCommonComponent extends BaseFilterComponent im
} else {
this.applicationPortalStatusCodes = statuses.filter(
(item: SelectOptions) =>
item.code != ApplicationPortalStatusCode.AwaitingThirdParty &&
item.code != ApplicationPortalStatusCode.UnderAssessment &&
item.code != ApplicationPortalStatusCode.CompletedCleared &&
item.code != ApplicationPortalStatusCode.RiskFound
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,7 @@ export class ScreeningStatusesCommonComponent implements OnInit {
this.defaultStatuses = [
ApplicationPortalStatusCode.AwaitingApplicant,
ApplicationPortalStatusCode.AwaitingPayment,
ApplicationPortalStatusCode.AwaitingThirdParty,
ApplicationPortalStatusCode.InProgress,
ApplicationPortalStatusCode.UnderAssessment,
ApplicationPortalStatusCode.VerifyIdentity,
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ import { UtilService } from 'src/app/core/services/util.service';
<mat-icon>info_outline</mat-icon>
</div>
</div>
<div class="d-flex flex-row statistic-card area-yellow align-items-center justify-content-between mt-2 me-2">
<div
class="d-flex flex-row statistic-card area-yellow align-items-center justify-content-between mt-2 me-2"
*ngIf="isCrrp"
>
<div class="fs-4 m-2 ms-3">
{{ applicationStatistics[statisticsCodes.AwaitingThirdParty] ?? 0 }}
</div>
Expand All @@ -58,7 +61,10 @@ import { UtilService } from 'src/app/core/services/util.service';
<mat-icon>info_outline</mat-icon>
</div>
</div>
<div class="d-flex flex-row statistic-card area-blue align-items-center justify-content-between mt-2 me-2">
<div
class="d-flex flex-row statistic-card area-blue align-items-center justify-content-between mt-2 me-2"
*ngIf="isCrrp"
>
<div class="fs-4 m-2 ms-3">
{{ applicationStatistics[statisticsCodes.UnderAssessment] ?? 0 }}
</div>
Expand All @@ -67,6 +73,18 @@ import { UtilService } from 'src/app/core/services/util.service';
<mat-icon>info_outline</mat-icon>
</div>
</div>
<div
class="d-flex flex-row statistic-card area-blue align-items-center justify-content-between mt-2 me-2"
*ngIf="!isCrrp"
>
<div class="fs-4 m-2 ms-3">
{{ applicationStatistics[statisticsCodes.Incomplete] ?? 0 }}
</div>
<div class="fs-6 m-2">{{ getStatusDesc(statisticsCodes.Incomplete) }}</div>
<div class="m-2" [matTooltip]="getStatusHint(statisticsCodes.Incomplete)">
<mat-icon>info_outline</mat-icon>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -112,6 +130,30 @@ import { UtilService } from 'src/app/core/services/util.service';
<mat-icon>info_outline</mat-icon>
</div>
</div>
<div
class="d-flex flex-row statistic-card area-grey align-items-center justify-content-between mt-2 me-2"
*ngIf="!isCrrp"
>
<div class="fs-4 m-2 ms-3">
{{ applicationStatistics[statisticsCodes.CancelledByOrganization] ?? 0 }}
</div>
<div class="fs-6 m-2">{{ getStatusDesc(statisticsCodes.CancelledByOrganization) }}</div>
<div class="m-2" [matTooltip]="getStatusHint(statisticsCodes.CancelledByOrganization)">
<mat-icon>info_outline</mat-icon>
</div>
</div>
<div
class="d-flex flex-row statistic-card area-grey align-items-center justify-content-between mt-2 me-2"
*ngIf="!isCrrp"
>
<div class="fs-4 m-2 ms-3">
{{ applicationStatistics[statisticsCodes.Completed] ?? 0 }}
</div>
<div class="fs-6 m-2">{{ getStatusDesc(statisticsCodes.Completed) }}</div>
<div class="m-2" [matTooltip]="getStatusHint(statisticsCodes.Completed)">
<mat-icon>info_outline</mat-icon>
</div>
</div>
</div>
</div>
</ng-container>
Expand Down Expand Up @@ -181,10 +223,10 @@ export class StatusStatisticsCommonComponent implements OnInit {
}

getStatusDesc(code: string): string {
return this.utilService.getApplicationPortalStatusDesc(code);
return this.utilService.getApplicationPortalStatisticsDesc(code);
}

getStatusHint(code: string): string {
return this.utilService.getApplicationPortalStatusHint(code);
return this.utilService.getApplicationPortalStatisticsHint(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public async Task<ApplicationStatisticsResp> QueryApplicationStatisticsAsync(App
if (pssoUserStatistics.RiskFound.HasValue) statisticsDictionary.Add(ApplicationPortalStatisticsCd.RiskFound, pssoUserStatistics.RiskFound.Value);
if (pssoUserStatistics.UnderAssessment.HasValue) statisticsDictionary.Add(ApplicationPortalStatisticsCd.UnderAssessment, pssoUserStatistics.UnderAssessment.Value);
if (pssoUserStatistics.VerifyIdentity.HasValue) statisticsDictionary.Add(ApplicationPortalStatisticsCd.VerifyIdentity, pssoUserStatistics.VerifyIdentity.Value);
if (pssoUserStatistics.Completed.HasValue) statisticsDictionary.Add(ApplicationPortalStatisticsCd.Completed, pssoUserStatistics.Completed.Value);
return new ApplicationStatisticsResp { Statistics = statisticsDictionary };
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,5 +364,6 @@ public enum ApplicationPortalStatisticsCd
CancelledByApplicant,
CancelledByOrganization,
ClearedLastSevenDays,
NotClearedLastSevenDays
NotClearedLastSevenDays,
Completed
}
5 changes: 3 additions & 2 deletions src/Spd.Resource.Repository/User/OrgUserRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private async Task<OrgUserManageResult> VerifyOrgUserInvitationAsync(UserInvitat
.FirstOrDefaultAsync(ct);
if (invite == null)
throw new ApiException(HttpStatusCode.Accepted, "The invitation link is no longer valid.");
if (invite.spd_OrganizationId.spd_orgguid != verify.OrgGuid.ToString())
if (!string.Equals(invite.spd_OrganizationId.spd_orgguid, verify.OrgGuid.ToString(), StringComparison.InvariantCultureIgnoreCase))
throw new ApiException(HttpStatusCode.Accepted, "There is a mismatch between the invite organization and your bceid organization.");

//verified, now add/link identity to user.
Expand Down Expand Up @@ -227,7 +227,8 @@ private async Task<OrgUserManageResult> DeleteUserAsync(Guid userId, Cancellatio
else
{
var invition = GetPortalInvitationByUserId(userId);
_dynaContext.DeleteObject(invition);
if (invition != null)
_dynaContext.DeleteObject(invition);

// Delete user and invitation
_dynaContext.DeleteObject(user);
Expand Down
Loading

0 comments on commit 219ec6d

Please sign in to comment.