Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ import { MainLicenceResponse } from '@app/core/services/common-application.servi
(keydown)="onKeydownRequestReplacement($event, licence)"
>Request a replacement</a
>

<div class="mt-4" *ngIf="licence.originalPhotoOfYourselfExpired">
<app-alert type="danger" icon="dangerous">
A replacement for this record is not available at this time.
</app-alert>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,6 @@ export class GdsdLicenceMainComponent implements OnInit {
.getLicenceWithSelectionAuthenticated(ApplicationTypeCode.Replacement, licence)
.pipe(
tap((_resp: any) => {
const originalPhotoOfYourselfExpired = !!this.gdsdTeamApplicationService.gdsdTeamModelFormGroup.get(
'originalLicenceData.originalPhotoOfYourselfExpired'
)?.value;

licence.originalPhotoOfYourselfExpired = originalPhotoOfYourselfExpired;

// User cannot continue with this flow if the photograph of yourself is missing
if (originalPhotoOfYourselfExpired) {
this.gdsdTeamApplicationService.reset();
return;
}

this.router.navigateByUrl(AppRoutes.pathGdsdAuthenticated(AppRoutes.GDSD_TEAM_REPLACEMENT_AUTHENTICATED));
}),
take(1)
Expand All @@ -255,18 +243,6 @@ export class GdsdLicenceMainComponent implements OnInit {
.getLicenceWithSelectionAuthenticated(ApplicationTypeCode.Replacement, licence)
.pipe(
tap((_resp: any) => {
const originalPhotoOfYourselfExpired = !!this.retiredDogApplicationService.retiredDogModelFormGroup.get(
'originalLicenceData.originalPhotoOfYourselfExpired'
)?.value;

licence.originalPhotoOfYourselfExpired = originalPhotoOfYourselfExpired;

// User cannot continue with this flow if the photograph of yourself is missing
if (originalPhotoOfYourselfExpired) {
this.retiredDogApplicationService.reset();
return;
}

this.router.navigateByUrl(
AppRoutes.pathGdsdAuthenticated(AppRoutes.RETIRED_DOG_REPLACEMENT_AUTHENTICATED)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class DogTrainerWizardNewRenewalComponent extends BaseWizardComponent imp
}

onSubmit(): void {
this.dogTrainerApplicationService.submitLicenceNewOrRenewalAnonymous().subscribe({
this.dogTrainerApplicationService.submitLicenceAnonymous().subscribe({
next: (_resp: StrictHttpResponse<DogTrainerAppCommandResponse>) => {
this.router.navigateByUrl(AppRoutes.path(AppRoutes.GDSD_APPLICATION_RECEIVED));
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import { Router } from '@angular/router';
import { ApplicationTypeCode, DogTrainerAppCommandResponse } from '@app/api/models';
import { StrictHttpResponse } from '@app/api/strict-http-response';
import { AppRoutes } from '@app/app.routes';
import { BooleanTypeCode } from '@app/core/code-types/model-desc.models';
import { BaseWizardComponent } from '@app/core/components/base-wizard.component';
import { DogTrainerApplicationService } from '@app/core/services/dog-trainer-application.service';
import { UtilService } from '@app/core/services/util.service';
import { distinctUntilChanged, Subscription } from 'rxjs';
import { StepDtConsentReplacementComponent } from './step-dt-consent-replacement.component';
import { StepDtMailingAddressComponent } from './step-dt-mailing-address.component';
import { StepDtPhotographOfYourselfRenewComponent } from './step-dt-photograph-of-yourself-renew.component';

@Component({
selector: 'app-dog-trainer-wizard-replacement',
Expand All @@ -33,7 +35,17 @@ import { StepDtMailingAddressComponent } from './step-dt-mailing-address.compone
></app-wizard-footer>
</mat-step>

<mat-step [completed]="step3Complete">
<mat-step [completed]="step3Complete" *ngIf="updatePhoto">
<ng-template matStepLabel>Photograph of Yourself</ng-template>
<app-step-dt-photograph-of-yourself-renew></app-step-dt-photograph-of-yourself-renew>

<app-wizard-footer
(previousStepperStep)="onGoToPreviousStep()"
(nextStepperStep)="onFormValidNextStep(STEP_PHOTO_OF_YOURSELF)"
></app-wizard-footer>
</mat-step>

<mat-step>
<ng-template matStepLabel>Acknowledgement</ng-template>
<app-step-dt-consent-replacement></app-step-dt-consent-replacement>

Expand All @@ -56,11 +68,15 @@ import { StepDtMailingAddressComponent } from './step-dt-mailing-address.compone
export class DogTrainerWizardReplacementComponent extends BaseWizardComponent implements OnInit, OnDestroy {
readonly STEP_SUMMARY = 0;
readonly STEP_MAILING_ADDRESS = 1;
readonly STEP_PHOTO_OF_YOURSELF = 2;

step2Complete = false;
step3Complete = false;

updatePhoto = false;

@ViewChild(StepDtMailingAddressComponent) stepAddress!: StepDtMailingAddressComponent;
@ViewChild(StepDtPhotographOfYourselfRenewComponent) stepPhoto!: StepDtPhotographOfYourselfRenewComponent;
@ViewChild(StepDtConsentReplacementComponent) stepConsent!: StepDtConsentReplacementComponent;

applicationTypeReplacement = ApplicationTypeCode.Replacement;
Expand Down Expand Up @@ -89,6 +105,10 @@ export class DogTrainerWizardReplacementComponent extends BaseWizardComponent im

this.dogTrainerChangedSubscription = this.dogTrainerApplicationService.dogTrainerModelValueChanges$.subscribe(
(_resp: boolean) => {
this.updatePhoto =
this.dogTrainerApplicationService.dogTrainerFormGroup.get('photographOfYourselfData.updatePhoto')?.value ===
BooleanTypeCode.Yes;

this.updateCompleteStatus();
}
);
Expand All @@ -114,6 +134,8 @@ export class DogTrainerWizardReplacementComponent extends BaseWizardComponent im
return true;
case this.STEP_MAILING_ADDRESS:
return this.stepAddress.isFormValid();
case this.STEP_PHOTO_OF_YOURSELF:
return this.stepPhoto.isFormValid();
default:
console.error('Unknown Form', step);
}
Expand All @@ -127,7 +149,7 @@ export class DogTrainerWizardReplacementComponent extends BaseWizardComponent im
onSubmit(): void {
if (!this.stepConsent.isFormValid()) return;

this.dogTrainerApplicationService.submitLicenceReplacementAnonymous().subscribe({
this.dogTrainerApplicationService.submitLicenceAnonymous().subscribe({
next: (_resp: StrictHttpResponse<DogTrainerAppCommandResponse>) => {
this.router.navigateByUrl(AppRoutes.path(AppRoutes.GDSD_APPLICATION_RECEIVED));
},
Expand All @@ -139,7 +161,9 @@ export class DogTrainerWizardReplacementComponent extends BaseWizardComponent im

private updateCompleteStatus(): void {
this.step2Complete = this.dogTrainerApplicationService.trainerMailingAddressFormGroup.valid;
this.step3Complete = this.dogTrainerApplicationService.consentAndDeclarationDtFormGroup.valid;
this.step3Complete = this.updatePhoto
? this.dogTrainerApplicationService.photographOfYourselfFormGroup.valid
: true;

console.debug('Complete Status', this.step2Complete, this.step3Complete);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { Router } from '@angular/router';
import { ApplicationTypeCode, GdsdTeamAppCommandResponse } from '@app/api/models';
import { StrictHttpResponse } from '@app/api/strict-http-response';
import { AppRoutes } from '@app/app.routes';
import { BooleanTypeCode } from '@app/core/code-types/model-desc.models';
import { BaseWizardComponent } from '@app/core/components/base-wizard.component';
import { AuthenticationService } from '@app/core/services/authentication.service';
import { GdsdTeamApplicationService } from '@app/core/services/gdsd-team-application.service';
import { UtilService } from '@app/core/services/util.service';
import { distinctUntilChanged, Subscription } from 'rxjs';
import { StepTeamConsentReplacementComponent } from './step-team-consent-replacement.component';
import { StepTeamMailingAddressComponent } from './step-team-mailing-address.component';
import { StepTeamPhotographOfYourselfRenewComponent } from './step-team-photograph-of-yourself-renew.component';

@Component({
selector: 'app-gdsd-team-wizard-replacement',
Expand All @@ -37,7 +39,17 @@ import { StepTeamMailingAddressComponent } from './step-team-mailing-address.com
></app-wizard-footer>
</mat-step>

<mat-step [completed]="step3Complete">
<mat-step [completed]="step3Complete" *ngIf="updatePhoto">
<ng-template matStepLabel>Photograph of Yourself</ng-template>
<app-step-team-photograph-of-yourself-renew></app-step-team-photograph-of-yourself-renew>

<app-wizard-footer
(previousStepperStep)="onGoToPreviousStep()"
(nextStepperStep)="onFormValidNextStep(STEP_PHOTO_OF_YOURSELF)"
></app-wizard-footer>
</mat-step>

<mat-step>
<ng-template matStepLabel>Acknowledgement</ng-template>
<app-step-team-consent-replacement></app-step-team-consent-replacement>

Expand All @@ -60,14 +72,17 @@ import { StepTeamMailingAddressComponent } from './step-team-mailing-address.com
export class GdsdTeamWizardReplacementComponent extends BaseWizardComponent implements OnInit, OnDestroy {
readonly STEP_SUMMARY = 0;
readonly STEP_MAILING_ADDRESS = 1;
readonly STEP_PHOTO_OF_YOURSELF = 2;

step2Complete = false;
step3Complete = false;

isLoggedIn = false;
updatePhoto = false;
applicationTypeReplacement = ApplicationTypeCode.Replacement;

@ViewChild(StepTeamMailingAddressComponent) stepAddress!: StepTeamMailingAddressComponent;
@ViewChild(StepTeamPhotographOfYourselfRenewComponent) stepPhoto!: StepTeamPhotographOfYourselfRenewComponent;
@ViewChild(StepTeamConsentReplacementComponent) stepConsent!: StepTeamConsentReplacementComponent;

private gdsdTeamChangedSubscription!: Subscription;
Expand Down Expand Up @@ -97,6 +112,10 @@ export class GdsdTeamWizardReplacementComponent extends BaseWizardComponent impl

this.gdsdTeamChangedSubscription = this.gdsdTeamApplicationService.gdsdTeamModelValueChanges$.subscribe(
(_resp: boolean) => {
this.updatePhoto =
this.gdsdTeamApplicationService.gdsdTeamModelFormGroup.get('photographOfYourselfData.updatePhoto')?.value ===
BooleanTypeCode.Yes;

this.updateCompleteStatus();
}
);
Expand All @@ -122,6 +141,8 @@ export class GdsdTeamWizardReplacementComponent extends BaseWizardComponent impl
return true;
case this.STEP_MAILING_ADDRESS:
return this.stepAddress.isFormValid();
case this.STEP_PHOTO_OF_YOURSELF:
return this.stepPhoto.isFormValid();
default:
console.error('Unknown Form', step);
}
Expand All @@ -147,7 +168,7 @@ export class GdsdTeamWizardReplacementComponent extends BaseWizardComponent impl
return;
}

this.gdsdTeamApplicationService.submitLicenceReplacementAnonymous().subscribe({
this.gdsdTeamApplicationService.submitLicenceAnonymous().subscribe({
next: (_resp: StrictHttpResponse<GdsdTeamAppCommandResponse>) => {
this.router.navigateByUrl(AppRoutes.path(AppRoutes.GDSD_APPLICATION_RECEIVED));
},
Expand All @@ -159,7 +180,7 @@ export class GdsdTeamWizardReplacementComponent extends BaseWizardComponent impl

private updateCompleteStatus(): void {
this.step2Complete = this.gdsdTeamApplicationService.mailingAddressFormGroup.valid;
this.step3Complete = this.gdsdTeamApplicationService.consentAndDeclarationFormGroup.valid;
this.step3Complete = this.updatePhoto ? this.gdsdTeamApplicationService.photographOfYourselfFormGroup.valid : true;

console.debug('Complete Status', this.step2Complete, this.step3Complete);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { Router } from '@angular/router';
import { ApplicationTypeCode, RetiredDogAppCommandResponse } from '@app/api/models';
import { StrictHttpResponse } from '@app/api/strict-http-response';
import { AppRoutes } from '@app/app.routes';
import { BooleanTypeCode } from '@app/core/code-types/model-desc.models';
import { BaseWizardComponent } from '@app/core/components/base-wizard.component';
import { AuthenticationService } from '@app/core/services/authentication.service';
import { RetiredDogApplicationService } from '@app/core/services/retired-dog-application.service';
import { UtilService } from '@app/core/services/util.service';
import { distinctUntilChanged, Subscription } from 'rxjs';
import { StepRdConsentReplacementComponent } from './step-rd-consent-replacement.component';
import { StepRdMailingAddressComponent } from './step-rd-mailing-address.component';
import { StepRdPhotographOfYourselfRenewComponent } from './step-rd-photograph-of-yourself-renew.component';

@Component({
selector: 'app-retired-dog-wizard-replacement',
Expand All @@ -37,7 +39,17 @@ import { StepRdMailingAddressComponent } from './step-rd-mailing-address.compone
></app-wizard-footer>
</mat-step>

<mat-step [completed]="step3Complete">
<mat-step [completed]="step3Complete" *ngIf="updatePhoto">
<ng-template matStepLabel>Photograph of Yourself</ng-template>
<app-step-rd-photograph-of-yourself-renew></app-step-rd-photograph-of-yourself-renew>

<app-wizard-footer
(previousStepperStep)="onGoToPreviousStep()"
(nextStepperStep)="onFormValidNextStep(STEP_PHOTO_OF_YOURSELF)"
></app-wizard-footer>
</mat-step>

<mat-step>
<ng-template matStepLabel>Acknowledgement</ng-template>
<app-step-rd-consent-replacement></app-step-rd-consent-replacement>

Expand All @@ -60,14 +72,17 @@ import { StepRdMailingAddressComponent } from './step-rd-mailing-address.compone
export class RetiredDogWizardReplacementComponent extends BaseWizardComponent implements OnInit, OnDestroy {
readonly STEP_SUMMARY = 0;
readonly STEP_MAILING_ADDRESS = 1;
readonly STEP_PHOTO_OF_YOURSELF = 2;

step2Complete = false;
step3Complete = false;

isLoggedIn = false;
updatePhoto = false;
applicationTypeReplacement = ApplicationTypeCode.Replacement;

@ViewChild(StepRdMailingAddressComponent) stepAddress!: StepRdMailingAddressComponent;
@ViewChild(StepRdPhotographOfYourselfRenewComponent) stepPhoto!: StepRdPhotographOfYourselfRenewComponent;
@ViewChild(StepRdConsentReplacementComponent) stepConsent!: StepRdConsentReplacementComponent;

private retiredDogChangedSubscription!: Subscription;
Expand Down Expand Up @@ -97,6 +112,10 @@ export class RetiredDogWizardReplacementComponent extends BaseWizardComponent im

this.retiredDogChangedSubscription = this.retiredDogApplicationService.retiredDogModelValueChanges$.subscribe(
(_resp: boolean) => {
this.updatePhoto =
this.retiredDogApplicationService.retiredDogModelFormGroup.get('photographOfYourselfData.updatePhoto')
?.value === BooleanTypeCode.Yes;

this.updateCompleteStatus();
}
);
Expand All @@ -122,6 +141,8 @@ export class RetiredDogWizardReplacementComponent extends BaseWizardComponent im
return true;
case this.STEP_MAILING_ADDRESS:
return this.stepAddress.isFormValid();
case this.STEP_PHOTO_OF_YOURSELF:
return this.stepPhoto.isFormValid();
default:
console.error('Unknown Form', step);
}
Expand All @@ -147,7 +168,7 @@ export class RetiredDogWizardReplacementComponent extends BaseWizardComponent im
return;
}

this.retiredDogApplicationService.submitLicenceReplacementAnonymous().subscribe({
this.retiredDogApplicationService.submitLicenceAnonymous().subscribe({
next: (_resp: StrictHttpResponse<RetiredDogAppCommandResponse>) => {
this.router.navigateByUrl(AppRoutes.path(AppRoutes.GDSD_APPLICATION_RECEIVED));
},
Expand All @@ -159,7 +180,9 @@ export class RetiredDogWizardReplacementComponent extends BaseWizardComponent im

private updateCompleteStatus(): void {
this.step2Complete = this.retiredDogApplicationService.mailingAddressFormGroup.valid;
this.step3Complete = this.retiredDogApplicationService.consentAndDeclarationFormGroup.valid;
this.step3Complete = this.updatePhoto
? this.retiredDogApplicationService.photographOfYourselfFormGroup.valid
: true;

console.debug('Complete Status', this.step2Complete, this.step3Complete);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export abstract class CommonApplicationHelper {

photographOfYourselfFormGroup: FormGroup = this.formBuilder.group(
{
updatePhoto: new FormControl(''), // used by update/renewal
updatePhoto: new FormControl(''), // used by replacement/renewal
uploadedDateTime: new FormControl(''), // used in Renewal to determine if a new photo is mandatory
attachments: new FormControl([]),
updateAttachments: new FormControl([]), // used by update/renewal
updateAttachments: new FormControl([]), // used by replacement/renewal
},
{
validators: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export interface MainApplicationResponse extends LicenceAppListResponse {

export interface MainLicenceResponse extends LicenceResponse {
hasLoginNameChanged: boolean;
originalPhotoOfYourselfExpired: boolean;
licenceExpiryNumberOfDays?: null | number;
isRenewalPeriod: boolean;
isReplacementPeriod: boolean;
Expand Down Expand Up @@ -397,8 +396,6 @@ export class CommonApplicationService {
const licenceRenewPeriodDays = SPD_CONSTANTS.periods.licenceRenewPeriodDays;
const licenceRenewPeriodDaysNinetyDayTerm = SPD_CONSTANTS.periods.licenceRenewPeriodDaysNinetyDayTerm;

licence.originalPhotoOfYourselfExpired = false; // default

licence.isRenewalPeriod = false;
licence.isReplacementPeriod = false;
licence.isExpiredLicenceRenewable = this.utilService.isExpiredLicenceRenewable(licence);
Expand Down
Loading