@ancon/wildcat-utils 1.44.14 → 1.44.15
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.
|
@@ -47,6 +47,7 @@ declare enum TranslationKey {
|
|
|
47
47
|
YourOrderIsReadyToCollect = "yourOrderIsReadyToCollect",
|
|
48
48
|
YourOrderIsReadyHostWillCollect = "yourOrderIsReadyHostWillCollect",
|
|
49
49
|
YourOrderIsBeingDelivered = "yourOrderIsBeingDelivered",
|
|
50
|
+
YourOrderIsReadyWillBringToYourTableSoon = "yourOrderIsReadyWillBringToYourTableSoon",
|
|
50
51
|
YourOrderHasBeenCompleted = "yourOrderHasBeenCompleted",
|
|
51
52
|
YourOrderWillArriveAtYourTable = "yourOrderWillArriveAtYourTable",
|
|
52
53
|
ModifiedDeliveryStartTime = "modifiedDeliveryStartTime",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@ancon/wildcat-types"),A=require("../order/getCheckOrderItemsMappedByTicketItemStatus.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@ancon/wildcat-types"),A=require("../order/getCheckOrderItemsMappedByTicketItemStatus.js"),B=require("./getCheckoutItemsMappedByTicketItemStatus.js"),k=require("./isWoltDeliveryInProgress.js");require("../order/getCheckOrderMinimumStatusTicketItem.js");require("../toString-9eae9442.js");require("../isArray-640f9811.js");require("../_baseIteratee-075c204c.js");require("../_getTag-b8923c48.js");require("../_baseIsEqual-bcac9024.js");require("../identity-1bae7cf8.js");require("../order/getMultiProductSubProductsTicketItems.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.YourOrderIsReadyWillBringToYourTableSoon="yourOrderIsReadyWillBringToYourTableSoon",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 T(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 S(e){const{isHost:o,preOrderStatus:d,preOrderAttendeeStatus:l,preOrderCancelInfo:i}=e;if(l===t.AttendeePreOrderStatus.Confirmed)switch(d){case t.PreOrderStatus.Started:{const{cancelActor:a,canceledAt:r}=i??{};return!!a&&!!r?o?"orderCanceledYouCanManageYourOrderAgain":"orderCanceledHostWillUpdateAndProcessAgain":"orderConfirmedHostWillApproveAndProcess"}case t.PreOrderStatus.Waiting:return o?"orderConfirmedRestaurantAdminWillAcceptSoon":"yourOrderHasBeenApprovedByHost"}return null}function W(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:l}){const i=(e==null?void 0:e.orderFormat)===t.OrderFormat.Delivery,a=(e==null?void 0:e.orderFormat)===t.OrderFormat.TakeAway,r=(e==null?void 0:e.orderFormat)===t.OrderFormat.TableOrder;if(i||a||r&&!l)return!1;const n=o!=null,s=d!=null;if(n){const u=o===t.CheckoutStatus.Captured,c=o===t.CheckoutStatus.InProgress;return u||c}if(s){const u=d===t.TicketStatus.Preparing,c=d===t.TicketStatus.Ready;return u||c}return!1}function H(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:l,pickupTimeUpdated:i,preOrderOptions:a},r){const n=a&&!a.isHost;if(r&&W(e,{checkoutStatus:o,ticketStatus:d,customersFetchTableOrders:l})){if(r.ready>0)return r.ready<2?n?["oneItemIsReadyHostWillCollect"]:["oneItemIsReadyToCollect"]:n?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[T(d)];if(a&&(o===t.CheckoutStatus.Created||o===t.CheckoutStatus.Authorized)){const C=S(a);if(C)return[C]}const s=(e==null?void 0:e.orderFormat)===t.OrderFormat.Delivery,u=v(o);if(u)return[u];const c=o===t.CheckoutStatus.Captured,f=o===t.CheckoutStatus.InProgress,h=o===t.CheckoutStatus.Done,I=o===t.CheckoutStatus.DeliveryInProgress,P=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,g=(e==null?void 0:e.orderFormat)===t.OrderFormat.BoxPickup;if(c){if(O&&!l)return["yourOrderWillArriveAtYourTable"];if(s)return i?["modifiedDeliveryStartTime"]:["yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"];if(i)return["modifiedPickUpTime"];if(r&&n&&(p||y)){if(r.ready===r.all)return["yourOrderIsReadyHostWillCollect"];if(r.done===r.all)return["yourOrderHasBeenCompleted"]}return["yourOrderHasBeenAcceptedPickupTime"]}if(f){if(s)return i?["modifiedDeliveryStartTime"]:k(e)?["yourOrderIsBeingDelivered"]:["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 i?["modifiedPickUpTime"]:l?["yourOrderIsBeingPrepared"]:["yourOrderWillArriveAtYourTable"]}return i?["modifiedPickUpTime"]:["yourOrderIsBeingPrepared"]}if(h)return p||y?["yourOrderHasBeenCompleted"]:s?["deliveryWasCompleted"]:["yourOrderHasBeenCompleted"];if(I){if(g)switch(e==null?void 0:e.deliveryStatus){case t.CheckoutDeliveryStatus.PickedUp:return["yourOrderHasBeenCompleted"];case t.CheckoutDeliveryStatus.Delivered:return["yourOrderReadyToPickupFromLocker"];default:return["yourOrderIsBeingPrepared"]}if(s)return["yourOrderIsBeingDelivered"]}if(P)return s?["yourOrderIsBeingDelivered"]:g?["yourOrderReadyToPickupFromLocker"]:O&&!l?["yourOrderIsReadyWillBringToYourTableSoon"]:r&&n&&(p||y)&&r.done===r.all?["yourOrderHasBeenCompleted"]:["yourOrderIsReadyToCollect"];throw new Error("Could not resolve translation key in getTranslationKey()")}const Y={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"}),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
|
|
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!"}),yourOrderIsReadyWillBringToYourTableSoon:()=>({title:"Your order is ready!",message:"Stay at your table - We will bring your order to your table soon"}),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 R(e,o){const i=o?A(e):B(e);return{all:i.all.length,ready:i.ready.length,done:i.done.length}}function w(e,o,d=Y){var u;const{isSkipTicketStatus:l,isCheckOrder:i}=o;let a;if(!l){const c=(e==null?void 0:e.items)??[];a=R(c,!!i)}const[r,n]=H(e,o,a),s=(u=d[r])==null?void 0:u.call(d,{key:r,meta:n});if(!s)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[s,r]}exports.TranslationKey=m;exports.default=w;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CheckoutStatus as o, OrderFormat as p, CheckoutDeliveryStatus as I, TicketStatus as u, AttendeePreOrderStatus as
|
|
2
|
-
import
|
|
1
|
+
import { CheckoutStatus as o, OrderFormat as p, CheckoutDeliveryStatus as I, TicketStatus as u, AttendeePreOrderStatus as W, PreOrderStatus as P } from "@ancon/wildcat-types";
|
|
2
|
+
import H from "../order/getCheckOrderItemsMappedByTicketItemStatus.mjs";
|
|
3
3
|
import T from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
4
4
|
import Y from "./isWoltDeliveryInProgress.mjs";
|
|
5
5
|
import "../order/getCheckOrderMinimumStatusTicketItem.mjs";
|
|
@@ -10,8 +10,8 @@ import "../_getTag-4e44633b.mjs";
|
|
|
10
10
|
import "../_baseIsEqual-12d01a44.mjs";
|
|
11
11
|
import "../identity-6eafe87b.mjs";
|
|
12
12
|
import "../order/getMultiProductSubProductsTicketItems.mjs";
|
|
13
|
-
var
|
|
14
|
-
function
|
|
13
|
+
var R = /* @__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.YourOrderIsReadyWillBringToYourTableSoon = "yourOrderIsReadyWillBringToYourTableSoon", 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))(R || {});
|
|
14
|
+
function w(e) {
|
|
15
15
|
switch (e) {
|
|
16
16
|
case o.Error:
|
|
17
17
|
return "thereWasAnError";
|
|
@@ -47,9 +47,9 @@ function k(e) {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function b(e) {
|
|
51
51
|
const { isHost: t, preOrderStatus: d, preOrderAttendeeStatus: l, preOrderCancelInfo: i } = e;
|
|
52
|
-
if (l ===
|
|
52
|
+
if (l === W.Confirmed)
|
|
53
53
|
switch (d) {
|
|
54
54
|
case P.Started: {
|
|
55
55
|
const { cancelActor: a, canceledAt: r } = i ?? {};
|
|
@@ -60,7 +60,7 @@ function D(e) {
|
|
|
60
60
|
}
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function D(e, {
|
|
64
64
|
checkoutStatus: t,
|
|
65
65
|
ticketStatus: d,
|
|
66
66
|
customersFetchTableOrders: l
|
|
@@ -79,7 +79,7 @@ function b(e, {
|
|
|
79
79
|
}
|
|
80
80
|
return !1;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function S(e, {
|
|
83
83
|
checkoutStatus: t,
|
|
84
84
|
ticketStatus: d,
|
|
85
85
|
customersFetchTableOrders: l,
|
|
@@ -87,7 +87,7 @@ function E(e, {
|
|
|
87
87
|
preOrderOptions: a
|
|
88
88
|
}, r) {
|
|
89
89
|
const n = a && !a.isHost;
|
|
90
|
-
if (r &&
|
|
90
|
+
if (r && D(e, {
|
|
91
91
|
checkoutStatus: t,
|
|
92
92
|
ticketStatus: d,
|
|
93
93
|
customersFetchTableOrders: l
|
|
@@ -118,16 +118,16 @@ function E(e, {
|
|
|
118
118
|
if (d != null)
|
|
119
119
|
return [k(d)];
|
|
120
120
|
if (a && (t === o.Created || t === o.Authorized)) {
|
|
121
|
-
const C =
|
|
121
|
+
const C = b(a);
|
|
122
122
|
if (C)
|
|
123
123
|
return [C];
|
|
124
124
|
}
|
|
125
|
-
const s = (e == null ? void 0 : e.orderFormat) === p.Delivery, c =
|
|
125
|
+
const s = (e == null ? void 0 : e.orderFormat) === p.Delivery, c = w(t);
|
|
126
126
|
if (c)
|
|
127
127
|
return [c];
|
|
128
|
-
const y = t === o.Captured, A = t === o.InProgress, h = t === o.Done, B = t === o.DeliveryInProgress, v = t === o.ReadyToCollect, m = (e == null ? void 0 : e.orderFormat) === p.EatIn,
|
|
128
|
+
const y = t === o.Captured, A = t === o.InProgress, h = t === o.Done, B = t === o.DeliveryInProgress, v = t === o.ReadyToCollect, m = (e == null ? void 0 : e.orderFormat) === p.EatIn, g = (e == null ? void 0 : e.orderFormat) === p.TakeAway, O = (e == null ? void 0 : e.orderFormat) === p.TableOrder, f = (e == null ? void 0 : e.orderFormat) === p.BoxPickup;
|
|
129
129
|
if (y) {
|
|
130
|
-
if (
|
|
130
|
+
if (O && !l)
|
|
131
131
|
return [
|
|
132
132
|
"yourOrderWillArriveAtYourTable"
|
|
133
133
|
/* YourOrderWillArriveAtYourTable */
|
|
@@ -145,7 +145,7 @@ function E(e, {
|
|
|
145
145
|
"modifiedPickUpTime"
|
|
146
146
|
/* ModifiedPickUpTime */
|
|
147
147
|
];
|
|
148
|
-
if (r && n && (m ||
|
|
148
|
+
if (r && n && (m || g)) {
|
|
149
149
|
if (r.ready === r.all)
|
|
150
150
|
return [
|
|
151
151
|
"yourOrderIsReadyHostWillCollect"
|
|
@@ -174,7 +174,7 @@ function E(e, {
|
|
|
174
174
|
"yourOrderIsBeingPreparedEstimatedDeliveryStartTime"
|
|
175
175
|
/* YourOrderIsBeingPreparedEstimatedDeliveryStartTime */
|
|
176
176
|
];
|
|
177
|
-
if (r && (m ||
|
|
177
|
+
if (r && (m || g)) {
|
|
178
178
|
if (r.ready === r.all)
|
|
179
179
|
return [
|
|
180
180
|
"yourOrderIsReadyToCollect"
|
|
@@ -186,7 +186,7 @@ function E(e, {
|
|
|
186
186
|
/* YourOrderHasBeenCompleted */
|
|
187
187
|
];
|
|
188
188
|
}
|
|
189
|
-
if (
|
|
189
|
+
if (O) {
|
|
190
190
|
if (r) {
|
|
191
191
|
if (r.ready === r.all)
|
|
192
192
|
return l ? [
|
|
@@ -225,7 +225,7 @@ function E(e, {
|
|
|
225
225
|
];
|
|
226
226
|
}
|
|
227
227
|
if (h)
|
|
228
|
-
return m ||
|
|
228
|
+
return m || g ? [
|
|
229
229
|
"yourOrderHasBeenCompleted"
|
|
230
230
|
/* YourOrderHasBeenCompleted */
|
|
231
231
|
] : s ? [
|
|
@@ -236,7 +236,7 @@ function E(e, {
|
|
|
236
236
|
/* YourOrderHasBeenCompleted */
|
|
237
237
|
];
|
|
238
238
|
if (B) {
|
|
239
|
-
if (
|
|
239
|
+
if (f)
|
|
240
240
|
switch (e == null ? void 0 : e.deliveryStatus) {
|
|
241
241
|
case I.PickedUp:
|
|
242
242
|
return [
|
|
@@ -264,10 +264,13 @@ function E(e, {
|
|
|
264
264
|
return s ? [
|
|
265
265
|
"yourOrderIsBeingDelivered"
|
|
266
266
|
/* YourOrderIsBeingDelivered */
|
|
267
|
-
] :
|
|
267
|
+
] : f ? [
|
|
268
268
|
"yourOrderReadyToPickupFromLocker"
|
|
269
269
|
/* YourOrderReadyToPickupFromLocker */
|
|
270
|
-
] :
|
|
270
|
+
] : O && !l ? [
|
|
271
|
+
"yourOrderIsReadyWillBringToYourTableSoon"
|
|
272
|
+
/* YourOrderIsReadyWillBringToYourTableSoon */
|
|
273
|
+
] : r && n && (m || g) && r.done === r.all ? [
|
|
271
274
|
"yourOrderHasBeenCompleted"
|
|
272
275
|
/* YourOrderHasBeenCompleted */
|
|
273
276
|
] : [
|
|
@@ -276,7 +279,7 @@ function E(e, {
|
|
|
276
279
|
];
|
|
277
280
|
throw new Error("Could not resolve translation key in getTranslationKey()");
|
|
278
281
|
}
|
|
279
|
-
const
|
|
282
|
+
const E = {
|
|
280
283
|
orderConfirmedHostWillApproveAndProcess: () => ({
|
|
281
284
|
title: `Order confirmed!
|
|
282
285
|
The host will approve and process the pre-order.`,
|
|
@@ -327,6 +330,10 @@ You can manage your order.`,
|
|
|
327
330
|
title: "Your order is being delivered",
|
|
328
331
|
message: "It will arrive at your door shortly. Enjoy your meal!"
|
|
329
332
|
}),
|
|
333
|
+
yourOrderIsReadyWillBringToYourTableSoon: () => ({
|
|
334
|
+
title: "Your order is ready!",
|
|
335
|
+
message: "Stay at your table - We will bring your order to your table soon"
|
|
336
|
+
}),
|
|
330
337
|
yourOrderHasBeenCompleted: () => ({
|
|
331
338
|
title: "Enjoy your meal!",
|
|
332
339
|
message: "Your order has been completed!"
|
|
@@ -392,26 +399,27 @@ You can manage your order.`,
|
|
|
392
399
|
})
|
|
393
400
|
};
|
|
394
401
|
function M(e, t) {
|
|
395
|
-
const i = t ?
|
|
402
|
+
const i = t ? H(e) : T(e);
|
|
396
403
|
return {
|
|
397
404
|
all: i.all.length,
|
|
398
405
|
ready: i.ready.length,
|
|
399
406
|
done: i.done.length
|
|
400
407
|
};
|
|
401
408
|
}
|
|
402
|
-
function V(e, t, d =
|
|
409
|
+
function V(e, t, d = E) {
|
|
410
|
+
var c;
|
|
403
411
|
const { isSkipTicketStatus: l, isCheckOrder: i } = t;
|
|
404
412
|
let a;
|
|
405
413
|
if (!l) {
|
|
406
|
-
const
|
|
407
|
-
a = M(
|
|
414
|
+
const y = (e == null ? void 0 : e.items) ?? [];
|
|
415
|
+
a = M(y, !!i);
|
|
408
416
|
}
|
|
409
|
-
const [r, n] =
|
|
417
|
+
const [r, n] = S(e, t, a), s = (c = d[r]) == null ? void 0 : c.call(d, { key: r, meta: n });
|
|
410
418
|
if (!s)
|
|
411
419
|
throw new Error("Could not resolve translation in getOrderStatusTexts()");
|
|
412
420
|
return [s, r];
|
|
413
421
|
}
|
|
414
422
|
export {
|
|
415
|
-
|
|
423
|
+
R as TranslationKey,
|
|
416
424
|
V as default
|
|
417
425
|
};
|