@stamhoofd/models 2.90.1 → 2.90.3

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.
@@ -0,0 +1,9 @@
1
+ ALTER TABLE `webshop_uitpas_numbers`
2
+ ADD COLUMN `ticketSaleId` varchar(255) NULL DEFAULT NULL,
3
+ ADD COLUMN `uitpasEventUrl` varchar(255) NULL DEFAULT NULL,
4
+ ADD COLUMN `basePrice` int NOT NULL,
5
+ ADD COLUMN `basePriceLabel` varchar(255) NOT NULL,
6
+ ADD COLUMN `reducedPrice` int NOT NULL,
7
+ ADD COLUMN `reducedPriceUitpas` int NULL DEFAULT NULL,
8
+ ADD COLUMN `uitpasTariffId` varchar(255) NULL DEFAULT NULL,
9
+ ADD COLUMN `registeredAt` datetime NULL DEFAULT NULL;
@@ -6,6 +6,19 @@ export declare class WebshopUitpasNumber extends QueryableModel {
6
6
  webshopId: string;
7
7
  productId: string;
8
8
  orderId: string;
9
+ ticketSaleId: string | null;
10
+ uitpasEventUrl: string | null;
11
+ basePrice: number;
12
+ reducedPrice: number;
13
+ registeredAt: Date | null;
14
+ uitpasTariffId: string | null;
15
+ basePriceLabel: string;
16
+ /**
17
+ * It is possible that the reduced price when registering the ticket sale
18
+ * is different from when the order was placed. Therefore we store the reduced price
19
+ * when the ticket sale was created in this column.
20
+ */
21
+ reducedPriceUitpas: number | null;
9
22
  static areUitpasNumbersUsed(webshopId: string, productId: string, uitpasNumbers: string[]): Promise<boolean>;
10
23
  }
11
24
  //# sourceMappingURL=WebshopUitpasNumber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebshopUitpasNumber.d.ts","sourceRoot":"","sources":["../../../src/models/WebshopUitpasNumber.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,qBAAa,mBAAoB,SAAQ,cAAc;IACnD,MAAM,CAAC,KAAK,SAA4B;IAQxC,EAAE,EAAG,MAAM,CAAC;IAGZ,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAGlB,OAAO,SAAM;WAEA,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAIrH"}
1
+ {"version":3,"file":"WebshopUitpasNumber.d.ts","sourceRoot":"","sources":["../../../src/models/WebshopUitpasNumber.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAO,MAAM,gBAAgB,CAAC;AAGrD,qBAAa,mBAAoB,SAAQ,cAAc;IACnD,MAAM,CAAC,KAAK,SAA4B;IAQxC,EAAE,EAAG,MAAM,CAAC;IAGZ,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAGlB,OAAO,SAAM;IAGb,YAAY,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGnC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGrC,SAAS,EAAE,MAAM,CAAC;IAGlB,YAAY,EAAE,MAAM,CAAC;IAGrB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAQ;IAGjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGrC,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IAEH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAQ;WAE5B,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAIrH"}
@@ -13,6 +13,19 @@ class WebshopUitpasNumber extends sql_1.QueryableModel {
13
13
  webshopId;
14
14
  productId;
15
15
  orderId = '';
16
+ ticketSaleId = null;
17
+ uitpasEventUrl = null;
18
+ basePrice;
19
+ reducedPrice;
20
+ registeredAt = null;
21
+ uitpasTariffId = null;
22
+ basePriceLabel;
23
+ /**
24
+ * It is possible that the reduced price when registering the ticket sale
25
+ * is different from when the order was placed. Therefore we store the reduced price
26
+ * when the ticket sale was created in this column.
27
+ */
28
+ reducedPriceUitpas = null;
16
29
  static async areUitpasNumbersUsed(webshopId, productId, uitpasNumbers) {
17
30
  const hasBeenUsed = !!(await WebshopUitpasNumber.select().where('webshopId', webshopId).andWhere('productId', productId).andWhere('uitpasNumber', uitpasNumbers).first(false));
18
31
  return hasBeenUsed;
@@ -38,4 +51,28 @@ tslib_1.__decorate([
38
51
  tslib_1.__decorate([
39
52
  (0, simple_database_1.column)({ type: 'string' })
40
53
  ], WebshopUitpasNumber.prototype, "orderId", void 0);
54
+ tslib_1.__decorate([
55
+ (0, simple_database_1.column)({ type: 'string', nullable: true })
56
+ ], WebshopUitpasNumber.prototype, "ticketSaleId", void 0);
57
+ tslib_1.__decorate([
58
+ (0, simple_database_1.column)({ type: 'string', nullable: true })
59
+ ], WebshopUitpasNumber.prototype, "uitpasEventUrl", void 0);
60
+ tslib_1.__decorate([
61
+ (0, simple_database_1.column)({ type: 'integer' })
62
+ ], WebshopUitpasNumber.prototype, "basePrice", void 0);
63
+ tslib_1.__decorate([
64
+ (0, simple_database_1.column)({ type: 'integer' })
65
+ ], WebshopUitpasNumber.prototype, "reducedPrice", void 0);
66
+ tslib_1.__decorate([
67
+ (0, simple_database_1.column)({ type: 'datetime', nullable: true })
68
+ ], WebshopUitpasNumber.prototype, "registeredAt", void 0);
69
+ tslib_1.__decorate([
70
+ (0, simple_database_1.column)({ type: 'string', nullable: true })
71
+ ], WebshopUitpasNumber.prototype, "uitpasTariffId", void 0);
72
+ tslib_1.__decorate([
73
+ (0, simple_database_1.column)({ type: 'string' })
74
+ ], WebshopUitpasNumber.prototype, "basePriceLabel", void 0);
75
+ tslib_1.__decorate([
76
+ (0, simple_database_1.column)({ type: 'integer', nullable: true })
77
+ ], WebshopUitpasNumber.prototype, "reducedPriceUitpas", void 0);
41
78
  //# sourceMappingURL=WebshopUitpasNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebshopUitpasNumber.js","sourceRoot":"","sources":["../../../src/models/WebshopUitpasNumber.ts"],"names":[],"mappings":";;;;AAAA,iEAAqD;AACrD,wCAAgD;AAChD,+BAAoC;AAEpC,MAAa,mBAAoB,SAAQ,oBAAc;IACnD,MAAM,CAAC,KAAK,GAAG,wBAAwB,CAAC;IAExC,UAAU;IAMV,EAAE,CAAU;IAGZ,YAAY,CAAS;IAGrB,SAAS,CAAS;IAGlB,SAAS,CAAS;IAGlB,OAAO,GAAG,EAAE,CAAC;IAEb,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,SAAiB,EAAE,SAAiB,EAAE,aAAuB;QAC3F,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,MAAM,mBAAmB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/K,OAAO,WAAW,CAAC;IACvB,CAAC;;AA1BL,kDA2BC;AAlBG;IALC,IAAA,wBAAM,EAAC;QACJ,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,KAAK;YAC3C,OAAO,KAAK,IAAI,IAAA,SAAM,GAAE,CAAC;QAC7B,CAAC;KACJ,CAAC;+CACU;AAGZ;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;yDACN;AAGrB;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;sDACT;AAGlB;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;sDACT;AAGlB;IADC,IAAA,wBAAM,EAAC,EAAE,IA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,EAAE,CAAC;yDACN;AAGrB;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;sDACT;AAGlB;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;sDACT;AAGlB;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;oDACd;AAGb;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;yDACR;AAGnC;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;2DACN;AAGrC;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;sDACV;AAGlB;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;yDACP;AAGrB;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;yDACZ;AAGjC;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;2DACN;AAGrC;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;2DACJ;AAQvB;IADC,IAAA,wBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;+DACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamhoofd/models",
3
- "version": "2.90.1",
3
+ "version": "2.90.3",
4
4
  "main": "./dist/src/index.js",
5
5
  "types": "./dist/src/index.d.ts",
6
6
  "license": "UNLICENCED",
@@ -30,5 +30,5 @@
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "9a720678a4d4699e555f38c9d97779da5818d712"
33
+ "gitHead": "81248f4f4d578fb67e29c48c55ddb1a1beb12313"
34
34
  }
@@ -0,0 +1,9 @@
1
+ ALTER TABLE `webshop_uitpas_numbers`
2
+ ADD COLUMN `ticketSaleId` varchar(255) NULL DEFAULT NULL,
3
+ ADD COLUMN `uitpasEventUrl` varchar(255) NULL DEFAULT NULL,
4
+ ADD COLUMN `basePrice` int NOT NULL,
5
+ ADD COLUMN `basePriceLabel` varchar(255) NOT NULL,
6
+ ADD COLUMN `reducedPrice` int NOT NULL,
7
+ ADD COLUMN `reducedPriceUitpas` int NULL DEFAULT NULL,
8
+ ADD COLUMN `uitpasTariffId` varchar(255) NULL DEFAULT NULL,
9
+ ADD COLUMN `registeredAt` datetime NULL DEFAULT NULL;
@@ -1,5 +1,5 @@
1
1
  import { column } from '@simonbackx/simple-database';
2
- import { QueryableModel } from '@stamhoofd/sql';
2
+ import { QueryableModel, SQL } from '@stamhoofd/sql';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
 
5
5
  export class WebshopUitpasNumber extends QueryableModel {
@@ -25,6 +25,35 @@ export class WebshopUitpasNumber extends QueryableModel {
25
25
  @column({ type: 'string' })
26
26
  orderId = '';
27
27
 
28
+ @column({ type: 'string', nullable: true })
29
+ ticketSaleId: string | null = null;
30
+
31
+ @column({ type: 'string', nullable: true })
32
+ uitpasEventUrl: string | null = null;
33
+
34
+ @column({ type: 'integer' })
35
+ basePrice: number;
36
+
37
+ @column({ type: 'integer' })
38
+ reducedPrice: number;
39
+
40
+ @column({ type: 'datetime', nullable: true })
41
+ registeredAt: Date | null = null;
42
+
43
+ @column({ type: 'string', nullable: true })
44
+ uitpasTariffId: string | null = null;
45
+
46
+ @column({ type: 'string' })
47
+ basePriceLabel: string;
48
+
49
+ /**
50
+ * It is possible that the reduced price when registering the ticket sale
51
+ * is different from when the order was placed. Therefore we store the reduced price
52
+ * when the ticket sale was created in this column.
53
+ */
54
+ @column({ type: 'integer', nullable: true })
55
+ reducedPriceUitpas: number | null = null;
56
+
28
57
  static async areUitpasNumbersUsed(webshopId: string, productId: string, uitpasNumbers: string[]): Promise<boolean> {
29
58
  const hasBeenUsed = !!(await WebshopUitpasNumber.select().where('webshopId', webshopId).andWhere('productId', productId).andWhere('uitpasNumber', uitpasNumbers).first(false));
30
59
  return hasBeenUsed;