@passly-nl/data 1.1.0 → 1.2.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/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.1.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git+https://github.com/basmilius/passly-data.git"
15
+ "url": "git+https://github.com/passly-nl/data.git"
16
16
  },
17
17
  "keywords": [
18
18
  "api",
@@ -14,12 +14,13 @@ export class ProductAdapter {
14
14
  optional(data.price, PaymentAdapter.parseCost),
15
15
  data.max_quantity,
16
16
  data.is_active,
17
+ data.is_personalization_required,
17
18
  data.is_swappable,
18
- data.has_sales,
19
19
  data.is_timeslotted,
20
20
  optionalArray(data.time_slots, EventAdapter.parseTimeSlot) ?? [],
21
21
  data.remaining_stock,
22
22
  optional(data.stock_pool, EventAdapter.parseStockPool),
23
+ data.has_sales,
23
24
  optional(data.image, FileSystemAdapter.parsePicture),
24
25
  optionalArray(data.images, FileSystemAdapter.parsePicture)!,
25
26
  optional(data.tickets_released_on, DateTimeAdapter.parseDateTime)
@@ -61,20 +61,20 @@ export class ProductDto {
61
61
  this.#isActive = value;
62
62
  }
63
63
 
64
- get isSwappable(): boolean {
65
- return this.#isSwappable;
64
+ get isPersonalizationRequired(): boolean {
65
+ return this.#isPersonalizationRequired;
66
66
  }
67
67
 
68
- set isSwappable(value: boolean) {
69
- this.#isSwappable = value;
68
+ set isPersonalizationRequired(value: boolean) {
69
+ this.#isPersonalizationRequired = value;
70
70
  }
71
71
 
72
- get hasSales(): boolean {
73
- return this.#hasSales;
72
+ get isSwappable(): boolean {
73
+ return this.#isSwappable;
74
74
  }
75
75
 
76
- set hasSales(value: boolean) {
77
- this.#hasSales = value;
76
+ set isSwappable(value: boolean) {
77
+ this.#isSwappable = value;
78
78
  }
79
79
 
80
80
  get isTimeslotted(): boolean {
@@ -109,6 +109,14 @@ export class ProductDto {
109
109
  this.#stock = value;
110
110
  }
111
111
 
112
+ get hasSales(): boolean {
113
+ return this.#hasSales;
114
+ }
115
+
116
+ set hasSales(value: boolean) {
117
+ this.#hasSales = value;
118
+ }
119
+
112
120
  get image(): PictureDto {
113
121
  return this.#image;
114
122
  }
@@ -140,17 +148,18 @@ export class ProductDto {
140
148
  #price: CostDto;
141
149
  #maxQuantity: number;
142
150
  #isActive: boolean;
151
+ #isPersonalizationRequired: boolean;
143
152
  #isSwappable: boolean;
144
- #hasSales: boolean;
145
153
  #isTimeslotted: boolean;
146
154
  #timeSlots: TimeSlotDto[];
147
155
  #remainingStock: number;
148
156
  #stock: StockPoolDto;
157
+ #hasSales: boolean;
149
158
  #image: PictureDto;
150
159
  #images: PictureDto[];
151
160
  #ticketsReleasedOn: DateTime | null;
152
161
 
153
- constructor(id: string, type: ProductType, name: string, description: string, price: CostDto, maxQuantity: number, isActive: boolean, isSwappable: boolean, hasSales: boolean, isTimeslotted: boolean, timeSlots: TimeSlotDto[], remainingStock: number, stock: StockPoolDto, image: PictureDto, images: PictureDto[], ticketsReleasedOn: DateTime | null) {
162
+ 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) {
154
163
  this.#id = id;
155
164
  this.#type = type;
156
165
  this.#name = name;
@@ -158,12 +167,13 @@ export class ProductDto {
158
167
  this.#price = price;
159
168
  this.#maxQuantity = maxQuantity;
160
169
  this.#isActive = isActive;
170
+ this.#isPersonalizationRequired = isPersonalizationRequired;
161
171
  this.#isSwappable = isSwappable;
162
- this.#hasSales = hasSales;
163
172
  this.#isTimeslotted = isTimeslotted;
164
173
  this.#timeSlots = timeSlots;
165
174
  this.#remainingStock = remainingStock;
166
175
  this.#stock = stock;
176
+ this.#hasSales = hasSales;
167
177
  this.#image = image;
168
178
  this.#images = images;
169
179
  this.#ticketsReleasedOn = ticketsReleasedOn;