@ancon/wildcat-utils 1.40.21 → 1.40.22
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.
|
@@ -41,6 +41,7 @@ declare enum TranslationKey {
|
|
|
41
41
|
ProcessingPayment = "processingPayment",
|
|
42
42
|
YourOrderIsBeingPrepared = "yourOrderIsBeingPrepared",
|
|
43
43
|
YourOrderIsReadyToCollect = "yourOrderIsReadyToCollect",
|
|
44
|
+
YourOrderIsReadyHostWillCollect = "yourOrderIsReadyHostWillCollect",
|
|
44
45
|
YourOrderIsBeingDelivered = "yourOrderIsBeingDelivered",
|
|
45
46
|
YourOrderHasBeenCompleted = "yourOrderHasBeenCompleted",
|
|
46
47
|
YourOrderWillArriveAtYourTable = "yourOrderWillArriveAtYourTable",
|
|
@@ -52,7 +53,9 @@ declare enum TranslationKey {
|
|
|
52
53
|
YourOrderHasBeenAcceptedPickupTime = "yourOrderHasBeenAcceptedPickupTime",
|
|
53
54
|
DeliveryWasCompleted = "deliveryWasCompleted",
|
|
54
55
|
OneItemIsReadyToCollect = "oneItemIsReadyToCollect",
|
|
56
|
+
OneItemIsReadyHostWillCollect = "oneItemIsReadyHostWillCollect",
|
|
55
57
|
MultipleItemsAreReadyToCollect = "multipleItemsAreReadyToCollect",
|
|
58
|
+
MultipleItemsAreReadyHostWillCollect = "multipleItemsAreReadyHostWillCollect",
|
|
56
59
|
EnjoyMealWhileOtherItemsBeingPrepared = "enjoyMealWhileOtherItemsBeingPrepared",
|
|
57
60
|
ThereWasAnError = "thereWasAnError",
|
|
58
61
|
YourOrderReadyToPickupFromLocker = "yourOrderReadyToPickupFromLocker"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@ancon/wildcat-types"),I=require("./getCheckoutItemsMappedByTicketItemStatus.js");var m=(e=>(e.OrderConfirmedHostWillApproveAndProcess="orderConfirmedHostWillApproveAndProcess",e.OrderConfirmedRestaurantAdminWillAcceptSoon="orderConfirmedRestaurantAdminWillAcceptSoon",e.YourOrderHasBeenApprovedByHost="yourOrderHasBeenApprovedByHost",e.OrderCanceledHostWillUpdateAndProcessAgain="orderCanceledHostWillUpdateAndProcessAgain",e.OrderCanceledYouCanManageYourOrderAgain="orderCanceledYouCanManageYourOrderAgain",e.YourOrderIsBeingProcessed="yourOrderIsBeingProcessed",e.YourOrderWasCancelled="yourOrderWasCancelled",e.ProcessingPayment="processingPayment",e.YourOrderIsBeingPrepared="yourOrderIsBeingPrepared",e.YourOrderIsReadyToCollect="yourOrderIsReadyToCollect",e.YourOrderIsReadyHostWillCollect="yourOrderIsReadyHostWillCollect",e.YourOrderIsBeingDelivered="yourOrderIsBeingDelivered",e.YourOrderHasBeenCompleted="yourOrderHasBeenCompleted",e.YourOrderWillArriveAtYourTable="yourOrderWillArriveAtYourTable",e.ModifiedDeliveryStartTime="modifiedDeliveryStartTime",e.ModifiedPickUpTime="modifiedPickUpTime",e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime="yourOrderHasBeenAcceptedEstimatedDeliveryStartTime",e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime="yourOrderIsBeingPreparedEstimatedDeliveryStartTime",e.YourOrderHasBeenAcceptedEstimatedTime="yourOrderHasBeenAcceptedEstimatedTime",e.YourOrderHasBeenAcceptedPickupTime="yourOrderHasBeenAcceptedPickupTime",e.DeliveryWasCompleted="deliveryWasCompleted",e.OneItemIsReadyToCollect="oneItemIsReadyToCollect",e.OneItemIsReadyHostWillCollect="oneItemIsReadyHostWillCollect",e.MultipleItemsAreReadyToCollect="multipleItemsAreReadyToCollect",e.MultipleItemsAreReadyHostWillCollect="multipleItemsAreReadyHostWillCollect",e.EnjoyMealWhileOtherItemsBeingPrepared="enjoyMealWhileOtherItemsBeingPrepared",e.ThereWasAnError="thereWasAnError",e.YourOrderReadyToPickupFromLocker="yourOrderReadyToPickupFromLocker",e))(m||{});function v(e){switch(e){case t.CheckoutStatus.Error:return"thereWasAnError";case t.CheckoutStatus.Created:case t.CheckoutStatus.Ready:case t.CheckoutStatus.Processing:case t.CheckoutStatus.Authorized:return"yourOrderIsBeingProcessed";case t.CheckoutStatus.Canceled:return"yourOrderWasCancelled";case t.CheckoutStatus.Received:return"processingPayment";default:return null}}function B(e){switch(e){case t.TicketStatus.Pending:case t.TicketStatus.PendingAccept:return"yourOrderIsBeingProcessed";case t.TicketStatus.Preparing:return"yourOrderIsBeingPrepared";case t.TicketStatus.Ready:return"yourOrderIsReadyToCollect";case t.TicketStatus.Closed:return"yourOrderHasBeenCompleted";case t.TicketStatus.Canceled:return"yourOrderWasCancelled";default:throw new Error(`Unhandled ticket status "${e}" in getTranslationKeyByTicketStatus()`)}}function T(e){const{isHost:o,preOrderStatus:d,preOrderAttendeeStatus:l,preOrderCancelInfo:a}=e;if(l===t.AttendeePreOrderStatus.Confirmed)switch(d){case t.PreOrderStatus.Started:{const{cancelActor:i,canceledAt:r}=a??{};return!!i&&!!r?o?"orderCanceledYouCanManageYourOrderAgain":"orderCanceledHostWillUpdateAndProcessAgain":"orderConfirmedHostWillApproveAndProcess"}case t.PreOrderStatus.Waiting:return o?"orderConfirmedRestaurantAdminWillAcceptSoon":"yourOrderHasBeenApprovedByHost"}return null}function k(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:l}){const a=(e==null?void 0:e.orderFormat)===t.OrderFormat.Delivery,i=(e==null?void 0:e.orderFormat)===t.OrderFormat.TakeAway,r=(e==null?void 0:e.orderFormat)===t.OrderFormat.TableOrder;if(a||i||r&&!l)return!1;const s=o!=null,n=d!=null;if(s){const c=o===t.CheckoutStatus.Captured,u=o===t.CheckoutStatus.InProgress;return c||u}if(n){const c=d===t.TicketStatus.Preparing,u=d===t.TicketStatus.Ready;return c||u}return!1}function H(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:l,pickupTimeUpdated:a,preOrderOptions:i},r){const s=i&&!i.isHost;if(r&&k(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:l})){if(r.ready>0)return r.ready<2?s?["oneItemIsReadyHostWillCollect"]:["oneItemIsReadyToCollect"]:s?r.ready===r.all?["yourOrderIsReadyHostWillCollect"]:["multipleItemsAreReadyHostWillCollect",{count:r.ready}]:["multipleItemsAreReadyToCollect",{count:r.ready}];if(r.done>0&&r.done<r.all)return["enjoyMealWhileOtherItemsBeingPrepared",{count:Math.max(0,r.all-r.done-r.ready)}]}if(d!=null)return[B(d)];if(i&&(o===t.CheckoutStatus.Created||o===t.CheckoutStatus.Authorized)){const g=T(i);if(g)return[g]}const n=(e==null?void 0:e.orderFormat)===t.OrderFormat.Delivery,c=v(o);if(c)return[c];const u=o===t.CheckoutStatus.Captured,f=o===t.CheckoutStatus.InProgress,h=o===t.CheckoutStatus.Done,P=o===t.CheckoutStatus.DeliveryInProgress,A=o===t.CheckoutStatus.ReadyToCollect,p=(e==null?void 0:e.orderFormat)===t.OrderFormat.EatIn,y=(e==null?void 0:e.orderFormat)===t.OrderFormat.TakeAway,O=(e==null?void 0:e.orderFormat)===t.OrderFormat.TableOrder,C=(e==null?void 0:e.orderFormat)===t.OrderFormat.BoxPickup;if(u){if(O&&!l)return["yourOrderWillArriveAtYourTable"];if(n)return a?["modifiedDeliveryStartTime"]:["yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"];if(a)return["modifiedPickUpTime"];if(r&&s&&(p||y)){if(r.ready===r.all)return["yourOrderIsReadyHostWillCollect"];if(r.done===r.all)return["yourOrderHasBeenCompleted"]}return["yourOrderHasBeenAcceptedPickupTime"]}if(f){if(n)return a?["modifiedDeliveryStartTime"]:["yourOrderIsBeingPreparedEstimatedDeliveryStartTime"];if(r&&(p||y)){if(r.ready===r.all)return["yourOrderIsReadyToCollect"];if(r.done===r.all)return["yourOrderHasBeenCompleted"]}if(O){if(r){if(r.ready===r.all)return l?["yourOrderIsReadyToCollect"]:["yourOrderWillArriveAtYourTable"];if(r.done===r.all)return l?["yourOrderHasBeenCompleted"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:l?["yourOrderIsBeingPrepared"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:["yourOrderIsBeingPrepared"]}if(h)return p||y?["yourOrderHasBeenCompleted"]:n?["deliveryWasCompleted"]:["yourOrderHasBeenCompleted"];if(P&&C)switch(e==null?void 0:e.deliveryStatus){case t.CheckoutDeliveryStatus.PickedUp:return["yourOrderHasBeenCompleted"];case t.CheckoutDeliveryStatus.Delivered:return["yourOrderReadyToPickupFromLocker"];default:return["yourOrderIsBeingPrepared"]}if(A)return n?["yourOrderIsBeingDelivered"]:C?["yourOrderReadyToPickupFromLocker"]:r&&s&&(p||y)&&r.done===r.all?["yourOrderHasBeenCompleted"]:["yourOrderIsReadyToCollect"];throw new Error("Could not resolve translation key in getTranslationKey()")}const S={orderConfirmedHostWillApproveAndProcess:()=>({title:`Order confirmed!
|
|
2
2
|
The host will approve and process the pre-order.`,message:"Please contact the host if you want to edit your order."}),orderConfirmedRestaurantAdminWillAcceptSoon:()=>({title:`Order confirmed!
|
|
3
3
|
The restaurant admin will accept your pre-order soon.`}),yourOrderHasBeenApprovedByHost:()=>({title:"Your order has been approved by host!",message:"The restaurant admin will accept and process the pre-order"}),orderCanceledHostWillUpdateAndProcessAgain:()=>({title:`Order canceled!
|
|
4
4
|
The host will update and process the pre-order again.`,message:"Please contact the host if you want to edit your order."}),orderCanceledYouCanManageYourOrderAgain:()=>({title:`Order canceled!
|
|
5
|
-
You can manage your order.`,message:"Please update and process the pre-order again."}),yourOrderIsBeingProcessed:()=>({title:"Your order is being processed"}),yourOrderWasCancelled:()=>({title:"Your order was canceled",message:"Sorry. Your order could not go through."}),processingPayment:()=>({title:"Processing payment",message:"Please wait while your payment is being processed"}),yourOrderIsBeingPrepared:()=>({title:"Your order is now being prepared!",message:"We will let you know when it is ready for pickup."}),yourOrderIsReadyToCollect:()=>({title:"Your order is ready to be collected!",message:"Please go ahead and show this screen at the collection point"}),yourOrderIsBeingDelivered:()=>({title:"Your order is being delivered",message:"It will arrive at your door shortly. Enjoy your meal!"}),yourOrderHasBeenCompleted:()=>({title:"Enjoy your meal!",message:"Your order has been completed!"}),yourOrderWillArriveAtYourTable:()=>({title:"Your order has been accepted!",message:"It will arrive at your table shortly"}),modifiedDeliveryStartTime:()=>({title:"Your delivery time was modified",message:"Delivery will start at approximately 00:00."}),modifiedPickUpTime:()=>({title:"Your pickup time was modified",message:"Pickup time: 00:00"}),yourOrderHasBeenAcceptedEstimatedDeliveryStartTime:()=>({title:"Your order has been accepted",message:"Estimated delivery start time: 00:00"}),yourOrderIsBeingPreparedEstimatedDeliveryStartTime:()=>({title:"Your order is now being prepared!",message:"Estimated delivery start time: 00:00"}),yourOrderHasBeenAcceptedEstimatedTime:()=>({title:"Your order has been accepted",message:"Estimated time: 00:00"}),yourOrderHasBeenAcceptedPickupTime:()=>({title:"Your order has been accepted",message:"Pickup time: 00:00"}),deliveryWasCompleted:()=>({title:"Your order was completed",message:"Enjoy your meal!"}),oneItemIsReadyToCollect:()=>({title:"One item is ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared item has been successfully issued."}),multipleItemsAreReadyToCollect:()=>({title:"Multiple items are ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared items have been successfully issued."}),enjoyMealWhileOtherItemsBeingPrepared:({meta:e})=>({title:"Enjoy your meal while the rest of the items are being prepared!",message:`${e.count} more items are being prepared`}),thereWasAnError:()=>({title:"Checkout error",message:"There was an error with the checkout"}),yourOrderReadyToPickupFromLocker:()=>({title:"Your order is ready to pick up from the locker!"})};function
|
|
5
|
+
You can manage your order.`,message:"Please update and process the pre-order again."}),yourOrderIsBeingProcessed:()=>({title:"Your order is being processed"}),yourOrderWasCancelled:()=>({title:"Your order was canceled",message:"Sorry. Your order could not go through."}),processingPayment:()=>({title:"Processing payment",message:"Please wait while your payment is being processed"}),yourOrderIsBeingPrepared:()=>({title:"Your order is now being prepared!",message:"We will let you know when it is ready for pickup."}),yourOrderIsReadyToCollect:()=>({title:"Your order is ready to be collected!",message:"Please go ahead and show this screen at the collection point"}),yourOrderIsReadyHostWillCollect:()=>({title:"Your order is ready to be collected!",message:"Host will collect your order at the collection point"}),yourOrderIsBeingDelivered:()=>({title:"Your order is being delivered",message:"It will arrive at your door shortly. Enjoy your meal!"}),yourOrderHasBeenCompleted:()=>({title:"Enjoy your meal!",message:"Your order has been completed!"}),yourOrderWillArriveAtYourTable:()=>({title:"Your order has been accepted!",message:"It will arrive at your table shortly"}),modifiedDeliveryStartTime:()=>({title:"Your delivery time was modified",message:"Delivery will start at approximately 00:00."}),modifiedPickUpTime:()=>({title:"Your pickup time was modified",message:"Pickup time: 00:00"}),yourOrderHasBeenAcceptedEstimatedDeliveryStartTime:()=>({title:"Your order has been accepted",message:"Estimated delivery start time: 00:00"}),yourOrderIsBeingPreparedEstimatedDeliveryStartTime:()=>({title:"Your order is now being prepared!",message:"Estimated delivery start time: 00:00"}),yourOrderHasBeenAcceptedEstimatedTime:()=>({title:"Your order has been accepted",message:"Estimated time: 00:00"}),yourOrderHasBeenAcceptedPickupTime:()=>({title:"Your order has been accepted",message:"Pickup time: 00:00"}),deliveryWasCompleted:()=>({title:"Your order was completed",message:"Enjoy your meal!"}),oneItemIsReadyToCollect:()=>({title:"One item is ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared item has been successfully issued."}),oneItemIsReadyHostWillCollect:()=>({title:"One item is ready to pick up!",message:"Host will collect your order and confirm that the prepared item has been successfully issued."}),multipleItemsAreReadyToCollect:()=>({title:"Multiple items are ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared items have been successfully issued."}),multipleItemsAreReadyHostWillCollect:()=>({title:"Multiple items are ready to pick up!",message:"Host will collect your order and confirm that the prepared items have been successfully issued."}),enjoyMealWhileOtherItemsBeingPrepared:({meta:e})=>({title:"Enjoy your meal while the rest of the items are being prepared!",message:`${e.count} more items are being prepared`}),thereWasAnError:()=>({title:"Checkout error",message:"There was an error with the checkout"}),yourOrderReadyToPickupFromLocker:()=>({title:"Your order is ready to pick up from the locker!"})};function W(e,o){if(o)return;const d=I(e);return{all:d.all.length,ready:d.ready.length,done:d.done.length}}function Y(e,o,d=S){const{isSkipTicketStatus:l}=o,a=W((e==null?void 0:e.items)??[],l),[i,r]=H(e,o,a),s=d[i]({key:i,meta:r});if(!s)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[s,i]}exports.TranslationKey=m;exports.default=Y;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CheckoutStatus as o, OrderFormat as c, CheckoutDeliveryStatus as
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
import { CheckoutStatus as o, OrderFormat as c, CheckoutDeliveryStatus as P, TicketStatus as n, AttendeePreOrderStatus as H, PreOrderStatus as A } from "@ancon/wildcat-types";
|
|
2
|
+
import W from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
3
|
+
var T = /* @__PURE__ */ ((e) => (e.OrderConfirmedHostWillApproveAndProcess = "orderConfirmedHostWillApproveAndProcess", e.OrderConfirmedRestaurantAdminWillAcceptSoon = "orderConfirmedRestaurantAdminWillAcceptSoon", e.YourOrderHasBeenApprovedByHost = "yourOrderHasBeenApprovedByHost", e.OrderCanceledHostWillUpdateAndProcessAgain = "orderCanceledHostWillUpdateAndProcessAgain", e.OrderCanceledYouCanManageYourOrderAgain = "orderCanceledYouCanManageYourOrderAgain", e.YourOrderIsBeingProcessed = "yourOrderIsBeingProcessed", e.YourOrderWasCancelled = "yourOrderWasCancelled", e.ProcessingPayment = "processingPayment", e.YourOrderIsBeingPrepared = "yourOrderIsBeingPrepared", e.YourOrderIsReadyToCollect = "yourOrderIsReadyToCollect", e.YourOrderIsReadyHostWillCollect = "yourOrderIsReadyHostWillCollect", e.YourOrderIsBeingDelivered = "yourOrderIsBeingDelivered", e.YourOrderHasBeenCompleted = "yourOrderHasBeenCompleted", e.YourOrderWillArriveAtYourTable = "yourOrderWillArriveAtYourTable", e.ModifiedDeliveryStartTime = "modifiedDeliveryStartTime", e.ModifiedPickUpTime = "modifiedPickUpTime", e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime = "yourOrderHasBeenAcceptedEstimatedDeliveryStartTime", e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime = "yourOrderIsBeingPreparedEstimatedDeliveryStartTime", e.YourOrderHasBeenAcceptedEstimatedTime = "yourOrderHasBeenAcceptedEstimatedTime", e.YourOrderHasBeenAcceptedPickupTime = "yourOrderHasBeenAcceptedPickupTime", e.DeliveryWasCompleted = "deliveryWasCompleted", e.OneItemIsReadyToCollect = "oneItemIsReadyToCollect", e.OneItemIsReadyHostWillCollect = "oneItemIsReadyHostWillCollect", e.MultipleItemsAreReadyToCollect = "multipleItemsAreReadyToCollect", e.MultipleItemsAreReadyHostWillCollect = "multipleItemsAreReadyHostWillCollect", e.EnjoyMealWhileOtherItemsBeingPrepared = "enjoyMealWhileOtherItemsBeingPrepared", e.ThereWasAnError = "thereWasAnError", e.YourOrderReadyToPickupFromLocker = "yourOrderReadyToPickupFromLocker", e))(T || {});
|
|
4
|
+
function Y(e) {
|
|
5
5
|
switch (e) {
|
|
6
6
|
case o.Error:
|
|
7
7
|
return "thereWasAnError";
|
|
@@ -18,18 +18,18 @@ function w(e) {
|
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function w(e) {
|
|
22
22
|
switch (e) {
|
|
23
|
-
case
|
|
24
|
-
case
|
|
23
|
+
case n.Pending:
|
|
24
|
+
case n.PendingAccept:
|
|
25
25
|
return "yourOrderIsBeingProcessed";
|
|
26
|
-
case
|
|
26
|
+
case n.Preparing:
|
|
27
27
|
return "yourOrderIsBeingPrepared";
|
|
28
|
-
case
|
|
28
|
+
case n.Ready:
|
|
29
29
|
return "yourOrderIsReadyToCollect";
|
|
30
|
-
case
|
|
30
|
+
case n.Closed:
|
|
31
31
|
return "yourOrderHasBeenCompleted";
|
|
32
|
-
case
|
|
32
|
+
case n.Canceled:
|
|
33
33
|
return "yourOrderWasCancelled";
|
|
34
34
|
default:
|
|
35
35
|
throw new Error(
|
|
@@ -37,13 +37,13 @@ function W(e) {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const { isHost: t, preOrderStatus: d, preOrderAttendeeStatus:
|
|
42
|
-
if (
|
|
40
|
+
function R(e) {
|
|
41
|
+
const { isHost: t, preOrderStatus: d, preOrderAttendeeStatus: l, preOrderCancelInfo: a } = e;
|
|
42
|
+
if (l === H.Confirmed)
|
|
43
43
|
switch (d) {
|
|
44
44
|
case A.Started: {
|
|
45
|
-
const { cancelActor:
|
|
46
|
-
return !!
|
|
45
|
+
const { cancelActor: i, canceledAt: r } = a ?? {};
|
|
46
|
+
return !!i && !!r ? t ? "orderCanceledYouCanManageYourOrderAgain" : "orderCanceledHostWillUpdateAndProcessAgain" : "orderConfirmedHostWillApproveAndProcess";
|
|
47
47
|
}
|
|
48
48
|
case A.Waiting:
|
|
49
49
|
return t ? "orderConfirmedRestaurantAdminWillAcceptSoon" : "yourOrderHasBeenApprovedByHost";
|
|
@@ -53,38 +53,48 @@ function H(e) {
|
|
|
53
53
|
function k(e, {
|
|
54
54
|
checkoutStatus: t,
|
|
55
55
|
ticketStatus: d,
|
|
56
|
-
customersFetchTableOrders:
|
|
56
|
+
customersFetchTableOrders: l
|
|
57
57
|
}) {
|
|
58
|
-
const a = (e == null ? void 0 : e.orderFormat) === c.Delivery,
|
|
59
|
-
if (a ||
|
|
58
|
+
const a = (e == null ? void 0 : e.orderFormat) === c.Delivery, i = (e == null ? void 0 : e.orderFormat) === c.TakeAway, r = (e == null ? void 0 : e.orderFormat) === c.TableOrder;
|
|
59
|
+
if (a || i || r && !l)
|
|
60
60
|
return !1;
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
return
|
|
61
|
+
const s = t != null, u = d != null;
|
|
62
|
+
if (s) {
|
|
63
|
+
const p = t === o.Captured, y = t === o.InProgress;
|
|
64
|
+
return p || y;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
return
|
|
66
|
+
if (u) {
|
|
67
|
+
const p = d === n.Preparing, y = d === n.Ready;
|
|
68
|
+
return p || y;
|
|
69
69
|
}
|
|
70
70
|
return !1;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function b(e, {
|
|
73
73
|
checkoutStatus: t,
|
|
74
74
|
ticketStatus: d,
|
|
75
|
-
customersFetchTableOrders:
|
|
75
|
+
customersFetchTableOrders: l,
|
|
76
76
|
pickupTimeUpdated: a,
|
|
77
|
-
preOrderOptions:
|
|
77
|
+
preOrderOptions: i
|
|
78
78
|
}, r) {
|
|
79
|
+
const s = i && !i.isHost;
|
|
79
80
|
if (r && k(e, {
|
|
80
81
|
checkoutStatus: t,
|
|
81
82
|
ticketStatus: d,
|
|
82
|
-
customersFetchTableOrders:
|
|
83
|
+
customersFetchTableOrders: l
|
|
83
84
|
})) {
|
|
84
85
|
if (r.ready > 0)
|
|
85
|
-
return r.ready < 2 ? [
|
|
86
|
+
return r.ready < 2 ? s ? [
|
|
87
|
+
"oneItemIsReadyHostWillCollect"
|
|
88
|
+
/* OneItemIsReadyHostWillCollect */
|
|
89
|
+
] : [
|
|
86
90
|
"oneItemIsReadyToCollect"
|
|
87
91
|
/* OneItemIsReadyToCollect */
|
|
92
|
+
] : s ? r.ready === r.all ? [
|
|
93
|
+
"yourOrderIsReadyHostWillCollect"
|
|
94
|
+
/* YourOrderIsReadyHostWillCollect */
|
|
95
|
+
] : [
|
|
96
|
+
"multipleItemsAreReadyHostWillCollect",
|
|
97
|
+
{ count: r.ready }
|
|
88
98
|
] : [
|
|
89
99
|
"multipleItemsAreReadyToCollect",
|
|
90
100
|
{ count: r.ready }
|
|
@@ -96,35 +106,54 @@ function R(e, {
|
|
|
96
106
|
];
|
|
97
107
|
}
|
|
98
108
|
if (d != null)
|
|
99
|
-
return [
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
return [
|
|
109
|
+
return [w(d)];
|
|
110
|
+
if (i && (t === o.Created || t === o.Authorized)) {
|
|
111
|
+
const C = R(i);
|
|
112
|
+
if (C)
|
|
113
|
+
return [C];
|
|
104
114
|
}
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
return [
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
const u = (e == null ? void 0 : e.orderFormat) === c.Delivery, p = Y(t);
|
|
116
|
+
if (p)
|
|
117
|
+
return [p];
|
|
118
|
+
const y = t === o.Captured, I = t === o.InProgress, h = t === o.Done, B = t === o.DeliveryInProgress, v = t === o.ReadyToCollect, f = (e == null ? void 0 : e.orderFormat) === c.EatIn, g = (e == null ? void 0 : e.orderFormat) === c.TakeAway, O = (e == null ? void 0 : e.orderFormat) === c.TableOrder, m = (e == null ? void 0 : e.orderFormat) === c.BoxPickup;
|
|
119
|
+
if (y) {
|
|
120
|
+
if (O && !l)
|
|
121
|
+
return [
|
|
122
|
+
"yourOrderWillArriveAtYourTable"
|
|
123
|
+
/* YourOrderWillArriveAtYourTable */
|
|
124
|
+
];
|
|
125
|
+
if (u)
|
|
126
|
+
return a ? [
|
|
127
|
+
"modifiedDeliveryStartTime"
|
|
128
|
+
/* ModifiedDeliveryStartTime */
|
|
129
|
+
] : [
|
|
130
|
+
"yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"
|
|
131
|
+
/* YourOrderHasBeenAcceptedEstimatedDeliveryStartTime */
|
|
132
|
+
];
|
|
133
|
+
if (a)
|
|
134
|
+
return [
|
|
135
|
+
"modifiedPickUpTime"
|
|
136
|
+
/* ModifiedPickUpTime */
|
|
137
|
+
];
|
|
138
|
+
if (r && s && (f || g)) {
|
|
139
|
+
if (r.ready === r.all)
|
|
140
|
+
return [
|
|
141
|
+
"yourOrderIsReadyHostWillCollect"
|
|
142
|
+
/* YourOrderIsReadyHostWillCollect */
|
|
143
|
+
];
|
|
144
|
+
if (r.done === r.all)
|
|
145
|
+
return [
|
|
146
|
+
"yourOrderHasBeenCompleted"
|
|
147
|
+
/* YourOrderHasBeenCompleted */
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
return [
|
|
123
151
|
"yourOrderHasBeenAcceptedPickupTime"
|
|
124
152
|
/* YourOrderHasBeenAcceptedPickupTime */
|
|
125
153
|
];
|
|
126
|
-
|
|
127
|
-
|
|
154
|
+
}
|
|
155
|
+
if (I) {
|
|
156
|
+
if (u)
|
|
128
157
|
return a ? [
|
|
129
158
|
"modifiedDeliveryStartTime"
|
|
130
159
|
/* ModifiedDeliveryStartTime */
|
|
@@ -132,7 +161,7 @@ function R(e, {
|
|
|
132
161
|
"yourOrderIsBeingPreparedEstimatedDeliveryStartTime"
|
|
133
162
|
/* YourOrderIsBeingPreparedEstimatedDeliveryStartTime */
|
|
134
163
|
];
|
|
135
|
-
if (r && (
|
|
164
|
+
if (r && (f || g)) {
|
|
136
165
|
if (r.ready === r.all)
|
|
137
166
|
return [
|
|
138
167
|
"yourOrderIsReadyToCollect"
|
|
@@ -144,10 +173,10 @@ function R(e, {
|
|
|
144
173
|
/* YourOrderHasBeenCompleted */
|
|
145
174
|
];
|
|
146
175
|
}
|
|
147
|
-
if (
|
|
176
|
+
if (O) {
|
|
148
177
|
if (r) {
|
|
149
178
|
if (r.ready === r.all)
|
|
150
|
-
return
|
|
179
|
+
return l ? [
|
|
151
180
|
"yourOrderIsReadyToCollect"
|
|
152
181
|
/* YourOrderIsReadyToCollect */
|
|
153
182
|
] : [
|
|
@@ -155,7 +184,7 @@ function R(e, {
|
|
|
155
184
|
/* YourOrderWillArriveAtYourTable */
|
|
156
185
|
];
|
|
157
186
|
if (r.done === r.all)
|
|
158
|
-
return
|
|
187
|
+
return l ? [
|
|
159
188
|
"yourOrderHasBeenCompleted"
|
|
160
189
|
/* YourOrderHasBeenCompleted */
|
|
161
190
|
] : [
|
|
@@ -166,7 +195,7 @@ function R(e, {
|
|
|
166
195
|
return a ? [
|
|
167
196
|
"modifiedPickUpTime"
|
|
168
197
|
/* ModifiedPickUpTime */
|
|
169
|
-
] :
|
|
198
|
+
] : l ? [
|
|
170
199
|
"yourOrderIsBeingPrepared"
|
|
171
200
|
/* YourOrderIsBeingPrepared */
|
|
172
201
|
] : [
|
|
@@ -183,24 +212,24 @@ function R(e, {
|
|
|
183
212
|
];
|
|
184
213
|
}
|
|
185
214
|
if (h)
|
|
186
|
-
return
|
|
215
|
+
return f || g ? [
|
|
187
216
|
"yourOrderHasBeenCompleted"
|
|
188
217
|
/* YourOrderHasBeenCompleted */
|
|
189
|
-
] :
|
|
218
|
+
] : u ? [
|
|
190
219
|
"deliveryWasCompleted"
|
|
191
220
|
/* DeliveryWasCompleted */
|
|
192
221
|
] : [
|
|
193
222
|
"yourOrderHasBeenCompleted"
|
|
194
223
|
/* YourOrderHasBeenCompleted */
|
|
195
224
|
];
|
|
196
|
-
if (B &&
|
|
225
|
+
if (B && m)
|
|
197
226
|
switch (e == null ? void 0 : e.deliveryStatus) {
|
|
198
|
-
case
|
|
227
|
+
case P.PickedUp:
|
|
199
228
|
return [
|
|
200
229
|
"yourOrderHasBeenCompleted"
|
|
201
230
|
/* YourOrderHasBeenCompleted */
|
|
202
231
|
];
|
|
203
|
-
case
|
|
232
|
+
case P.Delivered:
|
|
204
233
|
return [
|
|
205
234
|
"yourOrderReadyToPickupFromLocker"
|
|
206
235
|
/* YourOrderReadyToPickupFromLocker */
|
|
@@ -212,12 +241,15 @@ function R(e, {
|
|
|
212
241
|
];
|
|
213
242
|
}
|
|
214
243
|
if (v)
|
|
215
|
-
return
|
|
244
|
+
return u ? [
|
|
216
245
|
"yourOrderIsBeingDelivered"
|
|
217
246
|
/* YourOrderIsBeingDelivered */
|
|
218
|
-
] :
|
|
247
|
+
] : m ? [
|
|
219
248
|
"yourOrderReadyToPickupFromLocker"
|
|
220
249
|
/* YourOrderReadyToPickupFromLocker */
|
|
250
|
+
] : r && s && (f || g) && r.done === r.all ? [
|
|
251
|
+
"yourOrderHasBeenCompleted"
|
|
252
|
+
/* YourOrderHasBeenCompleted */
|
|
221
253
|
] : [
|
|
222
254
|
"yourOrderIsReadyToCollect"
|
|
223
255
|
/* YourOrderIsReadyToCollect */
|
|
@@ -267,6 +299,10 @@ You can manage your order.`,
|
|
|
267
299
|
title: "Your order is ready to be collected!",
|
|
268
300
|
message: "Please go ahead and show this screen at the collection point"
|
|
269
301
|
}),
|
|
302
|
+
yourOrderIsReadyHostWillCollect: () => ({
|
|
303
|
+
title: "Your order is ready to be collected!",
|
|
304
|
+
message: "Host will collect your order at the collection point"
|
|
305
|
+
}),
|
|
270
306
|
yourOrderIsBeingDelivered: () => ({
|
|
271
307
|
title: "Your order is being delivered",
|
|
272
308
|
message: "It will arrive at your door shortly. Enjoy your meal!"
|
|
@@ -311,10 +347,18 @@ You can manage your order.`,
|
|
|
311
347
|
title: "One item is ready to pick up!",
|
|
312
348
|
message: "Please allow cashier or waiter to confirm that the prepared item has been successfully issued."
|
|
313
349
|
}),
|
|
350
|
+
oneItemIsReadyHostWillCollect: () => ({
|
|
351
|
+
title: "One item is ready to pick up!",
|
|
352
|
+
message: "Host will collect your order and confirm that the prepared item has been successfully issued."
|
|
353
|
+
}),
|
|
314
354
|
multipleItemsAreReadyToCollect: () => ({
|
|
315
355
|
title: "Multiple items are ready to pick up!",
|
|
316
356
|
message: "Please allow cashier or waiter to confirm that the prepared items have been successfully issued."
|
|
317
357
|
}),
|
|
358
|
+
multipleItemsAreReadyHostWillCollect: () => ({
|
|
359
|
+
title: "Multiple items are ready to pick up!",
|
|
360
|
+
message: "Host will collect your order and confirm that the prepared items have been successfully issued."
|
|
361
|
+
}),
|
|
318
362
|
enjoyMealWhileOtherItemsBeingPrepared: ({ meta: e }) => ({
|
|
319
363
|
title: "Enjoy your meal while the rest of the items are being prepared!",
|
|
320
364
|
message: `${e.count} more items are being prepared`
|
|
@@ -330,23 +374,23 @@ You can manage your order.`,
|
|
|
330
374
|
function E(e, t) {
|
|
331
375
|
if (t)
|
|
332
376
|
return;
|
|
333
|
-
const d =
|
|
377
|
+
const d = W(e);
|
|
334
378
|
return {
|
|
335
379
|
all: d.all.length,
|
|
336
380
|
ready: d.ready.length,
|
|
337
381
|
done: d.done.length
|
|
338
382
|
};
|
|
339
383
|
}
|
|
340
|
-
function
|
|
341
|
-
const { isSkipTicketStatus:
|
|
384
|
+
function F(e, t, d = D) {
|
|
385
|
+
const { isSkipTicketStatus: l } = t, a = E(
|
|
342
386
|
(e == null ? void 0 : e.items) ?? [],
|
|
343
|
-
|
|
344
|
-
), [
|
|
345
|
-
if (!
|
|
387
|
+
l
|
|
388
|
+
), [i, r] = b(e, t, a), s = d[i]({ key: i, meta: r });
|
|
389
|
+
if (!s)
|
|
346
390
|
throw new Error("Could not resolve translation in getOrderStatusTexts()");
|
|
347
|
-
return [
|
|
391
|
+
return [s, i];
|
|
348
392
|
}
|
|
349
393
|
export {
|
|
350
|
-
|
|
351
|
-
|
|
394
|
+
T as TranslationKey,
|
|
395
|
+
F as default
|
|
352
396
|
};
|