@passly-nl/data 1.4.3 → 1.5.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 (34) hide show
  1. package/dist/index.d.mts +37 -23
  2. package/dist/index.d.mts.map +1 -1
  3. package/dist/index.mjs +109 -55
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/src/adapter/EventAdapter.ts +9 -1
  7. package/src/adapter/OrderAdapter.ts +3 -2
  8. package/src/adapter/ProductAdapter.ts +2 -1
  9. package/src/adapter/PublicShopAdapter.ts +8 -1
  10. package/src/adapter/ReservationAdapter.ts +4 -2
  11. package/src/dto/event/ShopElementButtonDto.ts +3 -2
  12. package/src/dto/event/ShopElementDividerDto.ts +3 -2
  13. package/src/dto/event/ShopElementDto.ts +12 -2
  14. package/src/dto/event/ShopElementHeadingDto.ts +3 -3
  15. package/src/dto/event/ShopElementInformationDto.ts +3 -2
  16. package/src/dto/event/ShopElementNoticeDto.ts +3 -3
  17. package/src/dto/event/ShopElementProductDto.ts +3 -2
  18. package/src/dto/event/ShopElementTextDto.ts +3 -2
  19. package/src/dto/order/OrderProductDto.ts +12 -1
  20. package/src/dto/product/ProductDto.ts +11 -1
  21. package/src/dto/publicShop/PublicShopElementButtonDto.ts +3 -2
  22. package/src/dto/publicShop/PublicShopElementDividerDto.ts +3 -2
  23. package/src/dto/publicShop/PublicShopElementDto.ts +12 -2
  24. package/src/dto/publicShop/PublicShopElementHeadingDto.ts +3 -3
  25. package/src/dto/publicShop/PublicShopElementInformationDto.ts +3 -2
  26. package/src/dto/publicShop/PublicShopElementNoticeDto.ts +3 -3
  27. package/src/dto/publicShop/PublicShopElementProductDto.ts +3 -2
  28. package/src/dto/publicShop/PublicShopElementTextDto.ts +3 -2
  29. package/src/dto/reservation/ReservationProductDto.ts +23 -2
  30. package/src/service/MerchantEventProductService.ts +3 -2
  31. package/src/service/MerchantEventProductsService.ts +5 -2
  32. package/src/service/PublicShopService.ts +17 -2
  33. package/src/types/event.ts +4 -0
  34. package/src/types/product.ts +2 -1
@@ -1,7 +1,7 @@
1
1
  import { BaseResponse, BaseService, QueryString } from '@basmilius/http-client';
2
2
  import type { DateTime } from 'luxon';
3
- import { OrderAdapter, PublicShopAdapter } from '#data/adapter';
4
- import type { MarketingAttributionDto, OrderDto, PublicShopCartProductDto, PublicShopDto, PublicShopReservationDto } from '#data/dto';
3
+ import { OrderAdapter, PublicShopAdapter, ReservationAdapter } from '#data/adapter';
4
+ import type { MarketingAttributionDto, OrderDto, PublicShopCartProductDto, PublicShopDto, PublicShopReservationDto, ReservationDto } from '#data/dto';
5
5
  import type { Gender } from '#data/types';
6
6
  import { emptyNull } from '#data/util';
7
7
 
@@ -69,6 +69,21 @@ export class PublicShopService extends BaseService {
69
69
  .runAdapter(OrderAdapter.parseOrder);
70
70
  }
71
71
 
72
+ async putReservationProducts(shopId: string, reservationId: string, products: PublicShopCartProductDto[]): Promise<BaseResponse<ReservationDto>> {
73
+ return await this
74
+ .request(`/shops/${shopId}/reservations/${reservationId}/products`)
75
+ .method('put')
76
+ .queryString(QueryString.builder()
77
+ .append('language', 'nl'))
78
+ .body({
79
+ products: products.map(product => [
80
+ product.productId,
81
+ product.quantity
82
+ ])
83
+ })
84
+ .runAdapter(ReservationAdapter.parseReservation);
85
+ }
86
+
72
87
  async reserve(shopId: string, products: PublicShopCartProductDto[], attribution: MarketingAttributionDto | null = null): Promise<BaseResponse<PublicShopReservationDto>> {
73
88
  return await this
74
89
  .request(`/shops/${shopId}/reserve`)
@@ -10,6 +10,10 @@ export type EventStatisticsStatus =
10
10
  | 'concluded'
11
11
  | 'upcoming';
12
12
 
13
+ export type ShopElementPage =
14
+ | 'main'
15
+ | 'add_ons';
16
+
13
17
  export type ShopElementType =
14
18
  | 'button'
15
19
  | 'divider'
@@ -1,5 +1,6 @@
1
1
  export type ProductType =
2
- | 'ticket'
2
+ | 'add_on'
3
+ | 'ticket';
3
4
 
4
5
  export type ProductAvailability =
5
6
  | 'available'