Skip to content

Commit 4c1c90f

Browse files
wip
1 parent 2e07e75 commit 4c1c90f

12 files changed

+97
-125
lines changed

src/Spd.Presentation.GuideDogServiceDog/ClientApp/src/app/components/authenticated/gdsd-licence-main-licences-list.component.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ import { MainLicenceResponse } from '@app/core/services/common-application.servi
110110
(keydown)="onKeydownRequestReplacement($event, licence)"
111111
>Request a replacement</a
112112
>
113-
114-
<div class="mt-4" *ngIf="licence.originalPhotoOfYourselfExpired">
115-
<app-alert type="danger" icon="dangerous">
116-
A replacement for this record is not available at this time.
117-
</app-alert>
118-
</div>
119113
</div>
120114
</div>
121115
</div>

src/Spd.Presentation.GuideDogServiceDog/ClientApp/src/app/components/authenticated/gdsd-licence-main.component.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,6 @@ export class GdsdLicenceMainComponent implements OnInit {
231231
.getLicenceWithSelectionAuthenticated(ApplicationTypeCode.Replacement, licence)
232232
.pipe(
233233
tap((_resp: any) => {
234-
const originalPhotoOfYourselfExpired = !!this.gdsdTeamApplicationService.gdsdTeamModelFormGroup.get(
235-
'originalLicenceData.originalPhotoOfYourselfExpired'
236-
)?.value;
237-
238-
licence.originalPhotoOfYourselfExpired = originalPhotoOfYourselfExpired;
239-
240-
// User cannot continue with this flow if the photograph of yourself is missing
241-
if (originalPhotoOfYourselfExpired) {
242-
this.gdsdTeamApplicationService.reset();
243-
return;
244-
}
245-
246234
this.router.navigateByUrl(AppRoutes.pathGdsdAuthenticated(AppRoutes.GDSD_TEAM_REPLACEMENT_AUTHENTICATED));
247235
}),
248236
take(1)
@@ -255,18 +243,6 @@ export class GdsdLicenceMainComponent implements OnInit {
255243
.getLicenceWithSelectionAuthenticated(ApplicationTypeCode.Replacement, licence)
256244
.pipe(
257245
tap((_resp: any) => {
258-
const originalPhotoOfYourselfExpired = !!this.retiredDogApplicationService.retiredDogModelFormGroup.get(
259-
'originalLicenceData.originalPhotoOfYourselfExpired'
260-
)?.value;
261-
262-
licence.originalPhotoOfYourselfExpired = originalPhotoOfYourselfExpired;
263-
264-
// User cannot continue with this flow if the photograph of yourself is missing
265-
if (originalPhotoOfYourselfExpired) {
266-
this.retiredDogApplicationService.reset();
267-
return;
268-
}
269-
270246
this.router.navigateByUrl(
271247
AppRoutes.pathGdsdAuthenticated(AppRoutes.RETIRED_DOG_REPLACEMENT_AUTHENTICATED)
272248
);

src/Spd.Presentation.GuideDogServiceDog/ClientApp/src/app/components/dog-trainer/dog-trainer-wizard-new-renewal.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class DogTrainerWizardNewRenewalComponent extends BaseWizardComponent imp
144144
}
145145

146146
onSubmit(): void {
147-
this.dogTrainerApplicationService.submitLicenceNewOrRenewalAnonymous().subscribe({
147+
this.dogTrainerApplicationService.submitLicenceAnonymous().subscribe({
148148
next: (_resp: StrictHttpResponse<DogTrainerAppCommandResponse>) => {
149149
this.router.navigateByUrl(AppRoutes.path(AppRoutes.GDSD_APPLICATION_RECEIVED));
150150
},

src/Spd.Presentation.GuideDogServiceDog/ClientApp/src/app/components/dog-trainer/dog-trainer-wizard-replacement.component.ts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import { Router } from '@angular/router';
44
import { ApplicationTypeCode, DogTrainerAppCommandResponse } from '@app/api/models';
55
import { StrictHttpResponse } from '@app/api/strict-http-response';
66
import { AppRoutes } from '@app/app.routes';
7+
import { BooleanTypeCode } from '@app/core/code-types/model-desc.models';
78
import { BaseWizardComponent } from '@app/core/components/base-wizard.component';
89
import { DogTrainerApplicationService } from '@app/core/services/dog-trainer-application.service';
910
import { UtilService } from '@app/core/services/util.service';
1011
import { distinctUntilChanged, Subscription } from 'rxjs';
1112
import { StepDtConsentReplacementComponent } from './step-dt-consent-replacement.component';
1213
import { StepDtMailingAddressComponent } from './step-dt-mailing-address.component';
14+
import { StepDtPhotographOfYourselfRenewComponent } from './step-dt-photograph-of-yourself-renew.component';
1315

1416
@Component({
1517
selector: 'app-dog-trainer-wizard-replacement',
@@ -33,7 +35,17 @@ import { StepDtMailingAddressComponent } from './step-dt-mailing-address.compone
3335
></app-wizard-footer>
3436
</mat-step>
3537
36-
<mat-step [completed]="step3Complete">
38+
<mat-step [completed]="step3Complete" *ngIf="updatePhoto">
39+
<ng-template matStepLabel>Photograph of Yourself</ng-template>
40+
<app-step-dt-photograph-of-yourself-renew></app-step-dt-photograph-of-yourself-renew>
41+
42+
<app-wizard-footer
43+
(previousStepperStep)="onGoToPreviousStep()"
44+
(nextStepperStep)="onFormValidNextStep(STEP_PHOTO_OF_YOURSELF)"
45+
></app-wizard-footer>
46+
</mat-step>
47+
48+
<mat-step>
3749
<ng-template matStepLabel>Acknowledgement</ng-template>
3850
<app-step-dt-consent-replacement></app-step-dt-consent-replacement>
3951
@@ -56,11 +68,15 @@ import { StepDtMailingAddressComponent } from './step-dt-mailing-address.compone
5668
export class DogTrainerWizardReplacementComponent extends BaseWizardComponent implements OnInit, OnDestroy {
5769
readonly STEP_SUMMARY = 0;
5870
readonly STEP_MAILING_ADDRESS = 1;
71+
readonly STEP_PHOTO_OF_YOURSELF = 2;
5972

6073
step2Complete = false;
6174
step3Complete = false;
6275

76+
updatePhoto = false;
77+
6378
@ViewChild(StepDtMailingAddressComponent) stepAddress!: StepDtMailingAddressComponent;
79+
@ViewChild(StepDtPhotographOfYourselfRenewComponent) stepPhoto!: StepDtPhotographOfYourselfRenewComponent;
6480
@ViewChild(StepDtConsentReplacementComponent) stepConsent!: StepDtConsentReplacementComponent;
6581

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

90106
this.dogTrainerChangedSubscription = this.dogTrainerApplicationService.dogTrainerModelValueChanges$.subscribe(
91107
(_resp: boolean) => {
108+
this.updatePhoto =
109+
this.dogTrainerApplicationService.dogTrainerFormGroup.get('photographOfYourselfData.updatePhoto')?.value ===
110+
BooleanTypeCode.Yes;
111+
92112
this.updateCompleteStatus();
93113
}
94114
);
@@ -114,6 +134,8 @@ export class DogTrainerWizardReplacementComponent extends BaseWizardComponent im
114134
return true;
115135
case this.STEP_MAILING_ADDRESS:
116136
return this.stepAddress.isFormValid();
137+
case this.STEP_PHOTO_OF_YOURSELF:
138+
return this.stepPhoto.isFormValid();
117139
default:
118140
console.error('Unknown Form', step);
119141
}
@@ -127,7 +149,7 @@ export class DogTrainerWizardReplacementComponent extends BaseWizardComponent im
127149
onSubmit(): void {
128150
if (!this.stepConsent.isFormValid()) return;
129151

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

140162
private updateCompleteStatus(): void {
141163
this.step2Complete = this.dogTrainerApplicationService.trainerMailingAddressFormGroup.valid;
142-
this.step3Complete = this.dogTrainerApplicationService.consentAndDeclarationDtFormGroup.valid;
164+
this.step3Complete = this.updatePhoto
165+
? this.dogTrainerApplicationService.photographOfYourselfFormGroup.valid
166+
: true;
143167

144168
console.debug('Complete Status', this.step2Complete, this.step3Complete);
145169
}

src/Spd.Presentation.GuideDogServiceDog/ClientApp/src/app/components/gdsd-team/gdsd-team-wizard-replacement.component.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { Router } from '@angular/router';
44
import { ApplicationTypeCode, GdsdTeamAppCommandResponse } from '@app/api/models';
55
import { StrictHttpResponse } from '@app/api/strict-http-response';
66
import { AppRoutes } from '@app/app.routes';
7+
import { BooleanTypeCode } from '@app/core/code-types/model-desc.models';
78
import { BaseWizardComponent } from '@app/core/components/base-wizard.component';
89
import { AuthenticationService } from '@app/core/services/authentication.service';
910
import { GdsdTeamApplicationService } from '@app/core/services/gdsd-team-application.service';
1011
import { UtilService } from '@app/core/services/util.service';
1112
import { distinctUntilChanged, Subscription } from 'rxjs';
1213
import { StepTeamConsentReplacementComponent } from './step-team-consent-replacement.component';
1314
import { StepTeamMailingAddressComponent } from './step-team-mailing-address.component';
15+
import { StepTeamPhotographOfYourselfRenewComponent } from './step-team-photograph-of-yourself-renew.component';
1416

1517
@Component({
1618
selector: 'app-gdsd-team-wizard-replacement',
@@ -37,7 +39,17 @@ import { StepTeamMailingAddressComponent } from './step-team-mailing-address.com
3739
></app-wizard-footer>
3840
</mat-step>
3941
40-
<mat-step [completed]="step3Complete">
42+
<mat-step [completed]="step3Complete" *ngIf="updatePhoto">
43+
<ng-template matStepLabel>Photograph of Yourself</ng-template>
44+
<app-step-team-photograph-of-yourself-renew></app-step-team-photograph-of-yourself-renew>
45+
46+
<app-wizard-footer
47+
(previousStepperStep)="onGoToPreviousStep()"
48+
(nextStepperStep)="onFormValidNextStep(STEP_PHOTO_OF_YOURSELF)"
49+
></app-wizard-footer>
50+
</mat-step>
51+
52+
<mat-step>
4153
<ng-template matStepLabel>Acknowledgement</ng-template>
4254
<app-step-team-consent-replacement></app-step-team-consent-replacement>
4355
@@ -60,14 +72,17 @@ import { StepTeamMailingAddressComponent } from './step-team-mailing-address.com
6072
export class GdsdTeamWizardReplacementComponent extends BaseWizardComponent implements OnInit, OnDestroy {
6173
readonly STEP_SUMMARY = 0;
6274
readonly STEP_MAILING_ADDRESS = 1;
75+
readonly STEP_PHOTO_OF_YOURSELF = 2;
6376

6477
step2Complete = false;
6578
step3Complete = false;
6679

6780
isLoggedIn = false;
81+
updatePhoto = false;
6882
applicationTypeReplacement = ApplicationTypeCode.Replacement;
6983

7084
@ViewChild(StepTeamMailingAddressComponent) stepAddress!: StepTeamMailingAddressComponent;
85+
@ViewChild(StepTeamPhotographOfYourselfRenewComponent) stepPhoto!: StepTeamPhotographOfYourselfRenewComponent;
7186
@ViewChild(StepTeamConsentReplacementComponent) stepConsent!: StepTeamConsentReplacementComponent;
7287

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

98113
this.gdsdTeamChangedSubscription = this.gdsdTeamApplicationService.gdsdTeamModelValueChanges$.subscribe(
99114
(_resp: boolean) => {
115+
this.updatePhoto =
116+
this.gdsdTeamApplicationService.gdsdTeamModelFormGroup.get('photographOfYourselfData.updatePhoto')?.value ===
117+
BooleanTypeCode.Yes;
118+
100119
this.updateCompleteStatus();
101120
}
102121
);
@@ -122,6 +141,8 @@ export class GdsdTeamWizardReplacementComponent extends BaseWizardComponent impl
122141
return true;
123142
case this.STEP_MAILING_ADDRESS:
124143
return this.stepAddress.isFormValid();
144+
case this.STEP_PHOTO_OF_YOURSELF:
145+
return this.stepPhoto.isFormValid();
125146
default:
126147
console.error('Unknown Form', step);
127148
}
@@ -147,7 +168,7 @@ export class GdsdTeamWizardReplacementComponent extends BaseWizardComponent impl
147168
return;
148169
}
149170

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

160181
private updateCompleteStatus(): void {
161182
this.step2Complete = this.gdsdTeamApplicationService.mailingAddressFormGroup.valid;
162-
this.step3Complete = this.gdsdTeamApplicationService.consentAndDeclarationFormGroup.valid;
183+
this.step3Complete = this.updatePhoto ? this.gdsdTeamApplicationService.photographOfYourselfFormGroup.valid : true;
163184

164185
console.debug('Complete Status', this.step2Complete, this.step3Complete);
165186
}

src/Spd.Presentation.GuideDogServiceDog/ClientApp/src/app/components/retired-dog/retired-dog-wizard-replacement.component.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { Router } from '@angular/router';
44
import { ApplicationTypeCode, RetiredDogAppCommandResponse } from '@app/api/models';
55
import { StrictHttpResponse } from '@app/api/strict-http-response';
66
import { AppRoutes } from '@app/app.routes';
7+
import { BooleanTypeCode } from '@app/core/code-types/model-desc.models';
78
import { BaseWizardComponent } from '@app/core/components/base-wizard.component';
89
import { AuthenticationService } from '@app/core/services/authentication.service';
910
import { RetiredDogApplicationService } from '@app/core/services/retired-dog-application.service';
1011
import { UtilService } from '@app/core/services/util.service';
1112
import { distinctUntilChanged, Subscription } from 'rxjs';
1213
import { StepRdConsentReplacementComponent } from './step-rd-consent-replacement.component';
1314
import { StepRdMailingAddressComponent } from './step-rd-mailing-address.component';
15+
import { StepRdPhotographOfYourselfRenewComponent } from './step-rd-photograph-of-yourself-renew.component';
1416

1517
@Component({
1618
selector: 'app-retired-dog-wizard-replacement',
@@ -37,7 +39,17 @@ import { StepRdMailingAddressComponent } from './step-rd-mailing-address.compone
3739
></app-wizard-footer>
3840
</mat-step>
3941
40-
<mat-step [completed]="step3Complete">
42+
<mat-step [completed]="step3Complete" *ngIf="updatePhoto">
43+
<ng-template matStepLabel>Photograph of Yourself</ng-template>
44+
<app-step-rd-photograph-of-yourself-renew></app-step-rd-photograph-of-yourself-renew>
45+
46+
<app-wizard-footer
47+
(previousStepperStep)="onGoToPreviousStep()"
48+
(nextStepperStep)="onFormValidNextStep(STEP_PHOTO_OF_YOURSELF)"
49+
></app-wizard-footer>
50+
</mat-step>
51+
52+
<mat-step>
4153
<ng-template matStepLabel>Acknowledgement</ng-template>
4254
<app-step-rd-consent-replacement></app-step-rd-consent-replacement>
4355
@@ -60,14 +72,17 @@ import { StepRdMailingAddressComponent } from './step-rd-mailing-address.compone
6072
export class RetiredDogWizardReplacementComponent extends BaseWizardComponent implements OnInit, OnDestroy {
6173
readonly STEP_SUMMARY = 0;
6274
readonly STEP_MAILING_ADDRESS = 1;
75+
readonly STEP_PHOTO_OF_YOURSELF = 2;
6376

6477
step2Complete = false;
6578
step3Complete = false;
6679

6780
isLoggedIn = false;
81+
updatePhoto = false;
6882
applicationTypeReplacement = ApplicationTypeCode.Replacement;
6983

7084
@ViewChild(StepRdMailingAddressComponent) stepAddress!: StepRdMailingAddressComponent;
85+
@ViewChild(StepRdPhotographOfYourselfRenewComponent) stepPhoto!: StepRdPhotographOfYourselfRenewComponent;
7186
@ViewChild(StepRdConsentReplacementComponent) stepConsent!: StepRdConsentReplacementComponent;
7287

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

98113
this.retiredDogChangedSubscription = this.retiredDogApplicationService.retiredDogModelValueChanges$.subscribe(
99114
(_resp: boolean) => {
115+
this.updatePhoto =
116+
this.retiredDogApplicationService.retiredDogModelFormGroup.get('photographOfYourselfData.updatePhoto')
117+
?.value === BooleanTypeCode.Yes;
118+
100119
this.updateCompleteStatus();
101120
}
102121
);
@@ -122,6 +141,8 @@ export class RetiredDogWizardReplacementComponent extends BaseWizardComponent im
122141
return true;
123142
case this.STEP_MAILING_ADDRESS:
124143
return this.stepAddress.isFormValid();
144+
case this.STEP_PHOTO_OF_YOURSELF:
145+
return this.stepPhoto.isFormValid();
125146
default:
126147
console.error('Unknown Form', step);
127148
}
@@ -147,7 +168,7 @@ export class RetiredDogWizardReplacementComponent extends BaseWizardComponent im
147168
return;
148169
}
149170

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

160181
private updateCompleteStatus(): void {
161182
this.step2Complete = this.retiredDogApplicationService.mailingAddressFormGroup.valid;
162-
this.step3Complete = this.retiredDogApplicationService.consentAndDeclarationFormGroup.valid;
183+
this.step3Complete = this.updatePhoto
184+
? this.retiredDogApplicationService.photographOfYourselfFormGroup.valid
185+
: true;
163186

164187
console.debug('Complete Status', this.step2Complete, this.step3Complete);
165188
}

src/Spd.Presentation.GuideDogServiceDog/ClientApp/src/app/core/services/common-application.helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ export abstract class CommonApplicationHelper {
5151

5252
photographOfYourselfFormGroup: FormGroup = this.formBuilder.group(
5353
{
54-
updatePhoto: new FormControl(''), // used by update/renewal
54+
updatePhoto: new FormControl(''), // used by replacement/renewal
5555
uploadedDateTime: new FormControl(''), // used in Renewal to determine if a new photo is mandatory
5656
attachments: new FormControl([]),
57-
updateAttachments: new FormControl([]), // used by update/renewal
57+
updateAttachments: new FormControl([]), // used by replacement/renewal
5858
},
5959
{
6060
validators: [

src/Spd.Presentation.GuideDogServiceDog/ClientApp/src/app/core/services/common-application.service.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export interface MainApplicationResponse extends LicenceAppListResponse {
4141

4242
export interface MainLicenceResponse extends LicenceResponse {
4343
hasLoginNameChanged: boolean;
44-
originalPhotoOfYourselfExpired: boolean;
4544
licenceExpiryNumberOfDays?: null | number;
4645
isRenewalPeriod: boolean;
4746
isReplacementPeriod: boolean;
@@ -397,8 +396,6 @@ export class CommonApplicationService {
397396
const licenceRenewPeriodDays = SPD_CONSTANTS.periods.licenceRenewPeriodDays;
398397
const licenceRenewPeriodDaysNinetyDayTerm = SPD_CONSTANTS.periods.licenceRenewPeriodDaysNinetyDayTerm;
399398

400-
licence.originalPhotoOfYourselfExpired = false; // default
401-
402399
licence.isRenewalPeriod = false;
403400
licence.isReplacementPeriod = false;
404401
licence.isExpiredLicenceRenewable = this.utilService.isExpiredLicenceRenewable(licence);

0 commit comments

Comments
 (0)