Skip to content

Commit

Permalink
add an interface for NewWorkerMandatoryInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
kapppa-joe committed Aug 22, 2024
1 parent c0b5d60 commit 5717dec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 7 additions & 2 deletions frontend/src/app/core/services/worker.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ interface TotalStaffRecordsResponse {
total: number;
}

export interface NewWorkerMandatoryInfo {
nameOrId: string;
contract: Contracts;
}

@Injectable({
providedIn: 'root',
})
Expand All @@ -45,7 +50,7 @@ export class WorkerService {
public worker$ = this._worker$.asObservable();
public getRoute$: BehaviorSubject<any> = new BehaviorSubject<any>(null);
public createStaffResponse = null;
private _newWorkerMandatoryInfo: { nameOrId: string; contract: Contracts } = null;
private _newWorkerMandatoryInfo: NewWorkerMandatoryInfo = null;

private _workers$: BehaviorSubject<Worker[]> = new BehaviorSubject<Worker[]>(null);
public workers$: Observable<Worker[]> = this._workers$.asObservable();
Expand Down Expand Up @@ -297,7 +302,7 @@ export class WorkerService {
this._newWorkerMandatoryInfo = { nameOrId, contract };
}

public get newWorkerMandatoryInfo(): { nameOrId: string; contract: Contracts } {
public get newWorkerMandatoryInfo(): NewWorkerMandatoryInfo {
return this._newWorkerMandatoryInfo;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { UntypedFormBuilder, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { BackLinkService } from '@core/services/backLink.service';
import { ErrorSummaryService } from '@core/services/error-summary.service';
import { WorkerService } from '@core/services/worker.service';
import { NewWorkerMandatoryInfo, WorkerService } from '@core/services/worker.service';
import { EstablishmentService } from '@core/services/establishment.service';
import { Contracts } from '@core/model/contracts.enum';
import { AlertService } from '@core/services/alert.service';
Expand All @@ -24,10 +24,7 @@ export class MainJobRoleComponent extends QuestionComponent implements OnInit, O
public summaryContinue: boolean;
public callToActionLabel: string = 'Save and return';
private isAddingNewWorker: boolean;
private newWorkerMandantoryInfo: {
nameOrId: string;
contract: Contracts;
};
private newWorkerMandantoryInfo: NewWorkerMandatoryInfo;

private summaryText = {
'Care providing roles': 'care worker, community support, support worker',
Expand Down

0 comments on commit 5717dec

Please sign in to comment.