@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@passly-nl/data",
3
3
  "description": "API implementation for Passly.",
4
- "version": "1.4.3",
4
+ "version": "1.6.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
@@ -24,6 +24,7 @@ export class EventAdapter {
24
24
  data.id,
25
25
  data.name,
26
26
  data.description,
27
+ data.description_plaintext,
27
28
  DateTimeAdapter.parseDateTime(data.starts_on),
28
29
  DateTimeAdapter.parseDateTime(data.ends_on),
29
30
  data.minimum_age,
@@ -88,6 +89,7 @@ export class EventAdapter {
88
89
  case 'button':
89
90
  return new ShopElementButtonDto(
90
91
  data.id,
92
+ data.page,
91
93
  data.icon,
92
94
  data.text,
93
95
  data.url
@@ -96,6 +98,7 @@ export class EventAdapter {
96
98
  case 'divider':
97
99
  return new ShopElementDividerDto(
98
100
  data.id,
101
+ data.page,
99
102
  data.icon,
100
103
  data.text
101
104
  );
@@ -103,18 +106,21 @@ export class EventAdapter {
103
106
  case 'heading':
104
107
  return new ShopElementHeadingDto(
105
108
  data.id,
109
+ data.page,
106
110
  data.heading_level,
107
111
  data.title
108
112
  );
109
113
 
110
114
  case 'information':
111
115
  return new ShopElementInformationDto(
112
- data.id
116
+ data.id,
117
+ data.page
113
118
  );
114
119
 
115
120
  case 'notice':
116
121
  return new ShopElementNoticeDto(
117
122
  data.id,
123
+ data.page,
118
124
  data.icon,
119
125
  data.notice_type,
120
126
  data.title,
@@ -124,18 +130,21 @@ export class EventAdapter {
124
130
  case 'product':
125
131
  return new ShopElementProductDto(
126
132
  data.id,
133
+ data.page,
127
134
  ProductAdapter.parseProduct(data.product)
128
135
  );
129
136
 
130
137
  case 'text':
131
138
  return new ShopElementTextDto(
132
139
  data.id,
140
+ data.page,
133
141
  data.text
134
142
  );
135
143
  }
136
144
 
137
145
  return new ShopElementTextDto(
138
146
  'unknown',
147
+ data.page,
139
148
  'Unknown element type.'
140
149
  );
141
150
  }
@@ -1,5 +1,5 @@
1
1
  import { adapter, ForeignData } from '@basmilius/http-client';
2
- import { BuyerAdapter, DateTimeAdapter, EventAdapter, MarketingAttributionAdapter, PaymentAdapter, PublicShopAdapter } from '#data/adapter';
2
+ import { BuyerAdapter, DateTimeAdapter, EventAdapter, FileSystemAdapter, MarketingAttributionAdapter, PaymentAdapter, PublicShopAdapter } from '#data/adapter';
3
3
  import { OrderDto, OrderLineDto, OrderPaymentProviderDto, OrderProductDto } from '#data/dto';
4
4
  import { optional, optionalArray } from '#data/util';
5
5
 
@@ -54,7 +54,8 @@ export class OrderAdapter {
54
54
  data.id,
55
55
  data.name,
56
56
  data.description,
57
- data.image
57
+ optional(data.image, FileSystemAdapter.parsePicture),
58
+ data.type ?? 'ticket'
58
59
  );
59
60
  }
60
61
  }
@@ -11,6 +11,7 @@ export class ProductAdapter {
11
11
  data.type,
12
12
  data.name,
13
13
  data.description,
14
+ data.description_plaintext,
14
15
  optional(data.price, PaymentAdapter.parseCost),
15
16
  data.max_quantity,
16
17
  data.is_active,
@@ -28,7 +29,8 @@ export class ProductAdapter {
28
29
  optional(data.sale_starts_on, DateTimeAdapter.parseDateTime),
29
30
  optional(data.sale_ends_on, DateTimeAdapter.parseDateTime),
30
31
  data.availability,
31
- data.sold
32
+ data.sold,
33
+ data.is_scannable ?? true
32
34
  );
33
35
  }
34
36
  }
@@ -38,6 +38,7 @@ export class PublicShopAdapter {
38
38
  case 'button':
39
39
  return new PublicShopElementButtonDto(
40
40
  data.id,
41
+ data.page,
41
42
  data.icon,
42
43
  data.text,
43
44
  data.url
@@ -46,6 +47,7 @@ export class PublicShopAdapter {
46
47
  case 'divider':
47
48
  return new PublicShopElementDividerDto(
48
49
  data.id,
50
+ data.page,
49
51
  data.icon,
50
52
  data.text
51
53
  );
@@ -53,18 +55,21 @@ export class PublicShopAdapter {
53
55
  case 'heading':
54
56
  return new PublicShopElementHeadingDto(
55
57
  data.id,
58
+ data.page,
56
59
  data.heading_level,
57
60
  data.title
58
61
  );
59
62
 
60
63
  case 'information':
61
64
  return new PublicShopElementInformationDto(
62
- data.id
65
+ data.id,
66
+ data.page
63
67
  );
64
68
 
65
69
  case 'notice':
66
70
  return new PublicShopElementNoticeDto(
67
71
  data.id,
72
+ data.page,
68
73
  data.icon,
69
74
  data.notice_type,
70
75
  data.title,
@@ -74,12 +79,14 @@ export class PublicShopAdapter {
74
79
  case 'product':
75
80
  return new PublicShopElementProductDto(
76
81
  data.id,
82
+ data.page,
77
83
  PublicShopAdapter.parsePublicShopProduct(data.product)
78
84
  );
79
85
 
80
86
  case 'text':
81
87
  return new PublicShopElementTextDto(
82
88
  data.id,
89
+ data.page,
83
90
  data.text
84
91
  );
85
92
  }
@@ -92,6 +99,7 @@ export class PublicShopAdapter {
92
99
  data.id,
93
100
  data.name,
94
101
  data.description,
102
+ data.description_plaintext,
95
103
  data.status,
96
104
  AddressAdapter.parseAddress(data.address),
97
105
  optional(data.header_file, FileSystemAdapter.parsePicture),
@@ -114,6 +122,7 @@ export class PublicShopAdapter {
114
122
  data.type,
115
123
  data.name,
116
124
  data.description,
125
+ data.description_plaintext,
117
126
  PaymentAdapter.parseCost(data.price),
118
127
  data.max_quantity,
119
128
  data.is_active,
@@ -1,5 +1,5 @@
1
1
  import { adapter, ForeignData } from '@basmilius/http-client';
2
- import { DateTimeAdapter, FileSystemAdapter, MarketingAttributionAdapter } from '#data/adapter';
2
+ import { DateTimeAdapter, FileSystemAdapter, MarketingAttributionAdapter, PaymentAdapter } from '#data/adapter';
3
3
  import { ReservationDto, ReservationItemDto, ReservationProductDto } from '#data/dto';
4
4
  import { optional, optionalArray } from '#data/util';
5
5
 
@@ -28,7 +28,9 @@ export class ReservationAdapter {
28
28
  data.id,
29
29
  data.name,
30
30
  data.description,
31
- optional(data.image, FileSystemAdapter.parsePicture)
31
+ optional(data.image, FileSystemAdapter.parsePicture),
32
+ PaymentAdapter.parseCost(data.price),
33
+ data.type ?? 'ticket'
32
34
  );
33
35
  }
34
36
  }
@@ -29,6 +29,14 @@ export class EventDto {
29
29
  this.#description = value;
30
30
  }
31
31
 
32
+ get descriptionPlaintext(): string {
33
+ return this.#descriptionPlaintext;
34
+ }
35
+
36
+ set descriptionPlaintext(value: string) {
37
+ this.#descriptionPlaintext = value;
38
+ }
39
+
32
40
  get startsOn(): DateTime {
33
41
  return this.#startsOn;
34
42
  }
@@ -96,6 +104,7 @@ export class EventDto {
96
104
  #id: string;
97
105
  #name: string;
98
106
  #description: string;
107
+ #descriptionPlaintext: string;
99
108
  #startsOn: DateTime;
100
109
  #endsOn: DateTime;
101
110
  #minimumAge: number;
@@ -105,10 +114,11 @@ export class EventDto {
105
114
  #createdOn: DateTime;
106
115
  #updatedOn: DateTime;
107
116
 
108
- constructor(id: string, name: string, description: string, startsOn: DateTime, endsOn: DateTime, minimumAge: number, status: EventStatus, address: AddressDto, headerFile: PictureDto | null, createdOn: DateTime, updatedOn: DateTime) {
117
+ constructor(id: string, name: string, description: string, descriptionPlaintext: string, startsOn: DateTime, endsOn: DateTime, minimumAge: number, status: EventStatus, address: AddressDto, headerFile: PictureDto | null, createdOn: DateTime, updatedOn: DateTime) {
109
118
  this.#id = id;
110
119
  this.#name = name;
111
120
  this.#description = description;
121
+ this.#descriptionPlaintext = descriptionPlaintext;
112
122
  this.#startsOn = startsOn;
113
123
  this.#endsOn = endsOn;
114
124
  this.#minimumAge = minimumAge;
@@ -1,6 +1,7 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import type { FluxIconName } from '@flux-ui/types';
3
3
  import { ShopElementDto } from '#data/dto';
4
+ import type { ShopElementPage } from '#data/types';
4
5
 
5
6
  @dto
6
7
  export class ShopElementButtonDto extends ShopElementDto {
@@ -32,8 +33,8 @@ export class ShopElementButtonDto extends ShopElementDto {
32
33
  #text: string;
33
34
  #url: string;
34
35
 
35
- constructor(id: string, icon: FluxIconName | null, text: string, url: string) {
36
- super(id, 'button');
36
+ constructor(id: string, page: ShopElementPage, icon: FluxIconName | null, text: string, url: string) {
37
+ super(id, 'button', page);
37
38
  this.#icon = icon;
38
39
  this.#text = text;
39
40
  this.#url = url;
@@ -1,6 +1,7 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import type { FluxIconName } from '@flux-ui/types';
3
3
  import { ShopElementDto } from '#data/dto';
4
+ import type { ShopElementPage } from '#data/types';
4
5
 
5
6
  @dto
6
7
  export class ShopElementDividerDto extends ShopElementDto {
@@ -23,8 +24,8 @@ export class ShopElementDividerDto extends ShopElementDto {
23
24
  #icon: FluxIconName | null;
24
25
  #text: string | null;
25
26
 
26
- constructor(id: string, icon: FluxIconName | null, text: string | null) {
27
- super(id, 'divider');
27
+ constructor(id: string, page: ShopElementPage, icon: FluxIconName | null, text: string | null) {
28
+ super(id, 'divider', page);
28
29
  this.#icon = icon;
29
30
  this.#text = text;
30
31
  }
@@ -1,4 +1,4 @@
1
- import type { ShopElementType } from '#data/types';
1
+ import type { ShopElementPage, ShopElementType } from '#data/types';
2
2
 
3
3
  export abstract class ShopElementDto {
4
4
  get id(): string {
@@ -9,6 +9,14 @@ export abstract class ShopElementDto {
9
9
  this.#id = value;
10
10
  }
11
11
 
12
+ get page(): ShopElementPage {
13
+ return this.#page;
14
+ }
15
+
16
+ set page(value: ShopElementPage) {
17
+ this.#page = value;
18
+ }
19
+
12
20
  get type(): ShopElementType {
13
21
  return this.#type;
14
22
  }
@@ -18,10 +26,12 @@ export abstract class ShopElementDto {
18
26
  }
19
27
 
20
28
  #id: string;
29
+ #page: ShopElementPage;
21
30
  #type: ShopElementType;
22
31
 
23
- protected constructor(id: string, type: ShopElementType) {
32
+ protected constructor(id: string, type: ShopElementType, page: ShopElementPage) {
24
33
  this.#id = id;
34
+ this.#page = page;
25
35
  this.#type = type;
26
36
  }
27
37
  }
@@ -1,6 +1,6 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import { ShopElementDto } from '#data/dto';
3
- import type { HeadingLevel } from '#data/types';
3
+ import type { HeadingLevel, ShopElementPage } from '#data/types';
4
4
 
5
5
  @dto
6
6
  export class ShopElementHeadingDto extends ShopElementDto {
@@ -23,8 +23,8 @@ export class ShopElementHeadingDto extends ShopElementDto {
23
23
  #headingLevel: HeadingLevel;
24
24
  #title: string;
25
25
 
26
- constructor(id: string, headingLevel: HeadingLevel, title: string) {
27
- super(id, 'heading');
26
+ constructor(id: string, page: ShopElementPage, headingLevel: HeadingLevel, title: string) {
27
+ super(id, 'heading', page);
28
28
  this.#headingLevel = headingLevel;
29
29
  this.#title = title;
30
30
  }
@@ -1,9 +1,10 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import { ShopElementDto } from '#data/dto';
3
+ import type { ShopElementPage } from '#data/types';
3
4
 
4
5
  @dto
5
6
  export class ShopElementInformationDto extends ShopElementDto {
6
- constructor(id: string) {
7
- super(id, 'information');
7
+ constructor(id: string, page: ShopElementPage) {
8
+ super(id, 'information', page);
8
9
  }
9
10
  }
@@ -1,7 +1,7 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import type { FluxIconName } from '@flux-ui/types';
3
3
  import { ShopElementDto } from '#data/dto';
4
- import type { NoticeType } from '#data/types';
4
+ import type { NoticeType, ShopElementPage } from '#data/types';
5
5
 
6
6
  @dto
7
7
  export class ShopElementNoticeDto extends ShopElementDto {
@@ -42,8 +42,8 @@ export class ShopElementNoticeDto extends ShopElementDto {
42
42
  #title: string | null;
43
43
  #text: string;
44
44
 
45
- constructor(id: string, icon: FluxIconName, noticeType: NoticeType, title: string | null, text: string) {
46
- super(id, 'notice');
45
+ constructor(id: string, page: ShopElementPage, icon: FluxIconName, noticeType: NoticeType, title: string | null, text: string) {
46
+ super(id, 'notice', page);
47
47
  this.#icon = icon;
48
48
  this.#noticeType = noticeType;
49
49
  this.#title = title;
@@ -1,5 +1,6 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import { type ProductDto, ShopElementDto } from '#data/dto';
3
+ import type { ShopElementPage } from '#data/types';
3
4
 
4
5
  @dto
5
6
  export class ShopElementProductDto extends ShopElementDto {
@@ -13,8 +14,8 @@ export class ShopElementProductDto extends ShopElementDto {
13
14
 
14
15
  #product: ProductDto;
15
16
 
16
- constructor(id: string, product: ProductDto) {
17
- super(id, 'product');
17
+ constructor(id: string, page: ShopElementPage, product: ProductDto) {
18
+ super(id, 'product', page);
18
19
  this.#product = product;
19
20
  }
20
21
  }
@@ -1,5 +1,6 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import { ShopElementDto } from '#data/dto';
3
+ import type { ShopElementPage } from '#data/types';
3
4
 
4
5
  @dto
5
6
  export class ShopElementTextDto extends ShopElementDto {
@@ -13,8 +14,8 @@ export class ShopElementTextDto extends ShopElementDto {
13
14
 
14
15
  #text: string;
15
16
 
16
- constructor(id: string, text: string) {
17
- super(id, 'text');
17
+ constructor(id: string, page: ShopElementPage, text: string) {
18
+ super(id, 'text', page);
18
19
  this.#text = text;
19
20
  }
20
21
  }
@@ -1,5 +1,6 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import type { PictureDto } from '#data/dto';
3
+ import type { ProductType } from '#data/types';
3
4
 
4
5
  @dto
5
6
  export class OrderProductDto {
@@ -35,15 +36,25 @@ export class OrderProductDto {
35
36
  this.#image = value;
36
37
  }
37
38
 
39
+ get type(): ProductType {
40
+ return this.#type;
41
+ }
42
+
43
+ set type(value: ProductType) {
44
+ this.#type = value;
45
+ }
46
+
38
47
  #id: string;
39
48
  #name: string;
40
49
  #description: string;
41
50
  #image: PictureDto | null;
51
+ #type: ProductType;
42
52
 
43
- constructor(id: string, name: string, description: string, image: PictureDto | null) {
53
+ constructor(id: string, name: string, description: string, image: PictureDto | null, type: ProductType) {
44
54
  this.#id = id;
45
55
  this.#name = name;
46
56
  this.#description = description;
47
57
  this.#image = image;
58
+ this.#type = type;
48
59
  }
49
60
  }
@@ -37,6 +37,14 @@ export class ProductDto {
37
37
  this.#description = value;
38
38
  }
39
39
 
40
+ get descriptionPlaintext(): string {
41
+ return this.#descriptionPlaintext;
42
+ }
43
+
44
+ set descriptionPlaintext(value: string) {
45
+ this.#descriptionPlaintext = value;
46
+ }
47
+
40
48
  get price(): CostDto {
41
49
  return this.#price;
42
50
  }
@@ -69,6 +77,14 @@ export class ProductDto {
69
77
  this.#isPersonalizationRequired = value;
70
78
  }
71
79
 
80
+ get isScannable(): boolean {
81
+ return this.#isScannable;
82
+ }
83
+
84
+ set isScannable(value: boolean) {
85
+ this.#isScannable = value;
86
+ }
87
+
72
88
  get isSwappable(): boolean {
73
89
  return this.#isSwappable;
74
90
  }
@@ -185,6 +201,7 @@ export class ProductDto {
185
201
  #type: ProductType;
186
202
  #name: string;
187
203
  #description: string;
204
+ #descriptionPlaintext: string;
188
205
  #price: CostDto;
189
206
  #maxQuantity: number;
190
207
  #isActive: boolean;
@@ -203,12 +220,14 @@ export class ProductDto {
203
220
  #saleEndsOn: DateTime | null;
204
221
  #availability: ProductAvailability;
205
222
  #sold: number;
223
+ #isScannable: boolean;
206
224
 
207
- constructor(id: string, type: ProductType, name: string, description: string, price: CostDto, maxQuantity: number, isActive: boolean, isPersonalizationRequired: boolean, isSwappable: boolean, isTimeslotted: boolean, timeSlots: TimeSlotDto[], remainingStock: number, stock: StockPoolDto, hasSales: boolean, image: PictureDto, images: PictureDto[], ticketsReleasedOn: DateTime | null, showWhenUnavailable: boolean, saleStartsOn: DateTime | null, saleEndsOn: DateTime | null, availability: ProductAvailability, sold: number) {
225
+ constructor(id: string, type: ProductType, name: string, description: string, descriptionPlaintext: string, price: CostDto, maxQuantity: number, isActive: boolean, isPersonalizationRequired: boolean, isSwappable: boolean, isTimeslotted: boolean, timeSlots: TimeSlotDto[], remainingStock: number, stock: StockPoolDto, hasSales: boolean, image: PictureDto, images: PictureDto[], ticketsReleasedOn: DateTime | null, showWhenUnavailable: boolean, saleStartsOn: DateTime | null, saleEndsOn: DateTime | null, availability: ProductAvailability, sold: number, isScannable: boolean = true) {
208
226
  this.#id = id;
209
227
  this.#type = type;
210
228
  this.#name = name;
211
229
  this.#description = description;
230
+ this.#descriptionPlaintext = descriptionPlaintext;
212
231
  this.#price = price;
213
232
  this.#maxQuantity = maxQuantity;
214
233
  this.#isActive = isActive;
@@ -227,5 +246,6 @@ export class ProductDto {
227
246
  this.#saleEndsOn = saleEndsOn;
228
247
  this.#availability = availability;
229
248
  this.#sold = sold;
249
+ this.#isScannable = isScannable;
230
250
  }
231
251
  }
@@ -1,6 +1,7 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import type { FluxIconName } from '@flux-ui/types';
3
3
  import { PublicShopElementDto } from '#data/dto';
4
+ import type { ShopElementPage } from '#data/types';
4
5
 
5
6
  @dto
6
7
  export class PublicShopElementButtonDto extends PublicShopElementDto {
@@ -32,8 +33,8 @@ export class PublicShopElementButtonDto extends PublicShopElementDto {
32
33
  #text: string;
33
34
  #url: string;
34
35
 
35
- constructor(id: string, icon: FluxIconName | null, text: string, url: string) {
36
- super(id, 'button');
36
+ constructor(id: string, page: ShopElementPage, icon: FluxIconName | null, text: string, url: string) {
37
+ super(id, 'button', page);
37
38
  this.#icon = icon;
38
39
  this.#text = text;
39
40
  this.#url = url;
@@ -1,6 +1,7 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import type { FluxIconName } from '@flux-ui/types';
3
3
  import { PublicShopElementDto } from '#data/dto';
4
+ import type { ShopElementPage } from '#data/types';
4
5
 
5
6
  @dto
6
7
  export class PublicShopElementDividerDto extends PublicShopElementDto {
@@ -23,8 +24,8 @@ export class PublicShopElementDividerDto extends PublicShopElementDto {
23
24
  #icon: FluxIconName | null;
24
25
  #text: string | null;
25
26
 
26
- constructor(id: string, icon: FluxIconName | null, text: string | null) {
27
- super(id, 'divider');
27
+ constructor(id: string, page: ShopElementPage, icon: FluxIconName | null, text: string | null) {
28
+ super(id, 'divider', page);
28
29
  this.#icon = icon;
29
30
  this.#text = text;
30
31
  }
@@ -1,4 +1,4 @@
1
- import type { PublicShopElementType } from '#data/types';
1
+ import type { PublicShopElementType, ShopElementPage } from '#data/types';
2
2
 
3
3
  export abstract class PublicShopElementDto {
4
4
  get id(): string {
@@ -9,6 +9,14 @@ export abstract class PublicShopElementDto {
9
9
  this.#id = value;
10
10
  }
11
11
 
12
+ get page(): ShopElementPage {
13
+ return this.#page;
14
+ }
15
+
16
+ set page(value: ShopElementPage) {
17
+ this.#page = value;
18
+ }
19
+
12
20
  get type(): PublicShopElementType {
13
21
  return this.#type;
14
22
  }
@@ -18,10 +26,12 @@ export abstract class PublicShopElementDto {
18
26
  }
19
27
 
20
28
  #id: string;
29
+ #page: ShopElementPage;
21
30
  #type: PublicShopElementType;
22
31
 
23
- protected constructor(id: string, type: PublicShopElementType) {
32
+ protected constructor(id: string, type: PublicShopElementType, page: ShopElementPage) {
24
33
  this.#id = id;
34
+ this.#page = page;
25
35
  this.#type = type;
26
36
  }
27
37
  }
@@ -1,6 +1,6 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import { PublicShopElementDto } from '#data/dto';
3
- import type { HeadingLevel } from '#data/types';
3
+ import type { HeadingLevel, ShopElementPage } from '#data/types';
4
4
 
5
5
  @dto
6
6
  export class PublicShopElementHeadingDto extends PublicShopElementDto {
@@ -23,8 +23,8 @@ export class PublicShopElementHeadingDto extends PublicShopElementDto {
23
23
  #headingLevel: HeadingLevel;
24
24
  #title: string;
25
25
 
26
- constructor(id: string, headingLevel: HeadingLevel, title: string) {
27
- super(id, 'heading');
26
+ constructor(id: string, page: ShopElementPage, headingLevel: HeadingLevel, title: string) {
27
+ super(id, 'heading', page);
28
28
  this.#headingLevel = headingLevel;
29
29
  this.#title = title;
30
30
  }
@@ -1,9 +1,10 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import { PublicShopElementDto } from '#data/dto';
3
+ import type { ShopElementPage } from '#data/types';
3
4
 
4
5
  @dto
5
6
  export class PublicShopElementInformationDto extends PublicShopElementDto {
6
- constructor(id: string) {
7
- super(id, 'information');
7
+ constructor(id: string, page: ShopElementPage) {
8
+ super(id, 'information', page);
8
9
  }
9
10
  }
@@ -1,7 +1,7 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import type { FluxIconName } from '@flux-ui/types';
3
3
  import { PublicShopElementDto } from '#data/dto';
4
- import type { NoticeType } from '#data/types';
4
+ import type { NoticeType, ShopElementPage } from '#data/types';
5
5
 
6
6
  @dto
7
7
  export class PublicShopElementNoticeDto extends PublicShopElementDto {
@@ -42,8 +42,8 @@ export class PublicShopElementNoticeDto extends PublicShopElementDto {
42
42
  #title: string | null;
43
43
  #text: string;
44
44
 
45
- constructor(id: string, icon: FluxIconName, noticeType: NoticeType, title: string | null, text: string) {
46
- super(id, 'notice');
45
+ constructor(id: string, page: ShopElementPage, icon: FluxIconName, noticeType: NoticeType, title: string | null, text: string) {
46
+ super(id, 'notice', page);
47
47
  this.#icon = icon;
48
48
  this.#noticeType = noticeType;
49
49
  this.#title = title;
@@ -1,5 +1,6 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import { PublicShopElementDto, type PublicShopProductDto } from '#data/dto';
3
+ import type { ShopElementPage } from '#data/types';
3
4
 
4
5
  @dto
5
6
  export class PublicShopElementProductDto extends PublicShopElementDto {
@@ -13,8 +14,8 @@ export class PublicShopElementProductDto extends PublicShopElementDto {
13
14
 
14
15
  #product: PublicShopProductDto;
15
16
 
16
- constructor(id: string, product: PublicShopProductDto) {
17
- super(id, 'product');
17
+ constructor(id: string, page: ShopElementPage, product: PublicShopProductDto) {
18
+ super(id, 'product', page);
18
19
  this.#product = product;
19
20
  }
20
21
  }
@@ -1,5 +1,6 @@
1
1
  import { dto } from '@basmilius/http-client';
2
2
  import { PublicShopElementDto } from '#data/dto';
3
+ import type { ShopElementPage } from '#data/types';
3
4
 
4
5
  @dto
5
6
  export class PublicShopElementTextDto extends PublicShopElementDto {
@@ -13,8 +14,8 @@ export class PublicShopElementTextDto extends PublicShopElementDto {
13
14
 
14
15
  #text: string;
15
16
 
16
- constructor(id: string, text: string) {
17
- super(id, 'text');
17
+ constructor(id: string, page: ShopElementPage, text: string) {
18
+ super(id, 'text', page);
18
19
  this.#text = text;
19
20
  }
20
21
  }