@licklist/design 0.44.486-dev.56 → 0.44.486-dev.57

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.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ManualBookingOrder } from "@licklist/plugins/dist/context/sale/ManualBookingStepsContext";
3
+ import { RelyOnPeopleType } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
3
4
  export interface ManualBookingSummaryProps {
4
5
  eventName: string;
5
6
  orders: ManualBookingOrder[];
@@ -7,6 +8,7 @@ export interface ManualBookingSummaryProps {
7
8
  orderSumIncludingFee?: number | null;
8
9
  isFeeFetching: boolean;
9
10
  orderDate: string;
11
+ relyOnPeopleType?: RelyOnPeopleType | null;
10
12
  }
11
- export declare const ManualBookingSummary: ({ eventName, orders, ordersSum, orderSumIncludingFee, isFeeFetching, orderDate, }: ManualBookingSummaryProps) => JSX.Element;
13
+ export declare const ManualBookingSummary: ({ eventName, orders, ordersSum, orderSumIncludingFee, isFeeFetching, orderDate, relyOnPeopleType, }: ManualBookingSummaryProps) => JSX.Element;
12
14
  //# sourceMappingURL=ManualBookingSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManualBookingSummary.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/summary/ManualBookingSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAUnG,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,sFAO9B,yBAAyB,gBA6E3B,CAAC"}
1
+ {"version":3,"file":"ManualBookingSummary.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/summary/ManualBookingSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAQnG,OAAO,EAEL,gBAAgB,EACjB,MAAM,6DAA6D,CAAC;AAIrE,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,oBAAoB,wGAQ9B,yBAAyB,gBAiF3B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config");require("../../../static/loader/LoaderIndicator.js");var l=require("../../../static/loader/BlockLoader.js"),n=require("react-i18next");require("../../../static/loader/ButtonLoader.js"),require("../../../static/loader/SnippetLoader.js"),require("../../../static/loader/PaymentLoader.js");var c=require("luxon"),i=require("react-intl");exports.ManualBookingSummary=function(e){var t=e.eventName,m=e.orders,o=e.ordersSum,s=e.orderSumIncludingFee,u=e.isFeeFetching,d=e.orderDate,y=n.useTranslation(["Design","Sale"]).t,v=i.useIntl().formatNumber,E=c.DateTime.fromISO(d),p=E.toFormat(a.DATE_TIME_MANUAL_BOOKING_FORMAT),N=E.toFormat(a.TIME_FORMAT);return r.createElement("div",{className:"manual-booking-summary"},r.createElement("div",{className:"receipt-title"},y("Sale:receipt")),r.createElement("div",{className:"event-name border-summary-item"},t),r.createElement("div",{className:"border-summary-item"},p),r.createElement("div",{className:"border-summary-item"},N),m.length>0?r.createElement("div",{className:"summary-item-container"},m.map((function(e){return r.createElement("div",{key:e.id,className:"d-flex justify-content-between border-summary-item"},r.createElement("div",null,e.name),(null==e?void 0:e.relyOnPeopleMultiplier)&&r.createElement("div",null,"x ".concat(e.quantity*(null==e?void 0:e.relyOnPeopleMultiplier)," ").concat(y("people"))),r.createElement("div",null,v(e.quantity*e.price,{style:"currency",currency:a.Currency.GBP})))})),r.createElement("div",null,r.createElement("div",{className:"total-container"},r.createElement("div",null,y("Sale:total")),r.createElement("div",{className:"total-amount"},v(o,{style:"currency",currency:a.Currency.GBP}))),s&&r.createElement("div",{className:"total-container ".concat(u?"mt-6":"mt-4")},u||!s?r.createElement(l.BlockLoader,null):r.createElement(r.Fragment,null,r.createElement("div",null,y("Sale:includingOperationalCost")),r.createElement("div",{className:"total-amount"},v(s,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},y("Design:emptyBasket"))))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config");require("../../../static/loader/LoaderIndicator.js");var l=require("../../../static/loader/BlockLoader.js"),n=require("react-i18next");require("../../../static/loader/ButtonLoader.js"),require("../../../static/loader/SnippetLoader.js"),require("../../../static/loader/PaymentLoader.js");var c=require("luxon"),i=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),m=require("react-intl"),o=require("@licklist/plugins/dist/utils/relyOnPeople");exports.ManualBookingSummary=function(e){var t=e.eventName,s=e.orders,u=e.ordersSum,d=e.orderSumIncludingFee,y=e.isFeeFetching,p=e.orderDate,v=e.relyOnPeopleType,E=n.useTranslation(["Design","Sale"]).t,N=m.useIntl().formatNumber,q=v&&v!==i.RELY_ON_PEOPLE_QUANTITY,O=c.DateTime.fromISO(p),P=O.toFormat(a.DATE_TIME_MANUAL_BOOKING_FORMAT),g=O.toFormat(a.TIME_FORMAT);return r.createElement("div",{className:"manual-booking-summary"},r.createElement("div",{className:"receipt-title"},E("Sale:receipt")),r.createElement("div",{className:"event-name border-summary-item"},t),r.createElement("div",{className:"border-summary-item"},P),r.createElement("div",{className:"border-summary-item"},g),s.length>0?r.createElement("div",{className:"summary-item-container"},s.map((function(e){var t=o.getRelyOnPeopleMultiplier({relyOnPeopleType:v,capacity:null==e?void 0:e.capacity});return r.createElement("div",{key:e.id,className:"d-flex justify-content-between border-summary-item"},r.createElement("div",null,e.name),q&&t&&r.createElement("div",null,"x ".concat(e.quantity*t," ").concat(E("people"))),r.createElement("div",null,N(e.quantity*e.price,{style:"currency",currency:a.Currency.GBP})))})),r.createElement("div",null,r.createElement("div",{className:"total-container"},r.createElement("div",null,E("Sale:total")),r.createElement("div",{className:"total-amount"},N(u,{style:"currency",currency:a.Currency.GBP}))),d&&r.createElement("div",{className:"total-container ".concat(y?"mt-6":"mt-4")},y||!d?r.createElement(l.BlockLoader,null):r.createElement(r.Fragment,null,r.createElement("div",null,E("Sale:includingOperationalCost")),r.createElement("div",{className:"total-amount"},N(d,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},E("Design:emptyBasket"))))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.486-dev.56",
3
+ "version": "0.44.486-dev.57",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -8,6 +8,11 @@ import {
8
8
  } from "@licklist/core/dist/Config";
9
9
  import { useIntl } from "react-intl";
10
10
  import * as Config from "@licklist/core/dist/Config";
11
+ import {
12
+ RELY_ON_PEOPLE_QUANTITY,
13
+ RelyOnPeopleType,
14
+ } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
15
+ import { getRelyOnPeopleMultiplier } from "@licklist/plugins/dist/utils/relyOnPeople";
11
16
  import { BlockLoader } from "../../../static/loader";
12
17
 
13
18
  export interface ManualBookingSummaryProps {
@@ -17,6 +22,7 @@ export interface ManualBookingSummaryProps {
17
22
  orderSumIncludingFee?: number | null;
18
23
  isFeeFetching: boolean;
19
24
  orderDate: string;
25
+ relyOnPeopleType?: RelyOnPeopleType | null;
20
26
  }
21
27
 
22
28
  export const ManualBookingSummary = ({
@@ -26,14 +32,15 @@ export const ManualBookingSummary = ({
26
32
  orderSumIncludingFee,
27
33
  isFeeFetching,
28
34
  orderDate,
35
+ relyOnPeopleType,
29
36
  }: ManualBookingSummaryProps) => {
30
37
  const { t } = useTranslation(["Design", "Sale"]);
31
38
  const { formatNumber } = useIntl();
32
-
39
+ const showRelyOnPeople =
40
+ relyOnPeopleType && relyOnPeopleType !== RELY_ON_PEOPLE_QUANTITY;
33
41
  const currentDate = DateTime.fromISO(orderDate);
34
42
  const date = currentDate.toFormat(DATE_TIME_MANUAL_BOOKING_FORMAT);
35
43
  const time = currentDate.toFormat(TIME_FORMAT);
36
-
37
44
  return (
38
45
  <div className="manual-booking-summary">
39
46
  <div className="receipt-title">{t("Sale:receipt")}</div>
@@ -43,15 +50,19 @@ export const ManualBookingSummary = ({
43
50
  {orders.length > 0 ? (
44
51
  <div className="summary-item-container">
45
52
  {orders.map((order: ManualBookingOrder) => {
53
+ const relyOnPeopleMultiplier = getRelyOnPeopleMultiplier({
54
+ relyOnPeopleType,
55
+ capacity: order?.capacity,
56
+ });
46
57
  return (
47
58
  <div
48
59
  key={order.id}
49
60
  className="d-flex justify-content-between border-summary-item"
50
61
  >
51
62
  <div>{order.name}</div>
52
- {order?.relyOnPeopleMultiplier && (
63
+ {showRelyOnPeople && relyOnPeopleMultiplier && (
53
64
  <div>
54
- {`x ${order.quantity * order?.relyOnPeopleMultiplier} ${t(
65
+ {`x ${order.quantity * relyOnPeopleMultiplier} ${t(
55
66
  "people"
56
67
  )}`}
57
68
  </div>