@passly-nl/data 1.4.3 → 1.6.0

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 (37) hide show
  1. package/dist/index.d.mts +48 -26
  2. package/dist/index.d.mts.map +1 -1
  3. package/dist/index.mjs +147 -61
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/src/adapter/EventAdapter.ts +10 -1
  7. package/src/adapter/OrderAdapter.ts +3 -2
  8. package/src/adapter/ProductAdapter.ts +3 -1
  9. package/src/adapter/PublicShopAdapter.ts +10 -1
  10. package/src/adapter/ReservationAdapter.ts +4 -2
  11. package/src/dto/event/EventDto.ts +11 -1
  12. package/src/dto/event/ShopElementButtonDto.ts +3 -2
  13. package/src/dto/event/ShopElementDividerDto.ts +3 -2
  14. package/src/dto/event/ShopElementDto.ts +12 -2
  15. package/src/dto/event/ShopElementHeadingDto.ts +3 -3
  16. package/src/dto/event/ShopElementInformationDto.ts +3 -2
  17. package/src/dto/event/ShopElementNoticeDto.ts +3 -3
  18. package/src/dto/event/ShopElementProductDto.ts +3 -2
  19. package/src/dto/event/ShopElementTextDto.ts +3 -2
  20. package/src/dto/order/OrderProductDto.ts +12 -1
  21. package/src/dto/product/ProductDto.ts +21 -1
  22. package/src/dto/publicShop/PublicShopElementButtonDto.ts +3 -2
  23. package/src/dto/publicShop/PublicShopElementDividerDto.ts +3 -2
  24. package/src/dto/publicShop/PublicShopElementDto.ts +12 -2
  25. package/src/dto/publicShop/PublicShopElementHeadingDto.ts +3 -3
  26. package/src/dto/publicShop/PublicShopElementInformationDto.ts +3 -2
  27. package/src/dto/publicShop/PublicShopElementNoticeDto.ts +3 -3
  28. package/src/dto/publicShop/PublicShopElementProductDto.ts +3 -2
  29. package/src/dto/publicShop/PublicShopElementTextDto.ts +3 -2
  30. package/src/dto/publicShop/PublicShopEventDto.ts +11 -1
  31. package/src/dto/publicShop/PublicShopProductDto.ts +11 -1
  32. package/src/dto/reservation/ReservationProductDto.ts +23 -2
  33. package/src/service/MerchantEventProductService.ts +3 -2
  34. package/src/service/MerchantEventProductsService.ts +5 -2
  35. package/src/service/PublicShopService.ts +17 -2
  36. package/src/types/event.ts +4 -0
  37. package/src/types/product.ts +2 -1
package/dist/index.mjs CHANGED
@@ -1462,6 +1462,12 @@ let EventDto = class EventDto {
1462
1462
  set description(value) {
1463
1463
  this.#description = value;
1464
1464
  }
1465
+ get descriptionPlaintext() {
1466
+ return this.#descriptionPlaintext;
1467
+ }
1468
+ set descriptionPlaintext(value) {
1469
+ this.#descriptionPlaintext = value;
1470
+ }
1465
1471
  get startsOn() {
1466
1472
  return this.#startsOn;
1467
1473
  }
@@ -1513,6 +1519,7 @@ let EventDto = class EventDto {
1513
1519
  #id;
1514
1520
  #name;
1515
1521
  #description;
1522
+ #descriptionPlaintext;
1516
1523
  #startsOn;
1517
1524
  #endsOn;
1518
1525
  #minimumAge;
@@ -1521,10 +1528,11 @@ let EventDto = class EventDto {
1521
1528
  #headerFile;
1522
1529
  #createdOn;
1523
1530
  #updatedOn;
1524
- constructor(id, name, description, startsOn, endsOn, minimumAge, status, address, headerFile, createdOn, updatedOn) {
1531
+ constructor(id, name, description, descriptionPlaintext, startsOn, endsOn, minimumAge, status, address, headerFile, createdOn, updatedOn) {
1525
1532
  this.#id = id;
1526
1533
  this.#name = name;
1527
1534
  this.#description = description;
1535
+ this.#descriptionPlaintext = descriptionPlaintext;
1528
1536
  this.#startsOn = startsOn;
1529
1537
  this.#endsOn = endsOn;
1530
1538
  this.#minimumAge = minimumAge;
@@ -1722,6 +1730,12 @@ var ShopElementDto = class {
1722
1730
  set id(value) {
1723
1731
  this.#id = value;
1724
1732
  }
1733
+ get page() {
1734
+ return this.#page;
1735
+ }
1736
+ set page(value) {
1737
+ this.#page = value;
1738
+ }
1725
1739
  get type() {
1726
1740
  return this.#type;
1727
1741
  }
@@ -1729,9 +1743,11 @@ var ShopElementDto = class {
1729
1743
  this.#type = value;
1730
1744
  }
1731
1745
  #id;
1746
+ #page;
1732
1747
  #type;
1733
- constructor(id, type) {
1748
+ constructor(id, type, page) {
1734
1749
  this.#id = id;
1750
+ this.#page = page;
1735
1751
  this.#type = type;
1736
1752
  }
1737
1753
  };
@@ -1760,8 +1776,8 @@ let ShopElementButtonDto = class ShopElementButtonDto extends ShopElementDto {
1760
1776
  #icon;
1761
1777
  #text;
1762
1778
  #url;
1763
- constructor(id, icon, text, url) {
1764
- super(id, "button");
1779
+ constructor(id, page, icon, text, url) {
1780
+ super(id, "button", page);
1765
1781
  this.#icon = icon;
1766
1782
  this.#text = text;
1767
1783
  this.#url = url;
@@ -1786,8 +1802,8 @@ let ShopElementDividerDto = class ShopElementDividerDto extends ShopElementDto {
1786
1802
  }
1787
1803
  #icon;
1788
1804
  #text;
1789
- constructor(id, icon, text) {
1790
- super(id, "divider");
1805
+ constructor(id, page, icon, text) {
1806
+ super(id, "divider", page);
1791
1807
  this.#icon = icon;
1792
1808
  this.#text = text;
1793
1809
  }
@@ -1811,8 +1827,8 @@ let ShopElementHeadingDto = class ShopElementHeadingDto extends ShopElementDto {
1811
1827
  }
1812
1828
  #headingLevel;
1813
1829
  #title;
1814
- constructor(id, headingLevel, title) {
1815
- super(id, "heading");
1830
+ constructor(id, page, headingLevel, title) {
1831
+ super(id, "heading", page);
1816
1832
  this.#headingLevel = headingLevel;
1817
1833
  this.#title = title;
1818
1834
  }
@@ -1822,8 +1838,8 @@ ShopElementHeadingDto = __decorate([dto], ShopElementHeadingDto);
1822
1838
  //#endregion
1823
1839
  //#region src/dto/event/ShopElementInformationDto.ts
1824
1840
  let ShopElementInformationDto = class ShopElementInformationDto extends ShopElementDto {
1825
- constructor(id) {
1826
- super(id, "information");
1841
+ constructor(id, page) {
1842
+ super(id, "information", page);
1827
1843
  }
1828
1844
  };
1829
1845
  ShopElementInformationDto = __decorate([dto], ShopElementInformationDto);
@@ -1859,8 +1875,8 @@ let ShopElementNoticeDto = class ShopElementNoticeDto extends ShopElementDto {
1859
1875
  #noticeType;
1860
1876
  #title;
1861
1877
  #text;
1862
- constructor(id, icon, noticeType, title, text) {
1863
- super(id, "notice");
1878
+ constructor(id, page, icon, noticeType, title, text) {
1879
+ super(id, "notice", page);
1864
1880
  this.#icon = icon;
1865
1881
  this.#noticeType = noticeType;
1866
1882
  this.#title = title;
@@ -1879,8 +1895,8 @@ let ShopElementProductDto = class ShopElementProductDto extends ShopElementDto {
1879
1895
  this.#product = value;
1880
1896
  }
1881
1897
  #product;
1882
- constructor(id, product) {
1883
- super(id, "product");
1898
+ constructor(id, page, product) {
1899
+ super(id, "product", page);
1884
1900
  this.#product = product;
1885
1901
  }
1886
1902
  };
@@ -1896,8 +1912,8 @@ let ShopElementTextDto = class ShopElementTextDto extends ShopElementDto {
1896
1912
  this.#text = value;
1897
1913
  }
1898
1914
  #text;
1899
- constructor(id, text) {
1900
- super(id, "text");
1915
+ constructor(id, page, text) {
1916
+ super(id, "text", page);
1901
1917
  this.#text = text;
1902
1918
  }
1903
1919
  };
@@ -3682,15 +3698,23 @@ let OrderProductDto = class OrderProductDto {
3682
3698
  set image(value) {
3683
3699
  this.#image = value;
3684
3700
  }
3701
+ get type() {
3702
+ return this.#type;
3703
+ }
3704
+ set type(value) {
3705
+ this.#type = value;
3706
+ }
3685
3707
  #id;
3686
3708
  #name;
3687
3709
  #description;
3688
3710
  #image;
3689
- constructor(id, name, description, image) {
3711
+ #type;
3712
+ constructor(id, name, description, image, type) {
3690
3713
  this.#id = id;
3691
3714
  this.#name = name;
3692
3715
  this.#description = description;
3693
3716
  this.#image = image;
3717
+ this.#type = type;
3694
3718
  }
3695
3719
  };
3696
3720
  OrderProductDto = __decorate([dto], OrderProductDto);
@@ -3922,6 +3946,12 @@ let ProductDto = class ProductDto {
3922
3946
  set description(value) {
3923
3947
  this.#description = value;
3924
3948
  }
3949
+ get descriptionPlaintext() {
3950
+ return this.#descriptionPlaintext;
3951
+ }
3952
+ set descriptionPlaintext(value) {
3953
+ this.#descriptionPlaintext = value;
3954
+ }
3925
3955
  get price() {
3926
3956
  return this.#price;
3927
3957
  }
@@ -3946,6 +3976,12 @@ let ProductDto = class ProductDto {
3946
3976
  set isPersonalizationRequired(value) {
3947
3977
  this.#isPersonalizationRequired = value;
3948
3978
  }
3979
+ get isScannable() {
3980
+ return this.#isScannable;
3981
+ }
3982
+ set isScannable(value) {
3983
+ this.#isScannable = value;
3984
+ }
3949
3985
  get isSwappable() {
3950
3986
  return this.#isSwappable;
3951
3987
  }
@@ -4034,6 +4070,7 @@ let ProductDto = class ProductDto {
4034
4070
  #type;
4035
4071
  #name;
4036
4072
  #description;
4073
+ #descriptionPlaintext;
4037
4074
  #price;
4038
4075
  #maxQuantity;
4039
4076
  #isActive;
@@ -4052,11 +4089,13 @@ let ProductDto = class ProductDto {
4052
4089
  #saleEndsOn;
4053
4090
  #availability;
4054
4091
  #sold;
4055
- constructor(id, type, name, description, price, maxQuantity, isActive, isPersonalizationRequired, isSwappable, isTimeslotted, timeSlots, remainingStock, stock, hasSales, image, images, ticketsReleasedOn, showWhenUnavailable, saleStartsOn, saleEndsOn, availability, sold) {
4092
+ #isScannable;
4093
+ constructor(id, type, name, description, descriptionPlaintext, price, maxQuantity, isActive, isPersonalizationRequired, isSwappable, isTimeslotted, timeSlots, remainingStock, stock, hasSales, image, images, ticketsReleasedOn, showWhenUnavailable, saleStartsOn, saleEndsOn, availability, sold, isScannable = true) {
4056
4094
  this.#id = id;
4057
4095
  this.#type = type;
4058
4096
  this.#name = name;
4059
4097
  this.#description = description;
4098
+ this.#descriptionPlaintext = descriptionPlaintext;
4060
4099
  this.#price = price;
4061
4100
  this.#maxQuantity = maxQuantity;
4062
4101
  this.#isActive = isActive;
@@ -4075,6 +4114,7 @@ let ProductDto = class ProductDto {
4075
4114
  this.#saleEndsOn = saleEndsOn;
4076
4115
  this.#availability = availability;
4077
4116
  this.#sold = sold;
4117
+ this.#isScannable = isScannable;
4078
4118
  }
4079
4119
  };
4080
4120
  ProductDto = __decorate([dto], ProductDto);
@@ -4304,6 +4344,12 @@ var PublicShopElementDto = class {
4304
4344
  set id(value) {
4305
4345
  this.#id = value;
4306
4346
  }
4347
+ get page() {
4348
+ return this.#page;
4349
+ }
4350
+ set page(value) {
4351
+ this.#page = value;
4352
+ }
4307
4353
  get type() {
4308
4354
  return this.#type;
4309
4355
  }
@@ -4311,9 +4357,11 @@ var PublicShopElementDto = class {
4311
4357
  this.#type = value;
4312
4358
  }
4313
4359
  #id;
4360
+ #page;
4314
4361
  #type;
4315
- constructor(id, type) {
4362
+ constructor(id, type, page) {
4316
4363
  this.#id = id;
4364
+ this.#page = page;
4317
4365
  this.#type = type;
4318
4366
  }
4319
4367
  };
@@ -4342,8 +4390,8 @@ let PublicShopElementButtonDto = class PublicShopElementButtonDto extends Public
4342
4390
  #icon;
4343
4391
  #text;
4344
4392
  #url;
4345
- constructor(id, icon, text, url) {
4346
- super(id, "button");
4393
+ constructor(id, page, icon, text, url) {
4394
+ super(id, "button", page);
4347
4395
  this.#icon = icon;
4348
4396
  this.#text = text;
4349
4397
  this.#url = url;
@@ -4368,8 +4416,8 @@ let PublicShopElementDividerDto = class PublicShopElementDividerDto extends Publ
4368
4416
  }
4369
4417
  #icon;
4370
4418
  #text;
4371
- constructor(id, icon, text) {
4372
- super(id, "divider");
4419
+ constructor(id, page, icon, text) {
4420
+ super(id, "divider", page);
4373
4421
  this.#icon = icon;
4374
4422
  this.#text = text;
4375
4423
  }
@@ -4393,8 +4441,8 @@ let PublicShopElementHeadingDto = class PublicShopElementHeadingDto extends Publ
4393
4441
  }
4394
4442
  #headingLevel;
4395
4443
  #title;
4396
- constructor(id, headingLevel, title) {
4397
- super(id, "heading");
4444
+ constructor(id, page, headingLevel, title) {
4445
+ super(id, "heading", page);
4398
4446
  this.#headingLevel = headingLevel;
4399
4447
  this.#title = title;
4400
4448
  }
@@ -4404,8 +4452,8 @@ PublicShopElementHeadingDto = __decorate([dto], PublicShopElementHeadingDto);
4404
4452
  //#endregion
4405
4453
  //#region src/dto/publicShop/PublicShopElementInformationDto.ts
4406
4454
  let PublicShopElementInformationDto = class PublicShopElementInformationDto extends PublicShopElementDto {
4407
- constructor(id) {
4408
- super(id, "information");
4455
+ constructor(id, page) {
4456
+ super(id, "information", page);
4409
4457
  }
4410
4458
  };
4411
4459
  PublicShopElementInformationDto = __decorate([dto], PublicShopElementInformationDto);
@@ -4441,8 +4489,8 @@ let PublicShopElementNoticeDto = class PublicShopElementNoticeDto extends Public
4441
4489
  #noticeType;
4442
4490
  #title;
4443
4491
  #text;
4444
- constructor(id, icon, noticeType, title, text) {
4445
- super(id, "notice");
4492
+ constructor(id, page, icon, noticeType, title, text) {
4493
+ super(id, "notice", page);
4446
4494
  this.#icon = icon;
4447
4495
  this.#noticeType = noticeType;
4448
4496
  this.#title = title;
@@ -4461,8 +4509,8 @@ let PublicShopElementProductDto = class PublicShopElementProductDto extends Publ
4461
4509
  this.#product = value;
4462
4510
  }
4463
4511
  #product;
4464
- constructor(id, product) {
4465
- super(id, "product");
4512
+ constructor(id, page, product) {
4513
+ super(id, "product", page);
4466
4514
  this.#product = product;
4467
4515
  }
4468
4516
  };
@@ -4478,8 +4526,8 @@ let PublicShopElementTextDto = class PublicShopElementTextDto extends PublicShop
4478
4526
  this.#text = value;
4479
4527
  }
4480
4528
  #text;
4481
- constructor(id, text) {
4482
- super(id, "text");
4529
+ constructor(id, page, text) {
4530
+ super(id, "text", page);
4483
4531
  this.#text = text;
4484
4532
  }
4485
4533
  };
@@ -4506,6 +4554,12 @@ let PublicShopEventDto = class PublicShopEventDto {
4506
4554
  set description(value) {
4507
4555
  this.#description = value;
4508
4556
  }
4557
+ get descriptionPlaintext() {
4558
+ return this.#descriptionPlaintext;
4559
+ }
4560
+ set descriptionPlaintext(value) {
4561
+ this.#descriptionPlaintext = value;
4562
+ }
4509
4563
  get status() {
4510
4564
  return this.#status;
4511
4565
  }
@@ -4545,16 +4599,18 @@ let PublicShopEventDto = class PublicShopEventDto {
4545
4599
  #id;
4546
4600
  #name;
4547
4601
  #description;
4602
+ #descriptionPlaintext;
4548
4603
  #status;
4549
4604
  #address;
4550
4605
  #headerFile;
4551
4606
  #minimumAge;
4552
4607
  #startsOn;
4553
4608
  #endsOn;
4554
- constructor(id, name, description, status, address, headerFile, minimumAge, startsOn, endsOn) {
4609
+ constructor(id, name, description, descriptionPlaintext, status, address, headerFile, minimumAge, startsOn, endsOn) {
4555
4610
  this.#id = id;
4556
4611
  this.#name = name;
4557
4612
  this.#description = description;
4613
+ this.#descriptionPlaintext = descriptionPlaintext;
4558
4614
  this.#status = status;
4559
4615
  this.#address = address;
4560
4616
  this.#headerFile = headerFile;
@@ -4616,6 +4672,12 @@ let PublicShopProductDto = class PublicShopProductDto {
4616
4672
  set description(value) {
4617
4673
  this.#description = value;
4618
4674
  }
4675
+ get descriptionPlaintext() {
4676
+ return this.#descriptionPlaintext;
4677
+ }
4678
+ set descriptionPlaintext(value) {
4679
+ this.#descriptionPlaintext = value;
4680
+ }
4619
4681
  get price() {
4620
4682
  return this.#price;
4621
4683
  }
@@ -4680,6 +4742,7 @@ let PublicShopProductDto = class PublicShopProductDto {
4680
4742
  #type;
4681
4743
  #name;
4682
4744
  #description;
4745
+ #descriptionPlaintext;
4683
4746
  #price;
4684
4747
  #maxQuantity;
4685
4748
  #isActive;
@@ -4690,11 +4753,12 @@ let PublicShopProductDto = class PublicShopProductDto {
4690
4753
  #availability;
4691
4754
  #saleStartsOn;
4692
4755
  #saleEndsOn;
4693
- constructor(id, type, name, description, price, maxQuantity, isActive, isTimeslotted, timeSlots, image, images, availability, saleStartsOn, saleEndsOn) {
4756
+ constructor(id, type, name, description, descriptionPlaintext, price, maxQuantity, isActive, isTimeslotted, timeSlots, image, images, availability, saleStartsOn, saleEndsOn) {
4694
4757
  this.#id = id;
4695
4758
  this.#type = type;
4696
4759
  this.#name = name;
4697
4760
  this.#description = description;
4761
+ this.#descriptionPlaintext = descriptionPlaintext;
4698
4762
  this.#price = price;
4699
4763
  this.#maxQuantity = maxQuantity;
4700
4764
  this.#isActive = isActive;
@@ -5104,15 +5168,31 @@ let ReservationProductDto = class ReservationProductDto {
5104
5168
  set image(value) {
5105
5169
  this.#image = value;
5106
5170
  }
5171
+ get price() {
5172
+ return this.#price;
5173
+ }
5174
+ set price(value) {
5175
+ this.#price = value;
5176
+ }
5177
+ get type() {
5178
+ return this.#type;
5179
+ }
5180
+ set type(value) {
5181
+ this.#type = value;
5182
+ }
5107
5183
  #id;
5108
5184
  #name;
5109
5185
  #description;
5110
5186
  #image;
5111
- constructor(id, name, description, image) {
5187
+ #price;
5188
+ #type;
5189
+ constructor(id, name, description, image, price, type) {
5112
5190
  this.#id = id;
5113
5191
  this.#name = name;
5114
5192
  this.#description = description;
5115
5193
  this.#image = image;
5194
+ this.#price = price;
5195
+ this.#type = type;
5116
5196
  }
5117
5197
  };
5118
5198
  ReservationProductDto = __decorate([dto], ReservationProductDto);
@@ -8255,7 +8335,7 @@ let EventAdapter = _EventAdapter = class EventAdapter {
8255
8335
  return new AppTeamDto(data.id, data.name, data.secret, data.checkin_count, data.checkout_count, optional_default(data.creator, AuthAdapter.parseUser), optional_default(data.event, _EventAdapter.parseEvent), optional_default(data.merchant, MerchantAdapter.parseMerchant), (data.products ?? []).map((product) => product.id));
8256
8336
  }
8257
8337
  static parseEvent(data) {
8258
- return new EventDto(data.id, data.name, data.description, DateTimeAdapter.parseDateTime(data.starts_on), DateTimeAdapter.parseDateTime(data.ends_on), data.minimum_age, data.status, optional_default(data.address, AddressAdapter.parseAddress), optional_default(data.header_file, FileSystemAdapter.parsePicture), DateTimeAdapter.parseDateTime(data.created_on), DateTimeAdapter.parseDateTime(data.updated_on));
8338
+ return new EventDto(data.id, data.name, data.description, data.description_plaintext, DateTimeAdapter.parseDateTime(data.starts_on), DateTimeAdapter.parseDateTime(data.ends_on), data.minimum_age, data.status, optional_default(data.address, AddressAdapter.parseAddress), optional_default(data.header_file, FileSystemAdapter.parsePicture), DateTimeAdapter.parseDateTime(data.created_on), DateTimeAdapter.parseDateTime(data.updated_on));
8259
8339
  }
8260
8340
  static parseEventAvailability(data) {
8261
8341
  return new EventAvailabilityDto(data.has_products, data.has_shops, data.has_shops_with_products, data.is_publishable, data.is_published);
@@ -8271,15 +8351,15 @@ let EventAdapter = _EventAdapter = class EventAdapter {
8271
8351
  }
8272
8352
  static parseShopElement(data) {
8273
8353
  switch (data.type) {
8274
- case "button": return new ShopElementButtonDto(data.id, data.icon, data.text, data.url);
8275
- case "divider": return new ShopElementDividerDto(data.id, data.icon, data.text);
8276
- case "heading": return new ShopElementHeadingDto(data.id, data.heading_level, data.title);
8277
- case "information": return new ShopElementInformationDto(data.id);
8278
- case "notice": return new ShopElementNoticeDto(data.id, data.icon, data.notice_type, data.title, data.text);
8279
- case "product": return new ShopElementProductDto(data.id, ProductAdapter.parseProduct(data.product));
8280
- case "text": return new ShopElementTextDto(data.id, data.text);
8354
+ case "button": return new ShopElementButtonDto(data.id, data.page, data.icon, data.text, data.url);
8355
+ case "divider": return new ShopElementDividerDto(data.id, data.page, data.icon, data.text);
8356
+ case "heading": return new ShopElementHeadingDto(data.id, data.page, data.heading_level, data.title);
8357
+ case "information": return new ShopElementInformationDto(data.id, data.page);
8358
+ case "notice": return new ShopElementNoticeDto(data.id, data.page, data.icon, data.notice_type, data.title, data.text);
8359
+ case "product": return new ShopElementProductDto(data.id, data.page, ProductAdapter.parseProduct(data.product));
8360
+ case "text": return new ShopElementTextDto(data.id, data.page, data.text);
8281
8361
  }
8282
- return new ShopElementTextDto("unknown", "Unknown element type.");
8362
+ return new ShopElementTextDto("unknown", data.page, "Unknown element type.");
8283
8363
  }
8284
8364
  static parseStockOverview(data) {
8285
8365
  return new StockOverviewDto(data.total, data.sold, data.remaining, data.items.map(_EventAdapter.parseStockOverviewItem));
@@ -8443,7 +8523,7 @@ let OrderAdapter = _OrderAdapter = class OrderAdapter {
8443
8523
  return new OrderPaymentProviderDto(data.name, data.url);
8444
8524
  }
8445
8525
  static parseOrderProduct(data) {
8446
- return new OrderProductDto(data.id, data.name, data.description, data.image);
8526
+ return new OrderProductDto(data.id, data.name, data.description, optional_default(data.image, FileSystemAdapter.parsePicture), data.type ?? "ticket");
8447
8527
  }
8448
8528
  };
8449
8529
  OrderAdapter = _OrderAdapter = __decorate([adapter], OrderAdapter);
@@ -8471,7 +8551,7 @@ PaymentAdapter = _PaymentAdapter = __decorate([adapter], PaymentAdapter);
8471
8551
  //#region src/adapter/ProductAdapter.ts
8472
8552
  let ProductAdapter = class ProductAdapter {
8473
8553
  static parseProduct(data) {
8474
- return new ProductDto(data.id, data.type, data.name, data.description, optional_default(data.price, PaymentAdapter.parseCost), data.max_quantity, data.is_active, data.is_personalization_required, data.is_swappable, data.is_timeslotted, optionalArray_default(data.time_slots, EventAdapter.parseTimeSlot) ?? [], data.remaining_stock, optional_default(data.stock_pool, EventAdapter.parseStockPool), data.has_sales, optional_default(data.image, FileSystemAdapter.parsePicture), optionalArray_default(data.images, FileSystemAdapter.parsePicture), optional_default(data.tickets_released_on, DateTimeAdapter.parseDateTime), data.show_when_unavailable, optional_default(data.sale_starts_on, DateTimeAdapter.parseDateTime), optional_default(data.sale_ends_on, DateTimeAdapter.parseDateTime), data.availability, data.sold);
8554
+ return new ProductDto(data.id, data.type, data.name, data.description, data.description_plaintext, optional_default(data.price, PaymentAdapter.parseCost), data.max_quantity, data.is_active, data.is_personalization_required, data.is_swappable, data.is_timeslotted, optionalArray_default(data.time_slots, EventAdapter.parseTimeSlot) ?? [], data.remaining_stock, optional_default(data.stock_pool, EventAdapter.parseStockPool), data.has_sales, optional_default(data.image, FileSystemAdapter.parsePicture), optionalArray_default(data.images, FileSystemAdapter.parsePicture), optional_default(data.tickets_released_on, DateTimeAdapter.parseDateTime), data.show_when_unavailable, optional_default(data.sale_starts_on, DateTimeAdapter.parseDateTime), optional_default(data.sale_ends_on, DateTimeAdapter.parseDateTime), data.availability, data.sold, data.is_scannable ?? true);
8475
8555
  }
8476
8556
  };
8477
8557
  ProductAdapter = __decorate([adapter], ProductAdapter);
@@ -8497,24 +8577,24 @@ let PublicShopAdapter = _PublicShopAdapter = class PublicShopAdapter {
8497
8577
  }
8498
8578
  static parsePublicShopElement(data) {
8499
8579
  switch (data.type) {
8500
- case "button": return new PublicShopElementButtonDto(data.id, data.icon, data.text, data.url);
8501
- case "divider": return new PublicShopElementDividerDto(data.id, data.icon, data.text);
8502
- case "heading": return new PublicShopElementHeadingDto(data.id, data.heading_level, data.title);
8503
- case "information": return new PublicShopElementInformationDto(data.id);
8504
- case "notice": return new PublicShopElementNoticeDto(data.id, data.icon, data.notice_type, data.title, data.text);
8505
- case "product": return new PublicShopElementProductDto(data.id, _PublicShopAdapter.parsePublicShopProduct(data.product));
8506
- case "text": return new PublicShopElementTextDto(data.id, data.text);
8580
+ case "button": return new PublicShopElementButtonDto(data.id, data.page, data.icon, data.text, data.url);
8581
+ case "divider": return new PublicShopElementDividerDto(data.id, data.page, data.icon, data.text);
8582
+ case "heading": return new PublicShopElementHeadingDto(data.id, data.page, data.heading_level, data.title);
8583
+ case "information": return new PublicShopElementInformationDto(data.id, data.page);
8584
+ case "notice": return new PublicShopElementNoticeDto(data.id, data.page, data.icon, data.notice_type, data.title, data.text);
8585
+ case "product": return new PublicShopElementProductDto(data.id, data.page, _PublicShopAdapter.parsePublicShopProduct(data.product));
8586
+ case "text": return new PublicShopElementTextDto(data.id, data.page, data.text);
8507
8587
  }
8508
8588
  throw new Error("Unknown shop element.");
8509
8589
  }
8510
8590
  static parsePublicShopEvent(data) {
8511
- return new PublicShopEventDto(data.id, data.name, data.description, data.status, AddressAdapter.parseAddress(data.address), optional_default(data.header_file, FileSystemAdapter.parsePicture), data.minimum_age, DateTimeAdapter.parseDateTime(data.starts_on), DateTimeAdapter.parseDateTime(data.ends_on));
8591
+ return new PublicShopEventDto(data.id, data.name, data.description, data.description_plaintext, data.status, AddressAdapter.parseAddress(data.address), optional_default(data.header_file, FileSystemAdapter.parsePicture), data.minimum_age, DateTimeAdapter.parseDateTime(data.starts_on), DateTimeAdapter.parseDateTime(data.ends_on));
8512
8592
  }
8513
8593
  static parsePublicShopMerchant(data) {
8514
8594
  return new PublicShopMerchantDto(data.id, data.name);
8515
8595
  }
8516
8596
  static parsePublicShopProduct(data) {
8517
- return new PublicShopProductDto(data.id, data.type, data.name, data.description, PaymentAdapter.parseCost(data.price), data.max_quantity, data.is_active, data.is_timeslotted, optionalArray_default(data.time_slots, _PublicShopAdapter.parsePublicShopTimeSlot), optional_default(data.image, FileSystemAdapter.parsePicture), optionalArray_default(data.images, FileSystemAdapter.parsePicture), data.availability, optional_default(data.sale_starts_on, DateTimeAdapter.parseDateTime), optional_default(data.sale_ends_on, DateTimeAdapter.parseDateTime));
8597
+ return new PublicShopProductDto(data.id, data.type, data.name, data.description, data.description_plaintext, PaymentAdapter.parseCost(data.price), data.max_quantity, data.is_active, data.is_timeslotted, optionalArray_default(data.time_slots, _PublicShopAdapter.parsePublicShopTimeSlot), optional_default(data.image, FileSystemAdapter.parsePicture), optionalArray_default(data.images, FileSystemAdapter.parsePicture), data.availability, optional_default(data.sale_starts_on, DateTimeAdapter.parseDateTime), optional_default(data.sale_ends_on, DateTimeAdapter.parseDateTime));
8518
8598
  }
8519
8599
  static parsePublicShopReservation(data) {
8520
8600
  return new PublicShopReservationDto(data.id, DateTimeAdapter.parseDateTime(data.created_on), DateTimeAdapter.parseDateTime(data.expires_on), data.products.map(_PublicShopAdapter.parsePublicShopReservationProduct));
@@ -8560,7 +8640,7 @@ let ReservationAdapter = _ReservationAdapter = class ReservationAdapter {
8560
8640
  return new ReservationItemDto(data.quantity, _ReservationAdapter.parseReservationProduct(data.product));
8561
8641
  }
8562
8642
  static parseReservationProduct(data) {
8563
- return new ReservationProductDto(data.id, data.name, data.description, optional_default(data.image, FileSystemAdapter.parsePicture));
8643
+ return new ReservationProductDto(data.id, data.name, data.description, optional_default(data.image, FileSystemAdapter.parsePicture), PaymentAdapter.parseCost(data.price), data.type ?? "ticket");
8564
8644
  }
8565
8645
  };
8566
8646
  ReservationAdapter = _ReservationAdapter = __decorate([adapter], ReservationAdapter);
@@ -9169,7 +9249,7 @@ var MerchantEventProductService = class extends BaseService {
9169
9249
  description
9170
9250
  }).runAdapter(ProductAdapter.parseProduct);
9171
9251
  }
9172
- async patchSales(merchantId, eventId, productId, price, maxQuantity, isSwappable, ticketsReleasedOn, showWhenUnavailable, saleStartsOn, saleEndsOn) {
9252
+ async patchSales(merchantId, eventId, productId, price, maxQuantity, isSwappable, ticketsReleasedOn, showWhenUnavailable, saleStartsOn, saleEndsOn, isScannable = null) {
9173
9253
  return await this.request(`/merchants/${merchantId}/events/${eventId}/products/${productId}/sales`).method("patch").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({
9174
9254
  price,
9175
9255
  max_quantity: maxQuantity,
@@ -9177,7 +9257,8 @@ var MerchantEventProductService = class extends BaseService {
9177
9257
  tickets_released_on: ticketsReleasedOn?.toISO() ?? null,
9178
9258
  show_when_unavailable: showWhenUnavailable,
9179
9259
  sale_starts_on: saleStartsOn?.toISO() ?? null,
9180
- sale_ends_on: saleEndsOn?.toISO() ?? null
9260
+ sale_ends_on: saleEndsOn?.toISO() ?? null,
9261
+ is_scannable: isScannable
9181
9262
  }).runAdapter(ProductAdapter.parseProduct);
9182
9263
  }
9183
9264
  async patchValidity(merchantId, eventId, productId, timeSlotIds) {
@@ -9203,7 +9284,7 @@ var MerchantEventProductsService = class extends BaseService {
9203
9284
  async getSelectOptions(merchantId, eventId, searchQuery = null, ids = null) {
9204
9285
  return await this.request(`/merchants/${merchantId}/events/${eventId}/products/select-options`).method("get").bearerToken().queryString(QueryString.builder().append("language", "nl").appendArray("ids[]", ids).append("searchQuery", searchQuery)).runArrayAdapter(FluxAdapter.parseFluxFormSelectEntry);
9205
9286
  }
9206
- async post(merchantId, eventId, name, description, price, maxQuantity, stock, stockPoolId, ticketsReleasedOn = null, timeSlotIds = null) {
9287
+ async post(merchantId, eventId, name, description, price, maxQuantity, stock, stockPoolId, ticketsReleasedOn = null, timeSlotIds = null, type = "ticket", isScannable = null) {
9207
9288
  return await this.request(`/merchants/${merchantId}/events/${eventId}/products`).method("post").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({
9208
9289
  name,
9209
9290
  description,
@@ -9212,7 +9293,9 @@ var MerchantEventProductsService = class extends BaseService {
9212
9293
  max_quantity: maxQuantity,
9213
9294
  stock_pool_id: stockPoolId,
9214
9295
  tickets_released_on: ticketsReleasedOn?.toISO() ?? null,
9215
- time_slot_ids: timeSlotIds
9296
+ time_slot_ids: timeSlotIds,
9297
+ type,
9298
+ is_scannable: isScannable
9216
9299
  }).runAdapter(ProductAdapter.parseProduct);
9217
9300
  }
9218
9301
  };
@@ -10271,6 +10354,9 @@ var PublicShopService = class extends BaseService {
10271
10354
  ...attributionBody(attribution)
10272
10355
  }).runAdapter(OrderAdapter.parseOrder);
10273
10356
  }
10357
+ async putReservationProducts(shopId, reservationId, products) {
10358
+ return await this.request(`/shops/${shopId}/reservations/${reservationId}/products`).method("put").queryString(QueryString.builder().append("language", "nl")).body({ products: products.map((product) => [product.productId, product.quantity]) }).runAdapter(ReservationAdapter.parseReservation);
10359
+ }
10274
10360
  async reserve(shopId, products, attribution = null) {
10275
10361
  return await this.request(`/shops/${shopId}/reserve`).method("post").queryString(QueryString.builder().append("language", "nl")).body({
10276
10362
  products: products.map((p) => [p.productId, p.quantity]),