@stamhoofd/models 2.78.3 → 2.79.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/factories/GroupFactory.d.ts +4 -0
- package/dist/src/factories/GroupFactory.d.ts.map +1 -1
- package/dist/src/factories/GroupFactory.js +11 -1
- package/dist/src/factories/GroupFactory.js.map +1 -1
- package/dist/src/factories/MemberResponsibilityRecordFactory.d.ts +14 -0
- package/dist/src/factories/MemberResponsibilityRecordFactory.d.ts.map +1 -0
- package/dist/src/factories/MemberResponsibilityRecordFactory.js +34 -0
- package/dist/src/factories/MemberResponsibilityRecordFactory.js.map +1 -0
- package/dist/src/factories/OrganizationFactory.d.ts +1 -0
- package/dist/src/factories/OrganizationFactory.d.ts.map +1 -1
- package/dist/src/factories/OrganizationFactory.js +4 -0
- package/dist/src/factories/OrganizationFactory.js.map +1 -1
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.d.ts +13 -0
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.d.ts.map +1 -0
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.js +20 -0
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.js.map +1 -0
- package/dist/src/factories/OrganizationTagFactory.d.ts +10 -0
- package/dist/src/factories/OrganizationTagFactory.d.ts.map +1 -0
- package/dist/src/factories/OrganizationTagFactory.js +23 -0
- package/dist/src/factories/OrganizationTagFactory.js.map +1 -0
- package/dist/src/factories/PlatformResponsibilityFactory.d.ts +11 -0
- package/dist/src/factories/PlatformResponsibilityFactory.d.ts.map +1 -0
- package/dist/src/factories/PlatformResponsibilityFactory.js +25 -0
- package/dist/src/factories/PlatformResponsibilityFactory.js.map +1 -0
- package/dist/src/factories/RegistrationFactory.d.ts +6 -2
- package/dist/src/factories/RegistrationFactory.d.ts.map +1 -1
- package/dist/src/factories/RegistrationFactory.js +6 -9
- package/dist/src/factories/RegistrationFactory.js.map +1 -1
- package/dist/src/factories/RegistrationPeriodFactory.d.ts +1 -0
- package/dist/src/factories/RegistrationPeriodFactory.d.ts.map +1 -1
- package/dist/src/factories/RegistrationPeriodFactory.js +4 -0
- package/dist/src/factories/RegistrationPeriodFactory.js.map +1 -1
- package/dist/src/factories/index.d.ts +18 -0
- package/dist/src/factories/index.d.ts.map +1 -0
- package/dist/src/factories/index.js +21 -0
- package/dist/src/factories/index.js.map +1 -0
- package/dist/src/helpers/EmailBuilder.d.ts +8 -10
- package/dist/src/helpers/EmailBuilder.d.ts.map +1 -1
- package/dist/src/helpers/EmailBuilder.js +44 -42
- package/dist/src/helpers/EmailBuilder.js.map +1 -1
- package/dist/src/index.d.ts +2 -14
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -14
- package/dist/src/index.js.map +1 -1
- package/dist/src/models/Email.d.ts +9 -2
- package/dist/src/models/Email.d.ts.map +1 -1
- package/dist/src/models/Email.js +18 -16
- package/dist/src/models/Email.js.map +1 -1
- package/dist/src/models/Email.test.js +183 -2
- package/dist/src/models/Email.test.js.map +1 -1
- package/dist/src/models/Member.d.ts +3 -1
- package/dist/src/models/Member.d.ts.map +1 -1
- package/dist/src/models/Member.js +14 -8
- package/dist/src/models/Member.js.map +1 -1
- package/dist/src/models/Order.d.ts +0 -2
- package/dist/src/models/Order.d.ts.map +1 -1
- package/dist/src/models/Order.js +0 -48
- package/dist/src/models/Order.js.map +1 -1
- package/dist/src/models/Organization.d.ts +1 -16
- package/dist/src/models/Organization.d.ts.map +1 -1
- package/dist/src/models/Organization.js +5 -86
- package/dist/src/models/Organization.js.map +1 -1
- package/dist/src/models/Platform.d.ts +11 -3
- package/dist/src/models/Platform.d.ts.map +1 -1
- package/dist/src/models/Platform.js +76 -24
- package/dist/src/models/Platform.js.map +1 -1
- package/dist/src/models/Platform.test.d.ts +2 -0
- package/dist/src/models/Platform.test.d.ts.map +1 -0
- package/dist/src/models/Platform.test.js +90 -0
- package/dist/src/models/Platform.test.js.map +1 -0
- package/dist/src/models/index.d.ts +1 -1
- package/dist/src/models/index.d.ts.map +1 -1
- package/dist/src/models/index.js +2 -3
- package/dist/src/models/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/factories/GroupFactory.ts +16 -3
- package/src/factories/MemberResponsibilityRecordFactory.ts +35 -0
- package/src/factories/OrganizationFactory.ts +5 -0
- package/src/factories/OrganizationRegistrationPeriodFactory.ts +22 -0
- package/src/factories/OrganizationTagFactory.ts +23 -0
- package/src/factories/PlatformResponsibilityFactory.ts +25 -0
- package/src/factories/RegistrationFactory.ts +15 -6
- package/src/factories/RegistrationPeriodFactory.ts +4 -0
- package/src/factories/index.ts +17 -0
- package/src/helpers/EmailBuilder.ts +54 -50
- package/src/index.ts +4 -15
- package/src/models/Email.test.ts +217 -5
- package/src/models/Email.ts +22 -20
- package/src/models/Member.ts +20 -10
- package/src/models/Order.ts +0 -55
- package/src/models/Organization.ts +6 -101
- package/src/models/Platform.test.ts +107 -0
- package/src/models/Platform.ts +86 -25
- package/src/models/index.ts +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Factory } from '@simonbackx/simple-database';
|
|
2
|
+
import { GroupType } from '@stamhoofd/structures';
|
|
3
|
+
import { RegistrationPeriod } from '../models';
|
|
2
4
|
import { Group } from '../models/Group';
|
|
3
5
|
import { Organization } from '../models/Organization';
|
|
4
6
|
declare class Options {
|
|
@@ -6,8 +8,10 @@ declare class Options {
|
|
|
6
8
|
price?: number;
|
|
7
9
|
reducedPrice?: number;
|
|
8
10
|
stock?: number;
|
|
11
|
+
type?: GroupType;
|
|
9
12
|
skipCategory?: boolean;
|
|
10
13
|
maxMembers?: number | null;
|
|
14
|
+
period?: RegistrationPeriod;
|
|
11
15
|
}
|
|
12
16
|
export declare class GroupFactory extends Factory<Options, Group> {
|
|
13
17
|
create(): Promise<Group>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/GroupFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/GroupFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAA6B,SAAS,EAAmB,MAAM,uBAAuB,CAAC;AAE9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,cAAM,OAAO;IACT,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED,qBAAa,YAAa,SAAQ,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC;IAC/C,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC;CA4CjC"}
|
|
@@ -10,15 +10,22 @@ class Options {
|
|
|
10
10
|
price;
|
|
11
11
|
reducedPrice;
|
|
12
12
|
stock;
|
|
13
|
+
type;
|
|
13
14
|
skipCategory;
|
|
14
15
|
maxMembers;
|
|
16
|
+
period;
|
|
15
17
|
}
|
|
16
18
|
class GroupFactory extends simple_database_1.Factory {
|
|
17
19
|
async create() {
|
|
18
20
|
const organization = this.options.organization ?? await new OrganizationFactory_1.OrganizationFactory({}).create();
|
|
19
21
|
const group = new Group_1.Group();
|
|
20
22
|
group.organizationId = organization.id;
|
|
21
|
-
|
|
23
|
+
if (this.options.period) {
|
|
24
|
+
group.periodId = this.options.period.id;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
group.periodId = organization.periodId;
|
|
28
|
+
}
|
|
22
29
|
group.settings = structures_1.GroupSettings.create({
|
|
23
30
|
name: 'Group name',
|
|
24
31
|
startDate: new Date(new Date().getTime() - 10 * 1000),
|
|
@@ -36,6 +43,9 @@ class GroupFactory extends simple_database_1.Factory {
|
|
|
36
43
|
],
|
|
37
44
|
maxMembers: this.options.maxMembers === undefined ? null : this.options.maxMembers,
|
|
38
45
|
});
|
|
46
|
+
if (this.options.type) {
|
|
47
|
+
group.type = this.options.type;
|
|
48
|
+
}
|
|
39
49
|
await group.save();
|
|
40
50
|
if (!this.options.skipCategory) {
|
|
41
51
|
organization.meta.rootCategory.groupIds.push(group.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupFactory.js","sourceRoot":"","sources":["../../../src/factories/GroupFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"GroupFactory.js","sourceRoot":"","sources":["../../../src/factories/GroupFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,sDAA8F;AAG9F,2CAAwC;AAExC,+DAA4D;AAE5D,MAAM,OAAO;IACT,YAAY,CAAgB;IAC5B,KAAK,CAAU;IACf,YAAY,CAAU;IACtB,KAAK,CAAU;IACf,IAAI,CAAa;IACjB,YAAY,CAAW;IACvB,UAAU,CAAiB;IAC3B,MAAM,CAAsB;CAC/B;AAED,MAAa,YAAa,SAAQ,yBAAuB;IACrD,KAAK,CAAC,MAAM;QACR,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,MAAM,IAAI,yCAAmB,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QAE7F,MAAM,KAAK,GAAG,IAAI,aAAK,EAAE,CAAC;QAC1B,KAAK,CAAC,cAAc,GAAG,YAAY,CA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IAAI,EAAE,CAAC;YACpB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QACnC,CAAC;QAED,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QAEnB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAC7B,YAAY,CAAC,IAAI,CAAC,YAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACxD,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;QAC9B,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA7CD,oCA6CC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Factory } from '@simonbackx/simple-database';
|
|
2
|
+
import { MemberResponsibility } from '@stamhoofd/structures';
|
|
3
|
+
import { Member, MemberResponsibilityRecord } from '../models';
|
|
4
|
+
declare class Options {
|
|
5
|
+
name?: string;
|
|
6
|
+
responsibility?: MemberResponsibility;
|
|
7
|
+
member: Member;
|
|
8
|
+
organizationId?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class MemberResponsibilityRecordFactory extends Factory<Options, MemberResponsibilityRecord> {
|
|
11
|
+
create(): Promise<MemberResponsibilityRecord>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=MemberResponsibilityRecordFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemberResponsibilityRecordFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/MemberResponsibilityRecordFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAG/D,cAAM,OAAO;IACT,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,iCAAkC,SAAQ,OAAO,CAAC,OAAO,EAAE,0BAA0B,CAAC;IACzF,MAAM,IAAI,OAAO,CAAC,0BAA0B,CAAC;CAoBtD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemberResponsibilityRecordFactory = void 0;
|
|
4
|
+
const simple_database_1 = require("@simonbackx/simple-database");
|
|
5
|
+
const models_1 = require("../models");
|
|
6
|
+
const PlatformResponsibilityFactory_1 = require("./PlatformResponsibilityFactory");
|
|
7
|
+
class Options {
|
|
8
|
+
name;
|
|
9
|
+
responsibility;
|
|
10
|
+
member;
|
|
11
|
+
organizationId;
|
|
12
|
+
}
|
|
13
|
+
class MemberResponsibilityRecordFactory extends simple_database_1.Factory {
|
|
14
|
+
async create() {
|
|
15
|
+
const record = new models_1.MemberResponsibilityRecord();
|
|
16
|
+
const responsibility = this.options.responsibility ?? (await new PlatformResponsibilityFactory_1.PlatformResponsibilityFactory({
|
|
17
|
+
organizationBased: !!this.options.organizationId,
|
|
18
|
+
}).create());
|
|
19
|
+
record.responsibilityId = this.options.responsibility?.id ?? responsibility.id;
|
|
20
|
+
record.memberId = this.options.member.id;
|
|
21
|
+
record.startDate = new Date();
|
|
22
|
+
record.endDate = null;
|
|
23
|
+
record.organizationId = this.options.organizationId ?? this.options.member.organizationId;
|
|
24
|
+
if (record.organizationId) {
|
|
25
|
+
if (responsibility.organizationBased) {
|
|
26
|
+
throw new Error('This responsibility is organization based. Please also provider the organizationId option when creating the record with MemberResponsibilityRecordFactory');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
await record.save();
|
|
30
|
+
return record;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.MemberResponsibilityRecordFactory = MemberResponsibilityRecordFactory;
|
|
34
|
+
//# sourceMappingURL=MemberResponsibilityRecordFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemberResponsibilityRecordFactory.js","sourceRoot":"","sources":["../../../src/factories/MemberResponsibilityRecordFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AAGtD,sCAA+D;AAC/D,mFAAgF;AAEhF,MAAM,OAAO;IACT,IAAI,CAAU;IACd,cAAc,CAAwB;IACtC,MAAM,CAAS;IACf,cAAc,CAAU;CAC3B;AAED,MAAa,iCAAkC,SAAQ,yBAA4C;IAC/F,KAAK,CAAC,MAAM;QACR,MAAM,MAAM,GAAG,IAAI,mCAA0B,EAAE,CAAC;QAChD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,CAAC,MAAM,IAAI,6DAA6B,CAAC;YAC3F,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc;SACnD,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QACb,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,cAAc,CAAC,EAAE,CAAC;QAC/E,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;QAE1F,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YACxB,IAAI,cAAc,CAAC,iBAAiB,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,2JAA2J,CAAC,CAAC;YACjL,CAAC;QACL,CAAC;QAED,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AArBD,8EAqBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/OrganizationFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAoB,oBAAoB,EAAoB,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGzH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,cAAM,OAAO;IACT,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACjC,MAAM,CAAC,EAAE,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"OrganizationFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/OrganizationFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAoB,oBAAoB,EAAoB,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGzH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,cAAM,OAAO;IACT,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACjC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC;IAC7D,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;CAmCxC"}
|
|
@@ -14,6 +14,7 @@ class Options {
|
|
|
14
14
|
city;
|
|
15
15
|
roles;
|
|
16
16
|
period;
|
|
17
|
+
tags;
|
|
17
18
|
}
|
|
18
19
|
class OrganizationFactory extends simple_database_1.Factory {
|
|
19
20
|
async create() {
|
|
@@ -41,6 +42,9 @@ class OrganizationFactory extends simple_database_1.Factory {
|
|
|
41
42
|
if (this.options.roles) {
|
|
42
43
|
organization.privateMeta.roles = this.options.roles;
|
|
43
44
|
}
|
|
45
|
+
if (this.options.tags) {
|
|
46
|
+
organization.meta.tags = this.options.tags;
|
|
47
|
+
}
|
|
44
48
|
await organization.save();
|
|
45
49
|
return organization;
|
|
46
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationFactory.js","sourceRoot":"","sources":["../../../src/factories/OrganizationFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,sDAAyH;AACzH,gDAA+C;AAE/C,yDAAsD;AAEtD,2EAAwE;AAExE,MAAM,OAAO;IACT,GAAG,CAAU;IACb,MAAM,CAAU;IAChB,IAAI,CAAwB;IAC5B,IAAI,CAAU;IACd,IAAI,CAAU;IACd,KAAK,CAA4B;IACjC,MAAM,CAAsB;
|
|
1
|
+
{"version":3,"file":"OrganizationFactory.js","sourceRoot":"","sources":["../../../src/factories/OrganizationFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,sDAAyH;AACzH,gDAA+C;AAE/C,yDAAsD;AAEtD,2EAAwE;AAExE,MAAM,OAAO;IACT,GAAG,CAAU;IACb,MAAM,CAAU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M,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,IAAI,qDAAyB,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACvF,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC;QAElC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACrB,YAAY,CAAC,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QACxD,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,YAAY,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAC/C,CAAC;QAED,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1B,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ;AApCD,kDAoCC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Factory } from '@simonbackx/simple-database';
|
|
2
|
+
import { OrganizationRegistrationPeriod } from '../models';
|
|
3
|
+
import { Organization } from '../models/Organization';
|
|
4
|
+
import { RegistrationPeriod } from '../models/RegistrationPeriod';
|
|
5
|
+
declare class Options {
|
|
6
|
+
organization: Organization;
|
|
7
|
+
period: RegistrationPeriod;
|
|
8
|
+
}
|
|
9
|
+
export declare class OrganizationRegistrationPeriodFactory extends Factory<Options, OrganizationRegistrationPeriod> {
|
|
10
|
+
create(): Promise<OrganizationRegistrationPeriod>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=OrganizationRegistrationPeriodFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationRegistrationPeriodFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/OrganizationRegistrationPeriodFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,cAAM,OAAO;IACT,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,kBAAkB,CAAC;CAC9B;AAED,qBAAa,qCAAsC,SAAQ,OAAO,CAAC,OAAO,EAAE,8BAA8B,CAAC;IACjG,MAAM,IAAI,OAAO,CAAC,8BAA8B,CAAC;CAS1D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganizationRegistrationPeriodFactory = void 0;
|
|
4
|
+
const simple_database_1 = require("@simonbackx/simple-database");
|
|
5
|
+
const models_1 = require("../models");
|
|
6
|
+
class Options {
|
|
7
|
+
organization;
|
|
8
|
+
period;
|
|
9
|
+
}
|
|
10
|
+
class OrganizationRegistrationPeriodFactory extends simple_database_1.Factory {
|
|
11
|
+
async create() {
|
|
12
|
+
const organizationRegistrationPeriod = new models_1.OrganizationRegistrationPeriod();
|
|
13
|
+
organizationRegistrationPeriod.organizationId = this.options.organization.id;
|
|
14
|
+
organizationRegistrationPeriod.periodId = this.options.period.id;
|
|
15
|
+
await organizationRegistrationPeriod.save();
|
|
16
|
+
return organizationRegistrationPeriod;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.OrganizationRegistrationPeriodFactory = OrganizationRegistrationPeriodFactory;
|
|
20
|
+
//# sourceMappingURL=OrganizationRegistrationPeriodFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationRegistrationPeriodFactory.js","sourceRoot":"","sources":["../../../src/factories/OrganizationRegistrationPeriodFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AAEtD,sCAA2D;AAI3D,MAAM,OAAO;IACT,YAAY,CAAe;IAC3B,MAAM,CAAqB;CAC9B;AAED,MAAa,qCAAsC,SAAQ,yBAAgD;IACvG,KAAK,CAAC,MAAM;QACR,MAAM,8BAA8B,GAAG,IAAI,uCAA8B,EAAE,CAAC;QAE5E,8BAA8B,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7E,8BAA8B,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAEjE,MAAM,8BAA8B,CAAC,IAAI,EAAE,CAAC;QAC5C,OAAO,8BAA8B,CAAC;IAC1C,CAAC;CACJ;AAVD,sFAUC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Factory } from '@simonbackx/simple-database';
|
|
2
|
+
import { OrganizationTag } from '@stamhoofd/structures';
|
|
3
|
+
declare class Options {
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class OrganizationTagFactory extends Factory<Options, OrganizationTag> {
|
|
7
|
+
create(): Promise<OrganizationTag>;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=OrganizationTagFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationTagFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/OrganizationTagFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD,cAAM,OAAO;IACT,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC;IACnE,MAAM,IAAI,OAAO,CAAC,eAAe,CAAC;CAY3C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganizationTagFactory = void 0;
|
|
4
|
+
const simple_database_1 = require("@simonbackx/simple-database");
|
|
5
|
+
const structures_1 = require("@stamhoofd/structures");
|
|
6
|
+
const Platform_1 = require("../models/Platform");
|
|
7
|
+
class Options {
|
|
8
|
+
name;
|
|
9
|
+
}
|
|
10
|
+
class OrganizationTagFactory extends simple_database_1.Factory {
|
|
11
|
+
async create() {
|
|
12
|
+
const tag = structures_1.OrganizationTag.create({
|
|
13
|
+
name: 'tag ' + (new Date().getTime() + Math.floor(Math.random() * 999999)),
|
|
14
|
+
});
|
|
15
|
+
// Add to platform
|
|
16
|
+
const platform = await Platform_1.Platform.getForEditing();
|
|
17
|
+
platform.config.tags.push(tag);
|
|
18
|
+
await platform.save();
|
|
19
|
+
return tag;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.OrganizationTagFactory = OrganizationTagFactory;
|
|
23
|
+
//# sourceMappingURL=OrganizationTagFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationTagFactory.js","sourceRoot":"","sources":["../../../src/factories/OrganizationTagFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,sDAAwD;AAExD,iDAA8C;AAE9C,MAAM,OAAO;IACT,IAAI,CAAU;CACjB;AAED,MAAa,sBAAuB,SAAQ,yBAAiC;IACzE,KAAK,CAAC,MAAM;QACR,MAAM,GAAG,GAAG,4BAAe,CAAC,MAAM,CAAC;YAC/B,IAAI,EAAE,MAAM,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC;SAC7E,CAAC,CAAC;QAEH,kBAAkB;QAClB,MAAM,QAAQ,GAAG,MAAM,mBAAQ,CAAC,aAAa,EAAE,CAAC;QAChD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEtB,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AAbD,wDAaC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Factory } from '@simonbackx/simple-database';
|
|
2
|
+
import { MemberResponsibility } from '@stamhoofd/structures';
|
|
3
|
+
declare class Options {
|
|
4
|
+
name?: string;
|
|
5
|
+
organizationBased?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class PlatformResponsibilityFactory extends Factory<Options, MemberResponsibility> {
|
|
8
|
+
create(): Promise<MemberResponsibility>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=PlatformResponsibilityFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformResponsibilityFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/PlatformResponsibilityFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,cAAM,OAAO;IACT,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,qBAAa,6BAA8B,SAAQ,OAAO,CAAC,OAAO,EAAE,oBAAoB,CAAC;IAC/E,MAAM,IAAI,OAAO,CAAC,oBAAoB,CAAC;CAahD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlatformResponsibilityFactory = void 0;
|
|
4
|
+
const simple_database_1 = require("@simonbackx/simple-database");
|
|
5
|
+
const structures_1 = require("@stamhoofd/structures");
|
|
6
|
+
const Platform_1 = require("../models/Platform");
|
|
7
|
+
class Options {
|
|
8
|
+
name;
|
|
9
|
+
organizationBased;
|
|
10
|
+
}
|
|
11
|
+
class PlatformResponsibilityFactory extends simple_database_1.Factory {
|
|
12
|
+
async create() {
|
|
13
|
+
const responsibility = structures_1.MemberResponsibility.create({
|
|
14
|
+
name: this.options.name ?? ('Responsibility ' + (new Date().getTime() + Math.floor(Math.random() * 999999))),
|
|
15
|
+
organizationBased: this.options.organizationBased ?? true,
|
|
16
|
+
});
|
|
17
|
+
// Add to platform
|
|
18
|
+
const platform = await Platform_1.Platform.getForEditing();
|
|
19
|
+
platform.config.responsibilities.push(responsibility);
|
|
20
|
+
await platform.save();
|
|
21
|
+
return responsibility;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.PlatformResponsibilityFactory = PlatformResponsibilityFactory;
|
|
25
|
+
//# sourceMappingURL=PlatformResponsibilityFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformResponsibilityFactory.js","sourceRoot":"","sources":["../../../src/factories/PlatformResponsibilityFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,sDAA6D;AAE7D,iDAA8C;AAE9C,MAAM,OAAO;IACT,IAAI,CAAU;IACd,iBAAiB,CAAW;CAC/B;AAED,MAAa,6BAA8B,SAAQ,yBAAsC;IACrF,KAAK,CAAC,MAAM;QACR,MAAM,cAAc,GAAG,iCAAoB,CAAC,MAAM,CAAC;YAC/C,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,iBAAiB,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;YAC5G,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,IAAI,IAAI;SAC5D,CAAC,CAAC;QAEH,kBAAkB;QAClB,MAAM,QAAQ,GAAG,MAAM,mBAAQ,CAAC,aAAa,EAAE,CAAC;QAChD,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACtD,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEtB,OAAO,cAAc,CAAC;IAC1B,CAAC;CACJ;AAdD,sEAcC"}
|
|
@@ -3,11 +3,15 @@ import { GroupPrice } from '@stamhoofd/structures';
|
|
|
3
3
|
import { Group } from '../models/Group';
|
|
4
4
|
import { Member } from '../models/Member';
|
|
5
5
|
import { Registration } from '../models/Registration';
|
|
6
|
-
|
|
6
|
+
import { Organization } from '../models';
|
|
7
|
+
type Options = {
|
|
7
8
|
member: Member;
|
|
8
9
|
group: Group;
|
|
9
10
|
groupPrice?: GroupPrice;
|
|
10
|
-
}
|
|
11
|
+
} | {
|
|
12
|
+
member: Member;
|
|
13
|
+
organization: Organization;
|
|
14
|
+
};
|
|
11
15
|
export declare class RegistrationFactory extends Factory<Options, Registration> {
|
|
12
16
|
create(): Promise<Registration>;
|
|
13
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegistrationFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/RegistrationFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"RegistrationFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/RegistrationFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,KAAK,OAAO,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B,GAAG;IACA,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;CAC9B,CAAC;AAEF,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC;IAC7D,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;CAiBxC"}
|
|
@@ -3,21 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RegistrationFactory = void 0;
|
|
4
4
|
const simple_database_1 = require("@simonbackx/simple-database");
|
|
5
5
|
const Registration_1 = require("../models/Registration");
|
|
6
|
-
|
|
7
|
-
member;
|
|
8
|
-
group;
|
|
9
|
-
groupPrice;
|
|
10
|
-
}
|
|
6
|
+
const GroupFactory_1 = require("./GroupFactory");
|
|
11
7
|
class RegistrationFactory extends simple_database_1.Factory {
|
|
12
8
|
async create() {
|
|
13
9
|
const registration = new Registration_1.Registration();
|
|
14
10
|
registration.memberId = this.options.member.id;
|
|
15
|
-
|
|
16
|
-
registration.
|
|
17
|
-
registration.
|
|
11
|
+
const group = 'group' in this.options ? this.options.group : await new GroupFactory_1.GroupFactory({ organization: this.options.organization }).create();
|
|
12
|
+
registration.groupId = group.id;
|
|
13
|
+
registration.periodId = group.periodId;
|
|
14
|
+
registration.organizationId = group.organizationId;
|
|
18
15
|
registration.registeredAt = new Date();
|
|
19
16
|
registration.registeredAt.setMilliseconds(0);
|
|
20
|
-
registration.groupPrice = this.options.groupPrice
|
|
17
|
+
registration.groupPrice = 'groupPrice' in this.options && this.options.groupPrice ? this.options.groupPrice : group.settings.prices[0];
|
|
21
18
|
await registration.save();
|
|
22
19
|
return registration;
|
|
23
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegistrationFactory.js","sourceRoot":"","sources":["../../../src/factories/RegistrationFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AAKtD,yDAAsD;AAEtD,
|
|
1
|
+
{"version":3,"file":"RegistrationFactory.js","sourceRoot":"","sources":["../../../src/factories/RegistrationFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AAKtD,yDAAsD;AAEtD,iDAA8C;AAW9C,MAAa,mBAAoB,SAAQ,yBAA8B;IACnE,KAAK,CAAC,MAAM;QACR,MAAM,YAAY,GAAG,IAAI,2BAAY,EAAE,CAAC;QACxC,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAE/C,MAAM,KAAK,GAAG,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,IAAI,2BAAY,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QAE1I,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;QAChC,YAAY,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QACvC,YAAY,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;QAEnD,YAAY,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;QACvC,YAAY,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAC7C,YAAY,CAAC,UAAU,GAAG,YAAY,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAEvI,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1B,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ;AAlBD,kDAkBC"}
|
|
@@ -3,6 +3,7 @@ import { RegistrationPeriod } from '../models';
|
|
|
3
3
|
declare class Options {
|
|
4
4
|
startDate?: Date;
|
|
5
5
|
endDate?: Date;
|
|
6
|
+
previousPeriodId?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare class RegistrationPeriodFactory extends Factory<Options, RegistrationPeriod> {
|
|
8
9
|
create(): Promise<RegistrationPeriod>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegistrationPeriodFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/RegistrationPeriodFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,cAAM,OAAO;IACT,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"RegistrationPeriodFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/RegistrationPeriodFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,cAAM,OAAO;IACT,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,qBAAa,yBAA0B,SAAQ,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACzE,MAAM,IAAI,OAAO,CAAC,kBAAkB,CAAC;CAc9C"}
|
|
@@ -7,6 +7,7 @@ const models_1 = require("../models");
|
|
|
7
7
|
class Options {
|
|
8
8
|
startDate;
|
|
9
9
|
endDate;
|
|
10
|
+
previousPeriodId;
|
|
10
11
|
}
|
|
11
12
|
class RegistrationPeriodFactory extends simple_database_1.Factory {
|
|
12
13
|
async create() {
|
|
@@ -14,6 +15,9 @@ class RegistrationPeriodFactory extends simple_database_1.Factory {
|
|
|
14
15
|
period.organizationId = null;
|
|
15
16
|
period.startDate = this.options.startDate ?? new Date(2024, 0, 1, 0, 0, 0, 0);
|
|
16
17
|
period.endDate = this.options.endDate ?? new Date(2024, 11, 31, 59, 59, 59, 999);
|
|
18
|
+
if (this.options.previousPeriodId) {
|
|
19
|
+
period.previousPeriodId = this.options.previousPeriodId;
|
|
20
|
+
}
|
|
17
21
|
period.settings = structures_1.RegistrationPeriodSettings.create({});
|
|
18
22
|
await period.save();
|
|
19
23
|
return period;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegistrationPeriodFactory.js","sourceRoot":"","sources":["../../../src/factories/RegistrationPeriodFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,sDAAmE;AAEnE,sCAA+C;AAE/C,MAAM,OAAO;IACT,SAAS,CAAQ;IACjB,OAAO,CAAQ;
|
|
1
|
+
{"version":3,"file":"RegistrationPeriodFactory.js","sourceRoot":"","sources":["../../../src/factories/RegistrationPeriodFactory.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,sDAAmE;AAEnE,sCAA+C;AAE/C,MAAM,OAAO;IACT,SAAS,CAAQ;IACjB,OAAO,CAAQ;IACf,gBAAgB,CAAU;CAC7B;AAED,MAAa,yBAA0B,SAAQ,yBAAoC;IAC/E,KAAK,CAAC,MAAM;QACR,MAAM,MAAM,GAAG,IAAI,2BAAkB,EAAE,CAAC;QAExC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9E,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;QACjF,IAAI,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAChC,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAC5D,CAAC;QACD,MAAM,CAAC,QAAQ,GAAG,uCAA0B,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAExD,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAfD,8DAeC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './AddressFactory';
|
|
2
|
+
export * from './EmergencyContactFactory';
|
|
3
|
+
export * from './GroupFactory';
|
|
4
|
+
export * from './MemberFactory';
|
|
5
|
+
export * from './OrganizationFactory';
|
|
6
|
+
export * from './ParentFactory';
|
|
7
|
+
export * from './RecordFactory';
|
|
8
|
+
export * from './RegisterCodeFactory';
|
|
9
|
+
export * from './RegistrationFactory';
|
|
10
|
+
export * from './UserFactory';
|
|
11
|
+
export * from './WebshopFactory';
|
|
12
|
+
export * from './BalanceItemFactory';
|
|
13
|
+
export * from './RegistrationPeriodFactory';
|
|
14
|
+
export * from './OrganizationTagFactory';
|
|
15
|
+
export * from './OrganizationRegistrationPeriodFactory';
|
|
16
|
+
export * from './MemberResponsibilityRecordFactory';
|
|
17
|
+
export * from './PlatformResponsibilityFactory';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./AddressFactory"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./EmergencyContactFactory"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./GroupFactory"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./MemberFactory"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./OrganizationFactory"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./ParentFactory"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./RecordFactory"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./RegisterCodeFactory"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./RegistrationFactory"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./UserFactory"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./WebshopFactory"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./BalanceItemFactory"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./RegistrationPeriodFactory"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./OrganizationTagFactory"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./OrganizationRegistrationPeriodFactory"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./MemberResponsibilityRecordFactory"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./PlatformResponsibilityFactory"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/factories/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,oEAA0C;AAC1C,yDAA+B;AAC/B,0DAAgC;AAChC,gEAAsC;AACtC,0DAAgC;AAChC,0DAAgC;AAChC,gEAAsC;AACtC,gEAAsC;AACtC,wDAA8B;AAC9B,2DAAiC;AACjC,+DAAqC;AACrC,sEAA4C;AAC5C,mEAAyC;AACzC,kFAAwD;AACxD,8EAAoD;AACpD,0EAAgD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmailBuilder } from '@stamhoofd/email';
|
|
1
|
+
import { EmailBuilder, EmailInterfaceRecipient } from '@stamhoofd/email';
|
|
2
2
|
import { EmailTemplateType, Platform as PlatformStruct, Recipient, Replacement } from '@stamhoofd/structures';
|
|
3
3
|
import { EmailTemplate, Group, Organization, Webshop } from '../models';
|
|
4
4
|
export type EmailTemplateOptions = {
|
|
@@ -12,20 +12,17 @@ export declare function canSendFromEmail(fromAddress: string, organization: Orga
|
|
|
12
12
|
export declare function getDefaultEmailFrom(organization: Organization | null, options: Pick<EmailBuilderOptions, 'type'> & {
|
|
13
13
|
template: Omit<EmailTemplateOptions, 'organizationId' | 'type'>;
|
|
14
14
|
}): Promise<{
|
|
15
|
-
from:
|
|
16
|
-
replyTo:
|
|
15
|
+
from: EmailInterfaceRecipient;
|
|
16
|
+
replyTo: EmailInterfaceRecipient | undefined;
|
|
17
17
|
}>;
|
|
18
18
|
export declare function sendEmailTemplate(organization: Organization | null, options: Omit<EmailBuilderOptions, 'subject' | 'html' | 'from' | 'replyTo'> & {
|
|
19
19
|
template: Omit<EmailTemplateOptions, 'organizationId'>;
|
|
20
20
|
}): Promise<void>;
|
|
21
|
-
export declare function getEmailBuilderForTemplate(organization: Organization | null, options: Omit<EmailBuilderOptions, 'subject' | 'html'> & {
|
|
22
|
-
template: Omit<EmailTemplateOptions, 'organizationId'>;
|
|
23
|
-
}): Promise<EmailBuilder | undefined>;
|
|
24
21
|
export type EmailBuilderOptions = {
|
|
25
22
|
defaultReplacements?: Replacement[];
|
|
26
23
|
recipients: Recipient[];
|
|
27
|
-
from:
|
|
28
|
-
replyTo?:
|
|
24
|
+
from: EmailInterfaceRecipient;
|
|
25
|
+
replyTo?: EmailInterfaceRecipient | null;
|
|
29
26
|
subject: string;
|
|
30
27
|
html: string;
|
|
31
28
|
attachments?: {
|
|
@@ -37,7 +34,7 @@ export type EmailBuilderOptions = {
|
|
|
37
34
|
type?: 'transactional' | 'broadcast';
|
|
38
35
|
unsubscribeType?: 'all' | 'marketing';
|
|
39
36
|
fromStamhoofd?: boolean;
|
|
40
|
-
singleBcc?:
|
|
37
|
+
singleBcc?: EmailInterfaceRecipient;
|
|
41
38
|
replaceAll?: {
|
|
42
39
|
from: string;
|
|
43
40
|
to: string;
|
|
@@ -53,6 +50,7 @@ export declare function getEmailBuilder(organization: Organization | null, email
|
|
|
53
50
|
export declare function fillRecipientReplacements(recipient: Recipient, options: {
|
|
54
51
|
organization: Organization | null;
|
|
55
52
|
platform?: PlatformStruct;
|
|
56
|
-
|
|
53
|
+
from: EmailInterfaceRecipient | null;
|
|
54
|
+
replyTo: EmailInterfaceRecipient | null;
|
|
57
55
|
}): Promise<void>;
|
|
58
56
|
//# sourceMappingURL=EmailBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailBuilder.d.ts","sourceRoot":"","sources":["../../../src/helpers/EmailBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"EmailBuilder.d.ts","sourceRoot":"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