client-app/src/app/core/services/carnet/carnet-application.service.ts
2025-07-14 19:30:28 +05:30

47 lines
1.3 KiB
TypeScript

// appli.service.ts
import { Injectable, signal } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class CarnetStateStore {
headerId = signal<number>(0);
applicationName = signal<string>('');
searchedHolder = signal<string>('');
holderid = signal<number>(0);
applicationType = signal<'new' | 'additional' | 'duplicate' | 'extend' | null>('new');
isEditMode = signal<boolean>(false);
stepsCompleted = signal({
applicationDetail: false,
holderSelection: false,
goodsSection: false,
travelPlan: false,
insurance: false,
shipping: false,
deliveryMethod: false,
payment: false
});
resetState() {
console.log("CALLED RESET STATE");
this.headerId.set(0);
this.applicationName.set('');
this.searchedHolder.set('');
this.holderid.set(0);
this.applicationType.set('new');
this.isEditMode.set(false);
this.stepsCompleted.set({
applicationDetail: false, // this is intentionally true on reset?
holderSelection: false,
goodsSection: false,
travelPlan: false,
insurance: false,
shipping: false,
deliveryMethod: false,
payment: false
});
}
}