@almatar/smart-booking-dashboard 0.0.2-alpha.8 → 0.0.2-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/booking-input/booking-input.component.mjs +2 -1
- package/esm2022/lib/components/train-details/train-details.component.mjs +89 -0
- package/esm2022/lib/config/dashboard.config.mjs +1 -1
- package/esm2022/lib/models/booking.types.mjs +1 -1
- package/esm2022/lib/models/train.types.mjs +2 -0
- package/esm2022/lib/pages/smart-booking-dashboard/smart-booking-dashboard.component.mjs +29 -7
- package/esm2022/lib/services/booking.service.mjs +8 -1
- package/fesm2022/almatar-smart-booking-dashboard.mjs +121 -6
- package/fesm2022/almatar-smart-booking-dashboard.mjs.map +1 -1
- package/lib/components/action-dialog/action-dialog.component.d.ts +1 -1
- package/lib/components/booking-input/booking-input.component.d.ts +3 -3
- package/lib/components/cancel-dialog/cancel-dialog.component.d.ts +2 -2
- package/lib/components/hotel-cancel/components/hotel-content/hotel-content.component.d.ts +1 -1
- package/lib/components/reissue-dialog/steps/reissue-notice/reissue-notice.component.d.ts +1 -1
- package/lib/components/result-panel/result-panel.component.d.ts +1 -1
- package/lib/components/train-details/train-details.component.d.ts +28 -0
- package/lib/config/dashboard.config.d.ts +5 -0
- package/lib/models/booking.types.d.ts +2 -0
- package/lib/models/train.types.d.ts +61 -0
- package/lib/pages/smart-booking-dashboard/smart-booking-dashboard.component.d.ts +5 -3
- package/lib/services/booking.service.d.ts +3 -0
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ export declare class SbdActionDialogComponent {
|
|
|
12
12
|
preloadedData: import("@angular/core").InputSignal<any>;
|
|
13
13
|
closed: import("@angular/core").OutputEmitterRef<void>;
|
|
14
14
|
selectedAction: import("@angular/core").WritableSignal<ActionConfig>;
|
|
15
|
-
actionStatus: import("@angular/core").WritableSignal<"
|
|
15
|
+
actionStatus: import("@angular/core").WritableSignal<"error" | "success" | "idle" | "loading">;
|
|
16
16
|
actionData: import("@angular/core").WritableSignal<unknown>;
|
|
17
17
|
elapsedMs: import("@angular/core").WritableSignal<number>;
|
|
18
18
|
copying: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DashboardProduct } from '../../models/booking.types';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
interface ProductOption {
|
|
4
4
|
label: string;
|
|
5
|
-
value:
|
|
5
|
+
value: DashboardProduct;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare class SbdBookingInputComponent {
|
|
9
9
|
loading: import("@angular/core").InputSignal<boolean>;
|
|
10
|
-
product: import("@angular/core").ModelSignal<
|
|
10
|
+
product: import("@angular/core").ModelSignal<DashboardProduct>;
|
|
11
11
|
bookingId: import("@angular/core").ModelSignal<string>;
|
|
12
12
|
lookup: import("@angular/core").OutputEmitterRef<void>;
|
|
13
13
|
/** The agent picked another brand: the booking on screen belongs to the previous one. */
|
|
@@ -36,7 +36,7 @@ export declare class SbdCancelDialogComponent {
|
|
|
36
36
|
* bookings the backend hasn't already restricted to a single leg — mirrors
|
|
37
37
|
* almatar-b2c's select-leg screen. Skipped straight to 'details' otherwise.
|
|
38
38
|
*/
|
|
39
|
-
step: import("@angular/core").WritableSignal<"loading" | "
|
|
39
|
+
step: import("@angular/core").WritableSignal<"loading" | "select-leg" | "details">;
|
|
40
40
|
/** Per-leg inclusion (checkbox) and expand/collapse state — round-trip only. */
|
|
41
41
|
onwardChecked: import("@angular/core").WritableSignal<boolean>;
|
|
42
42
|
returnChecked: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -45,7 +45,7 @@ export declare class SbdCancelDialogComponent {
|
|
|
45
45
|
selectedSource: import("@angular/core").WritableSignal<string>;
|
|
46
46
|
cancelHint: import("@angular/core").WritableSignal<string>;
|
|
47
47
|
paidSummaryExpanded: import("@angular/core").WritableSignal<boolean>;
|
|
48
|
-
preferredRefundMethod: import("@angular/core").WritableSignal<"
|
|
48
|
+
preferredRefundMethod: import("@angular/core").WritableSignal<"wallet" | "originalPaymentMethod" | "split">;
|
|
49
49
|
private readonly CANCEL_HINTS;
|
|
50
50
|
private hintTimer;
|
|
51
51
|
hasOnward: import("@angular/core").Signal<boolean>;
|
|
@@ -2,7 +2,7 @@ import { IHotelBookingData } from '../../../../models/booking.types';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class SbdHotelContentComponent {
|
|
4
4
|
bookingData: import("@angular/core").InputSignal<IHotelBookingData>;
|
|
5
|
-
bookingStatus: import("@angular/core").InputSignal<"
|
|
5
|
+
bookingStatus: import("@angular/core").InputSignal<"error" | "success" | "idle" | "loading">;
|
|
6
6
|
bookingId: import("@angular/core").InputSignal<string>;
|
|
7
7
|
dataVerified: import("@angular/core").InputSignal<boolean>;
|
|
8
8
|
bookingNotes: import("@angular/core").InputSignal<any[]>;
|
|
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
/** Icon + message box used for the info callout, loading / error states and the validation hint. */
|
|
3
3
|
export declare class SbdReissueNoticeComponent {
|
|
4
4
|
icon: import("@angular/core").InputSignal<string>;
|
|
5
|
-
tone: import("@angular/core").InputSignal<"
|
|
5
|
+
tone: import("@angular/core").InputSignal<"error" | "success" | "info" | "warn" | "muted">;
|
|
6
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<SbdReissueNoticeComponent, never>;
|
|
7
7
|
static ɵcmp: i0.ɵɵComponentDeclaration<SbdReissueNoticeComponent, "app-sbd-reissue-notice", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[action]"], true, never>;
|
|
8
8
|
}
|
|
@@ -4,7 +4,7 @@ export declare class SbdResultPanelComponent {
|
|
|
4
4
|
private toast;
|
|
5
5
|
actionLabel: import("@angular/core").InputSignal<string>;
|
|
6
6
|
elapsedMs: import("@angular/core").InputSignal<number>;
|
|
7
|
-
status: import("@angular/core").InputSignal<"
|
|
7
|
+
status: import("@angular/core").InputSignal<"error" | "success" | "idle" | "loading">;
|
|
8
8
|
result: import("@angular/core").InputSignal<ResultContent>;
|
|
9
9
|
feedbackGiven: import("@angular/core").OutputEmitterRef<"up" | "down">;
|
|
10
10
|
get elapsedSeconds(): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SbdDetailSection, SbdTrainDetail, SbdTrainLeg } from '../../models/train.types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/** Train booking details (read only): journey summary, passengers, payment and the bilingual sections to copy. */
|
|
4
|
+
export declare class SbdTrainDetailsComponent {
|
|
5
|
+
detail: import("@angular/core").InputSignal<SbdTrainDetail>;
|
|
6
|
+
bookingId: import("@angular/core").InputSignal<string>;
|
|
7
|
+
/** Same as Helix for a train booking: read only, only the non-mutating "coming soon" actions. */
|
|
8
|
+
readonly quickActions: {
|
|
9
|
+
icon: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}[];
|
|
12
|
+
private picked;
|
|
13
|
+
copied: import("@angular/core").WritableSignal<boolean>;
|
|
14
|
+
summary: import("@angular/core").Signal<import("../../models/train.types").SbdTrainSummary>;
|
|
15
|
+
sections: import("@angular/core").Signal<SbdDetailSection[]>;
|
|
16
|
+
current: import("@angular/core").Signal<SbdDetailSection>;
|
|
17
|
+
select(key: string): void;
|
|
18
|
+
meta(key: string): {
|
|
19
|
+
icon: string;
|
|
20
|
+
sub: string;
|
|
21
|
+
};
|
|
22
|
+
isReturn(leg: SbdTrainLeg): boolean;
|
|
23
|
+
private format;
|
|
24
|
+
copy(mode: 'en' | 'ar' | 'both'): void;
|
|
25
|
+
private fallbackCopy;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SbdTrainDetailsComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SbdTrainDetailsComponent, "app-sbd-train-details", never, { "detail": { "alias": "detail"; "required": true; "isSignal": true; }; "bookingId": { "alias": "bookingId"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
@@ -16,6 +16,11 @@ export interface SbdConfig {
|
|
|
16
16
|
apiBase: string;
|
|
17
17
|
/** Value of the `platform` header sent with FCR requests. Default: 'BO' */
|
|
18
18
|
platform: string;
|
|
19
|
+
/**
|
|
20
|
+
* Base URL of the API that serves the train booking details (`GET {trainApiBase}/crm/fcr/booking/{id}/details?product=trains`),
|
|
21
|
+
* e.g. Helix: '/api/v1/helix/api'. Not set = `apiBase`.
|
|
22
|
+
*/
|
|
23
|
+
trainApiBase?: string;
|
|
19
24
|
/**
|
|
20
25
|
* Base URL of the consumer web app the Reissue search redirects to, INCLUDING the language/country
|
|
21
26
|
* prefix the web requires, e.g. 'https://prelive-alpha.alm6ar.com/en/sa'. Without the prefix the web answers 404.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IBookingPackage } from '../components/hotel-cancel/interfaces/i-almatar-hotel-auto-cancellation.interface';
|
|
2
2
|
export type ProductType = 'flight' | 'hotel';
|
|
3
|
+
/** What the dashboard can look up: the FCR products plus trains (read only, own API). */
|
|
4
|
+
export type DashboardProduct = ProductType | 'train';
|
|
3
5
|
export type BookingStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
4
6
|
export interface BookingResponse {
|
|
5
7
|
data: any;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape of the train booking details, as the Helix API returns it from
|
|
3
|
+
* GET /crm/fcr/booking/{id}/details?product=trains (bilingual, already split into sections).
|
|
4
|
+
*/
|
|
5
|
+
export interface SbdDetailRow {
|
|
6
|
+
label: string;
|
|
7
|
+
labelAr: string;
|
|
8
|
+
en: string;
|
|
9
|
+
ar: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SbdDetailSection {
|
|
12
|
+
key: string;
|
|
13
|
+
title: string;
|
|
14
|
+
titleAr: string;
|
|
15
|
+
rows: SbdDetailRow[];
|
|
16
|
+
}
|
|
17
|
+
export interface SbdTrainLeg {
|
|
18
|
+
direction: string;
|
|
19
|
+
operator: string;
|
|
20
|
+
trainNumber: string;
|
|
21
|
+
fromStation: string;
|
|
22
|
+
fromCity: string;
|
|
23
|
+
toStation: string;
|
|
24
|
+
toCity: string;
|
|
25
|
+
depTime: string;
|
|
26
|
+
depDate: string;
|
|
27
|
+
arrTime: string;
|
|
28
|
+
arrDate: string;
|
|
29
|
+
duration: string;
|
|
30
|
+
fareClass: string;
|
|
31
|
+
status: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SbdPassenger {
|
|
34
|
+
type: string;
|
|
35
|
+
typeLabel: string;
|
|
36
|
+
name: string;
|
|
37
|
+
doc: string;
|
|
38
|
+
email: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SbdPayment {
|
|
41
|
+
amount: string;
|
|
42
|
+
currency: string;
|
|
43
|
+
status: string;
|
|
44
|
+
method: string;
|
|
45
|
+
date: string;
|
|
46
|
+
}
|
|
47
|
+
export interface SbdTrainSummary {
|
|
48
|
+
verified: boolean;
|
|
49
|
+
trainLegs: SbdTrainLeg[];
|
|
50
|
+
passengers: SbdPassenger[];
|
|
51
|
+
payment: SbdPayment | null;
|
|
52
|
+
}
|
|
53
|
+
export interface SbdTrainDetail {
|
|
54
|
+
configured: boolean;
|
|
55
|
+
found: boolean;
|
|
56
|
+
bookingId: string;
|
|
57
|
+
headline: string;
|
|
58
|
+
headlineAr: string;
|
|
59
|
+
summary: SbdTrainSummary | null;
|
|
60
|
+
sections: SbdDetailSection[];
|
|
61
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { ProductType } from '../../models/booking.types';
|
|
1
|
+
import { DashboardProduct, ProductType } from '../../models/booking.types';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class SmartBookingDashboardComponent {
|
|
4
4
|
private bookingService;
|
|
5
5
|
private toast;
|
|
6
6
|
/** The Reissue button is shown for flights only, and only when the host enabled the feature. */
|
|
7
7
|
protected readonly reissueEnabled: boolean;
|
|
8
|
-
product: import("@angular/core").WritableSignal<
|
|
8
|
+
product: import("@angular/core").WritableSignal<DashboardProduct>;
|
|
9
|
+
/** The product the FCR based parts (cancel, notes, actions) work on. Trains have none of them. */
|
|
10
|
+
fcrProduct: import("@angular/core").Signal<ProductType>;
|
|
9
11
|
bookingId: import("@angular/core").WritableSignal<string>;
|
|
10
|
-
bookingStatus: import("@angular/core").WritableSignal<"
|
|
12
|
+
bookingStatus: import("@angular/core").WritableSignal<"error" | "success" | "idle" | "loading">;
|
|
11
13
|
bookingData: import("@angular/core").WritableSignal<any>;
|
|
12
14
|
cancelDialogOpen: import("@angular/core").WritableSignal<boolean>;
|
|
13
15
|
hotelAutoCancelDialogOpen: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { SbdTrainDetail } from '../models/train.types';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
type ApiResponse = any;
|
|
4
5
|
export declare class SbdBookingService {
|
|
@@ -9,6 +10,8 @@ export declare class SbdBookingService {
|
|
|
9
10
|
data: ApiResponse;
|
|
10
11
|
elapsedMs: number;
|
|
11
12
|
}>;
|
|
13
|
+
/** Train booking details: bilingual sections + summary, ready to show (same API Helix uses). */
|
|
14
|
+
getTrainDetails(id: string): Observable<SbdTrainDetail>;
|
|
12
15
|
resendTicket(id: string): Observable<ApiResponse>;
|
|
13
16
|
getRefundDetails(id: string, product?: 'flight' | 'hotel', language?: 'en' | 'ar'): Observable<ApiResponse>;
|
|
14
17
|
addNote(id: string, product: 'flight' | 'hotel', message: string, action?: 'GENERAL' | 'FEEDBACK' | 'REMARK'): Observable<ApiResponse>;
|
package/package.json
CHANGED