@sellout/models 0.0.388 → 0.0.389

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 (43) hide show
  1. package/.dist/graphql/queries/eventsAdminCalender.query.js +3 -0
  2. package/.dist/graphql/queries/eventsAdminCalender.query.js.map +1 -1
  3. package/.dist/graphql/queries/eventsListOptimized.query.js +4 -1
  4. package/.dist/graphql/queries/eventsListOptimized.query.js.map +1 -1
  5. package/.dist/interfaces/IAnalytics.d.ts +1 -0
  6. package/.dist/interfaces/IAnalytics.js.map +1 -1
  7. package/.dist/interfaces/IEvent.d.ts +1 -0
  8. package/.dist/interfaces/IOrder.d.ts +12 -0
  9. package/.dist/interfaces/IOrder.js.map +1 -1
  10. package/.dist/interfaces/IPassKitDeviceRegistration.d.ts +11 -0
  11. package/.dist/interfaces/IPassKitDeviceRegistration.js +3 -0
  12. package/.dist/interfaces/IPassKitDeviceRegistration.js.map +1 -0
  13. package/.dist/interfaces/ITask.d.ts +2 -1
  14. package/.dist/interfaces/ITask.js +1 -0
  15. package/.dist/interfaces/ITask.js.map +1 -1
  16. package/.dist/schemas/Event.d.ts +5 -0
  17. package/.dist/schemas/Event.js +5 -0
  18. package/.dist/schemas/Event.js.map +1 -1
  19. package/.dist/schemas/Order.d.ts +34 -0
  20. package/.dist/schemas/Order.js +36 -0
  21. package/.dist/schemas/Order.js.map +1 -1
  22. package/.dist/schemas/WalletPassDevice.d.ts +45 -0
  23. package/.dist/schemas/WalletPassDevice.js +51 -0
  24. package/.dist/schemas/WalletPassDevice.js.map +1 -0
  25. package/.dist/sellout-proto.js +5151 -341
  26. package/.dist/utils/OrderUtil.js +0 -79
  27. package/.dist/utils/OrderUtil.js.map +1 -1
  28. package/package.json +3 -3
  29. package/src/graphql/queries/eventsAdminCalender.query.ts +3 -0
  30. package/src/graphql/queries/eventsListOptimized.query.ts +4 -1
  31. package/src/interfaces/IAnalytics.ts +1 -0
  32. package/src/interfaces/IEvent.ts +1 -0
  33. package/src/interfaces/IOrder.ts +21 -7
  34. package/src/interfaces/IPassKitDeviceRegistration.ts +11 -0
  35. package/src/interfaces/ITask.ts +1 -0
  36. package/src/proto/broadcast.proto +14 -0
  37. package/src/proto/email.proto +2 -0
  38. package/src/proto/event.proto +30 -0
  39. package/src/proto/order.proto +77 -0
  40. package/src/schemas/Event.ts +5 -0
  41. package/src/schemas/Order.ts +39 -1
  42. package/src/schemas/WalletPassDevice.ts +46 -0
  43. package/src/utils/OrderUtil.ts +0 -93
@@ -44,99 +44,6 @@ export default {
44
44
  if (!order.tickets) order.tickets = [];
45
45
  if (!order.upgrades) order.upgrades = [];
46
46
 
47
-
48
- // const ticketFees = fees.filter(f => f.appliedTo === "Ticket");
49
- // const upgradeFees = fees.filter(f => f.appliedTo === "Upgrade");
50
- // let orderFees = fees.filter(f => f.appliedTo === "Order");
51
-
52
- // function applyTicketFee(ticket, fee) {
53
- // if (fee.filters.includes("Seated") && !ticket.seat) return 0;
54
- // const noMax = fee.maxAppliedToPrice === 0;
55
- // if (
56
- // (fee.minAppliedToPrice <= ticket.price &&
57
- // ticket.price <= fee.maxAppliedToPrice) ||
58
- // noMax
59
- // ) {
60
- // if (fee.type === "Flat") {
61
- // return fee.value;
62
- // }
63
- // if (fee.type === "Percent") {
64
- // return (ticket.price * fee.value) / 100;
65
- // }
66
- // } else {
67
- // return 0;
68
- // }
69
- // }
70
-
71
- // function applyUpgradeFee(upgrade, fee) {
72
- // const noMax = fee.maxAppliedToPrice === 0;
73
- // if (
74
- // (fee.minAppliedToPrice <= upgrade.price &&
75
- // upgrade.price <= fee.minAppliedToPrice) ||
76
- // noMax
77
- // ) {
78
- // if (fee.type === "Flat") {
79
- // return fee.value;
80
- // }
81
- // if (fee.type === "Percent") {
82
- // return (upgrade.price * fee.value) / 100;
83
- // }
84
- // } else {
85
- // return 0;
86
- // }
87
- // }
88
-
89
- // function applyOrderFee(orderSubtotal, fee) {
90
- // if (fee.type === "Flat") {
91
- // return orderSubtotal + fee.value;
92
- // }
93
- // if (fee.type === "Percent") {
94
- // return orderSubtotal / (1 - fee.value / 100);
95
- // }
96
- // }
97
-
98
- // const ticketTotal = order.tickets.reduce(
99
- // (cur, ticket) => cur + ticket.price,
100
- // 0
101
- // );
102
-
103
- // const ticketFeeTotal = order.tickets.reduce((cur, ticket) => {
104
- // return (
105
- // cur +
106
- // ticketFees.reduce((cur, fee) => cur + applyTicketFee(ticket, fee), 0)
107
- // );
108
- // }, 0);
109
-
110
- // const upgradeTotal = order.upgrades.reduce(
111
- // (cur, upgrade) => cur + upgrade.price,
112
- // 0
113
- // );
114
-
115
- // const upgradeFeeTotal = order.upgrades.reduce((cur, upgrade) => {
116
- // return (
117
- // cur +
118
- // upgradeFees.reduce((cur, fee) => cur + applyUpgradeFee(upgrade, fee), 0)
119
- // );
120
- // }, 0);
121
- // const orderSubtotal =
122
- // ticketTotal + ticketFeeTotal + upgradeTotal + upgradeFeeTotal;
123
-
124
- // // Order matters here. Flat type fees must be
125
- // // applied before Percent type fees
126
- // orderFees = orderFees.sort(({ type }) => {
127
- // if (type === "Flat") return -1;
128
- // return 1;
129
- // });
130
-
131
- // const orderTotal = orderFees.reduce((cur, fee) => {
132
- // return applyOrderFee(cur, fee);
133
- // }, orderSubtotal) || 0;
134
-
135
- // console.log("orderTotal orderTotal+++++>>",orderTotal );
136
-
137
- // return Math.round(orderTotal);
138
-
139
-
140
47
  const ticketTotal = order.tickets.reduce(
141
48
  (cur, ticket) => cur + ticket.price,
142
49
  0