@gomusdev/web-components 1.55.3 → 1.56.1

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.
@@ -10953,25 +10953,26 @@ function formatCurrency$1(priceCents) {
10953
10953
  }
10954
10954
  let uuid$2 = 1;
10955
10955
  function isUITicket(x) {
10956
- return x.product_type === "Ticket";
10956
+ return x.type === "Ticket";
10957
10957
  }
10958
10958
  function createUITicket(apiTicket, options) {
10959
10959
  const uiTicket = {
10960
10960
  ...apiTicket,
10961
10961
  uid: uuid$2++,
10962
10962
  selectedTime: options?.selectedTime ?? "",
10963
- product_type: "Ticket",
10964
- type: { time_slot: "timeslot", normal: "day", annual: "annual" }[apiTicket.ticket_type],
10963
+ type: "Ticket",
10964
+ // Product_type
10965
+ subtype: { time_slot: "timeslot", normal: "day", annual: "annual" }[apiTicket.ticket_type],
10965
10966
  shop_order: apiTicket.shop_order ?? 0
10966
10967
  };
10967
10968
  return uiTicket;
10968
10969
  }
10969
- function initUITimeslotTickets(tickets, selectedTime2 = "") {
10970
- return sort(Object.values(tickets).map((ticket) => createUITicket(ticket, { selectedTime: selectedTime2 })), (f) => f.shop_order);
10970
+ function initUITimeslotTickets(tickets, selectedTime = "") {
10971
+ return sort(Object.values(tickets).map((ticket) => createUITicket(ticket, { selectedTime })), (f) => f.shop_order);
10971
10972
  }
10972
- function filterAvailabletickets(tickets, selectedTime2 = "") {
10973
+ function filterAvailabletickets(tickets, selectedTime = "") {
10973
10974
  let available = Object.entries(tickets);
10974
- if (selectedTime2 !== "") available = available.filter(([, t]) => t.total_capacities?.[selectedTime2] && t.total_capacities[selectedTime2] > 0);
10975
+ if (selectedTime !== "") available = available.filter(([, t]) => t.total_capacities?.[selectedTime] && t.total_capacities[selectedTime] > 0);
10975
10976
  return Object.fromEntries(available);
10976
10977
  }
10977
10978
  const maxQuantity_Quotas = function(manager, cart, item, preCart) {
@@ -10997,38 +10998,48 @@ const maxQuantity_Quotas = function(manager, cart, item, preCart) {
10997
10998
  unavailable: total === 0
10998
10999
  };
10999
11000
  };
11000
- function isUIScaledPricesTicket(x) {
11001
- return x.product_type === "Event";
11001
+ function isEventTicket(x) {
11002
+ return x.type === "Event";
11003
+ }
11004
+ function isScaleEventTicket(x) {
11005
+ return isEventTicket(x) && x.subtype === "scale";
11002
11006
  }
11003
11007
  let uuid$1 = 1;
11004
- function createUIScaledPricesTicket(apiTicket, dateId, options) {
11005
- const finalOptions = {
11006
- minAvailableCapacity: 0,
11007
- selectedTime: "",
11008
- event_title: "",
11009
- ...options ?? {},
11010
- ...apiTicket
11011
- };
11008
+ function buildUIEventTicket(apiTicket, dateId, options) {
11012
11009
  const product = {
11013
- product_type: "Event",
11010
+ type: "Event",
11011
+ // todo: remove this id and keep explicit ids from event and date and price
11014
11012
  id: dateId,
11015
11013
  tax_included: true,
11016
11014
  ...apiTicket
11017
11015
  };
11018
- const uiTicket = {
11016
+ if (options?.date) {
11017
+ const date2 = options.date;
11018
+ options.date_title = date2.title || "";
11019
+ options.date_description = date2.description || "";
11020
+ options.event_title = date2.event_title || "";
11021
+ options.event_subtitle = date2.event_sub_title || "";
11022
+ options.price_title = apiTicket.title || "";
11023
+ options.price_description = apiTicket.description || "";
11024
+ }
11025
+ return {
11019
11026
  uid: uuid$1++,
11020
11027
  dateId,
11021
- scalePriceId: apiTicket.scale_price_id,
11028
+ minAvailableCapacity: 0,
11029
+ selectedTime: "",
11030
+ ...options,
11022
11031
  ...product,
11023
11032
  ...apiTicket,
11024
- ...finalOptions,
11025
- type: "scale"
11033
+ type: "Event",
11034
+ subtype: apiTicket.scale_price_id === void 0 ? "flat" : "scale"
11026
11035
  };
11027
- return uiTicket;
11036
+ }
11037
+ function createUIEventTicket(apiTicket, dateId, options) {
11038
+ return buildUIEventTicket(apiTicket, dateId, options);
11028
11039
  }
11029
11040
  const maxQuantity_Seats = function(manager, cart, item, preCart) {
11030
11041
  if (manager.capacityPolicy(item) !== "seats") throw new Error("(getMaxQuantitySeats) impossible");
11031
- if (!isUIScaledPricesTicket(item.product)) {
11042
+ if (!isEventTicket(item.product)) {
11032
11043
  throw new Error("(getMaxQuantitySeats) impossible");
11033
11044
  }
11034
11045
  const p2 = item.product;
@@ -11180,7 +11191,7 @@ function createCartItem(product, options) {
11180
11191
  };
11181
11192
  return {
11182
11193
  ...finalOptions,
11183
- type: product.product_type,
11194
+ type: product.type,
11184
11195
  product,
11185
11196
  /**
11186
11197
  * is passed to the Order API
@@ -11188,29 +11199,35 @@ function createCartItem(product, options) {
11188
11199
  orderAttributes() {
11189
11200
  const base = {
11190
11201
  shipped_with_merchandise_id: null,
11191
- shipping_mode: "email"
11202
+ shipping_mode: "email",
11203
+ id: this.product.id
11192
11204
  };
11193
- switch (this.type) {
11205
+ switch (product.type) {
11194
11206
  case "Ticket":
11195
11207
  return {
11196
- id: this.product.id,
11208
+ ...base,
11197
11209
  time: this.time,
11198
- quantity: this.quantity,
11199
- ...base
11210
+ quantity: this.quantity
11200
11211
  };
11201
11212
  case "Event":
11202
- if (!isUIScaledPricesTicket(this.product)) {
11203
- throw new Error("Event ticket is not a scale ticket");
11213
+ switch (product.subtype) {
11214
+ case "flat":
11215
+ return {
11216
+ ...base,
11217
+ quantity: this.quantity
11218
+ };
11219
+ case "scale":
11220
+ return {
11221
+ ...base,
11222
+ quantities: { [product.scale_price_id]: this.quantity }
11223
+ };
11224
+ default:
11225
+ const exhaustedSubtype = product;
11226
+ throw new Error(`(orderAttributes) Unhandled Event subtype: ${exhaustedSubtype}`);
11204
11227
  }
11205
- const scaleTicket = this.product;
11206
- return {
11207
- id: this.product.id,
11208
- quantities: { [scaleTicket.scale_price_id]: this.quantity },
11209
- ...base
11210
- };
11211
11228
  default:
11212
- const exhastedChecking = this.type;
11213
- throw new Error(`(orderAttributes) Unhandled case: ${exhastedChecking}`);
11229
+ const exhaustedChecking = product;
11230
+ throw new Error(`(orderAttributes) Unhandled product type: ${exhaustedChecking}`);
11214
11231
  }
11215
11232
  },
11216
11233
  get uuid() {
@@ -11221,7 +11238,7 @@ function createCartItem(product, options) {
11221
11238
  if (this.time) {
11222
11239
  segments.push(`time: ${this.time}`);
11223
11240
  }
11224
- if (isUIScaledPricesTicket(this.product)) {
11241
+ if (isScaleEventTicket(this.product)) {
11225
11242
  segments.push(`scale_price: ${this.product.scale_price_id}`);
11226
11243
  }
11227
11244
  if (this.display?.discounted) {
@@ -11257,15 +11274,15 @@ function createCartItem(product, options) {
11257
11274
  };
11258
11275
  }
11259
11276
  function generateCartItem(cartItem) {
11260
- const type = cartItem.type;
11277
+ const type = cartItem.product.type;
11261
11278
  switch (type) {
11262
11279
  case "Ticket":
11263
- if (cartItem.product.type === "timeslot" && !inTheFuture(cartItem.time)) return;
11280
+ if (cartItem.product.subtype === "timeslot" && !inTheFuture(cartItem.time)) return;
11264
11281
  const ticket = createUITicket(cartItem.product);
11265
11282
  return createCartItem(ticket, { time: cartItem.time, quantity: cartItem.quantity });
11266
11283
  case "Event":
11267
11284
  if (cartItem.time && !inTheFuture(cartItem.time)) return;
11268
- const event2 = createUIScaledPricesTicket(cartItem.product, cartItem.id);
11285
+ const event2 = createUIEventTicket(cartItem.product, cartItem.id);
11269
11286
  return createCartItem(event2, { time: cartItem.time, quantity: cartItem.quantity });
11270
11287
  default:
11271
11288
  const _exhaustiveCheck = type;
@@ -11323,7 +11340,7 @@ const inTheFuture = (time2) => {
11323
11340
  };
11324
11341
  const defined = (x) => x !== void 0;
11325
11342
  let lastUuid = 0;
11326
- function createCart(products) {
11343
+ function createCart(products, contingent = 20) {
11327
11344
  const items = proxy([]);
11328
11345
  const coupons = proxy([]);
11329
11346
  let paymentModeId = void 0;
@@ -11486,10 +11503,12 @@ function createCapacityManager() {
11486
11503
  if (saveToLocalStorage2) saveCapacityToLocalStorage(this.allSeats, this.allQuotas);
11487
11504
  },
11488
11505
  capacityPolicy(item) {
11489
- switch (item.type) {
11506
+ const type = item.product.type;
11507
+ switch (type) {
11490
11508
  case "Ticket":
11491
- const product = item.product;
11492
- switch (product.type) {
11509
+ const product1 = item.product;
11510
+ const subtype1 = product1.subtype;
11511
+ switch (subtype1) {
11493
11512
  case "timeslot":
11494
11513
  case "event:ticket":
11495
11514
  case "day":
@@ -11499,21 +11518,23 @@ function createCapacityManager() {
11499
11518
  return "unlimited";
11500
11519
  // UNLIMITED CASE
11501
11520
  default:
11502
- const unhandled2 = product.type;
11521
+ const unhandled2 = subtype1;
11503
11522
  throw new Error(`(getMaxAvailability) Unhandled case: ${unhandled2}`);
11504
11523
  }
11505
11524
  case "Event":
11506
11525
  const product2 = item.product;
11507
- switch (product2.type) {
11526
+ const subtype2 = product2.subtype;
11527
+ switch (subtype2) {
11528
+ case "flat":
11508
11529
  case "scale":
11509
11530
  return "seats";
11510
11531
  // SEATS CASE
11511
11532
  default:
11512
- const unhandled2 = product2.type;
11533
+ const unhandled2 = subtype2;
11513
11534
  throw new Error(`(getMaxAvailability) Unhandled case: ${unhandled2}`);
11514
11535
  }
11515
11536
  default:
11516
- const unhandled = item.type;
11537
+ const unhandled = type;
11517
11538
  throw new Error(`(getMaxAvailability) Unhandled case: ${unhandled}`);
11518
11539
  }
11519
11540
  },
@@ -16804,7 +16825,7 @@ var root$c = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-te
16804
16825
  function Event$2($$anchor, $$props) {
16805
16826
  push($$props, true);
16806
16827
  let cartItem = prop($$props, "cartItem", 7);
16807
- if (!isUIScaledPricesTicket(cartItem().product)) throw new Error("Product is not an event ticket");
16828
+ if (!isEventTicket(cartItem().product)) throw new Error("Product is not an event ticket");
16808
16829
  const product = cartItem().product;
16809
16830
  var $$exports = {
16810
16831
  get cartItem() {
@@ -16894,7 +16915,7 @@ function Ticket($$anchor, $$props) {
16894
16915
  append($$anchor3, span_2);
16895
16916
  };
16896
16917
  if_block(node_1, ($$render) => {
16897
- if (cartItem().product.type === "timeslot") $$render(consequent);
16918
+ if (cartItem().product.subtype === "timeslot") $$render(consequent);
16898
16919
  });
16899
16920
  }
16900
16921
  template_effect(($0) => set_text(text_1, $0), [
@@ -17030,7 +17051,7 @@ function Item$1($$anchor, $$props) {
17030
17051
  if_block(
17031
17052
  node_2,
17032
17053
  ($$render) => {
17033
- if (displayItem().product.product_type === "Event") $$render(consequent_1);
17054
+ if (displayItem().product.type === "Event") $$render(consequent_1);
17034
17055
  },
17035
17056
  true
17036
17057
  );
@@ -17038,7 +17059,7 @@ function Item$1($$anchor, $$props) {
17038
17059
  append($$anchor3, fragment_2);
17039
17060
  };
17040
17061
  if_block(node_1, ($$render) => {
17041
- if (displayItem().product.product_type === "Ticket") $$render(consequent);
17062
+ if (displayItem().product.type === "Ticket") $$render(consequent);
17042
17063
  else $$render(alternate, false);
17043
17064
  });
17044
17065
  }
@@ -17178,7 +17199,7 @@ function createDisplayCart(baseCart, apiItems) {
17178
17199
  const attrs = apiItem.attributes;
17179
17200
  const scalePriceId = getScalePriceId(attrs);
17180
17201
  const itemInBaseCart = baseCart.items.find(
17181
- (i) => i.type.toLowerCase() === apiItem.type.toLowerCase() && i.product.id === attrs.id && (!attrs.time || i.time === attrs.time) && (scalePriceId === void 0 || isUIScaledPricesTicket(i.product) && i.product.scale_price_id === scalePriceId)
17202
+ (i) => i.type.toLowerCase() === apiItem.type.toLowerCase() && i.product.id === attrs.id && (!attrs.time || i.time === attrs.time) && (scalePriceId === void 0 || isEventTicket(i.product) && i.product.scale_price_id === scalePriceId)
17182
17203
  );
17183
17204
  if (!itemInBaseCart) {
17184
17205
  console.error("(go-cart) Ignoring unmatched cart line", { type: apiItem.type, attrs });
@@ -35010,7 +35031,10 @@ async function loadDayTickets(segment) {
35010
35031
  shop.capacityManager.addQuotas(quotas);
35011
35032
  const available = filterAvailabletickets(tickets, timeslot);
35012
35033
  const uiTickets = initUITimeslotTickets(available, timeslot);
35013
- segment.preCart = createCart(uiTickets);
35034
+ segment.preCart = createCart();
35035
+ for (const ticket of uiTickets) {
35036
+ segment.preCart.addItem(createCartItem(ticket, { time: timeslot }));
35037
+ }
35014
35038
  }
35015
35039
  async function load_Event_ScaledPricesTickets(segment) {
35016
35040
  const tsd = segment.ticketSelectionDetails;
@@ -35038,11 +35062,11 @@ async function load_Event_ScaledPricesTickets(segment) {
35038
35062
  const eid = tsd.eventIds[0];
35039
35063
  const eventDate = await shop.asyncFetch(() => shop.getEventDetailsOnDate(eid, segment.dateId));
35040
35064
  if (eventDate.prices) {
35041
- const UITickets = eventDate.prices.map((t) => createUIScaledPricesTicket(t, segment.dateId, {
35042
- selectedTime: eventDate.start_time,
35043
- event_title: eventDate.event_title
35044
- })) || [];
35045
- segment.preCart = createCart(UITickets);
35065
+ segment.preCart = createCart();
35066
+ for (const price of eventDate.prices) {
35067
+ const ticket = createUIEventTicket(price, segment.dateId, { event_title: eventDate.event_title });
35068
+ segment.preCart.addItem(createCartItem(ticket, { time: eventDate.start_time }));
35069
+ }
35046
35070
  } else console.warn("(loadEventScaledPricesTickets) event.prices is undefined");
35047
35071
  if (eventDate.seats) shop.capacityManager.addSeats(segment.dateId, eventDate.seats);
35048
35072
  else console.warn("(loadEventScaledPricesTickets) event.seats is undefined");
@@ -35086,7 +35110,10 @@ async function loadEventTickets(segment) {
35086
35110
  shop.capacityManager.addQuotas(quotas);
35087
35111
  const available = filterAvailabletickets(tickets, tsd.selectedTime);
35088
35112
  const uiTickets = initUITimeslotTickets(available, tsd.selectedTime);
35089
- segment.preCart = createCart(uiTickets);
35113
+ segment.preCart = createCart();
35114
+ for (const ticket of uiTickets) {
35115
+ segment.preCart.addItem(createCartItem(ticket, { time: tsd.selectedTime }));
35116
+ }
35090
35117
  }
35091
35118
  const TWO_HOURS_IN_MILLISECONDS = 2 * 60 * 60 * 1e3;
35092
35119
  async function load_Events_ScaledPricesTickets(segment) {
@@ -35140,9 +35167,10 @@ async function load_Events_ScaledPricesTickets(segment) {
35140
35167
  if (date2.prices) {
35141
35168
  let prices = date2.prices;
35142
35169
  if (segment.query) prices = prices.filter((p2) => p2.title.includes(segment.query));
35143
- const tickets = prices.map((t) => createUIScaledPricesTicket(t, date2.id, { selectedTime: date2.start_time, event_title: date2.event_title }));
35144
- const cartItems = tickets.map((t) => createCartItem(t));
35145
- segment.preCart.addItems(cartItems);
35170
+ for (const price of prices) {
35171
+ const ticket = createUIEventTicket(price, date2.id, { event_title: date2.event_title });
35172
+ segment.preCart.addItem(createCartItem(ticket, { time: date2.start_time }));
35173
+ }
35146
35174
  } else console.warn("(load_Events_ScaledPricesTickets) event.prices is undefined");
35147
35175
  if (date2.seats) {
35148
35176
  shop.capacityManager.addSeats(date2.id, date2.seats);
@@ -35179,7 +35207,10 @@ async function loadTimeslotTickets(segment) {
35179
35207
  shop.capacityManager.addQuotas(quotas);
35180
35208
  const available = filterAvailabletickets(tickets, tsd.selectedTime);
35181
35209
  const uiTickets = initUITimeslotTickets(available, tsd.selectedTime);
35182
- segment.preCart = createCart(uiTickets);
35210
+ segment.preCart = createCart();
35211
+ for (const ticket of uiTickets) {
35212
+ segment.preCart.addItem(createCartItem(ticket, { time: tsd.selectedTime }));
35213
+ }
35183
35214
  }
35184
35215
  class SegmentDetails {
35185
35216
  #ticketSelectionDetails;
@@ -35415,43 +35446,6 @@ function TicketSegmentEmpty($$anchor, $$props) {
35415
35446
  pop();
35416
35447
  }
35417
35448
  customElements.define("go-ticket-segment-empty", create_custom_element(TicketSegmentEmpty, {}, [], []));
35418
- function selectedTime(product, tsd) {
35419
- switch (product.product_type) {
35420
- case "Ticket":
35421
- if (!isUITicket(product)) {
35422
- throw new Error("(selectedTime) this should not happen");
35423
- }
35424
- const ticket = product;
35425
- switch (ticket.type) {
35426
- case "timeslot":
35427
- if (!tsd.selectedTimeslot) {
35428
- throw new Error("(selectedTime) selected timeslot is undefined");
35429
- }
35430
- return tsd.selectedTimeslot;
35431
- case "annual":
35432
- return berlinNowISO();
35433
- case "day":
35434
- return product.selectedTime;
35435
- case "event:ticket":
35436
- return tsd.selectedDate;
35437
- default:
35438
- const exhaustedChecking2 = ticket.type;
35439
- throw new Error(`(selectedTime) Unhandled Ticket Type: ${exhaustedChecking2}`);
35440
- }
35441
- case "Event":
35442
- if (!isUIScaledPricesTicket(product)) {
35443
- throw new Error("(selectedTime) this should not happen");
35444
- }
35445
- return product.selectedTime || "";
35446
- default:
35447
- const exhaustedChecking = product.product_type;
35448
- throw new Error(`(selectedTime) Unhandled product type: ${exhaustedChecking}`);
35449
- }
35450
- }
35451
- function berlinNowISO() {
35452
- const d = /* @__PURE__ */ new Date();
35453
- return d.toISOString();
35454
- }
35455
35449
  var root_1$3 = /* @__PURE__ */ from_html(`<span class="go-tickets-item-title-event-title"> </span> <span class="go-tickets-item-title-product-title"> </span>`, 1);
35456
35450
  var root_4 = /* @__PURE__ */ from_html(`<option> </option>`);
35457
35451
  var root_3$1 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-tickets-item-title"><!></li> <li class="go-tickets-item-description" data-go-tickets-description=""><!></li> <li class="go-tickets-item-price" data-go-tickets-price=""> </li> <li class="go-tickets-item-quality" data-go-tickets-quality=""><select class="go-tickets-item-select"></select></li></ul></article></li>`);
@@ -35467,10 +35461,10 @@ function Item($$anchor, $$props) {
35467
35461
  reset(span_1);
35468
35462
  template_effect(
35469
35463
  ($0) => {
35470
- set_text(text2, `${item().product.event_title ?? ""} - ${$0 ?? ""}`);
35464
+ set_text(text2, `${item().product.eventTitle ?? ""} - ${$0 ?? ""}`);
35471
35465
  set_text(text_1, item().product.title);
35472
35466
  },
35473
- [() => formatTime(item().product.selectedTime)]
35467
+ [() => formatTime(item().time)]
35474
35468
  );
35475
35469
  append($$anchor2, fragment);
35476
35470
  };
@@ -35491,10 +35485,9 @@ function Item($$anchor, $$props) {
35491
35485
  function update(ci, target, tsd) {
35492
35486
  const el = target;
35493
35487
  ci.quantity = parseInt(el.value);
35494
- ci.time = selectedTime(ci.product, tsd);
35495
35488
  }
35496
35489
  let titleSnippet = default_title;
35497
- if (isUIScaledPricesTicket(item().product)) titleSnippet = scaled_title;
35490
+ if (isEventTicket(item().product)) titleSnippet = scaled_title;
35498
35491
  var $$exports = {
35499
35492
  get item() {
35500
35493
  return item();
@@ -1,8 +1,8 @@
1
1
  export declare function createMockUITicket(): {
2
2
  uid: number;
3
3
  selectedTime: string;
4
- product_type: import('../../../lib/models/cart/types').ProductType;
5
- type: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
4
+ type: "Ticket";
5
+ subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
6
6
  shop_order: number;
7
7
  id: number;
8
8
  title: string;
@@ -57,8 +57,8 @@ export declare function createMockUITicket(): {
57
57
  } | {
58
58
  uid: number;
59
59
  selectedTime: string;
60
- product_type: import('../../../lib/models/cart/types').ProductType;
61
- type: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
60
+ type: "Ticket";
61
+ subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
62
62
  shop_order: number;
63
63
  id: number;
64
64
  title: string;
@@ -105,8 +105,8 @@ export declare function createMockUITicket(): {
105
105
  } | {
106
106
  uid: number;
107
107
  selectedTime: string;
108
- product_type: import('../../../lib/models/cart/types').ProductType;
109
- type: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
108
+ type: "Ticket";
109
+ subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
110
110
  shop_order: number;
111
111
  id: number;
112
112
  title: string;
@@ -3,30 +3,111 @@ import { DetailsWrapper } from '../../../../../../../lib/helpers/context.svelte.
3
3
  export type TicketSegmentFilter = 'timeslot' | 'annual' | 'custom' | 'day' | 'event:scaled-price' | 'event:ticket' | 'events:scaled-price';
4
4
  export declare class SegmentDetails {
5
5
  preCart: {
6
- items: import('../../../../../../lib/models/cart/types').CartItem[];
6
+ items: {
7
+ type: "Ticket" | "Event";
8
+ product: import('../../../../../../lib/models/cart/types').Product;
9
+ orderAttributes(): {
10
+ time: string | undefined;
11
+ quantity: number | undefined;
12
+ shipped_with_merchandise_id: null;
13
+ shipping_mode: string;
14
+ id: number;
15
+ } | {
16
+ quantity: number | undefined;
17
+ shipped_with_merchandise_id: null;
18
+ shipping_mode: string;
19
+ id: number;
20
+ } | {
21
+ quantities: {
22
+ [x: number]: number | undefined;
23
+ };
24
+ shipped_with_merchandise_id: null;
25
+ shipping_mode: string;
26
+ id: number;
27
+ };
28
+ uuid: string;
29
+ subUId: string;
30
+ toString(): string;
31
+ price_cents: number;
32
+ price_formatted: string;
33
+ final_price_cents: number;
34
+ final_price_formatted: string;
35
+ total_price_cents: number;
36
+ total_price_formatted: string;
37
+ quantity?: number | undefined;
38
+ time?: string | undefined;
39
+ display?: {
40
+ discounted: boolean;
41
+ reference_uuid: string;
42
+ originalPrice: number;
43
+ } | undefined;
44
+ }[];
7
45
  coupons: string[];
8
46
  paymentModeId: undefined;
9
47
  uid: string;
10
- readonly nonEmptyItems: import('../../../../../../lib/models/cart/types').CartItem[];
48
+ readonly nonEmptyItems: {
49
+ type: "Ticket" | "Event";
50
+ product: import('../../../../../../lib/models/cart/types').Product;
51
+ orderAttributes(): {
52
+ time: string | undefined;
53
+ quantity: number | undefined;
54
+ shipped_with_merchandise_id: null;
55
+ shipping_mode: string;
56
+ id: number;
57
+ } | {
58
+ quantity: number | undefined;
59
+ shipped_with_merchandise_id: null;
60
+ shipping_mode: string;
61
+ id: number;
62
+ } | {
63
+ quantities: {
64
+ [x: number]: number | undefined;
65
+ };
66
+ shipped_with_merchandise_id: null;
67
+ shipping_mode: string;
68
+ id: number;
69
+ };
70
+ uuid: string;
71
+ subUId: string;
72
+ toString(): string;
73
+ price_cents: number;
74
+ price_formatted: string;
75
+ final_price_cents: number;
76
+ final_price_formatted: string;
77
+ total_price_cents: number;
78
+ total_price_formatted: string;
79
+ quantity?: number | undefined;
80
+ time?: string | undefined;
81
+ display?: {
82
+ discounted: boolean;
83
+ reference_uuid: string;
84
+ originalPrice: number;
85
+ } | undefined;
86
+ }[];
11
87
  readonly totalPriceCents: number;
12
88
  readonly totalQuantity: number;
13
89
  toString(): string;
14
90
  orderData(): {
15
91
  items: {
16
- type: import('../../../../../../lib/models/cart/types').ProductType;
92
+ type: "Ticket" | "Event";
17
93
  attributes: {
94
+ time: string | undefined;
95
+ quantity: number | undefined;
18
96
  shipped_with_merchandise_id: null;
19
97
  shipping_mode: string;
20
98
  id: number;
21
- time: string | undefined;
22
- quantity: number | undefined;
23
99
  } | {
100
+ quantity: number | undefined;
24
101
  shipped_with_merchandise_id: null;
25
102
  shipping_mode: string;
26
103
  id: number;
104
+ } | {
27
105
  quantities: {
28
106
  [x: number]: number | undefined;
29
107
  };
108
+ shipped_with_merchandise_id: null;
109
+ shipping_mode: string;
110
+ id: number;
30
111
  };
31
112
  }[];
32
113
  shipping_address_id: null;
@@ -1,3 +1,3 @@
1
1
  import { TicketSelectionDetails } from '../../../../../../components/ticketSelection/TicketSelectionDetails.svelte.ts';
2
- import { Product } from '../../../../../../lib/models/cart/types.ts';
3
- export declare function selectedTime(product: Product, tsd: TicketSelectionDetails): string | import('@internationalized/date').CalendarDate | undefined;
2
+ import { CartItem } from '../../../../../../lib/models/cart/types.ts';
3
+ export declare function selectedTime(cartItem: CartItem, tsd: TicketSelectionDetails): string | undefined;
@@ -0,0 +1,57 @@
1
+ export declare class EventTicketFactories {
2
+ static scaled(title: string, price_cents: number, scale_price_id: number, description?: string): {
3
+ scale_price_id: number;
4
+ title: string;
5
+ description: string;
6
+ group: boolean;
7
+ optional: boolean;
8
+ price_cents: number;
9
+ vat_pct: number;
10
+ accounting_article_id: number;
11
+ accounting_article_type: string;
12
+ };
13
+ static flat(price_cents: number): {
14
+ title: string;
15
+ description: string;
16
+ group: boolean;
17
+ optional: boolean;
18
+ price_cents: number;
19
+ vat_pct: number;
20
+ accounting_article_id: number;
21
+ accounting_article_type: string;
22
+ };
23
+ }
24
+ export declare const eventTicketMocks: {
25
+ scaledTicket1: () => {
26
+ scale_price_id: number;
27
+ title: string;
28
+ description: string;
29
+ group: boolean;
30
+ optional: boolean;
31
+ price_cents: number;
32
+ vat_pct: number;
33
+ accounting_article_id: number;
34
+ accounting_article_type: string;
35
+ };
36
+ scaledTicket2: () => {
37
+ scale_price_id: number;
38
+ title: string;
39
+ description: string;
40
+ group: boolean;
41
+ optional: boolean;
42
+ price_cents: number;
43
+ vat_pct: number;
44
+ accounting_article_id: number;
45
+ accounting_article_type: string;
46
+ };
47
+ flatTicket1: () => {
48
+ title: string;
49
+ description: string;
50
+ group: boolean;
51
+ optional: boolean;
52
+ price_cents: number;
53
+ vat_pct: number;
54
+ accounting_article_id: number;
55
+ accounting_article_type: string;
56
+ };
57
+ };
@@ -1,7 +1,7 @@
1
1
  import { ProductType } from '../../lib/models/cart/types.ts';
2
2
  export declare const TicketFactories: {
3
3
  timeslot(options?: Partial<ReturnType<typeof defaultTicket>>): {
4
- product_type: ProductType;
4
+ type: ProductType;
5
5
  id: number;
6
6
  ticket_type: "time_slot";
7
7
  title: string;
@@ -43,7 +43,7 @@ export declare const TicketFactories: {
43
43
  dynamic_prices: null;
44
44
  };
45
45
  day(options?: Partial<ReturnType<typeof defaultTicket>>): {
46
- product_type: ProductType;
46
+ type: ProductType;
47
47
  id: number;
48
48
  ticket_type: "time_slot" | "normal";
49
49
  title: string;
@@ -86,7 +86,7 @@ export declare const TicketFactories: {
86
86
  };
87
87
  };
88
88
  declare function defaultTicket(): {
89
- product_type: ProductType;
89
+ type: ProductType;
90
90
  id: number;
91
91
  ticket_type: "time_slot";
92
92
  title: string;