Skip to content

Commit

Permalink
[FE] relative url / confirmation updates (#1715)
Browse files Browse the repository at this point in the history
# Description

This PR includes the following proposed change(s):

- relative url issues
- show licence number on confirmation page
  • Loading branch information
carolcarpenter authored Nov 5, 2024
1 parent 3fd6edd commit 5b68a36
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 185 deletions.
18 changes: 10 additions & 8 deletions src/Spd.Manager.Licence/SecurityWorkerAppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,16 @@ private async Task<ChangeSpec> MakeChanges(
changes.CategoriesChanged = newFileInfos.Any(i => i.LicenceDocumentTypeCode.ToString().StartsWith("Category"));
}

//DogRestraintsChanged
if (newRequest.UseDogs != originalLic.UseDogs ||
newRequest.CarryAndUseRestraints != originalLic.CarryAndUseRestraints ||
newRequest.IsDogsPurposeProtection != originalLic.IsDogsPurposeProtection ||
newRequest.IsDogsPurposeDetectionDrugs != originalLic.IsDogsPurposeDetectionDrugs ||
newRequest.IsDogsPurposeDetectionExplosives != originalLic.IsDogsPurposeDetectionExplosives)
{
changes.DogRestraintsChanged = true;
//DogRestraintsChanged - this check only matters if the new and original requests both contain SecurityGuard, otherwise 'CategoriesChanged' will catch the change.
if (newRequest.CategoryCodes.Any(d => d == WorkerCategoryTypeCode.SecurityGuard) && originalLic.CategoryCodes.Any(d => d == WorkerCategoryTypeEnum.SecurityGuard)) {
if (newRequest.UseDogs != originalLic.UseDogs ||
newRequest.CarryAndUseRestraints != originalLic.CarryAndUseRestraints ||
newRequest.IsDogsPurposeProtection != originalLic.IsDogsPurposeProtection ||
newRequest.IsDogsPurposeDetectionDrugs != originalLic.IsDogsPurposeDetectionDrugs ||
newRequest.IsDogsPurposeDetectionExplosives != originalLic.IsDogsPurposeDetectionExplosives)
{
changes.DogRestraintsChanged = true;
}
}

//PeaceOfficerStatusChanged: check if Hold a Position with Peace Officer Status changed, create task with high priority, assign to Licensing CS team
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import { RequestBuilder } from '../../request-builder';
import { PermitAppCommandResponse } from '../../models/permit-app-command-response';
import { PermitAppSubmitRequest } from '../../models/permit-app-submit-request';

export interface ApiPermitApplicationsAnonymousSubmitPost$Params {
export interface ApiPermitApplicationsAnonymousSubmitChangePost$Params {

/**
* PermitAppAnonymousSubmitRequest data
*/
body?: PermitAppSubmitRequest
}

export function apiPermitApplicationsAnonymousSubmitPost(http: HttpClient, rootUrl: string, params?: ApiPermitApplicationsAnonymousSubmitPost$Params, context?: HttpContext): Observable<StrictHttpResponse<PermitAppCommandResponse>> {
const rb = new RequestBuilder(rootUrl, apiPermitApplicationsAnonymousSubmitPost.PATH, 'post');
export function apiPermitApplicationsAnonymousSubmitChangePost(http: HttpClient, rootUrl: string, params?: ApiPermitApplicationsAnonymousSubmitChangePost$Params, context?: HttpContext): Observable<StrictHttpResponse<PermitAppCommandResponse>> {
const rb = new RequestBuilder(rootUrl, apiPermitApplicationsAnonymousSubmitChangePost.PATH, 'post');
if (params) {
rb.body(params.body, 'application/*+json');
}
Expand All @@ -35,4 +35,4 @@ export function apiPermitApplicationsAnonymousSubmitPost(http: HttpClient, rootU
);
}

apiPermitApplicationsAnonymousSubmitPost.PATH = '/api/permit-applications/anonymous/submit';
apiPermitApplicationsAnonymousSubmitChangePost.PATH = '/api/permit-applications/anonymous/submit-change';
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import { RequestBuilder } from '../../request-builder';
import { PermitAppCommandResponse } from '../../models/permit-app-command-response';
import { PermitAppSubmitRequest } from '../../models/permit-app-submit-request';

export interface ApiPermitApplicationsAuthenticatedSubmitPost$Params {
export interface ApiPermitApplicationsChangePost$Params {

/**
* WorkerLicenceAppAnonymousSubmitRequestJson data
*/
body?: PermitAppSubmitRequest
}

export function apiPermitApplicationsAuthenticatedSubmitPost(http: HttpClient, rootUrl: string, params?: ApiPermitApplicationsAuthenticatedSubmitPost$Params, context?: HttpContext): Observable<StrictHttpResponse<PermitAppCommandResponse>> {
const rb = new RequestBuilder(rootUrl, apiPermitApplicationsAuthenticatedSubmitPost.PATH, 'post');
export function apiPermitApplicationsChangePost(http: HttpClient, rootUrl: string, params?: ApiPermitApplicationsChangePost$Params, context?: HttpContext): Observable<StrictHttpResponse<PermitAppCommandResponse>> {
const rb = new RequestBuilder(rootUrl, apiPermitApplicationsChangePost.PATH, 'post');
if (params) {
rb.body(params.body, 'application/*+json');
}
Expand All @@ -35,4 +35,4 @@ export function apiPermitApplicationsAuthenticatedSubmitPost(http: HttpClient, r
);
}

apiPermitApplicationsAuthenticatedSubmitPost.PATH = '/api/permit-applications/authenticated/submit';
apiPermitApplicationsChangePost.PATH = '/api/permit-applications/change';
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import { apiApplicantsApplicantIdPermitLatestGet } from '../fn/permit/api-applic
import { ApiApplicantsApplicantIdPermitLatestGet$Params } from '../fn/permit/api-applicants-applicant-id-permit-latest-get';
import { apiPermitApplicationGet } from '../fn/permit/api-permit-application-get';
import { ApiPermitApplicationGet$Params } from '../fn/permit/api-permit-application-get';
import { apiPermitApplicationsAnonymousSubmitPost } from '../fn/permit/api-permit-applications-anonymous-submit-post';
import { ApiPermitApplicationsAnonymousSubmitPost$Params } from '../fn/permit/api-permit-applications-anonymous-submit-post';
import { apiPermitApplicationsAuthenticatedSubmitPost } from '../fn/permit/api-permit-applications-authenticated-submit-post';
import { ApiPermitApplicationsAuthenticatedSubmitPost$Params } from '../fn/permit/api-permit-applications-authenticated-submit-post';
import { apiPermitApplicationsAnonymousSubmitChangePost } from '../fn/permit/api-permit-applications-anonymous-submit-change-post';
import { ApiPermitApplicationsAnonymousSubmitChangePost$Params } from '../fn/permit/api-permit-applications-anonymous-submit-change-post';
import { apiPermitApplicationsChangePost } from '../fn/permit/api-permit-applications-change-post';
import { ApiPermitApplicationsChangePost$Params } from '../fn/permit/api-permit-applications-change-post';
import { apiPermitApplicationsLicenceAppIdGet } from '../fn/permit/api-permit-applications-licence-app-id-get';
import { ApiPermitApplicationsLicenceAppIdGet$Params } from '../fn/permit/api-permit-applications-licence-app-id-get';
import { apiPermitApplicationsPost } from '../fn/permit/api-permit-applications-post';
Expand All @@ -38,7 +38,7 @@ export class PermitService extends BaseService {
static readonly ApiPermitApplicationsPostPath = '/api/permit-applications';

/**
* Create Permit Application.
* Create/partial save permit application.
*
*
*
Expand All @@ -52,7 +52,7 @@ export class PermitService extends BaseService {
}

/**
* Create Permit Application.
* Create/partial save permit application.
*
*
*
Expand Down Expand Up @@ -139,7 +139,7 @@ export class PermitService extends BaseService {
static readonly ApiPermitApplicationsSubmitPostPath = '/api/permit-applications/submit';

/**
* Submit Permit Application.
* Submit new permit Application authenticated with bcsc.
*
*
*
Expand All @@ -153,7 +153,7 @@ export class PermitService extends BaseService {
}

/**
* Submit Permit Application.
* Submit new permit Application authenticated with bcsc.
*
*
*
Expand All @@ -168,8 +168,8 @@ export class PermitService extends BaseService {
);
}

/** Path part for operation `apiPermitApplicationsAuthenticatedSubmitPost()` */
static readonly ApiPermitApplicationsAuthenticatedSubmitPostPath = '/api/permit-applications/authenticated/submit';
/** Path part for operation `apiPermitApplicationsChangePost()` */
static readonly ApiPermitApplicationsChangePostPath = '/api/permit-applications/change';

/**
* Submit Permit Application Json part for authenticated users, supports only: renewal, update and replace
Expand All @@ -178,12 +178,12 @@ export class PermitService extends BaseService {
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `apiPermitApplicationsAuthenticatedSubmitPost()` instead.
* To access only the response body, use `apiPermitApplicationsChangePost()` instead.
*
* This method sends `application/*+json` and handles request body of type `application/*+json`.
*/
apiPermitApplicationsAuthenticatedSubmitPost$Response(params?: ApiPermitApplicationsAuthenticatedSubmitPost$Params, context?: HttpContext): Observable<StrictHttpResponse<PermitAppCommandResponse>> {
return apiPermitApplicationsAuthenticatedSubmitPost(this.http, this.rootUrl, params, context);
apiPermitApplicationsChangePost$Response(params?: ApiPermitApplicationsChangePost$Params, context?: HttpContext): Observable<StrictHttpResponse<PermitAppCommandResponse>> {
return apiPermitApplicationsChangePost(this.http, this.rootUrl, params, context);
}

/**
Expand All @@ -193,12 +193,12 @@ export class PermitService extends BaseService {
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `apiPermitApplicationsAuthenticatedSubmitPost$Response()` instead.
* To access the full response (for headers, for example), `apiPermitApplicationsChangePost$Response()` instead.
*
* This method sends `application/*+json` and handles request body of type `application/*+json`.
*/
apiPermitApplicationsAuthenticatedSubmitPost(params?: ApiPermitApplicationsAuthenticatedSubmitPost$Params, context?: HttpContext): Observable<PermitAppCommandResponse> {
return this.apiPermitApplicationsAuthenticatedSubmitPost$Response(params, context).pipe(
apiPermitApplicationsChangePost(params?: ApiPermitApplicationsChangePost$Params, context?: HttpContext): Observable<PermitAppCommandResponse> {
return this.apiPermitApplicationsChangePost$Response(params, context).pipe(
map((r: StrictHttpResponse<PermitAppCommandResponse>): PermitAppCommandResponse => r.body)
);
}
Expand Down Expand Up @@ -236,8 +236,8 @@ export class PermitService extends BaseService {
);
}

/** Path part for operation `apiPermitApplicationsAnonymousSubmitPost()` */
static readonly ApiPermitApplicationsAnonymousSubmitPostPath = '/api/permit-applications/anonymous/submit';
/** Path part for operation `apiPermitApplicationsAnonymousSubmitChangePost()` */
static readonly ApiPermitApplicationsAnonymousSubmitChangePostPath = '/api/permit-applications/anonymous/submit-change';

/**
* Submit Body Armour or Armour Vehicle permit application Anonymously
Expand All @@ -247,12 +247,12 @@ export class PermitService extends BaseService {
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `apiPermitApplicationsAnonymousSubmitPost()` instead.
* To access only the response body, use `apiPermitApplicationsAnonymousSubmitChangePost()` instead.
*
* This method sends `application/*+json` and handles request body of type `application/*+json`.
*/
apiPermitApplicationsAnonymousSubmitPost$Response(params?: ApiPermitApplicationsAnonymousSubmitPost$Params, context?: HttpContext): Observable<StrictHttpResponse<PermitAppCommandResponse>> {
return apiPermitApplicationsAnonymousSubmitPost(this.http, this.rootUrl, params, context);
apiPermitApplicationsAnonymousSubmitChangePost$Response(params?: ApiPermitApplicationsAnonymousSubmitChangePost$Params, context?: HttpContext): Observable<StrictHttpResponse<PermitAppCommandResponse>> {
return apiPermitApplicationsAnonymousSubmitChangePost(this.http, this.rootUrl, params, context);
}

/**
Expand All @@ -263,12 +263,12 @@ export class PermitService extends BaseService {
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `apiPermitApplicationsAnonymousSubmitPost$Response()` instead.
* To access the full response (for headers, for example), `apiPermitApplicationsAnonymousSubmitChangePost$Response()` instead.
*
* This method sends `application/*+json` and handles request body of type `application/*+json`.
*/
apiPermitApplicationsAnonymousSubmitPost(params?: ApiPermitApplicationsAnonymousSubmitPost$Params, context?: HttpContext): Observable<PermitAppCommandResponse> {
return this.apiPermitApplicationsAnonymousSubmitPost$Response(params, context).pipe(
apiPermitApplicationsAnonymousSubmitChangePost(params?: ApiPermitApplicationsAnonymousSubmitChangePost$Params, context?: HttpContext): Observable<PermitAppCommandResponse> {
return this.apiPermitApplicationsAnonymousSubmitChangePost$Response(params, context).pipe(
map((r: StrictHttpResponse<PermitAppCommandResponse>): PermitAppCommandResponse => r.body)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,14 @@ export abstract class PermitApplicationHelper extends CommonApplicationHelper {

const documentInfos: Array<Document> = [];

let employerData = {};
let employerPrimaryAddress = {};
let employerData = {
employerName: null,
supervisorName: null,
supervisorEmailAddress: null,
supervisorPhoneNumber: null,
};

let employerPrimaryAddress = null;

// default the flags
mailingAddressData.isAddressTheSame = !!mailingAddressData.isAddressTheSame; // make it a boolean
Expand All @@ -472,7 +478,6 @@ export abstract class PermitApplicationHelper extends CommonApplicationHelper {
});
});
}
delete personalInformationData.attachments; // cleanup so that it is not included in the payload

permitRationaleData.attachments?.forEach((doc: any) => {
const licenceDocumentTypeCode =
Expand Down Expand Up @@ -704,7 +709,7 @@ export abstract class PermitApplicationHelper extends CommonApplicationHelper {
rationale: permitRationaleData.rationale,
//-----------------------------------
...employerData,
employerPrimaryAddress: includesMyEmployement ? employerPrimaryAddress : null,
employerPrimaryAddress,
//-----------------------------------
armouredVehiclePermitReasonCodes,
bodyArmourPermitReasonCodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export class PermitApplicationService extends PermitApplicationHelper {
// application and are still being used
body.previousDocumentIds = [...existingDocumentIds];

return this.permitService.apiPermitApplicationsAuthenticatedSubmitPost$Response({
return this.permitService.apiPermitApplicationsChangePost$Response({
body,
});
})
Expand All @@ -605,7 +605,7 @@ export class PermitApplicationService extends PermitApplicationHelper {
// application and are still being used
body.previousDocumentIds = [...existingDocumentIds];

return this.permitService.apiPermitApplicationsAuthenticatedSubmitPost$Response({
return this.permitService.apiPermitApplicationsChangePost$Response({
body,
});
}
Expand Down Expand Up @@ -893,7 +893,7 @@ export class PermitApplicationService extends PermitApplicationHelper {
// application and are still being used
body.previousDocumentIds = [...existingDocumentIds];

return this.permitService.apiPermitApplicationsAnonymousSubmitPost$Response({
return this.permitService.apiPermitApplicationsAnonymousSubmitChangePost$Response({
body,
});
})
Expand Down Expand Up @@ -949,7 +949,7 @@ export class PermitApplicationService extends PermitApplicationHelper {
// application and are still being used
body.previousDocumentIds = [...existingDocumentIds];

return this.permitService.apiPermitApplicationsAnonymousSubmitPost$Response({
return this.permitService.apiPermitApplicationsAnonymousSubmitChangePost$Response({
body,
});
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ApplicantProfileResponse,
ApplicantUpdateRequest,
ApplicationTypeCode,
BizTypeCode,
Document,
GoogleRecaptcha,
HeightUnitCode,
Expand Down Expand Up @@ -152,6 +153,25 @@ export class WorkerApplicationService extends WorkerApplicationHelper {
this.workerModelFormGroup.getRawValue()
);

const isSoleProprietorYesNo = this.workerModelFormGroup.get('soleProprietorData.isSoleProprietor')?.value;
if (isSoleProprietorYesNo) {
const isSoleProprietor = this.utilService.booleanTypeToBoolean(isSoleProprietorYesNo);
if (!isSoleProprietor) {
// if the sole proprietor flag is 'No', then set the bizTypeCode. This is not user selected.
const soleProprietorData = {
isSoleProprietor: isSoleProprietorYesNo,
bizTypeCode: BizTypeCode.None,
};

this.workerModelFormGroup.patchValue(
{
soleProprietorData,
},
{ emitEvent: false }
);
}
}

this.updateModelChangeFlags();

this.workerModelValueChanges$.next(isValid);
Expand Down Expand Up @@ -343,17 +363,27 @@ export class WorkerApplicationService extends WorkerApplicationHelper {
this.photographOfYourselfFormGroup.valid
);
} else {
const applicationTypeCode = this.applicationTypeFormGroup.get('applicationTypeCode')?.value;
const hasGenderChanged = !!this.personalInformationFormGroup.get('hasGenderChanged')?.value;

let photographOfYourselfFormGroupValid = this.photographOfYourselfFormGroup.valid;

// If anonymous update flown and gender has not changed, then it is valid
if (applicationTypeCode === ApplicationTypeCode.Update && !hasGenderChanged) {
photographOfYourselfFormGroupValid = true;
}

// console.debug(
// 'isStepIdentificationComplete',
// this.personalInformationFormGroup.valid,
// this.aliasesFormGroup.valid,
// this.citizenshipFormGroup.valid,
// this.bcDriversLicenceFormGroup.valid,
// this.characteristicsFormGroup.valid,
// this.photographOfYourselfFormGroup.valid,
// photographOfYourselfFormGroupValid,
// this.residentialAddressFormGroup.valid,
// this.mailingAddressFormGroup.valid,
// this.contactInformationFormGroup.valid,
// this.contactInformationFormGroup.valid
// );

return (
Expand All @@ -362,7 +392,7 @@ export class WorkerApplicationService extends WorkerApplicationHelper {
this.citizenshipFormGroup.valid &&
this.bcDriversLicenceFormGroup.valid &&
this.characteristicsFormGroup.valid &&
this.photographOfYourselfFormGroup.valid &&
photographOfYourselfFormGroupValid &&
this.residentialAddressFormGroup.valid &&
this.mailingAddressFormGroup.valid &&
this.contactInformationFormGroup.valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { BusinessLicencePaymentCancelComponent } from './components/business-lic
import { BusinessLicencePaymentErrorComponent } from './components/business-licence-payment-error.component';
import { BusinessLicencePaymentFailComponent } from './components/business-licence-payment-fail.component';
import { BusinessLicencePaymentSuccessComponent } from './components/business-licence-payment-success.component';
import { BusinessLicenceUpdateReceivedSuccessComponent } from './components/business-licence-update-received-success.component';
import { BusinessLicenceWizardNewSwlSoleProprietorComponent } from './components/business-licence-wizard-new-swl-sole-proprietor.component';
import { BusinessLicenceWizardNewComponent } from './components/business-licence-wizard-new.component';
import { BusinessLicenceWizardRenewalSwlSoleProprietorComponent } from './components/business-licence-wizard-renewal-swl-sole-proprietor.component';
Expand Down Expand Up @@ -88,10 +87,6 @@ const routes: Routes = [
component: BusinessLicencePaymentCancelComponent,
},
{ path: BusinessLicenceApplicationRoutes.PAYMENT_ERROR, component: BusinessLicencePaymentErrorComponent },
{
path: BusinessLicenceApplicationRoutes.BUSINESS_UPDATE_SUCCESS,
component: BusinessLicenceUpdateReceivedSuccessComponent,
},
],
},
{
Expand Down
Loading

0 comments on commit 5b68a36

Please sign in to comment.