@passly-nl/data 1.4.2 → 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.
- package/dist/index.d.mts +49 -25
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +155 -60
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/adapter/EventAdapter.ts +12 -2
- package/src/adapter/OrderAdapter.ts +3 -2
- package/src/adapter/ProductAdapter.ts +2 -1
- package/src/adapter/PublicShopAdapter.ts +11 -2
- package/src/adapter/ReservationAdapter.ts +4 -2
- package/src/dto/event/ShopDesignDto.ts +22 -1
- package/src/dto/event/ShopElementButtonDto.ts +3 -2
- package/src/dto/event/ShopElementDividerDto.ts +3 -2
- package/src/dto/event/ShopElementDto.ts +12 -2
- package/src/dto/event/ShopElementHeadingDto.ts +3 -3
- package/src/dto/event/ShopElementInformationDto.ts +3 -2
- package/src/dto/event/ShopElementNoticeDto.ts +3 -3
- package/src/dto/event/ShopElementProductDto.ts +3 -2
- package/src/dto/event/ShopElementTextDto.ts +3 -2
- package/src/dto/order/OrderProductDto.ts +12 -1
- package/src/dto/product/ProductDto.ts +11 -1
- package/src/dto/publicShop/PublicShopDesignDto.ts +22 -1
- package/src/dto/publicShop/PublicShopElementButtonDto.ts +3 -2
- package/src/dto/publicShop/PublicShopElementDividerDto.ts +3 -2
- package/src/dto/publicShop/PublicShopElementDto.ts +12 -2
- package/src/dto/publicShop/PublicShopElementHeadingDto.ts +3 -3
- package/src/dto/publicShop/PublicShopElementInformationDto.ts +3 -2
- package/src/dto/publicShop/PublicShopElementNoticeDto.ts +3 -3
- package/src/dto/publicShop/PublicShopElementProductDto.ts +3 -2
- package/src/dto/publicShop/PublicShopElementTextDto.ts +3 -2
- package/src/dto/reservation/ReservationProductDto.ts +23 -2
- package/src/service/MerchantEventProductService.ts +3 -2
- package/src/service/MerchantEventProductsService.ts +5 -2
- package/src/service/MerchantEventShopService.ts +28 -3
- package/src/service/PublicShopService.ts +17 -2
- package/src/types/event.ts +4 -0
- package/src/types/product.ts +2 -1
package/package.json
CHANGED
|
@@ -77,7 +77,9 @@ export class EventAdapter {
|
|
|
77
77
|
return new ShopDesignDto(
|
|
78
78
|
data.background_color,
|
|
79
79
|
data.foreground_color,
|
|
80
|
-
data.primary_color
|
|
80
|
+
data.primary_color,
|
|
81
|
+
optional(data.background, FileSystemAdapter.parsePicture),
|
|
82
|
+
data.background_scrim ?? 0
|
|
81
83
|
);
|
|
82
84
|
}
|
|
83
85
|
|
|
@@ -86,6 +88,7 @@ export class EventAdapter {
|
|
|
86
88
|
case 'button':
|
|
87
89
|
return new ShopElementButtonDto(
|
|
88
90
|
data.id,
|
|
91
|
+
data.page,
|
|
89
92
|
data.icon,
|
|
90
93
|
data.text,
|
|
91
94
|
data.url
|
|
@@ -94,6 +97,7 @@ export class EventAdapter {
|
|
|
94
97
|
case 'divider':
|
|
95
98
|
return new ShopElementDividerDto(
|
|
96
99
|
data.id,
|
|
100
|
+
data.page,
|
|
97
101
|
data.icon,
|
|
98
102
|
data.text
|
|
99
103
|
);
|
|
@@ -101,18 +105,21 @@ export class EventAdapter {
|
|
|
101
105
|
case 'heading':
|
|
102
106
|
return new ShopElementHeadingDto(
|
|
103
107
|
data.id,
|
|
108
|
+
data.page,
|
|
104
109
|
data.heading_level,
|
|
105
110
|
data.title
|
|
106
111
|
);
|
|
107
112
|
|
|
108
113
|
case 'information':
|
|
109
114
|
return new ShopElementInformationDto(
|
|
110
|
-
data.id
|
|
115
|
+
data.id,
|
|
116
|
+
data.page
|
|
111
117
|
);
|
|
112
118
|
|
|
113
119
|
case 'notice':
|
|
114
120
|
return new ShopElementNoticeDto(
|
|
115
121
|
data.id,
|
|
122
|
+
data.page,
|
|
116
123
|
data.icon,
|
|
117
124
|
data.notice_type,
|
|
118
125
|
data.title,
|
|
@@ -122,18 +129,21 @@ export class EventAdapter {
|
|
|
122
129
|
case 'product':
|
|
123
130
|
return new ShopElementProductDto(
|
|
124
131
|
data.id,
|
|
132
|
+
data.page,
|
|
125
133
|
ProductAdapter.parseProduct(data.product)
|
|
126
134
|
);
|
|
127
135
|
|
|
128
136
|
case 'text':
|
|
129
137
|
return new ShopElementTextDto(
|
|
130
138
|
data.id,
|
|
139
|
+
data.page,
|
|
131
140
|
data.text
|
|
132
141
|
);
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
return new ShopElementTextDto(
|
|
136
145
|
'unknown',
|
|
146
|
+
data.page,
|
|
137
147
|
'Unknown element type.'
|
|
138
148
|
);
|
|
139
149
|
}
|
|
@@ -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
|
}
|
|
@@ -27,7 +27,9 @@ export class PublicShopAdapter {
|
|
|
27
27
|
return new PublicShopDesignDto(
|
|
28
28
|
data.background_color,
|
|
29
29
|
data.foreground_color,
|
|
30
|
-
data.primary_color
|
|
30
|
+
data.primary_color,
|
|
31
|
+
optional(data.background, FileSystemAdapter.parsePicture),
|
|
32
|
+
data.background_scrim ?? 0
|
|
31
33
|
);
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -36,6 +38,7 @@ export class PublicShopAdapter {
|
|
|
36
38
|
case 'button':
|
|
37
39
|
return new PublicShopElementButtonDto(
|
|
38
40
|
data.id,
|
|
41
|
+
data.page,
|
|
39
42
|
data.icon,
|
|
40
43
|
data.text,
|
|
41
44
|
data.url
|
|
@@ -44,6 +47,7 @@ export class PublicShopAdapter {
|
|
|
44
47
|
case 'divider':
|
|
45
48
|
return new PublicShopElementDividerDto(
|
|
46
49
|
data.id,
|
|
50
|
+
data.page,
|
|
47
51
|
data.icon,
|
|
48
52
|
data.text
|
|
49
53
|
);
|
|
@@ -51,18 +55,21 @@ export class PublicShopAdapter {
|
|
|
51
55
|
case 'heading':
|
|
52
56
|
return new PublicShopElementHeadingDto(
|
|
53
57
|
data.id,
|
|
58
|
+
data.page,
|
|
54
59
|
data.heading_level,
|
|
55
60
|
data.title
|
|
56
61
|
);
|
|
57
62
|
|
|
58
63
|
case 'information':
|
|
59
64
|
return new PublicShopElementInformationDto(
|
|
60
|
-
data.id
|
|
65
|
+
data.id,
|
|
66
|
+
data.page
|
|
61
67
|
);
|
|
62
68
|
|
|
63
69
|
case 'notice':
|
|
64
70
|
return new PublicShopElementNoticeDto(
|
|
65
71
|
data.id,
|
|
72
|
+
data.page,
|
|
66
73
|
data.icon,
|
|
67
74
|
data.notice_type,
|
|
68
75
|
data.title,
|
|
@@ -72,12 +79,14 @@ export class PublicShopAdapter {
|
|
|
72
79
|
case 'product':
|
|
73
80
|
return new PublicShopElementProductDto(
|
|
74
81
|
data.id,
|
|
82
|
+
data.page,
|
|
75
83
|
PublicShopAdapter.parsePublicShopProduct(data.product)
|
|
76
84
|
);
|
|
77
85
|
|
|
78
86
|
case 'text':
|
|
79
87
|
return new PublicShopElementTextDto(
|
|
80
88
|
data.id,
|
|
89
|
+
data.page,
|
|
81
90
|
data.text
|
|
82
91
|
);
|
|
83
92
|
}
|
|
@@ -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
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { PictureDto } from '#data/dto';
|
|
2
3
|
|
|
3
4
|
@dto
|
|
4
5
|
export class ShopDesignDto {
|
|
@@ -26,13 +27,33 @@ export class ShopDesignDto {
|
|
|
26
27
|
this.#primaryColor = value;
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
get background(): PictureDto | null {
|
|
31
|
+
return this.#background;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set background(value: PictureDto | null) {
|
|
35
|
+
this.#background = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get backgroundScrim(): number {
|
|
39
|
+
return this.#backgroundScrim;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set backgroundScrim(value: number) {
|
|
43
|
+
this.#backgroundScrim = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
29
46
|
#backgroundColor: string;
|
|
30
47
|
#foregroundColor: string;
|
|
31
48
|
#primaryColor: string;
|
|
49
|
+
#background: PictureDto | null;
|
|
50
|
+
#backgroundScrim: number;
|
|
32
51
|
|
|
33
|
-
constructor(backgroundColor: string, foregroundColor: string, primaryColor: string) {
|
|
52
|
+
constructor(backgroundColor: string, foregroundColor: string, primaryColor: string, background: PictureDto | null, backgroundScrim: number) {
|
|
34
53
|
this.#backgroundColor = backgroundColor;
|
|
35
54
|
this.#foregroundColor = foregroundColor;
|
|
36
55
|
this.#primaryColor = primaryColor;
|
|
56
|
+
this.#background = background;
|
|
57
|
+
this.#backgroundScrim = backgroundScrim;
|
|
37
58
|
}
|
|
38
59
|
}
|
|
@@ -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
|
}
|
|
@@ -69,6 +69,14 @@ export class ProductDto {
|
|
|
69
69
|
this.#isPersonalizationRequired = value;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
get isScannable(): boolean {
|
|
73
|
+
return this.#isScannable;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
set isScannable(value: boolean) {
|
|
77
|
+
this.#isScannable = value;
|
|
78
|
+
}
|
|
79
|
+
|
|
72
80
|
get isSwappable(): boolean {
|
|
73
81
|
return this.#isSwappable;
|
|
74
82
|
}
|
|
@@ -203,8 +211,9 @@ export class ProductDto {
|
|
|
203
211
|
#saleEndsOn: DateTime | null;
|
|
204
212
|
#availability: ProductAvailability;
|
|
205
213
|
#sold: number;
|
|
214
|
+
#isScannable: boolean;
|
|
206
215
|
|
|
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) {
|
|
216
|
+
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, isScannable: boolean = true) {
|
|
208
217
|
this.#id = id;
|
|
209
218
|
this.#type = type;
|
|
210
219
|
this.#name = name;
|
|
@@ -227,5 +236,6 @@ export class ProductDto {
|
|
|
227
236
|
this.#saleEndsOn = saleEndsOn;
|
|
228
237
|
this.#availability = availability;
|
|
229
238
|
this.#sold = sold;
|
|
239
|
+
this.#isScannable = isScannable;
|
|
230
240
|
}
|
|
231
241
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { PictureDto } from '#data/dto';
|
|
2
3
|
|
|
3
4
|
@dto
|
|
4
5
|
export class PublicShopDesignDto {
|
|
@@ -26,13 +27,33 @@ export class PublicShopDesignDto {
|
|
|
26
27
|
this.#primaryColor = value;
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
get background(): PictureDto | null {
|
|
31
|
+
return this.#background;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set background(value: PictureDto | null) {
|
|
35
|
+
this.#background = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get backgroundScrim(): number {
|
|
39
|
+
return this.#backgroundScrim;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set backgroundScrim(value: number) {
|
|
43
|
+
this.#backgroundScrim = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
29
46
|
#backgroundColor: string;
|
|
30
47
|
#foregroundColor: string;
|
|
31
48
|
#primaryColor: string;
|
|
49
|
+
#background: PictureDto | null;
|
|
50
|
+
#backgroundScrim: number;
|
|
32
51
|
|
|
33
|
-
constructor(backgroundColor: string, foregroundColor: string, primaryColor: string) {
|
|
52
|
+
constructor(backgroundColor: string, foregroundColor: string, primaryColor: string, background: PictureDto | null, backgroundScrim: number) {
|
|
34
53
|
this.#backgroundColor = backgroundColor;
|
|
35
54
|
this.#foregroundColor = foregroundColor;
|
|
36
55
|
this.#primaryColor = primaryColor;
|
|
56
|
+
this.#background = background;
|
|
57
|
+
this.#backgroundScrim = backgroundScrim;
|
|
37
58
|
}
|
|
38
59
|
}
|
|
@@ -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
|
}
|