@tabres/react 1.0.54 → 1.0.56

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.
Files changed (91) hide show
  1. package/dist/index.esm.js +1 -1
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/index.esm.js +1 -1
  6. package/dist/models/index.esm.js.map +1 -1
  7. package/dist/models/index.js +1 -1
  8. package/dist/models/index.js.map +1 -1
  9. package/dist/models/modules/branch/constants.d.ts +1 -0
  10. package/dist/models/modules/branch/models.d.ts +33 -0
  11. package/dist/models/modules/branch/utils.d.ts +43 -0
  12. package/dist/models/modules/order/hooks.d.ts +15 -0
  13. package/dist/models/modules/order/models.d.ts +8 -0
  14. package/dist/models/services/translation/locales/az/error.d.ts +1 -0
  15. package/dist/models/services/translation/locales/az/index.d.ts +1 -0
  16. package/dist/models/services/translation/locales/en/error.d.ts +1 -0
  17. package/dist/models/services/translation/locales/en/index.d.ts +1 -0
  18. package/dist/models/services/translation/locales/es/error.d.ts +1 -0
  19. package/dist/models/services/translation/locales/es/index.d.ts +1 -0
  20. package/dist/models/services/translation/locales/et/error.d.ts +1 -0
  21. package/dist/models/services/translation/locales/et/index.d.ts +1 -0
  22. package/dist/models/services/translation/locales/hr/error.d.ts +1 -0
  23. package/dist/models/services/translation/locales/hr/index.d.ts +1 -0
  24. package/dist/models/services/translation/locales/index.d.ts +10 -0
  25. package/dist/models/services/translation/locales/nl/error.d.ts +1 -0
  26. package/dist/models/services/translation/locales/nl/index.d.ts +1 -0
  27. package/dist/models/services/translation/locales/pl/error.d.ts +1 -0
  28. package/dist/models/services/translation/locales/pl/index.d.ts +1 -0
  29. package/dist/models/services/translation/locales/pt/error.d.ts +1 -0
  30. package/dist/models/services/translation/locales/pt/index.d.ts +1 -0
  31. package/dist/models/services/translation/locales/ru/error.d.ts +1 -0
  32. package/dist/models/services/translation/locales/ru/index.d.ts +1 -0
  33. package/dist/models/services/translation/locales/tr/error.d.ts +1 -0
  34. package/dist/models/services/translation/locales/tr/index.d.ts +1 -0
  35. package/dist/modules/branch/constants.d.ts +1 -0
  36. package/dist/modules/branch/models.d.ts +33 -0
  37. package/dist/modules/branch/utils.d.ts +43 -0
  38. package/dist/modules/order/hooks.d.ts +15 -0
  39. package/dist/modules/order/models.d.ts +8 -0
  40. package/dist/services/translation/locales/az/error.d.ts +1 -0
  41. package/dist/services/translation/locales/az/index.d.ts +1 -0
  42. package/dist/services/translation/locales/en/error.d.ts +1 -0
  43. package/dist/services/translation/locales/en/index.d.ts +1 -0
  44. package/dist/services/translation/locales/es/error.d.ts +1 -0
  45. package/dist/services/translation/locales/es/index.d.ts +1 -0
  46. package/dist/services/translation/locales/et/error.d.ts +1 -0
  47. package/dist/services/translation/locales/et/index.d.ts +1 -0
  48. package/dist/services/translation/locales/hr/error.d.ts +1 -0
  49. package/dist/services/translation/locales/hr/index.d.ts +1 -0
  50. package/dist/services/translation/locales/index.d.ts +10 -0
  51. package/dist/services/translation/locales/nl/error.d.ts +1 -0
  52. package/dist/services/translation/locales/nl/index.d.ts +1 -0
  53. package/dist/services/translation/locales/pl/error.d.ts +1 -0
  54. package/dist/services/translation/locales/pl/index.d.ts +1 -0
  55. package/dist/services/translation/locales/pt/error.d.ts +1 -0
  56. package/dist/services/translation/locales/pt/index.d.ts +1 -0
  57. package/dist/services/translation/locales/ru/error.d.ts +1 -0
  58. package/dist/services/translation/locales/ru/index.d.ts +1 -0
  59. package/dist/services/translation/locales/tr/error.d.ts +1 -0
  60. package/dist/services/translation/locales/tr/index.d.ts +1 -0
  61. package/dist/styles/ui.css +1 -1
  62. package/dist/styles/ui.css.map +1 -1
  63. package/dist/utils/index.esm.js.map +1 -1
  64. package/dist/utils/index.js.map +1 -1
  65. package/dist/utils/modules/branch/constants.d.ts +1 -0
  66. package/dist/utils/modules/branch/models.d.ts +33 -0
  67. package/dist/utils/modules/branch/utils.d.ts +43 -0
  68. package/dist/utils/modules/order/hooks.d.ts +15 -0
  69. package/dist/utils/modules/order/models.d.ts +8 -0
  70. package/dist/utils/services/translation/locales/az/error.d.ts +1 -0
  71. package/dist/utils/services/translation/locales/az/index.d.ts +1 -0
  72. package/dist/utils/services/translation/locales/en/error.d.ts +1 -0
  73. package/dist/utils/services/translation/locales/en/index.d.ts +1 -0
  74. package/dist/utils/services/translation/locales/es/error.d.ts +1 -0
  75. package/dist/utils/services/translation/locales/es/index.d.ts +1 -0
  76. package/dist/utils/services/translation/locales/et/error.d.ts +1 -0
  77. package/dist/utils/services/translation/locales/et/index.d.ts +1 -0
  78. package/dist/utils/services/translation/locales/hr/error.d.ts +1 -0
  79. package/dist/utils/services/translation/locales/hr/index.d.ts +1 -0
  80. package/dist/utils/services/translation/locales/index.d.ts +10 -0
  81. package/dist/utils/services/translation/locales/nl/error.d.ts +1 -0
  82. package/dist/utils/services/translation/locales/nl/index.d.ts +1 -0
  83. package/dist/utils/services/translation/locales/pl/error.d.ts +1 -0
  84. package/dist/utils/services/translation/locales/pl/index.d.ts +1 -0
  85. package/dist/utils/services/translation/locales/pt/error.d.ts +1 -0
  86. package/dist/utils/services/translation/locales/pt/index.d.ts +1 -0
  87. package/dist/utils/services/translation/locales/ru/error.d.ts +1 -0
  88. package/dist/utils/services/translation/locales/ru/index.d.ts +1 -0
  89. package/dist/utils/services/translation/locales/tr/error.d.ts +1 -0
  90. package/dist/utils/services/translation/locales/tr/index.d.ts +1 -0
  91. package/package.json +1 -1
@@ -12,6 +12,7 @@ declare const _default: {
12
12
  STREET_REQUIRED: string;
13
13
  STREET_NUMBER_REQUIRED: string;
14
14
  OUT_OF_DELIVERY_RANGE: string;
15
+ DELIVERY_DISTANCE_NOT_COVERED: string;
15
16
  NO_ORDER_TYPE: string;
16
17
  INVALID_ADDRESS: string;
17
18
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -60,6 +60,7 @@ declare const _default: {
60
60
  STREET_REQUIRED: string;
61
61
  STREET_NUMBER_REQUIRED: string;
62
62
  OUT_OF_DELIVERY_RANGE: string;
63
+ DELIVERY_DISTANCE_NOT_COVERED: string;
63
64
  NO_ORDER_TYPE: string;
64
65
  INVALID_ADDRESS: string;
65
66
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -16,6 +16,7 @@ declare const _default: {
16
16
  STREET_REQUIRED: string;
17
17
  STREET_NUMBER_REQUIRED: string;
18
18
  OUT_OF_DELIVERY_RANGE: string;
19
+ DELIVERY_DISTANCE_NOT_COVERED: string;
19
20
  NO_ORDER_TYPE: string;
20
21
  INVALID_ADDRESS: string;
21
22
  };
@@ -146,6 +147,7 @@ declare const _default: {
146
147
  STREET_REQUIRED: string;
147
148
  STREET_NUMBER_REQUIRED: string;
148
149
  OUT_OF_DELIVERY_RANGE: string;
150
+ DELIVERY_DISTANCE_NOT_COVERED: string;
149
151
  NO_ORDER_TYPE: string;
150
152
  INVALID_ADDRESS: string;
151
153
  };
@@ -226,6 +228,7 @@ declare const _default: {
226
228
  STREET_REQUIRED: string;
227
229
  STREET_NUMBER_REQUIRED: string;
228
230
  OUT_OF_DELIVERY_RANGE: string;
231
+ DELIVERY_DISTANCE_NOT_COVERED: string;
229
232
  NO_ORDER_TYPE: string;
230
233
  INVALID_ADDRESS: string;
231
234
  };
@@ -315,6 +318,7 @@ declare const _default: {
315
318
  STREET_REQUIRED: string;
316
319
  STREET_NUMBER_REQUIRED: string;
317
320
  OUT_OF_DELIVERY_RANGE: string;
321
+ DELIVERY_DISTANCE_NOT_COVERED: string;
318
322
  NO_ORDER_TYPE: string;
319
323
  INVALID_ADDRESS: string;
320
324
  };
@@ -446,6 +450,7 @@ declare const _default: {
446
450
  STREET_REQUIRED: string;
447
451
  STREET_NUMBER_REQUIRED: string;
448
452
  OUT_OF_DELIVERY_RANGE: string;
453
+ DELIVERY_DISTANCE_NOT_COVERED: string;
449
454
  NO_ORDER_TYPE: string;
450
455
  INVALID_ADDRESS: string;
451
456
  };
@@ -577,6 +582,7 @@ declare const _default: {
577
582
  STREET_REQUIRED: string;
578
583
  STREET_NUMBER_REQUIRED: string;
579
584
  OUT_OF_DELIVERY_RANGE: string;
585
+ DELIVERY_DISTANCE_NOT_COVERED: string;
580
586
  NO_ORDER_TYPE: string;
581
587
  INVALID_ADDRESS: string;
582
588
  };
@@ -708,6 +714,7 @@ declare const _default: {
708
714
  STREET_REQUIRED: string;
709
715
  STREET_NUMBER_REQUIRED: string;
710
716
  OUT_OF_DELIVERY_RANGE: string;
717
+ DELIVERY_DISTANCE_NOT_COVERED: string;
711
718
  NO_ORDER_TYPE: string;
712
719
  INVALID_ADDRESS: string;
713
720
  };
@@ -839,6 +846,7 @@ declare const _default: {
839
846
  STREET_REQUIRED: string;
840
847
  STREET_NUMBER_REQUIRED: string;
841
848
  OUT_OF_DELIVERY_RANGE: string;
849
+ DELIVERY_DISTANCE_NOT_COVERED: string;
842
850
  NO_ORDER_TYPE: string;
843
851
  INVALID_ADDRESS: string;
844
852
  };
@@ -972,6 +980,7 @@ declare const _default: {
972
980
  STREET_REQUIRED: string;
973
981
  STREET_NUMBER_REQUIRED: string;
974
982
  OUT_OF_DELIVERY_RANGE: string;
983
+ DELIVERY_DISTANCE_NOT_COVERED: string;
975
984
  NO_ORDER_TYPE: string;
976
985
  INVALID_ADDRESS: string;
977
986
  };
@@ -1105,6 +1114,7 @@ declare const _default: {
1105
1114
  STREET_REQUIRED: string;
1106
1115
  STREET_NUMBER_REQUIRED: string;
1107
1116
  OUT_OF_DELIVERY_RANGE: string;
1117
+ DELIVERY_DISTANCE_NOT_COVERED: string;
1108
1118
  NO_ORDER_TYPE: string;
1109
1119
  INVALID_ADDRESS: string;
1110
1120
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -1 +1,2 @@
1
1
  export declare const DEFAULT_CURRENCY = "EUR";
2
+ export declare const EARTH_RADIUS_KM = 6371;
@@ -10,13 +10,44 @@ export type BranchWorkDay = {
10
10
  export type BranchWorkDays = {
11
11
  days: BranchWorkDay[];
12
12
  };
13
+ /**
14
+ * How a branch charges for delivery: one flat amount (`deliveryFeeAmount`) or a
15
+ * fee picked from the branch's distance ranges (`deliveryFeeTiers`). Mirrors
16
+ * the API's branch_settings.delivery_fee_type — extend both together. A branch
17
+ * is FIXED until its owner opts into distance pricing.
18
+ */
19
+ export declare enum DeliveryFeeType {
20
+ FIXED = "FIXED",
21
+ DISTANCE = "DISTANCE"
22
+ }
23
+ /**
24
+ * One distance range of a branch's per-km delivery pricing, read as "up to
25
+ * `upToDistance` kilometres, charge `fee`". Ranges carry no lower bound of
26
+ * their own: the applicable one is the cheapest `upToDistance` that still
27
+ * covers the delivery distance, so 5/10/20 km ranges describe 0-5, 5-10 and
28
+ * 10-20 km. The API returns them sorted by `upToDistance` ascending.
29
+ *
30
+ * `upToDistance` is in KILOMETRES — unlike `BranchSettings.maxDeliveryDistance`,
31
+ * which the API keeps in metres.
32
+ */
33
+ export type DeliveryFeeTier = {
34
+ upToDistance: number;
35
+ fee: number;
36
+ };
13
37
  export interface BranchSettings {
14
38
  deliveryOrderEnabled: boolean;
15
39
  pickupOrderEnabled: boolean;
16
40
  dineInOrderEnabled: boolean;
41
+ /** In METRES, unlike the kilometres a DeliveryFeeTier is measured in. */
17
42
  maxDeliveryDistance: number;
18
43
  minDeliveryAmount: number;
19
44
  deliveryFeeAmount: number;
45
+ /**
46
+ * Absent on a payload cached before the branch gained distance pricing;
47
+ * treated as FIXED, the same default the API stores.
48
+ */
49
+ deliveryFeeType?: DeliveryFeeType;
50
+ deliveryFeeTiers?: DeliveryFeeTier[];
20
51
  serviceChargeEnabled: boolean;
21
52
  serviceChargePercentage: number;
22
53
  addToOrderEnabled: boolean;
@@ -31,6 +62,8 @@ export declare enum BranchSetting {
31
62
  DINE_IN_ORDER_ENABLED = "dineInOrderEnabled",
32
63
  MIN_DELIVERY_AMOUNT = "minDeliveryAmount",
33
64
  DELIVERY_FEE_AMOUNT = "deliveryFeeAmount",
65
+ DELIVERY_FEE_TYPE = "deliveryFeeType",
66
+ DELIVERY_FEE_TIERS = "deliveryFeeTiers",
34
67
  SERVICE_CHARGE_ENABLED = "serviceChargeEnabled",
35
68
  SERVICE_CHARGE_PERCENTAGE = "serviceChargePercentage",
36
69
  ADD_TO_ORDER_ENABLED = "addToOrderEnabled",
@@ -1,7 +1,50 @@
1
1
  import { BranchWorkDays } from "src/models";
2
+ import { Coordinates } from "src/modules/view/models";
3
+ import { BranchSettings, DeliveryFeeTier } from "./models";
2
4
  export declare const getHoursForDay: (schedule: BranchWorkDays, weekDayIndex: number) => import("src/models").BranchWorkHour;
3
5
  export declare const splitHours: (hours: string) => number[];
4
6
  export declare const isWithinTimeRange: (timeRange?: {
5
7
  openAt: string;
6
8
  closeAt: string;
7
9
  }) => boolean;
10
+ export declare const isValidCoordinate: (latitude?: number, longitude?: number) => boolean;
11
+ /**
12
+ * Great-circle ("as the crow flies") distance in kilometres between two
13
+ * coordinates — the haversine formula, mirroring the API's geo.DistanceKm down
14
+ * to the Earth radius so a fee resolved here lands on the same range the server
15
+ * charges. It is not a driving route.
16
+ *
17
+ * Returns null when either end is unknown or unusable (a branch that was never
18
+ * geocoded, an order with no address yet), which is what makes distance-based
19
+ * pricing fall back to the branch's flat fee instead of blocking the order.
20
+ */
21
+ export declare const deliveryDistanceKm: (from: Coordinates, to: Coordinates) => number | null;
22
+ /**
23
+ * The fee of the first range that covers `distanceKm`. Ranges are read cheapest
24
+ * boundary first, so the first match is the tightest one; past every range the
25
+ * largest range's fee applies — the branch's max delivery distance, not the last
26
+ * range, is what puts an address outside the delivery area. Returns null when
27
+ * the branch defined no ranges at all.
28
+ *
29
+ * Mirrors the API's pickDeliveryFeeTier, which walks the stored array in place
30
+ * because the API sorts on write. We sort a copy first so a hand-built or
31
+ * stale payload still prices correctly.
32
+ */
33
+ export declare const pickDeliveryFeeTier: (tiers: DeliveryFeeTier[] | undefined, distanceKm: number) => number | null;
34
+ /**
35
+ * What this branch charges to deliver, resolved the way the API resolves it so
36
+ * the fee shown before the server has priced the cart matches the one it
37
+ * charges: a FIXED branch charges its flat amount, a DISTANCE branch charges
38
+ * the range covering how far the order is going.
39
+ *
40
+ * A destination that could not be located (no address yet, a branch that was
41
+ * never geocoded, a distance that is not a finite number) or a branch that
42
+ * switched to DISTANCE without configuring any range falls back to the flat
43
+ * amount rather than showing nothing — the same fallback the API takes. The
44
+ * flat amount is clamped at zero because its legacy column has no CHECK.
45
+ *
46
+ * Being outside the delivery area is not priced here: the API refuses such an
47
+ * order outright (DELIVERY_DISTANCE_NOT_COVERED), and the drawer blocks it
48
+ * ahead of that through useDeliveryDistanceError.
49
+ */
50
+ export declare const resolveDeliveryFee: (settings: BranchSettings | undefined, distanceKm: number | null) => number;
@@ -15,6 +15,21 @@ export declare const useProductQuantityInOrder: ({ productId, variantId, selecte
15
15
  selectedAddons: SelectedAddons;
16
16
  }) => number;
17
17
  export declare const useProductQuantityInOrderWithAllVariants: (productId: number) => number;
18
+ /**
19
+ * How far this order is going, in kilometres, or null while either end is
20
+ * unknown — the branch was never geocoded, or no delivery address has been
21
+ * entered yet. Straight-line, matching how the API measures a delivery.
22
+ */
23
+ export declare const useDeliveryDistanceKm: () => number | null;
24
+ /**
25
+ * What the branch charges to deliver this order, resolved client-side.
26
+ *
27
+ * The order preview is authoritative — it is the same math run against
28
+ * server-of-record settings — so this is what the summary shows until the
29
+ * preview arrives, and if it fails. Non-delivery orders are not charged a
30
+ * delivery fee; the summary only renders the row for DELIVERY.
31
+ */
32
+ export declare const useDeliveryFee: () => number;
18
33
  export declare const useDeliveryDistanceError: () => string | null;
19
34
  export declare const useDeliveryAmountError: () => string | null;
20
35
  export declare const useOrderErrorInDetails: () => string | null;
@@ -176,6 +176,14 @@ export interface CalculatePreviewRequest {
176
176
  branchId: number;
177
177
  orderType: OrderType;
178
178
  items: CalculatePreviewItemRequest[];
179
+ /**
180
+ * Where the delivery is heading. They matter only for a DELIVERY order on a
181
+ * branch that prices delivery by distance; without them such a cart previews
182
+ * the branch's flat fee, and the real fee is resolved from the order's
183
+ * address at create time.
184
+ */
185
+ latitude?: number;
186
+ longitude?: number;
179
187
  }
180
188
  export interface CalculatePreviewTax {
181
189
  branchTaxId: number;
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -11,6 +11,7 @@ declare const _default: {
11
11
  STREET_REQUIRED: string;
12
12
  STREET_NUMBER_REQUIRED: string;
13
13
  OUT_OF_DELIVERY_RANGE: string;
14
+ DELIVERY_DISTANCE_NOT_COVERED: string;
14
15
  NO_ORDER_TYPE: string;
15
16
  INVALID_ADDRESS: string;
16
17
  };
@@ -12,6 +12,7 @@ declare const _default: {
12
12
  STREET_REQUIRED: string;
13
13
  STREET_NUMBER_REQUIRED: string;
14
14
  OUT_OF_DELIVERY_RANGE: string;
15
+ DELIVERY_DISTANCE_NOT_COVERED: string;
15
16
  NO_ORDER_TYPE: string;
16
17
  INVALID_ADDRESS: string;
17
18
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -60,6 +60,7 @@ declare const _default: {
60
60
  STREET_REQUIRED: string;
61
61
  STREET_NUMBER_REQUIRED: string;
62
62
  OUT_OF_DELIVERY_RANGE: string;
63
+ DELIVERY_DISTANCE_NOT_COVERED: string;
63
64
  NO_ORDER_TYPE: string;
64
65
  INVALID_ADDRESS: string;
65
66
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -16,6 +16,7 @@ declare const _default: {
16
16
  STREET_REQUIRED: string;
17
17
  STREET_NUMBER_REQUIRED: string;
18
18
  OUT_OF_DELIVERY_RANGE: string;
19
+ DELIVERY_DISTANCE_NOT_COVERED: string;
19
20
  NO_ORDER_TYPE: string;
20
21
  INVALID_ADDRESS: string;
21
22
  };
@@ -146,6 +147,7 @@ declare const _default: {
146
147
  STREET_REQUIRED: string;
147
148
  STREET_NUMBER_REQUIRED: string;
148
149
  OUT_OF_DELIVERY_RANGE: string;
150
+ DELIVERY_DISTANCE_NOT_COVERED: string;
149
151
  NO_ORDER_TYPE: string;
150
152
  INVALID_ADDRESS: string;
151
153
  };
@@ -226,6 +228,7 @@ declare const _default: {
226
228
  STREET_REQUIRED: string;
227
229
  STREET_NUMBER_REQUIRED: string;
228
230
  OUT_OF_DELIVERY_RANGE: string;
231
+ DELIVERY_DISTANCE_NOT_COVERED: string;
229
232
  NO_ORDER_TYPE: string;
230
233
  INVALID_ADDRESS: string;
231
234
  };
@@ -315,6 +318,7 @@ declare const _default: {
315
318
  STREET_REQUIRED: string;
316
319
  STREET_NUMBER_REQUIRED: string;
317
320
  OUT_OF_DELIVERY_RANGE: string;
321
+ DELIVERY_DISTANCE_NOT_COVERED: string;
318
322
  NO_ORDER_TYPE: string;
319
323
  INVALID_ADDRESS: string;
320
324
  };
@@ -446,6 +450,7 @@ declare const _default: {
446
450
  STREET_REQUIRED: string;
447
451
  STREET_NUMBER_REQUIRED: string;
448
452
  OUT_OF_DELIVERY_RANGE: string;
453
+ DELIVERY_DISTANCE_NOT_COVERED: string;
449
454
  NO_ORDER_TYPE: string;
450
455
  INVALID_ADDRESS: string;
451
456
  };
@@ -577,6 +582,7 @@ declare const _default: {
577
582
  STREET_REQUIRED: string;
578
583
  STREET_NUMBER_REQUIRED: string;
579
584
  OUT_OF_DELIVERY_RANGE: string;
585
+ DELIVERY_DISTANCE_NOT_COVERED: string;
580
586
  NO_ORDER_TYPE: string;
581
587
  INVALID_ADDRESS: string;
582
588
  };
@@ -708,6 +714,7 @@ declare const _default: {
708
714
  STREET_REQUIRED: string;
709
715
  STREET_NUMBER_REQUIRED: string;
710
716
  OUT_OF_DELIVERY_RANGE: string;
717
+ DELIVERY_DISTANCE_NOT_COVERED: string;
711
718
  NO_ORDER_TYPE: string;
712
719
  INVALID_ADDRESS: string;
713
720
  };
@@ -839,6 +846,7 @@ declare const _default: {
839
846
  STREET_REQUIRED: string;
840
847
  STREET_NUMBER_REQUIRED: string;
841
848
  OUT_OF_DELIVERY_RANGE: string;
849
+ DELIVERY_DISTANCE_NOT_COVERED: string;
842
850
  NO_ORDER_TYPE: string;
843
851
  INVALID_ADDRESS: string;
844
852
  };
@@ -972,6 +980,7 @@ declare const _default: {
972
980
  STREET_REQUIRED: string;
973
981
  STREET_NUMBER_REQUIRED: string;
974
982
  OUT_OF_DELIVERY_RANGE: string;
983
+ DELIVERY_DISTANCE_NOT_COVERED: string;
975
984
  NO_ORDER_TYPE: string;
976
985
  INVALID_ADDRESS: string;
977
986
  };
@@ -1105,6 +1114,7 @@ declare const _default: {
1105
1114
  STREET_REQUIRED: string;
1106
1115
  STREET_NUMBER_REQUIRED: string;
1107
1116
  OUT_OF_DELIVERY_RANGE: string;
1117
+ DELIVERY_DISTANCE_NOT_COVERED: string;
1108
1118
  NO_ORDER_TYPE: string;
1109
1119
  INVALID_ADDRESS: string;
1110
1120
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  STREET_REQUIRED: string;
15
15
  STREET_NUMBER_REQUIRED: string;
16
16
  OUT_OF_DELIVERY_RANGE: string;
17
+ DELIVERY_DISTANCE_NOT_COVERED: string;
17
18
  NO_ORDER_TYPE: string;
18
19
  INVALID_ADDRESS: string;
19
20
  };
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  STREET_REQUIRED: string;
16
16
  STREET_NUMBER_REQUIRED: string;
17
17
  OUT_OF_DELIVERY_RANGE: string;
18
+ DELIVERY_DISTANCE_NOT_COVERED: string;
18
19
  NO_ORDER_TYPE: string;
19
20
  INVALID_ADDRESS: string;
20
21
  };