Add cancellation and conversion error/success flows
Introduces new components for cancellation and conversion error/success states, updates routing and UI to support resuming and cancelling orders, and refactors seat selection and order handling logic to accommodate these new flows. Also improves seat selection feedback and error handling throughout the checkout process.
This commit is contained in:
@@ -9,12 +9,16 @@ export class SelectedSeatsService {
|
||||
private selectedSeatsSignal = signal<Sitzplatz[]>([]);
|
||||
private seatIsSelectableSignal = signal(true);
|
||||
private committedSignal = signal(false);
|
||||
private erroredSignal = signal(false);
|
||||
private cancelledSignal = signal(false);
|
||||
private debugSignal = signal(false);
|
||||
private hadConflictSignal = signal(false);
|
||||
|
||||
readonly selectedSeats = this.selectedSeatsSignal.asReadonly();
|
||||
readonly seatIsSelectable = this.seatIsSelectableSignal.asReadonly();
|
||||
readonly committed = this.committedSignal.asReadonly();
|
||||
readonly errored = this.erroredSignal.asReadonly();
|
||||
readonly cancelled = this.cancelledSignal.asReadonly();
|
||||
readonly debug = this.debugSignal.asReadonly();
|
||||
readonly hadConflict = this.hadConflictSignal.asReadonly();
|
||||
|
||||
@@ -38,6 +42,8 @@ export class SelectedSeatsService {
|
||||
clearSelection(): void {
|
||||
this.selectedSeatsSignal.set([]);
|
||||
this.committedSignal.set(false);
|
||||
this.cancelledSignal.set(false);
|
||||
this.erroredSignal.set(false);
|
||||
this.hadConflictSignal.set(false);
|
||||
}
|
||||
|
||||
@@ -49,6 +55,8 @@ export class SelectedSeatsService {
|
||||
this.seatIsSelectableSignal.set(selectable);
|
||||
if (selectable) {
|
||||
this.committedSignal.set(false);
|
||||
this.cancelledSignal.set(false);
|
||||
this.erroredSignal.set(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +64,14 @@ export class SelectedSeatsService {
|
||||
this.committedSignal.set(true);
|
||||
}
|
||||
|
||||
error(): void {
|
||||
this.erroredSignal.set(true);
|
||||
}
|
||||
|
||||
cancel(): void {
|
||||
this.cancelledSignal.set(true);
|
||||
}
|
||||
|
||||
toggleDebug(): void {
|
||||
this.debugSignal.update(debug => !debug);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user