@stamhoofd/structures 2.4.0 → 2.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/src/DefaultAgeGroup.d.ts +2 -0
- package/dist/src/DefaultAgeGroup.d.ts.map +1 -1
- package/dist/src/DefaultAgeGroup.js +8 -0
- package/dist/src/DefaultAgeGroup.js.map +1 -1
- package/dist/src/Event.d.ts +13 -2
- package/dist/src/Event.d.ts.map +1 -1
- package/dist/src/Event.js +36 -3
- package/dist/src/Event.js.map +1 -1
- package/dist/src/Group.d.ts +5 -0
- package/dist/src/Group.d.ts.map +1 -1
- package/dist/src/Group.js +9 -1
- package/dist/src/Group.js.map +1 -1
- package/dist/src/GroupSettings.d.ts +19 -0
- package/dist/src/GroupSettings.d.ts.map +1 -1
- package/dist/src/GroupSettings.js +45 -6
- package/dist/src/GroupSettings.js.map +1 -1
- package/dist/src/Organization.js +2 -2
- package/dist/src/Organization.js.map +1 -1
- package/dist/src/Version.d.ts +1 -1
- package/dist/src/Version.js +1 -1
- package/dist/src/billing/STPackageBundle.js +6 -6
- package/dist/src/billing/STPackageBundle.js.map +1 -1
- package/dist/src/members/MemberDetails.d.ts +3 -0
- package/dist/src/members/MemberDetails.d.ts.map +1 -1
- package/dist/src/members/MemberDetails.js +12 -0
- package/dist/src/members/MemberDetails.js.map +1 -1
- package/dist/src/members/OrganizationRecordsConfiguration.d.ts +13 -0
- package/dist/src/members/OrganizationRecordsConfiguration.d.ts.map +1 -1
- package/dist/src/members/OrganizationRecordsConfiguration.js +49 -0
- package/dist/src/members/OrganizationRecordsConfiguration.js.map +1 -1
- package/dist/src/members/PlatformMember.d.ts +5 -4
- package/dist/src/members/PlatformMember.d.ts.map +1 -1
- package/dist/src/members/PlatformMember.js +25 -20
- package/dist/src/members/PlatformMember.js.map +1 -1
- package/dist/src/members/checkout/OldRegisterCartValidator.js +1 -1
- package/dist/src/members/checkout/OldRegisterCartValidator.js.map +1 -1
- package/dist/src/members/checkout/RegisterCart.d.ts +2 -0
- package/dist/src/members/checkout/RegisterCart.d.ts.map +1 -1
- package/dist/src/members/checkout/RegisterCart.js +33 -2
- package/dist/src/members/checkout/RegisterCart.js.map +1 -1
- package/dist/src/members/checkout/RegisterCheckout.d.ts +27 -3
- package/dist/src/members/checkout/RegisterCheckout.d.ts.map +1 -1
- package/dist/src/members/checkout/RegisterCheckout.js +47 -3
- package/dist/src/members/checkout/RegisterCheckout.js.map +1 -1
- package/dist/src/members/checkout/RegisterItem.d.ts +33 -8
- package/dist/src/members/checkout/RegisterItem.d.ts.map +1 -1
- package/dist/src/members/checkout/RegisterItem.js +164 -27
- package/dist/src/members/checkout/RegisterItem.js.map +1 -1
- package/dist/src/members/records/RecordCategory.d.ts +1 -0
- package/dist/src/members/records/RecordCategory.d.ts.map +1 -1
- package/dist/src/members/records/RecordCategory.js +3 -0
- package/dist/src/members/records/RecordCategory.js.map +1 -1
- package/esm/dist/src/DefaultAgeGroup.d.ts +2 -0
- package/esm/dist/src/DefaultAgeGroup.d.ts.map +1 -1
- package/esm/dist/src/DefaultAgeGroup.js +8 -0
- package/esm/dist/src/DefaultAgeGroup.js.map +1 -1
- package/esm/dist/src/Event.d.ts +13 -2
- package/esm/dist/src/Event.d.ts.map +1 -1
- package/esm/dist/src/Event.js +34 -2
- package/esm/dist/src/Event.js.map +1 -1
- package/esm/dist/src/Group.d.ts +5 -0
- package/esm/dist/src/Group.d.ts.map +1 -1
- package/esm/dist/src/Group.js +9 -1
- package/esm/dist/src/Group.js.map +1 -1
- package/esm/dist/src/GroupSettings.d.ts +19 -0
- package/esm/dist/src/GroupSettings.d.ts.map +1 -1
- package/esm/dist/src/GroupSettings.js +45 -6
- package/esm/dist/src/GroupSettings.js.map +1 -1
- package/esm/dist/src/Organization.js +2 -2
- package/esm/dist/src/Organization.js.map +1 -1
- package/esm/dist/src/Version.d.ts +1 -1
- package/esm/dist/src/Version.js +1 -1
- package/esm/dist/src/billing/STPackageBundle.js +6 -6
- package/esm/dist/src/billing/STPackageBundle.js.map +1 -1
- package/esm/dist/src/members/MemberDetails.d.ts +3 -0
- package/esm/dist/src/members/MemberDetails.d.ts.map +1 -1
- package/esm/dist/src/members/MemberDetails.js +12 -0
- package/esm/dist/src/members/MemberDetails.js.map +1 -1
- package/esm/dist/src/members/OrganizationRecordsConfiguration.d.ts +13 -0
- package/esm/dist/src/members/OrganizationRecordsConfiguration.d.ts.map +1 -1
- package/esm/dist/src/members/OrganizationRecordsConfiguration.js +49 -0
- package/esm/dist/src/members/OrganizationRecordsConfiguration.js.map +1 -1
- package/esm/dist/src/members/PlatformMember.d.ts +5 -4
- package/esm/dist/src/members/PlatformMember.d.ts.map +1 -1
- package/esm/dist/src/members/PlatformMember.js +25 -20
- package/esm/dist/src/members/PlatformMember.js.map +1 -1
- package/esm/dist/src/members/checkout/OldRegisterCartValidator.js +1 -1
- package/esm/dist/src/members/checkout/OldRegisterCartValidator.js.map +1 -1
- package/esm/dist/src/members/checkout/RegisterCart.d.ts +2 -0
- package/esm/dist/src/members/checkout/RegisterCart.d.ts.map +1 -1
- package/esm/dist/src/members/checkout/RegisterCart.js +33 -2
- package/esm/dist/src/members/checkout/RegisterCart.js.map +1 -1
- package/esm/dist/src/members/checkout/RegisterCheckout.d.ts +27 -3
- package/esm/dist/src/members/checkout/RegisterCheckout.d.ts.map +1 -1
- package/esm/dist/src/members/checkout/RegisterCheckout.js +48 -4
- package/esm/dist/src/members/checkout/RegisterCheckout.js.map +1 -1
- package/esm/dist/src/members/checkout/RegisterItem.d.ts +33 -8
- package/esm/dist/src/members/checkout/RegisterItem.d.ts.map +1 -1
- package/esm/dist/src/members/checkout/RegisterItem.js +166 -29
- package/esm/dist/src/members/checkout/RegisterItem.js.map +1 -1
- package/esm/dist/src/members/records/RecordCategory.d.ts +1 -0
- package/esm/dist/src/members/records/RecordCategory.d.ts.map +1 -1
- package/esm/dist/src/members/records/RecordCategory.js +3 -0
- package/esm/dist/src/members/records/RecordCategory.js.map +1 -1
- package/package.json +2 -2
- package/dist/src/GroupPrices.d.ts +0 -44
- package/dist/src/GroupPrices.d.ts.map +0 -1
- package/dist/src/GroupPrices.js +0 -119
- package/dist/src/GroupPrices.js.map +0 -1
- package/esm/dist/src/GroupPrices.d.ts +0 -44
- package/esm/dist/src/GroupPrices.d.ts.map +0 -1
- package/esm/dist/src/GroupPrices.js +0 -114
- package/esm/dist/src/GroupPrices.js.map +0 -1
|
@@ -23,6 +23,7 @@ export declare class RecordCategory extends AutoEncoder {
|
|
|
23
23
|
childCategories: RecordCategory[];
|
|
24
24
|
records: RecordSettings[];
|
|
25
25
|
filter: PropertyFilter | null;
|
|
26
|
+
get containsSensitiveData(): boolean;
|
|
26
27
|
getAllRecords(): RecordSettings[];
|
|
27
28
|
getAllFilteredRecords<T extends ObjectWithRecords>(filterValue: T): RecordSettings[];
|
|
28
29
|
filterRecords<T extends ObjectWithRecords>(filterValue: T): RecordSettings[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordCategory.d.ts","sourceRoot":"","sources":["../../../../../src/members/records/RecordCategory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAO9G,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAkI,MAAM,gBAAgB,CAAC;AAC9K,OAAO,EAAE,cAAc,EAAc,MAAM,kBAAkB,CAAC;AAE9D,MAAM,WAAW,UAAU;IACvB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAA;CACpD;AAED,qBAAa,cAAe,SAAQ,WAAW;IAE3C,EAAE,EAAE,MAAM,CAAA;IAGV,IAAI,SAAK;IAGT,WAAW,SAAK;IAEhB;;;OAGG;IAEH,cAAc,UAA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C,SAAS,iBAAiB,EAAE,WAAW,EAAE,CAAC,GAAG,cAAc,EAAE;IAIpF;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,CAAC,SAAS,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,CAAC,GAAG,cAAc,EAAE;IA0BrH;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,UAAU,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,GAAG,cAAc,EAAE;IA4BzH;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,GAAG,cAAc,EAAE;IAerH;;OAEG;IACH,MAAM,CAAC,2BAA2B,CAAC,UAAU,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE;IAM3G,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,CAAC;CAoB5F"}
|
|
@@ -22,6 +22,9 @@ export class RecordCategory extends AutoEncoder {
|
|
|
22
22
|
this.records = [];
|
|
23
23
|
this.filter = null;
|
|
24
24
|
}
|
|
25
|
+
get containsSensitiveData() {
|
|
26
|
+
return !!this.getAllRecords().find(r => r.sensitive);
|
|
27
|
+
}
|
|
25
28
|
getAllRecords() {
|
|
26
29
|
if (this.childCategories.length > 0) {
|
|
27
30
|
return [...this.childCategories.flatMap(c => c.getAllRecords()), ...this.records];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordCategory.js","sourceRoot":"","sources":["../../../../../src/members/records/RecordCategory.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9G,O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a,EAAE,CAAC;4CACzB;AAGT;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;mDAClB;AAOhB;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;sDAC5B;AAOrB;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;uDACf;AAGtC;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;+CACvB;AAG9B;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8CAC7C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamhoofd/structures",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./esm/dist/index.js",
|
|
6
6
|
"types": "./esm/dist/index.d.ts",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"@simonbackx/simple-errors": "^1.4",
|
|
32
32
|
"uuid": "^8.3.2"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "07cc26af0e3036e4ae4309a268fbf57b7f6ac2ed"
|
|
35
35
|
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { AutoEncoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
export declare class GroupPrice extends AutoEncoder {
|
|
3
|
-
price: number;
|
|
4
|
-
reducedPrice: number | null;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* A group can have multiple prices, stored in an array. The pricing with the highest date or index is applied.
|
|
8
|
-
*/
|
|
9
|
-
export declare class GroupPrices extends AutoEncoder {
|
|
10
|
-
id: string;
|
|
11
|
-
startDate: Date | null;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the array count is per member of the same family (true) or only the same member (false)
|
|
14
|
-
*/
|
|
15
|
-
sameMemberOnlyDiscount: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Count members in same category or only for the same group?
|
|
18
|
-
*/
|
|
19
|
-
onlySameGroup: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The array contains prices: for first member, second member... If more members are present in a family (or member itself), the last price is used
|
|
22
|
-
*/
|
|
23
|
-
prices: GroupPrice[];
|
|
24
|
-
getPriceFor(reduced: boolean, alreadyRegisteredCount?: number): number;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated
|
|
27
|
-
*/
|
|
28
|
-
private price;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated
|
|
31
|
-
*/
|
|
32
|
-
private reducedPrice;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated
|
|
35
|
-
* Second member in the family
|
|
36
|
-
*/
|
|
37
|
-
private familyPrice;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated
|
|
40
|
-
* Third or later member
|
|
41
|
-
*/
|
|
42
|
-
private extraFamilyPrice;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=GroupPrices.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPrices.d.ts","sourceRoot":"","sources":["../../src/GroupPrices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAoE,MAAM,6BAA6B,CAAC;AAG1I,qBAAa,UAAW,SAAQ,WAAW;IAEvC,KAAK,SAAI;IAGT,YAAY,EAAE,MAAM,GAAG,IAAI,CAAO;CACrC;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAExC,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,IAAI,GAAG,IAAI,CAAO;IAE7B;;OAEG;IAEH,sBAAsB,UAAQ;IAE9B;;OAEG;IAEH,aAAa,UAAQ;IAErB;;OAEG;IA2BH,MAAM,EAAE,UAAU,EAAE,CAA0B;IAE9C,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,sBAAsB,SAAI;IAYxD;;OAEG;IAEH,OAAO,CAAC,KAAK,CAAI;IAEjB;;OAEG;IAEH,OAAO,CAAC,YAAY,CAAsB;IAE1C;;;OAGG;IAEH,OAAO,CAAC,WAAW,CAAsB;IAEzC;;;OAGG;IAEH,OAAO,CAAC,gBAAgB,CAAsB;CACjD"}
|
package/dist/src/GroupPrices.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GroupPrices = exports.GroupPrice = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const simple_encoding_1 = require("@simonbackx/simple-encoding");
|
|
6
|
-
const uuid_1 = require("uuid");
|
|
7
|
-
class GroupPrice extends simple_encoding_1.AutoEncoder {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.price = 0;
|
|
11
|
-
this.reducedPrice = null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.GroupPrice = GroupPrice;
|
|
15
|
-
tslib_1.__decorate([
|
|
16
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.IntegerDecoder })
|
|
17
|
-
], GroupPrice.prototype, "price", void 0);
|
|
18
|
-
tslib_1.__decorate([
|
|
19
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.IntegerDecoder, nullable: true })
|
|
20
|
-
], GroupPrice.prototype, "reducedPrice", void 0);
|
|
21
|
-
/**
|
|
22
|
-
* A group can have multiple prices, stored in an array. The pricing with the highest date or index is applied.
|
|
23
|
-
*/
|
|
24
|
-
class GroupPrices extends simple_encoding_1.AutoEncoder {
|
|
25
|
-
constructor() {
|
|
26
|
-
super(...arguments);
|
|
27
|
-
this.startDate = null;
|
|
28
|
-
/**
|
|
29
|
-
* Whether the array count is per member of the same family (true) or only the same member (false)
|
|
30
|
-
*/
|
|
31
|
-
this.sameMemberOnlyDiscount = false;
|
|
32
|
-
/**
|
|
33
|
-
* Count members in same category or only for the same group?
|
|
34
|
-
*/
|
|
35
|
-
this.onlySameGroup = false;
|
|
36
|
-
/**
|
|
37
|
-
* The array contains prices: for first member, second member... If more members are present in a family (or member itself), the last price is used
|
|
38
|
-
*/
|
|
39
|
-
this.prices = [GroupPrice.create({})];
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated
|
|
42
|
-
*/
|
|
43
|
-
this.price = 0;
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated
|
|
46
|
-
*/
|
|
47
|
-
this.reducedPrice = null;
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated
|
|
50
|
-
* Second member in the family
|
|
51
|
-
*/
|
|
52
|
-
this.familyPrice = null;
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated
|
|
55
|
-
* Third or later member
|
|
56
|
-
*/
|
|
57
|
-
this.extraFamilyPrice = null;
|
|
58
|
-
}
|
|
59
|
-
getPriceFor(reduced, alreadyRegisteredCount = 0) {
|
|
60
|
-
var _a;
|
|
61
|
-
if (this.prices.length == 0 || alreadyRegisteredCount < 0) {
|
|
62
|
-
return 0;
|
|
63
|
-
}
|
|
64
|
-
const price = this.prices[Math.min(this.prices.length - 1, alreadyRegisteredCount)];
|
|
65
|
-
if (reduced) {
|
|
66
|
-
return (_a = price.reducedPrice) !== null && _a !== void 0 ? _a : price.price;
|
|
67
|
-
}
|
|
68
|
-
return price.price;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.GroupPrices = GroupPrices;
|
|
72
|
-
tslib_1.__decorate([
|
|
73
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.StringDecoder, version: 2, defaultValue: () => (0, uuid_1.v4)() })
|
|
74
|
-
], GroupPrices.prototype, "id", void 0);
|
|
75
|
-
tslib_1.__decorate([
|
|
76
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.DateDecoder, nullable: true })
|
|
77
|
-
], GroupPrices.prototype, "startDate", void 0);
|
|
78
|
-
tslib_1.__decorate([
|
|
79
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.BooleanDecoder, upgrade: () => false, version: 99 })
|
|
80
|
-
], GroupPrices.prototype, "sameMemberOnlyDiscount", void 0);
|
|
81
|
-
tslib_1.__decorate([
|
|
82
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.BooleanDecoder, upgrade: () => false, version: 99 })
|
|
83
|
-
], GroupPrices.prototype, "onlySameGroup", void 0);
|
|
84
|
-
tslib_1.__decorate([
|
|
85
|
-
(0, simple_encoding_1.field)({ decoder: new simple_encoding_1.ArrayDecoder(GroupPrice), version: 98, upgrade: function () {
|
|
86
|
-
const arr = [
|
|
87
|
-
GroupPrice.create({
|
|
88
|
-
price: this.price,
|
|
89
|
-
reducedPrice: this.reducedPrice
|
|
90
|
-
})
|
|
91
|
-
];
|
|
92
|
-
if (this.familyPrice !== null) {
|
|
93
|
-
arr.push(GroupPrice.create({
|
|
94
|
-
price: this.familyPrice,
|
|
95
|
-
reducedPrice: (this.reducedPrice !== null && this.familyPrice < this.reducedPrice) ? null : this.reducedPrice
|
|
96
|
-
}));
|
|
97
|
-
if (this.extraFamilyPrice !== null) {
|
|
98
|
-
arr.push(GroupPrice.create({
|
|
99
|
-
price: this.extraFamilyPrice,
|
|
100
|
-
reducedPrice: (this.reducedPrice !== null && this.extraFamilyPrice < this.reducedPrice) ? null : this.reducedPrice
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return arr;
|
|
105
|
-
} })
|
|
106
|
-
], GroupPrices.prototype, "prices", void 0);
|
|
107
|
-
tslib_1.__decorate([
|
|
108
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.IntegerDecoder })
|
|
109
|
-
], GroupPrices.prototype, "price", void 0);
|
|
110
|
-
tslib_1.__decorate([
|
|
111
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.IntegerDecoder, nullable: true })
|
|
112
|
-
], GroupPrices.prototype, "reducedPrice", void 0);
|
|
113
|
-
tslib_1.__decorate([
|
|
114
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.IntegerDecoder, nullable: true, version: 22 })
|
|
115
|
-
], GroupPrices.prototype, "familyPrice", void 0);
|
|
116
|
-
tslib_1.__decorate([
|
|
117
|
-
(0, simple_encoding_1.field)({ decoder: simple_encoding_1.IntegerDecoder, nullable: true, version: 22 })
|
|
118
|
-
], GroupPrices.prototype, "extraFamilyPrice", void 0);
|
|
119
|
-
//# sourceMappingURL=GroupPrices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPrices.js","sourceRoot":"","sources":["../../src/GroupPrices.ts"],"names":[],"mappings":";;;;AAAA,iEAA0I;AAC1I,+BAAoC;AAEpC,MAAa,UAAW,SAAQ,6BAAW;IAA3C;;QAEI,UAAK,GAAG,CAAC,CAAA;QAGT,iBAAY,GAAkB,IAAI,CAAA;IACtC,CAAC;CAAA;AAND,gCAMC;AAJG;IADC,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,gCAAc,EAAE,CAAC;yCAC1B;AAGT;IADC,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,gCAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;gDACjB;AAGtC;;GAEG;AACH,MAAa,WAAY,SAAQ,6BAAW;IAA5C;;QAKI,cAAS,GAAgB,IAAI,CAAA;QAE7B;;WAEG;QAEH,2BAAsB,GAAG,KAAK,CAAA;QAE9B;;WAEG;QAEH,kBAAa,GAAG,KAAK,CAAA;QAErB;;WAEG;QA2BH,WAAM,GAAiB,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;QAc9C;;WAEG;QAEK,UAAK,GAAG,CAAC,CAAA;QAEjB;;WAEG;QAEK,iBAAY,GAAkB,IA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,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;gDACvB;AAOjC;IADP,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,gCAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;qDAClB"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { AutoEncoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
export declare class GroupPrice extends AutoEncoder {
|
|
3
|
-
price: number;
|
|
4
|
-
reducedPrice: number | null;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* A group can have multiple prices, stored in an array. The pricing with the highest date or index is applied.
|
|
8
|
-
*/
|
|
9
|
-
export declare class GroupPrices extends AutoEncoder {
|
|
10
|
-
id: string;
|
|
11
|
-
startDate: Date | null;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the array count is per member of the same family (true) or only the same member (false)
|
|
14
|
-
*/
|
|
15
|
-
sameMemberOnlyDiscount: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Count members in same category or only for the same group?
|
|
18
|
-
*/
|
|
19
|
-
onlySameGroup: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The array contains prices: for first member, second member... If more members are present in a family (or member itself), the last price is used
|
|
22
|
-
*/
|
|
23
|
-
prices: GroupPrice[];
|
|
24
|
-
getPriceFor(reduced: boolean, alreadyRegisteredCount?: number): number;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated
|
|
27
|
-
*/
|
|
28
|
-
private price;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated
|
|
31
|
-
*/
|
|
32
|
-
private reducedPrice;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated
|
|
35
|
-
* Second member in the family
|
|
36
|
-
*/
|
|
37
|
-
private familyPrice;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated
|
|
40
|
-
* Third or later member
|
|
41
|
-
*/
|
|
42
|
-
private extraFamilyPrice;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=GroupPrices.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPrices.d.ts","sourceRoot":"","sources":["../../../src/GroupPrices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAoE,MAAM,6BAA6B,CAAC;AAG1I,qBAAa,UAAW,SAAQ,WAAW;IAEvC,KAAK,SAAI;IAGT,YAAY,EAAE,MAAM,GAAG,IAAI,CAAO;CACrC;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAExC,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,IAAI,GAAG,IAAI,CAAO;IAE7B;;OAEG;IAEH,sBAAsB,UAAQ;IAE9B;;OAEG;IAEH,aAAa,UAAQ;IAErB;;OAEG;IA2BH,MAAM,EAAE,UAAU,EAAE,CAA0B;IAE9C,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,sBAAsB,SAAI;IAYxD;;OAEG;IAEH,OAAO,CAAC,KAAK,CAAI;IAEjB;;OAEG;IAEH,OAAO,CAAC,YAAY,CAAsB;IAE1C;;;OAGG;IAEH,OAAO,CAAC,WAAW,CAAsB;IAEzC;;;OAGG;IAEH,OAAO,CAAC,gBAAgB,CAAsB;CACjD"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { ArrayDecoder, AutoEncoder, BooleanDecoder, DateDecoder, field, IntegerDecoder, StringDecoder } from '@simonbackx/simple-encoding';
|
|
3
|
-
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
export class GroupPrice extends AutoEncoder {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.price = 0;
|
|
8
|
-
this.reducedPrice = null;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
__decorate([
|
|
12
|
-
field({ decoder: IntegerDecoder })
|
|
13
|
-
], GroupPrice.prototype, "price", void 0);
|
|
14
|
-
__decorate([
|
|
15
|
-
field({ decoder: IntegerDecoder, nullable: true })
|
|
16
|
-
], GroupPrice.prototype, "reducedPrice", void 0);
|
|
17
|
-
/**
|
|
18
|
-
* A group can have multiple prices, stored in an array. The pricing with the highest date or index is applied.
|
|
19
|
-
*/
|
|
20
|
-
export class GroupPrices extends AutoEncoder {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.startDate = null;
|
|
24
|
-
/**
|
|
25
|
-
* Whether the array count is per member of the same family (true) or only the same member (false)
|
|
26
|
-
*/
|
|
27
|
-
this.sameMemberOnlyDiscount = false;
|
|
28
|
-
/**
|
|
29
|
-
* Count members in same category or only for the same group?
|
|
30
|
-
*/
|
|
31
|
-
this.onlySameGroup = false;
|
|
32
|
-
/**
|
|
33
|
-
* The array contains prices: for first member, second member... If more members are present in a family (or member itself), the last price is used
|
|
34
|
-
*/
|
|
35
|
-
this.prices = [GroupPrice.create({})];
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated
|
|
38
|
-
*/
|
|
39
|
-
this.price = 0;
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated
|
|
42
|
-
*/
|
|
43
|
-
this.reducedPrice = null;
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated
|
|
46
|
-
* Second member in the family
|
|
47
|
-
*/
|
|
48
|
-
this.familyPrice = null;
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated
|
|
51
|
-
* Third or later member
|
|
52
|
-
*/
|
|
53
|
-
this.extraFamilyPrice = null;
|
|
54
|
-
}
|
|
55
|
-
getPriceFor(reduced, alreadyRegisteredCount = 0) {
|
|
56
|
-
var _a;
|
|
57
|
-
if (this.prices.length == 0 || alreadyRegisteredCount < 0) {
|
|
58
|
-
return 0;
|
|
59
|
-
}
|
|
60
|
-
const price = this.prices[Math.min(this.prices.length - 1, alreadyRegisteredCount)];
|
|
61
|
-
if (reduced) {
|
|
62
|
-
return (_a = price.reducedPrice) !== null && _a !== void 0 ? _a : price.price;
|
|
63
|
-
}
|
|
64
|
-
return price.price;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
__decorate([
|
|
68
|
-
field({ decoder: StringDecoder, version: 2, defaultValue: () => uuidv4() })
|
|
69
|
-
], GroupPrices.prototype, "id", void 0);
|
|
70
|
-
__decorate([
|
|
71
|
-
field({ decoder: DateDecoder, nullable: true })
|
|
72
|
-
], GroupPrices.prototype, "startDate", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
field({ decoder: BooleanDecoder, upgrade: () => false, version: 99 })
|
|
75
|
-
], GroupPrices.prototype, "sameMemberOnlyDiscount", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
field({ decoder: BooleanDecoder, upgrade: () => false, version: 99 })
|
|
78
|
-
], GroupPrices.prototype, "onlySameGroup", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
field({ decoder: new ArrayDecoder(GroupPrice), version: 98, upgrade: function () {
|
|
81
|
-
const arr = [
|
|
82
|
-
GroupPrice.create({
|
|
83
|
-
price: this.price,
|
|
84
|
-
reducedPrice: this.reducedPrice
|
|
85
|
-
})
|
|
86
|
-
];
|
|
87
|
-
if (this.familyPrice !== null) {
|
|
88
|
-
arr.push(GroupPrice.create({
|
|
89
|
-
price: this.familyPrice,
|
|
90
|
-
reducedPrice: (this.reducedPrice !== null && this.familyPrice < this.reducedPrice) ? null : this.reducedPrice
|
|
91
|
-
}));
|
|
92
|
-
if (this.extraFamilyPrice !== null) {
|
|
93
|
-
arr.push(GroupPrice.create({
|
|
94
|
-
price: this.extraFamilyPrice,
|
|
95
|
-
reducedPrice: (this.reducedPrice !== null && this.extraFamilyPrice < this.reducedPrice) ? null : this.reducedPrice
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return arr;
|
|
100
|
-
} })
|
|
101
|
-
], GroupPrices.prototype, "prices", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
field({ decoder: IntegerDecoder })
|
|
104
|
-
], GroupPrices.prototype, "price", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
field({ decoder: IntegerDecoder, nullable: true })
|
|
107
|
-
], GroupPrices.prototype, "reducedPrice", void 0);
|
|
108
|
-
__decorate([
|
|
109
|
-
field({ decoder: IntegerDecoder, nullable: true, version: 22 })
|
|
110
|
-
], GroupPrices.prototype, "familyPrice", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
field({ decoder: IntegerDecoder, nullable: true, version: 22 })
|
|
113
|
-
], GroupPrices.prototype, "extraFamilyPrice", void 0);
|
|
114
|
-
//# sourceMappingURL=GroupPrices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPrices.js","sourceRoot":"","sources":["../../../src/GroupPrices.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAC,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC1I,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,MAAM,OAAO,UAAW,SAAQ,WAAW;IAA3C;;QAEI,UAAK,GAAG,CAAC,CAAA;QAGT,iBAAY,GAAkB,IAAI,CAAA;IACtC,CAAC;CAAA;AAJG;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;yCAC1B;AAGT;IADC,KAAK,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;gDACjB;AAGtC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QAKI,cAAS,GAAgB,IAAI,CAAA;QAE7B;;WAEG;QAEH,2BAAsB,GAAG,KAAK,CAAA;QAE9B;;WAEG;QAEH,kBAAa,GAAG,KAAK,CAAA;QAErB;;WAEG;QA2BH,WAAM,GAAiB,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;QAc9C;;WAEG;QAE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