@stamhoofd/models 2.82.0 → 2.83.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/EventNotificationTypeFactory.js +1 -1
- package/dist/src/factories/EventNotificationTypeFactory.js.map +1 -1
- package/dist/src/factories/GroupFactory.d.ts.map +1 -1
- package/dist/src/factories/GroupFactory.js +1 -1
- package/dist/src/factories/GroupFactory.js.map +1 -1
- package/dist/src/factories/RecordCategoryFactory.d.ts.map +1 -1
- package/dist/src/factories/RecordCategoryFactory.js +1 -1
- package/dist/src/factories/RecordCategoryFactory.js.map +1 -1
- package/dist/src/factories/RecordFactory.d.ts.map +1 -1
- package/dist/src/factories/RecordFactory.js +1 -1
- package/dist/src/factories/RecordFactory.js.map +1 -1
- package/dist/src/helpers/DNSValidator.js +8 -8
- package/dist/src/helpers/DNSValidator.js.map +1 -1
- package/dist/src/helpers/EmailBuilder.js +3 -3
- package/dist/src/helpers/EmailBuilder.js.map +1 -1
- package/dist/src/helpers/GroupBuilder.js +23 -23
- package/dist/src/helpers/GroupBuilder.js.map +1 -1
- package/dist/src/helpers/MemberMerger.test.js +4 -4
- package/dist/src/helpers/MemberMerger.test.js.map +1 -1
- package/dist/src/models/DocumentTemplate.js +3 -3
- package/dist/src/models/DocumentTemplate.js.map +1 -1
- package/dist/src/models/Email.js +10 -10
- package/dist/src/models/Email.js.map +1 -1
- package/dist/src/models/EmailVerificationCode.js +2 -2
- package/dist/src/models/EmailVerificationCode.js.map +1 -1
- package/dist/src/models/Event.d.ts.map +1 -1
- package/dist/src/models/Event.js +1 -1
- package/dist/src/models/Event.js.map +1 -1
- package/dist/src/models/Image.d.ts +3 -1
- package/dist/src/models/Image.d.ts.map +1 -1
- package/dist/src/models/Image.js +12 -2
- package/dist/src/models/Image.js.map +1 -1
- package/dist/src/models/MemberPlatformMembership.js +5 -5
- package/dist/src/models/MemberPlatformMembership.js.map +1 -1
- package/dist/src/models/MollieToken.js +1 -1
- package/dist/src/models/MollieToken.js.map +1 -1
- package/dist/src/models/Order.js +3 -3
- package/dist/src/models/Order.js.map +1 -1
- package/dist/src/models/Organization.d.ts.map +1 -1
- package/dist/src/models/Organization.js +4 -4
- package/dist/src/models/Organization.js.map +1 -1
- package/dist/src/models/PayconiqPayment.js +1 -1
- package/dist/src/models/PayconiqPayment.js.map +1 -1
- package/dist/src/models/Registration.js +2 -2
- package/dist/src/models/Registration.js.map +1 -1
- package/dist/src/models/STPackage.js +3 -3
- package/dist/src/models/STPackage.js.map +1 -1
- package/dist/src/models/User.js +2 -2
- package/dist/src/models/User.js.map +1 -1
- package/dist/src/models/addresses/PostalCode.js +1 -1
- package/dist/src/models/addresses/PostalCode.js.map +1 -1
- package/package.json +2 -2
- package/src/factories/EventNotificationTypeFactory.ts +1 -1
- package/src/factories/GroupFactory.ts +2 -2
- package/src/factories/RecordCategoryFactory.ts +2 -2
- package/src/factories/RecordFactory.ts +2 -2
- package/src/helpers/DNSValidator.ts +8 -8
- package/src/helpers/EmailBuilder.ts +3 -3
- package/src/helpers/GroupBuilder.ts +24 -24
- package/src/helpers/MemberMerger.test.ts +5 -4
- package/src/models/DocumentTemplate.ts +3 -3
- package/src/models/Email.ts +10 -10
- package/src/models/EmailVerificationCode.ts +2 -2
- package/src/models/Event.ts +2 -2
- package/src/models/Image.ts +14 -2
- package/src/models/MemberPlatformMembership.ts +5 -5
- package/src/models/MollieToken.ts +1 -1
- package/src/models/Order.ts +3 -3
- package/src/models/Organization.ts +5 -5
- package/src/models/PayconiqPayment.ts +1 -1
- package/src/models/Registration.ts +2 -2
- package/src/models/STPackage.ts +3 -3
- package/src/models/User.ts +2 -2
- package/src/models/addresses/PostalCode.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Group as GroupStruct, GroupCategory, GroupCategorySettings, GroupGenderType, GroupSettings, OrganizationGenderType, OrganizationType, OrganizationTypeHelper, UmbrellaOrganization } from '@stamhoofd/structures';
|
|
1
|
+
import { Group as GroupStruct, GroupCategory, GroupCategorySettings, GroupGenderType, GroupSettings, OrganizationGenderType, OrganizationType, OrganizationTypeHelper, UmbrellaOrganization, TranslatedString } from '@stamhoofd/structures';
|
|
2
2
|
import { Group, Organization } from '../models';
|
|
3
3
|
|
|
4
4
|
export class GroupBuilder {
|
|
@@ -84,7 +84,7 @@ export class GroupBuilder {
|
|
|
84
84
|
kapoenen.organizationId = this.organization.id;
|
|
85
85
|
kapoenen.periodId = this.organization.periodId;
|
|
86
86
|
kapoenen.settings = GroupSettings.create({
|
|
87
|
-
name: 'Kapoenen',
|
|
87
|
+
name: new TranslatedString('Kapoenen'),
|
|
88
88
|
genderType: mixedType,
|
|
89
89
|
startDate: this.organization.meta.defaultStartDate,
|
|
90
90
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -98,7 +98,7 @@ export class GroupBuilder {
|
|
|
98
98
|
jin.organizationId = this.organization.id;
|
|
99
99
|
jin.periodId = this.organization.periodId;
|
|
100
100
|
jin.settings = GroupSettings.create({
|
|
101
|
-
name: 'Jin',
|
|
101
|
+
name: new TranslatedString('Jin'),
|
|
102
102
|
genderType: mixedType,
|
|
103
103
|
startDate: this.organization.meta.defaultStartDate,
|
|
104
104
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -113,7 +113,7 @@ export class GroupBuilder {
|
|
|
113
113
|
wouters.organizationId = this.organization.id;
|
|
114
114
|
wouters.periodId = this.organization.periodId;
|
|
115
115
|
wouters.settings = GroupSettings.create({
|
|
116
|
-
name: 'Wouters',
|
|
116
|
+
name: new TranslatedString('Wouters'),
|
|
117
117
|
genderType: GroupGenderType.Mixed,
|
|
118
118
|
startDate: this.organization.meta.defaultStartDate,
|
|
119
119
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -127,7 +127,7 @@ export class GroupBuilder {
|
|
|
127
127
|
jonggivers.organizationId = this.organization.id;
|
|
128
128
|
jonggivers.periodId = this.organization.periodId;
|
|
129
129
|
jonggivers.settings = GroupSettings.create({
|
|
130
|
-
name: 'Jonggivers',
|
|
130
|
+
name: new TranslatedString('Jonggivers'),
|
|
131
131
|
genderType: GroupGenderType.Mixed,
|
|
132
132
|
startDate: this.organization.meta.defaultStartDate,
|
|
133
133
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -141,7 +141,7 @@ export class GroupBuilder {
|
|
|
141
141
|
givers.organizationId = this.organization.id;
|
|
142
142
|
givers.periodId = this.organization.periodId;
|
|
143
143
|
givers.settings = GroupSettings.create({
|
|
144
|
-
name: 'Givers',
|
|
144
|
+
name: new TranslatedString('Givers'),
|
|
145
145
|
genderType: GroupGenderType.Mixed,
|
|
146
146
|
startDate: this.organization.meta.defaultStartDate,
|
|
147
147
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -157,7 +157,7 @@ export class GroupBuilder {
|
|
|
157
157
|
wouters.organizationId = this.organization.id;
|
|
158
158
|
wouters.periodId = this.organization.periodId;
|
|
159
159
|
wouters.settings = GroupSettings.create({
|
|
160
|
-
name: 'Kabouters',
|
|
160
|
+
name: new TranslatedString('Kabouters'),
|
|
161
161
|
genderType: GroupGenderType.OnlyFemale,
|
|
162
162
|
startDate: this.organization.meta.defaultStartDate,
|
|
163
163
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -171,7 +171,7 @@ export class GroupBuilder {
|
|
|
171
171
|
jonggivers.organizationId = this.organization.id;
|
|
172
172
|
jonggivers.periodId = this.organization.periodId;
|
|
173
173
|
jonggivers.settings = GroupSettings.create({
|
|
174
|
-
name: 'Jonggidsen',
|
|
174
|
+
name: new TranslatedString('Jonggidsen'),
|
|
175
175
|
genderType: GroupGenderType.OnlyFemale,
|
|
176
176
|
startDate: this.organization.meta.defaultStartDate,
|
|
177
177
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -185,7 +185,7 @@ export class GroupBuilder {
|
|
|
185
185
|
givers.organizationId = this.organization.id;
|
|
186
186
|
givers.periodId = this.organization.periodId;
|
|
187
187
|
givers.settings = GroupSettings.create({
|
|
188
|
-
name: 'Gidsen',
|
|
188
|
+
name: new TranslatedString('Gidsen'),
|
|
189
189
|
genderType: GroupGenderType.OnlyFemale,
|
|
190
190
|
startDate: this.organization.meta.defaultStartDate,
|
|
191
191
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -201,7 +201,7 @@ export class GroupBuilder {
|
|
|
201
201
|
wouters.organizationId = this.organization.id;
|
|
202
202
|
wouters.periodId = this.organization.periodId;
|
|
203
203
|
wouters.settings = GroupSettings.create({
|
|
204
|
-
name: 'Welpen',
|
|
204
|
+
name: new TranslatedString('Welpen'),
|
|
205
205
|
genderType: GroupGenderType.OnlyMale,
|
|
206
206
|
startDate: this.organization.meta.defaultStartDate,
|
|
207
207
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -215,7 +215,7 @@ export class GroupBuilder {
|
|
|
215
215
|
jonggivers.organizationId = this.organization.id;
|
|
216
216
|
jonggivers.periodId = this.organization.periodId;
|
|
217
217
|
jonggivers.settings = GroupSettings.create({
|
|
218
|
-
name: 'Jongverkenners',
|
|
218
|
+
name: new TranslatedString('Jongverkenners'),
|
|
219
219
|
genderType: GroupGenderType.OnlyMale,
|
|
220
220
|
startDate: this.organization.meta.defaultStartDate,
|
|
221
221
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -229,7 +229,7 @@ export class GroupBuilder {
|
|
|
229
229
|
givers.organizationId = this.organization.id;
|
|
230
230
|
givers.periodId = this.organization.periodId;
|
|
231
231
|
givers.settings = GroupSettings.create({
|
|
232
|
-
name: 'Verkenners',
|
|
232
|
+
name: new TranslatedString('Verkenners'),
|
|
233
233
|
genderType: GroupGenderType.OnlyMale,
|
|
234
234
|
startDate: this.organization.meta.defaultStartDate,
|
|
235
235
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -254,7 +254,7 @@ export class GroupBuilder {
|
|
|
254
254
|
ribbels.organizationId = this.organization.id;
|
|
255
255
|
ribbels.periodId = this.organization.periodId;
|
|
256
256
|
ribbels.settings = GroupSettings.create({
|
|
257
|
-
name: 'Ribbels',
|
|
257
|
+
name: new TranslatedString('Ribbels'),
|
|
258
258
|
genderType: mixedType,
|
|
259
259
|
startDate: this.organization.meta.defaultStartDate,
|
|
260
260
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -267,7 +267,7 @@ export class GroupBuilder {
|
|
|
267
267
|
speelclub.organizationId = this.organization.id;
|
|
268
268
|
speelclub.periodId = this.organization.periodId;
|
|
269
269
|
speelclub.settings = GroupSettings.create({
|
|
270
|
-
name: 'Speelclub',
|
|
270
|
+
name: new TranslatedString('Speelclub'),
|
|
271
271
|
genderType: mixedType,
|
|
272
272
|
startDate: this.organization.meta.defaultStartDate,
|
|
273
273
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -280,7 +280,7 @@ export class GroupBuilder {
|
|
|
280
280
|
aspis.organizationId = this.organization.id;
|
|
281
281
|
aspis.periodId = this.organization.periodId;
|
|
282
282
|
aspis.settings = GroupSettings.create({
|
|
283
|
-
name: "Aspi's",
|
|
283
|
+
name: new TranslatedString("Aspi's"),
|
|
284
284
|
genderType: mixedType,
|
|
285
285
|
startDate: this.organization.meta.defaultStartDate,
|
|
286
286
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -294,7 +294,7 @@ export class GroupBuilder {
|
|
|
294
294
|
rakwis.organizationId = this.organization.id;
|
|
295
295
|
rakwis.periodId = this.organization.periodId;
|
|
296
296
|
rakwis.settings = GroupSettings.create({
|
|
297
|
-
name: "Rakwi's",
|
|
297
|
+
name: new TranslatedString("Rakwi's"),
|
|
298
298
|
genderType: GroupGenderType.Mixed,
|
|
299
299
|
startDate: this.organization.meta.defaultStartDate,
|
|
300
300
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -307,7 +307,7 @@ export class GroupBuilder {
|
|
|
307
307
|
titos.organizationId = this.organization.id;
|
|
308
308
|
titos.periodId = this.organization.periodId;
|
|
309
309
|
titos.settings = GroupSettings.create({
|
|
310
|
-
name: "Tito's",
|
|
310
|
+
name: new TranslatedString("Tito's"),
|
|
311
311
|
genderType: GroupGenderType.Mixed,
|
|
312
312
|
startDate: this.organization.meta.defaultStartDate,
|
|
313
313
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -320,7 +320,7 @@ export class GroupBuilder {
|
|
|
320
320
|
ketis.organizationId = this.organization.id;
|
|
321
321
|
ketis.periodId = this.organization.periodId;
|
|
322
322
|
ketis.settings = GroupSettings.create({
|
|
323
|
-
name: "Keti's",
|
|
323
|
+
name: new TranslatedString("Keti's"),
|
|
324
324
|
genderType: GroupGenderType.Mixed,
|
|
325
325
|
startDate: this.organization.meta.defaultStartDate,
|
|
326
326
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -335,7 +335,7 @@ export class GroupBuilder {
|
|
|
335
335
|
rakwis.organizationId = this.organization.id;
|
|
336
336
|
rakwis.periodId = this.organization.periodId;
|
|
337
337
|
rakwis.settings = GroupSettings.create({
|
|
338
|
-
name: 'Kwiks',
|
|
338
|
+
name: new TranslatedString('Kwiks'),
|
|
339
339
|
genderType: GroupGenderType.OnlyFemale,
|
|
340
340
|
startDate: this.organization.meta.defaultStartDate,
|
|
341
341
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -348,7 +348,7 @@ export class GroupBuilder {
|
|
|
348
348
|
titos.organizationId = this.organization.id;
|
|
349
349
|
titos.periodId = this.organization.periodId;
|
|
350
350
|
titos.settings = GroupSettings.create({
|
|
351
|
-
name: 'Toppers',
|
|
351
|
+
name: new TranslatedString('Toppers'),
|
|
352
352
|
genderType: GroupGenderType.OnlyFemale,
|
|
353
353
|
startDate: this.organization.meta.defaultStartDate,
|
|
354
354
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -361,7 +361,7 @@ export class GroupBuilder {
|
|
|
361
361
|
ketis.organizationId = this.organization.id;
|
|
362
362
|
ketis.periodId = this.organization.periodId;
|
|
363
363
|
ketis.settings = GroupSettings.create({
|
|
364
|
-
name: 'Tiptiens',
|
|
364
|
+
name: new TranslatedString('Tiptiens'),
|
|
365
365
|
genderType: GroupGenderType.OnlyFemale,
|
|
366
366
|
startDate: this.organization.meta.defaultStartDate,
|
|
367
367
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -376,7 +376,7 @@ export class GroupBuilder {
|
|
|
376
376
|
rakwis.organizationId = this.organization.id;
|
|
377
377
|
rakwis.periodId = this.organization.periodId;
|
|
378
378
|
rakwis.settings = GroupSettings.create({
|
|
379
|
-
name: 'Rakkers',
|
|
379
|
+
name: new TranslatedString('Rakkers'),
|
|
380
380
|
genderType: GroupGenderType.OnlyMale,
|
|
381
381
|
startDate: this.organization.meta.defaultStartDate,
|
|
382
382
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -389,7 +389,7 @@ export class GroupBuilder {
|
|
|
389
389
|
titos.organizationId = this.organization.id;
|
|
390
390
|
titos.periodId = this.organization.periodId;
|
|
391
391
|
titos.settings = GroupSettings.create({
|
|
392
|
-
name: 'Tippers',
|
|
392
|
+
name: new TranslatedString('Tippers'),
|
|
393
393
|
genderType: GroupGenderType.OnlyMale,
|
|
394
394
|
startDate: this.organization.meta.defaultStartDate,
|
|
395
395
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -402,7 +402,7 @@ export class GroupBuilder {
|
|
|
402
402
|
ketis.organizationId = this.organization.id;
|
|
403
403
|
ketis.periodId = this.organization.periodId;
|
|
404
404
|
ketis.settings = GroupSettings.create({
|
|
405
|
-
name: 'Kerels',
|
|
405
|
+
name: new TranslatedString('Kerels'),
|
|
406
406
|
genderType: GroupGenderType.OnlyMale,
|
|
407
407
|
startDate: this.organization.meta.defaultStartDate,
|
|
408
408
|
endDate: this.organization.meta.defaultEndDate,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
RecordSettings,
|
|
11
11
|
ReviewTime,
|
|
12
12
|
ReviewTimes,
|
|
13
|
+
TranslatedString,
|
|
13
14
|
} from '@stamhoofd/structures';
|
|
14
15
|
import { v4 as uuidv4 } from 'uuid';
|
|
15
16
|
import { Member } from '../models';
|
|
@@ -45,7 +46,7 @@ describe('member merge', () => {
|
|
|
45
46
|
|
|
46
47
|
const recordAnswer = RecordAnswer.create({
|
|
47
48
|
settings: RecordSettings.create({
|
|
48
|
-
name: 'answer1',
|
|
49
|
+
name: TranslatedString.create('answer1'),
|
|
49
50
|
required: true,
|
|
50
51
|
choices: [],
|
|
51
52
|
}),
|
|
@@ -215,7 +216,7 @@ describe('member merge', () => {
|
|
|
215
216
|
|
|
216
217
|
const recordAnswer = RecordAnswer.create({
|
|
217
218
|
settings: RecordSettings.create({
|
|
218
|
-
name: 'answer1',
|
|
219
|
+
name: TranslatedString.create('answer1'),
|
|
219
220
|
required: true,
|
|
220
221
|
choices: [],
|
|
221
222
|
}),
|
|
@@ -407,7 +408,7 @@ describe('member merge', () => {
|
|
|
407
408
|
|
|
408
409
|
const recordAnswer1 = RecordAnswer.create({
|
|
409
410
|
settings: RecordSettings.create({
|
|
410
|
-
name: 'answer1',
|
|
411
|
+
name: TranslatedString.create('answer1'),
|
|
411
412
|
required: true,
|
|
412
413
|
choices: [],
|
|
413
414
|
}),
|
|
@@ -418,7 +419,7 @@ describe('member merge', () => {
|
|
|
418
419
|
|
|
419
420
|
const recordAnswer2 = RecordAnswer.create({
|
|
420
421
|
settings: RecordSettings.create({
|
|
421
|
-
name: 'answer2',
|
|
422
|
+
name: TranslatedString.create('answer2'),
|
|
422
423
|
required: true,
|
|
423
424
|
choices: [],
|
|
424
425
|
}),
|
|
@@ -91,7 +91,7 @@ export class DocumentTemplate extends QueryableModel {
|
|
|
91
91
|
id: 'group.name',
|
|
92
92
|
type: RecordType.Text,
|
|
93
93
|
}),
|
|
94
|
-
value: group?.settings?.name ?? '',
|
|
94
|
+
value: group?.settings?.name?.toString() ?? '',
|
|
95
95
|
}),
|
|
96
96
|
'group.type': RecordTextAnswer.create({
|
|
97
97
|
settings: RecordSettings.create({
|
|
@@ -426,7 +426,7 @@ export class DocumentTemplate extends QueryableModel {
|
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
const group = await Group.getByID(registration.groupId);
|
|
429
|
-
const description = `${registration.member.details.name}, ${group ? group.settings.name : ''}${group && group.settings.period && group.type === GroupType.Membership ? ' ' + group.settings.period?.nameShort : ''}`;
|
|
429
|
+
const description = `${registration.member.details.name}, ${group ? group.settings.name.toString() : ''}${group && group.settings.period && group.type === GroupType.Membership ? ' ' + group.settings.period?.nameShort : ''}`;
|
|
430
430
|
|
|
431
431
|
if (existingDocuments.length > 0) {
|
|
432
432
|
for (const document of existingDocuments) {
|
|
@@ -622,7 +622,7 @@ export class DocumentTemplate extends QueryableModel {
|
|
|
622
622
|
throw new SimpleError({
|
|
623
623
|
code: 'invalid_document_number',
|
|
624
624
|
message: 'Expected document number to be ' + (lastNumber + 1) + ' but got ' + document.number,
|
|
625
|
-
human:
|
|
625
|
+
human: $t(`7fd5e5f1-6ff5-48a5-beae-36776935ec90`),
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
628
|
lastNumber = document.number;
|
package/src/models/Email.ts
CHANGED
|
@@ -111,7 +111,7 @@ export class Email extends QueryableModel {
|
|
|
111
111
|
throw new SimpleError({
|
|
112
112
|
code: 'invalid_field',
|
|
113
113
|
message: 'Missing subject',
|
|
114
|
-
human:
|
|
114
|
+
human: $t(`e78c8218-4d25-413b-ae6b-fd916e663e5a`),
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -119,7 +119,7 @@ export class Email extends QueryableModel {
|
|
|
119
119
|
throw new SimpleError({
|
|
120
120
|
code: 'invalid_field',
|
|
121
121
|
message: 'Missing text',
|
|
122
|
-
human:
|
|
122
|
+
human: $t(`65b701a3-c74c-4eb6-b98e-7b9dcad0a358`),
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -127,7 +127,7 @@ export class Email extends QueryableModel {
|
|
|
127
127
|
throw new SimpleError({
|
|
128
128
|
code: 'invalid_field',
|
|
129
129
|
message: 'Missing html',
|
|
130
|
-
human:
|
|
130
|
+
human: $t(`65b701a3-c74c-4eb6-b98e-7b9dcad0a358`),
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -135,7 +135,7 @@ export class Email extends QueryableModel {
|
|
|
135
135
|
throw new SimpleError({
|
|
136
136
|
code: 'invalid_field',
|
|
137
137
|
message: 'Missing from',
|
|
138
|
-
human:
|
|
138
|
+
human: $t(`e92cd077-b0f1-4b0a-82a0-8a8baa82e73a`),
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -152,7 +152,7 @@ export class Email extends QueryableModel {
|
|
|
152
152
|
throw new SimpleError({
|
|
153
153
|
code: 'too_big_attachments',
|
|
154
154
|
message: 'Too big attachments',
|
|
155
|
-
human:
|
|
155
|
+
human: $t(`e8b9a1db-97d0-410e-99b2-6a87c1087593`),
|
|
156
156
|
field: 'attachments',
|
|
157
157
|
});
|
|
158
158
|
}
|
|
@@ -173,7 +173,7 @@ export class Email extends QueryableModel {
|
|
|
173
173
|
throw new SimpleError({
|
|
174
174
|
code: 'content_type_not_supported',
|
|
175
175
|
message: 'Content-Type not supported',
|
|
176
|
-
human:
|
|
176
|
+
human: $t(`54da84d6-5f6a-4db2-be34-9ddb7f47bbe8`),
|
|
177
177
|
field: 'attachments',
|
|
178
178
|
});
|
|
179
179
|
}
|
|
@@ -246,7 +246,7 @@ export class Email extends QueryableModel {
|
|
|
246
246
|
throw new SimpleError({
|
|
247
247
|
code: 'not_found',
|
|
248
248
|
message: 'Email not found',
|
|
249
|
-
human:
|
|
249
|
+
human: $t(`55899a7c-f3d4-43fe-a431-70a3a9e78e34`),
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
252
|
if (upToDate.status === EmailStatus.Sent || upToDate.status === EmailStatus.Failed) {
|
|
@@ -281,7 +281,7 @@ export class Email extends QueryableModel {
|
|
|
281
281
|
throw new SimpleError({
|
|
282
282
|
code: 'invalid_field',
|
|
283
283
|
message: 'Missing from',
|
|
284
|
-
human:
|
|
284
|
+
human: $t(`e92cd077-b0f1-4b0a-82a0-8a8baa82e73a`),
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -304,7 +304,7 @@ export class Email extends QueryableModel {
|
|
|
304
304
|
throw new SimpleError({
|
|
305
305
|
code: 'not_found',
|
|
306
306
|
message: 'Email not found',
|
|
307
|
-
human:
|
|
307
|
+
human: $t(`55899a7c-f3d4-43fe-a431-70a3a9e78e34`),
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
|
|
@@ -312,7 +312,7 @@ export class Email extends QueryableModel {
|
|
|
312
312
|
throw new SimpleError({
|
|
313
313
|
code: 'recipients_not_created',
|
|
314
314
|
message: 'Failed to create recipients',
|
|
315
|
-
human:
|
|
315
|
+
human: $t(`f660b2eb-e382-4d21-86e4-673ca7bc2d4a`),
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
318
|
|
|
@@ -217,7 +217,7 @@ export class EmailVerificationCode extends QueryableModel {
|
|
|
217
217
|
throw new SimpleError({
|
|
218
218
|
code: 'too_many_attempts',
|
|
219
219
|
message: 'Too many attempts',
|
|
220
|
-
human:
|
|
220
|
+
human: $t(`9ea99caf-e245-45b2-97d5-004393e78b49`),
|
|
221
221
|
statusCode: 429,
|
|
222
222
|
});
|
|
223
223
|
}
|
|
@@ -238,7 +238,7 @@ export class EmailVerificationCode extends QueryableModel {
|
|
|
238
238
|
throw new SimpleError({
|
|
239
239
|
code: 'too_many_attempts',
|
|
240
240
|
message: 'Too many attempts',
|
|
241
|
-
human:
|
|
241
|
+
human: $t(`9ea99caf-e245-45b2-97d5-004393e78b49`),
|
|
242
242
|
statusCode: 429,
|
|
243
243
|
});
|
|
244
244
|
}
|
package/src/models/Event.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { column } from '@simonbackx/simple-database';
|
|
2
2
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
3
|
-
import { EventMeta, Event as EventStruct, GroupType } from '@stamhoofd/structures';
|
|
3
|
+
import { EventMeta, Event as EventStruct, GroupType, TranslatedString } from '@stamhoofd/structures';
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import { Group } from './Group';
|
|
6
6
|
|
|
@@ -87,7 +87,7 @@ export class Event extends QueryableModel {
|
|
|
87
87
|
|
|
88
88
|
if (group.type === GroupType.EventRegistration) {
|
|
89
89
|
// Don't change the name of the waiting list
|
|
90
|
-
group.settings.name = this.name;
|
|
90
|
+
group.settings.name = new TranslatedString(this.name);
|
|
91
91
|
group.settings.eventId = this.id;
|
|
92
92
|
}
|
|
93
93
|
|
package/src/models/Image.ts
CHANGED
|
@@ -24,7 +24,7 @@ export class Image extends QueryableModel {
|
|
|
24
24
|
@column({ type: 'datetime' })
|
|
25
25
|
createdAt: Date = new Date();
|
|
26
26
|
|
|
27
|
-
static async create(fileContent: string | Buffer, type: string | undefined, resolutions: ResolutionRequest[], isPrivateFile: boolean = false): Promise<Image> {
|
|
27
|
+
static async create(fileContent: string | Buffer, type: string | undefined, resolutions: ResolutionRequest[], isPrivateFile: boolean = false, user: { id: string } | null = null): Promise<Image> {
|
|
28
28
|
if (!STAMHOOFD.SPACES_BUCKET || !STAMHOOFD.SPACES_ENDPOINT || !STAMHOOFD.SPACES_KEY || !STAMHOOFD.SPACES_SECRET) {
|
|
29
29
|
throw new SimpleError({
|
|
30
30
|
code: 'not_available',
|
|
@@ -92,6 +92,18 @@ export class Image extends QueryableModel {
|
|
|
92
92
|
prefix += '/';
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
prefix += (STAMHOOFD.environment ?? 'development') === 'development' ? ('development/') : ('');
|
|
96
|
+
|
|
97
|
+
// Prepend user id to the file path
|
|
98
|
+
if (isPrivateFile && user) {
|
|
99
|
+
// Private files
|
|
100
|
+
prefix += 'users/' + user.id + '/';
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// Public files
|
|
104
|
+
prefix += 'p/';
|
|
105
|
+
}
|
|
106
|
+
|
|
95
107
|
const uploadPromises: Promise<any>[] = [];
|
|
96
108
|
const image = new Image();
|
|
97
109
|
image.id = uuidv4();
|
|
@@ -99,7 +111,7 @@ export class Image extends QueryableModel {
|
|
|
99
111
|
for (const f of files) {
|
|
100
112
|
const fileId = uuidv4();
|
|
101
113
|
|
|
102
|
-
const key = prefix +
|
|
114
|
+
const key = prefix + image.id + '/' + fileId + (!supportsTransparency ? '.jpg' : '.png');
|
|
103
115
|
const params = {
|
|
104
116
|
Bucket: STAMHOOFD.SPACES_BUCKET,
|
|
105
117
|
Key: key,
|
|
@@ -166,7 +166,7 @@ export class MemberPlatformMembership extends QueryableModel {
|
|
|
166
166
|
throw new SimpleError({
|
|
167
167
|
code: 'invalid_membership_type',
|
|
168
168
|
message: 'Unknown membership type',
|
|
169
|
-
human:
|
|
169
|
+
human: $t(`14e020be-1dd8-4caf-9dce-369cbe0db902`),
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -176,7 +176,7 @@ export class MemberPlatformMembership extends QueryableModel {
|
|
|
176
176
|
throw new SimpleError({
|
|
177
177
|
code: 'period_unavailable',
|
|
178
178
|
message: 'Membership not available for this period',
|
|
179
|
-
human:
|
|
179
|
+
human: $t(`d5795b94-23d5-4fe7-97e1-6f0fe916caca`),
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
|
|
@@ -267,7 +267,7 @@ export class MemberPlatformMembership extends QueryableModel {
|
|
|
267
267
|
throw new SimpleError({
|
|
268
268
|
code: 'invalid_membership_type',
|
|
269
269
|
message: 'Unknown membership type',
|
|
270
|
-
human:
|
|
270
|
+
human: $t(`14e020be-1dd8-4caf-9dce-369cbe0db902`),
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
273
|
|
|
@@ -277,7 +277,7 @@ export class MemberPlatformMembership extends QueryableModel {
|
|
|
277
277
|
throw new SimpleError({
|
|
278
278
|
code: 'period_unavailable',
|
|
279
279
|
message: 'Membership not available for this period',
|
|
280
|
-
human:
|
|
280
|
+
human: $t(`d5795b94-23d5-4fe7-97e1-6f0fe916caca`),
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
|
|
@@ -287,7 +287,7 @@ export class MemberPlatformMembership extends QueryableModel {
|
|
|
287
287
|
// todo
|
|
288
288
|
code: 'not_found',
|
|
289
289
|
message: 'Organization not found',
|
|
290
|
-
human:
|
|
290
|
+
human: $t(`1524a6e6-aad7-4072-81c1-ce6fc196224f`),
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -366,7 +366,7 @@ export class MollieToken extends QueryableModel {
|
|
|
366
366
|
profile: {
|
|
367
367
|
name: organization.name + ' - Stamhoofd',
|
|
368
368
|
// url: "https://"+organization.getHost(),
|
|
369
|
-
description:
|
|
369
|
+
description: $t(`62246c37-15c7-4f7d-94e2-7476f971c8da`),
|
|
370
370
|
categoryCode: 8398,
|
|
371
371
|
},
|
|
372
372
|
});
|
package/src/models/Order.ts
CHANGED
|
@@ -116,9 +116,9 @@ export class Order extends QueryableModel {
|
|
|
116
116
|
|
|
117
117
|
generateBalanceDescription(webshop: Webshop) {
|
|
118
118
|
if (!this.number) {
|
|
119
|
-
return
|
|
119
|
+
return $t(`df5c326c-e9a3-4f76-ba80-8a22f95f0e70`) + ' ' + webshop.meta.name;
|
|
120
120
|
}
|
|
121
|
-
return
|
|
121
|
+
return $t(`12be5ac0-8353-43a2-badb-ab3b27d156b3`) + this.number.toString() + ' - ' + webshop.meta.name;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
@@ -925,7 +925,7 @@ export class Order extends QueryableModel {
|
|
|
925
925
|
throw new SimpleError({
|
|
926
926
|
code: 'missing_iban',
|
|
927
927
|
message: 'Missing IBAN',
|
|
928
|
-
human:
|
|
928
|
+
human: $t(`cc8b5066-a7e4-4eae-b556-f56de5d3502c`),
|
|
929
929
|
});
|
|
930
930
|
}
|
|
931
931
|
payment.generateDescription(organization, this.number.toString(), this.getTransferReplacements());
|
|
@@ -3,7 +3,7 @@ import { SimpleError } from '@simonbackx/simple-errors';
|
|
|
3
3
|
import { I18n } from '@stamhoofd/backend-i18n';
|
|
4
4
|
import { EmailInterfaceRecipient } from '@stamhoofd/email';
|
|
5
5
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
6
|
-
import { Address, Country, DNSRecordStatus, EmailTemplateType, OrganizationEmail, OrganizationMetaData, OrganizationPrivateMetaData, Organization as OrganizationStruct, PaymentMethod, PaymentProvider, PrivatePaymentConfiguration, Recipient, Replacement, STPackageType, TransferSettings } from '@stamhoofd/structures';
|
|
6
|
+
import { Address, Country, DNSRecordStatus, EmailTemplateType, Language, OrganizationEmail, OrganizationMetaData, OrganizationPrivateMetaData, Organization as OrganizationStruct, PaymentMethod, PaymentProvider, PrivatePaymentConfiguration, Recipient, Replacement, STPackageType, TransferSettings } from '@stamhoofd/structures';
|
|
7
7
|
import { AWSError } from 'aws-sdk';
|
|
8
8
|
import SES from 'aws-sdk/clients/sesv2';
|
|
9
9
|
import { PromiseResult } from 'aws-sdk/lib/request';
|
|
@@ -103,7 +103,7 @@ export class Organization extends QueryableModel {
|
|
|
103
103
|
* Return default locale confiruation
|
|
104
104
|
*/
|
|
105
105
|
get i18n() {
|
|
106
|
-
return new I18n(
|
|
106
|
+
return new I18n(Language.Dutch, this.address.country);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
@@ -201,7 +201,7 @@ export class Organization extends QueryableModel {
|
|
|
201
201
|
throw new SimpleError({
|
|
202
202
|
code: 'archived',
|
|
203
203
|
message: 'This organization is archived',
|
|
204
|
-
human:
|
|
204
|
+
human: $t(`8bd60208-9101-40cf-9f1d-1fd90cdafd62`),
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
return organization;
|
|
@@ -423,7 +423,7 @@ export class Organization extends QueryableModel {
|
|
|
423
423
|
bcc?: boolean;
|
|
424
424
|
}) {
|
|
425
425
|
const recipients = await this.getAdminRecipients();
|
|
426
|
-
const defaultI18n = new I18n(
|
|
426
|
+
const defaultI18n = new I18n(Language.Dutch, Country.Belgium);
|
|
427
427
|
const i18n = this.i18n;
|
|
428
428
|
|
|
429
429
|
const replaceAll = [
|
|
@@ -883,7 +883,7 @@ export class Organization extends QueryableModel {
|
|
|
883
883
|
throw new SimpleError({
|
|
884
884
|
code: 'payment_provider_not_configured',
|
|
885
885
|
message: 'Payment provider not configured for ' + method,
|
|
886
|
-
human:
|
|
886
|
+
human: $t(`9e44e007-3b35-4edf-979f-41b458d2eb39`),
|
|
887
887
|
});
|
|
888
888
|
}
|
|
889
889
|
|
|
@@ -124,7 +124,7 @@ export class PayconiqPayment extends QueryableModel {
|
|
|
124
124
|
if (!apiKey) {
|
|
125
125
|
throw new SimpleError({
|
|
126
126
|
code: '',
|
|
127
|
-
message: '
|
|
127
|
+
message: $t('4a3b54dc-e945-4a15-8b31-b9b4bb483b2a'),
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -194,7 +194,7 @@ export class Registration extends QueryableModel {
|
|
|
194
194
|
}),
|
|
195
195
|
Replacement.create({
|
|
196
196
|
token: 'groupName',
|
|
197
|
-
value: group.settings.name,
|
|
197
|
+
value: group.settings.name.toString(),
|
|
198
198
|
}),
|
|
199
199
|
],
|
|
200
200
|
}));
|
|
@@ -261,7 +261,7 @@ export class Registration extends QueryableModel {
|
|
|
261
261
|
}),
|
|
262
262
|
Replacement.create({
|
|
263
263
|
token: 'overviewContext',
|
|
264
|
-
value:
|
|
264
|
+
value: $t(`01d5fd7e-2960-4eb4-ab3a-2ac6dcb2e39c`) + ' ' + paymentGeneral.memberNames,
|
|
265
265
|
}),
|
|
266
266
|
Replacement.create({
|
|
267
267
|
token: 'memberNames',
|
package/src/models/STPackage.ts
CHANGED
|
@@ -152,7 +152,7 @@ export class STPackage extends QueryableModel {
|
|
|
152
152
|
throw new SimpleError({
|
|
153
153
|
code: 'not_allowed',
|
|
154
154
|
message: 'Not allowed',
|
|
155
|
-
human:
|
|
155
|
+
human: $t(`fcb50c02-7510-4e48-bfac-10bb584e3454`),
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -288,11 +288,11 @@ export class STPackage extends QueryableModel {
|
|
|
288
288
|
}),
|
|
289
289
|
Replacement.create({
|
|
290
290
|
token: 'validUntil',
|
|
291
|
-
value: this.validUntil ? Formatter.dateTime(this.validUntil) :
|
|
291
|
+
value: this.validUntil ? Formatter.dateTime(this.validUntil) : $t(`a402f8d1-b470-4b1e-948b-1524576708ea`),
|
|
292
292
|
}),
|
|
293
293
|
Replacement.create({
|
|
294
294
|
token: 'validUntilDate',
|
|
295
|
-
value: this.validUntil ? Formatter.date(this.validUntil) :
|
|
295
|
+
value: this.validUntil ? Formatter.date(this.validUntil) : $t(`a402f8d1-b470-4b1e-948b-1524576708ea`),
|
|
296
296
|
}),
|
|
297
297
|
Replacement.create({
|
|
298
298
|
token: 'renewUrl',
|
package/src/models/User.ts
CHANGED
|
@@ -456,7 +456,7 @@ export class User extends QueryableModel {
|
|
|
456
456
|
throw new SimpleError({
|
|
457
457
|
code: 'duplicate_login_provider',
|
|
458
458
|
message: 'This account is already linked to another account',
|
|
459
|
-
human:
|
|
459
|
+
human: $t(`d4f1cb82-1e15-421a-8218-37cd3066436c`),
|
|
460
460
|
statusCode: 400,
|
|
461
461
|
});
|
|
462
462
|
}
|
|
@@ -467,7 +467,7 @@ export class User extends QueryableModel {
|
|
|
467
467
|
throw new SimpleError({
|
|
468
468
|
code: 'password_based_account',
|
|
469
469
|
message: 'This user uses a password to login. Log in with the password and link the external account through the settings.',
|
|
470
|
-
human:
|
|
470
|
+
human: $t(`0154f68a-7458-4b87-91f2-5d04be0737fd`),
|
|
471
471
|
statusCode: 400,
|
|
472
472
|
});
|
|
473
473
|
}
|
|
@@ -92,7 +92,7 @@ export class PostalCode extends QueryableModel {
|
|
|
92
92
|
throw new SimpleError({
|
|
93
93
|
code: 'invalid_field',
|
|
94
94
|
message: 'Invalid city. Suggestions: ' + Formatter.joinLast(cities.map(c => c.name), ', ', ' of ') + '?',
|
|
95
|
-
human:
|
|
95
|
+
human: $t(`8c2fe8b6-416a-47e5-b77b-20c8192ad0c7`) + ' ' + Formatter.joinLast(cities.map(c => c.name), ', ', ' ' + $t(`411cf334-eebb-4f27-beb6-d81bd544c3f5`) + ' ') + '?',
|
|
96
96
|
field: 'city',
|
|
97
97
|
});
|
|
98
98
|
}
|