@kiminix/tp-client 1.2.0 → 1.4.0
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/dist/enum.d.ts
CHANGED
|
@@ -13,3 +13,10 @@ export declare enum TimelineDirection {
|
|
|
13
13
|
Past = "past",
|
|
14
14
|
Next = "next"
|
|
15
15
|
}
|
|
16
|
+
export declare enum ReservationEventKind {
|
|
17
|
+
Confirmed = "confirmed",
|
|
18
|
+
Missed = "missed",
|
|
19
|
+
CanceledUser = "canceled_user",
|
|
20
|
+
CanceledBusiness = "canceled_business",
|
|
21
|
+
Updated = "updated"
|
|
22
|
+
}
|
package/dist/enum.js
CHANGED
|
@@ -16,3 +16,11 @@ export var TimelineDirection;
|
|
|
16
16
|
TimelineDirection["Past"] = "past";
|
|
17
17
|
TimelineDirection["Next"] = "next";
|
|
18
18
|
})(TimelineDirection || (TimelineDirection = {}));
|
|
19
|
+
export var ReservationEventKind;
|
|
20
|
+
(function (ReservationEventKind) {
|
|
21
|
+
ReservationEventKind["Confirmed"] = "confirmed";
|
|
22
|
+
ReservationEventKind["Missed"] = "missed";
|
|
23
|
+
ReservationEventKind["CanceledUser"] = "canceled_user";
|
|
24
|
+
ReservationEventKind["CanceledBusiness"] = "canceled_business";
|
|
25
|
+
ReservationEventKind["Updated"] = "updated";
|
|
26
|
+
})(ReservationEventKind || (ReservationEventKind = {}));
|
package/dist/menus/apis.js
CHANGED
|
@@ -44,7 +44,7 @@ var MenusAPIs = /** @class */ (function () {
|
|
|
44
44
|
return __awaiter(this, void 0, void 0, function () {
|
|
45
45
|
return __generator(this, function (_a) {
|
|
46
46
|
switch (_a.label) {
|
|
47
|
-
case 0: return [4 /*yield*/, axios.get(base + "/business/".concat(businessId, "/
|
|
47
|
+
case 0: return [4 /*yield*/, axios.get(base + "/business/".concat(businessId, "/preset_menus"))
|
|
48
48
|
.then(function (response) {
|
|
49
49
|
return response.data;
|
|
50
50
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReservationStatus } from "../../enum";
|
|
1
|
+
import { ReservationEventKind, ReservationStatus } from "../../enum";
|
|
2
2
|
export interface Business {
|
|
3
3
|
id: string;
|
|
4
4
|
identifier: string;
|
|
@@ -20,16 +20,15 @@ export interface GuestDetails {
|
|
|
20
20
|
}
|
|
21
21
|
export interface OnMenuCommand {
|
|
22
22
|
id: string;
|
|
23
|
-
|
|
23
|
+
presetMenuId: string;
|
|
24
24
|
title: string;
|
|
25
25
|
adults: GuestDetails;
|
|
26
26
|
children?: GuestDetails;
|
|
27
27
|
deal: string;
|
|
28
28
|
}
|
|
29
29
|
export interface ReservationEvent {
|
|
30
|
-
|
|
30
|
+
kind: ReservationEventKind;
|
|
31
31
|
at: string;
|
|
32
|
-
message?: string;
|
|
33
32
|
}
|
|
34
33
|
export interface Reservation {
|
|
35
34
|
id: string;
|
|
@@ -43,4 +42,16 @@ export interface Reservation {
|
|
|
43
42
|
onMenuCommands: OnMenuCommand[];
|
|
44
43
|
deposit?: number;
|
|
45
44
|
events?: ReservationEvent[];
|
|
45
|
+
notes?: string;
|
|
46
|
+
cancellation?: Cancellation;
|
|
46
47
|
}
|
|
48
|
+
export interface Cancellation {
|
|
49
|
+
reason: CancellationReason;
|
|
50
|
+
notes?: string;
|
|
51
|
+
}
|
|
52
|
+
declare enum CancellationReason {
|
|
53
|
+
CustomerRequest = "customer_request",
|
|
54
|
+
UnreachableCustomer = "unreachable_customer",
|
|
55
|
+
Other = "other"
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
var CancellationReason;
|
|
2
|
+
(function (CancellationReason) {
|
|
3
|
+
CancellationReason["CustomerRequest"] = "customer_request";
|
|
4
|
+
CancellationReason["UnreachableCustomer"] = "unreachable_customer";
|
|
5
|
+
CancellationReason["Other"] = "other";
|
|
6
|
+
})(CancellationReason || (CancellationReason = {}));
|
|
1
7
|
export {};
|
|
@@ -11,7 +11,7 @@ export declare function isDayBefore(date: Date, dateToCompare: Date, include?: B
|
|
|
11
11
|
* @param options
|
|
12
12
|
*/
|
|
13
13
|
export declare function toString(date: string, options?: Intl.DateTimeFormatOptions): string;
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function toTunisiaLocale(date: string): string;
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
17
|
* @param date
|
package/dist/utils/date-utils.js
CHANGED
|
@@ -53,7 +53,9 @@ export function toString(date, options) {
|
|
|
53
53
|
);
|
|
54
54
|
return parseISO(date).toLocaleDateString("fr-FR", mergedOptions);
|
|
55
55
|
}
|
|
56
|
-
export function
|
|
56
|
+
export function toTunisiaLocale(date) {
|
|
57
|
+
// This is how we get Timezone auto from user OS, but for simplicity we will use Africa/Tunis
|
|
58
|
+
// const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
57
59
|
// request a weekday along with a long date. ex: 25 juin 2022 10:30
|
|
58
60
|
var options = {
|
|
59
61
|
year: "numeric",
|
|
@@ -61,9 +63,9 @@ export function toLocaleTime(date) {
|
|
|
61
63
|
day: "numeric",
|
|
62
64
|
hour: '2-digit',
|
|
63
65
|
minute: '2-digit',
|
|
64
|
-
timeZone: 'Africa/Tunis'
|
|
66
|
+
timeZone: 'Africa/Tunis'
|
|
65
67
|
};
|
|
66
|
-
return parseISO(date).
|
|
68
|
+
return parseISO(date).toLocaleString("fr-FR", options);
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
71
|
*
|