@stamhoofd/backend 2.118.1 → 2.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/src/audit-logs/OrderLogger.ts +1 -1
- package/src/email-replacements/getEmailReplacementsForPayment.ts +6 -6
- package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +4 -4
- package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +1 -1
- package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +1 -1
- package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +1 -1
- package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +8 -8
- package/src/endpoints/admin/registrations/ChargeRegistrationsEndpoint.ts +1 -1
- package/src/endpoints/auth/CreateAdminEndpoint.ts +3 -3
- package/src/endpoints/auth/CreateTokenEndpoint.ts +10 -10
- package/src/endpoints/auth/ForgotPasswordEndpoint.ts +2 -2
- package/src/endpoints/auth/PatchUserEndpoint.ts +9 -9
- package/src/endpoints/auth/SignupEndpoint.ts +2 -2
- package/src/endpoints/auth/VerifyEmailEndpoint.ts +3 -3
- package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +1 -1
- package/src/endpoints/global/billing/ActivatePackagesEndpoint.ts +3 -3
- package/src/endpoints/global/billing/DeactivatePackageEndpoint.ts +2 -2
- package/src/endpoints/global/email/CreateEmailEndpoint.ts +4 -4
- package/src/endpoints/global/email/GetEmailAddressEndpoint.ts +2 -2
- package/src/endpoints/global/email/GetEmailEndpoint.ts +1 -1
- package/src/endpoints/global/email/GetUserEmailsEndpoint.test.ts +1 -1
- package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +3 -3
- package/src/endpoints/global/email/PatchEmailEndpoint.test.ts +1 -1
- package/src/endpoints/global/email/PatchEmailEndpoint.ts +8 -8
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.ts +1 -1
- package/src/endpoints/global/email-recipients/RetryEmailRecipientEndpoint.ts +3 -3
- package/src/endpoints/global/email-recipients/helpers/validateEmailRecipientFilter.ts +2 -2
- package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +1 -1
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.ts +13 -13
- package/src/endpoints/global/events/PatchEventsEndpoint.ts +24 -24
- package/src/endpoints/global/files/ExportToExcelEndpoint.ts +1 -1
- package/src/endpoints/global/files/UploadFile.ts +1 -1
- package/src/endpoints/global/groups/GetGroupsEndpoint.ts +1 -1
- package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +2 -2
- package/src/endpoints/global/members/GetMembersEndpoint.ts +2 -2
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +52 -52
- package/src/endpoints/global/members/helpers/validateGroupFilter.ts +2 -2
- package/src/endpoints/global/organizations/CheckRegisterCodeEndpoint.ts +1 -1
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +5 -5
- package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +1 -1
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.ts +2 -2
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +4 -4
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +18 -18
- package/src/endpoints/global/registration-periods/GetRegistrationPeriodsEndpoint.ts +1 -1
- package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +5 -5
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/balance-items/PatchBalanceItemsEndpoint.ts +11 -11
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplateXML.ts +1 -1
- package/src/endpoints/organization/dashboard/documents/PatchDocumentEndpoint.ts +5 -5
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +16 -16
- package/src/endpoints/organization/dashboard/organization/SetOrganizationDomainEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts +5 -5
- package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +13 -13
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +26 -26
- package/src/endpoints/organization/dashboard/stripe/DeleteStripeAccountEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +4 -4
- package/src/endpoints/organization/dashboard/webshops/DeleteWebshopEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/PatchDiscountCodesEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +9 -9
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/SearchUitpasEventsEndpoint.ts +1 -1
- package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +1 -1
- package/src/endpoints/organization/shared/GetDocumentHtml.ts +2 -2
- package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/CheckWebshopDiscountCodesEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +2 -2
- package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +3 -3
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +8 -8
- package/src/endpoints/organization/webshops/RetrieveUitpasSocialTariffPriceEndpoint.ts +2 -2
- package/src/excel-loaders/balance-items.ts +15 -15
- package/src/excel-loaders/event-notifications.ts +11 -11
- package/src/excel-loaders/members.ts +41 -41
- package/src/excel-loaders/organizations.ts +23 -23
- package/src/excel-loaders/payments.ts +40 -40
- package/src/excel-loaders/receivable-balances.ts +21 -21
- package/src/excel-loaders/registrations.ts +26 -26
- package/src/helpers/AddressValidator.ts +6 -6
- package/src/helpers/AdminPermissionChecker.ts +4 -4
- package/src/helpers/AuthenticatedStructures.ts +9 -9
- package/src/helpers/BuckarooHelper.ts +1 -1
- package/src/helpers/Context.ts +4 -4
- package/src/helpers/FileCache.ts +7 -7
- package/src/helpers/ForwardHandler.ts +1 -1
- package/src/helpers/MembershipCharger.ts +2 -2
- package/src/helpers/SetupStepUpdater.ts +1 -1
- package/src/helpers/StripeHelper.ts +6 -6
- package/src/helpers/UitpasTokenRepository.ts +7 -7
- package/src/helpers/ViesHelper.ts +1 -1
- package/src/helpers/XlsxTransformerColumnHelper.ts +17 -17
- package/src/helpers/email-html-helpers.ts +10 -10
- package/src/helpers/updateMemberDetailsUitpasNumber.ts +1 -1
- package/src/seeds/1752848561-groups-registration-periods.ts +1 -1
- package/src/seeds/1755790070-fill-email-recipient-errors.ts +6 -6
- package/src/services/EventNotificationService.ts +3 -3
- package/src/services/FileSignService.ts +1 -1
- package/src/services/InvoiceService.ts +3 -3
- package/src/services/MemberNumberService.ts +3 -3
- package/src/services/PaymentService.ts +23 -23
- package/src/services/SSOService.ts +5 -5
- package/src/services/STPackageService.ts +2 -2
- package/src/services/uitpas/PassholderEndpoints.ts +2 -2
- package/src/services/uitpas/UitpasService.ts +5 -5
- package/src/services/uitpas/cancelTicketSales.ts +1 -1
- package/src/services/uitpas/checkPermissionsFor.ts +9 -9
- package/src/services/uitpas/getSocialTariffForEvent.ts +4 -4
- package/src/services/uitpas/getSocialTariffForUitpasNumbers.ts +5 -5
- package/src/services/uitpas/handleUitpasResponse.ts +1 -1
- package/src/services/uitpas/registerTicketSales.ts +4 -4
- package/src/services/uitpas/searchUitpasEvents.ts +3 -3
- package/src/services/uitpas/searchUitpasOrganizers.ts +3 -3
- package/src/sql-filters/base-registration-filter-compilers.ts +2 -2
- package/src/sql-filters/members.ts +6 -6
- package/src/sql-filters/orders.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamhoofd/backend",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.119.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"@simonbackx/simple-encoding": "2.23.1",
|
|
56
56
|
"@simonbackx/simple-endpoints": "1.20.1",
|
|
57
57
|
"@simonbackx/simple-logging": "^1.0.1",
|
|
58
|
-
"@stamhoofd/backend-i18n": "2.
|
|
59
|
-
"@stamhoofd/backend-middleware": "2.
|
|
60
|
-
"@stamhoofd/email": "2.
|
|
61
|
-
"@stamhoofd/models": "2.
|
|
62
|
-
"@stamhoofd/queues": "2.
|
|
63
|
-
"@stamhoofd/sql": "2.
|
|
64
|
-
"@stamhoofd/structures": "2.
|
|
65
|
-
"@stamhoofd/utility": "2.
|
|
58
|
+
"@stamhoofd/backend-i18n": "2.119.0",
|
|
59
|
+
"@stamhoofd/backend-middleware": "2.119.0",
|
|
60
|
+
"@stamhoofd/email": "2.119.0",
|
|
61
|
+
"@stamhoofd/models": "2.119.0",
|
|
62
|
+
"@stamhoofd/queues": "2.119.0",
|
|
63
|
+
"@stamhoofd/sql": "2.119.0",
|
|
64
|
+
"@stamhoofd/structures": "2.119.0",
|
|
65
|
+
"@stamhoofd/utility": "2.119.0",
|
|
66
66
|
"archiver": "^7.0.1",
|
|
67
67
|
"axios": "^1.13.2",
|
|
68
68
|
"cookie": "^0.7.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "7bcbadd31fcc4f3109efc67c4034d1382a1d0439"
|
|
84
84
|
}
|
|
@@ -50,7 +50,7 @@ export const OrderLogger = new ModelLogger(Order, {
|
|
|
50
50
|
id: model.id,
|
|
51
51
|
value: model.number ? `bestelling #${model.number}` : `bestelling van ${model.data.customer.name}`,
|
|
52
52
|
type: AuditLogReplacementType.Order,
|
|
53
|
-
description: model.number ? model.data.customer.name : $t(`
|
|
53
|
+
description: model.number ? model.data.customer.name : $t(`%Cq`),
|
|
54
54
|
})],
|
|
55
55
|
]);
|
|
56
56
|
},
|
|
@@ -216,7 +216,7 @@ function getPaymentContext(payment: PaymentGeneral, { orderMap, webshopMap }: Re
|
|
|
216
216
|
const webshop = webshopMap.get(order.webshopId);
|
|
217
217
|
if (webshop) {
|
|
218
218
|
if (order.number) {
|
|
219
|
-
overviewContext.add($t('
|
|
219
|
+
overviewContext.add($t('%1Kz', {
|
|
220
220
|
webshop: webshop.meta.name,
|
|
221
221
|
orderNumber: order.number ?? '',
|
|
222
222
|
}));
|
|
@@ -226,7 +226,7 @@ function getPaymentContext(payment: PaymentGeneral, { orderMap, webshopMap }: Re
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
else {
|
|
229
|
-
overviewContext.add($t('
|
|
229
|
+
overviewContext.add($t('%1L0', {
|
|
230
230
|
orderNumber: order.number ?? '',
|
|
231
231
|
}));
|
|
232
232
|
}
|
|
@@ -252,8 +252,8 @@ function getPaymentContext(payment: PaymentGeneral, { orderMap, webshopMap }: Re
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
if (registrationMemberNames.size > 0) {
|
|
255
|
-
const memberNames = Formatter.joinLast([...registrationMemberNames], ', ', ' ' + $t(`
|
|
256
|
-
overviewContext.add($t(`
|
|
255
|
+
const memberNames = Formatter.joinLast([...registrationMemberNames], ', ', ' ' + $t(`%M1`) + ' ');
|
|
256
|
+
overviewContext.add($t(`%x6`) + ' ' + memberNames);
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
if (overviewContext.size === 0) {
|
|
@@ -273,11 +273,11 @@ function getPaymentContext(payment: PaymentGeneral, { orderMap, webshopMap }: Re
|
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
// else return default text for multiple items
|
|
276
|
-
return $t('
|
|
276
|
+
return $t('%1Kx', { count: payment.balanceItemPayments.length });
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// else return default text for single item
|
|
280
|
-
return $t('
|
|
280
|
+
return $t('%1Ky');
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
// join texts for balance items with type order or registration
|
|
@@ -35,7 +35,7 @@ export class ChargeMembersEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
35
35
|
throw new SimpleError({
|
|
36
36
|
code: 'invalid_field',
|
|
37
37
|
message: 'Invalid description',
|
|
38
|
-
human: $t(`
|
|
38
|
+
human: $t(`%Cr`),
|
|
39
39
|
field: 'description',
|
|
40
40
|
});
|
|
41
41
|
}
|
|
@@ -44,7 +44,7 @@ export class ChargeMembersEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
44
44
|
throw new SimpleError({
|
|
45
45
|
code: 'invalid_field',
|
|
46
46
|
message: 'Invalid price',
|
|
47
|
-
human: $t(`
|
|
47
|
+
human: $t(`%Cs`),
|
|
48
48
|
field: 'price',
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -53,7 +53,7 @@ export class ChargeMembersEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
53
53
|
throw new SimpleError({
|
|
54
54
|
code: 'invalid_field',
|
|
55
55
|
message: 'Invalid amount',
|
|
56
|
-
human: $t(`
|
|
56
|
+
human: $t(`%Ct`),
|
|
57
57
|
field: 'amount',
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -77,7 +77,7 @@ export class ChargeMembersEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
77
77
|
throw new SimpleError({
|
|
78
78
|
code: 'charge_pending',
|
|
79
79
|
message: 'Charge members already pending',
|
|
80
|
-
human: $t(`
|
|
80
|
+
human: $t(`%Cu`),
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -34,7 +34,7 @@ export class ChargeMembershipsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
34
34
|
throw new SimpleError({
|
|
35
35
|
code: 'charge_pending',
|
|
36
36
|
message: 'Charge already pending',
|
|
37
|
-
human: $t(`
|
|
37
|
+
human: $t(`%Cu`),
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -48,7 +48,7 @@ export class ChargeOrganizationsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
48
48
|
throw new SimpleError({
|
|
49
49
|
code: 'charge_pending',
|
|
50
50
|
message: 'Charge organizations already pending',
|
|
51
|
-
human: $t(`
|
|
51
|
+
human: $t(`%Cu`),
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -129,7 +129,7 @@ export class GetOrganizationsEndpoint extends Endpoint<Params, Query, Body, Resp
|
|
|
129
129
|
throw new SimpleError({
|
|
130
130
|
code: 'timeout',
|
|
131
131
|
message: 'Query took too long',
|
|
132
|
-
human: $t(`
|
|
132
|
+
human: $t(`%Cv`),
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
throw error;
|
|
@@ -43,7 +43,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
43
43
|
|
|
44
44
|
for (const id of request.body.getDeletes()) {
|
|
45
45
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
46
|
-
throw Context.auth.error($t(`
|
|
46
|
+
throw Context.auth.error($t(`%Cw`));
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const organization = await Organization.getByID(id);
|
|
@@ -55,7 +55,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
55
55
|
throw new SimpleError({
|
|
56
56
|
code: 'cannot_delete_membership_organization',
|
|
57
57
|
message: 'Cannot delete membership organization',
|
|
58
|
-
human: $t(`
|
|
58
|
+
human: $t(`%Cx`),
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -65,7 +65,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
65
65
|
// Organization creation
|
|
66
66
|
for (const { put } of request.body.getPuts()) {
|
|
67
67
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
68
|
-
throw Context.auth.error($t(`
|
|
68
|
+
throw Context.auth.error($t(`%Cy`));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
if (put.name.length < 4) {
|
|
@@ -73,7 +73,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
73
73
|
throw new SimpleError({
|
|
74
74
|
code: 'invalid_field',
|
|
75
75
|
message: 'Should not be empty',
|
|
76
|
-
human: $t(`
|
|
76
|
+
human: $t(`%Cz`),
|
|
77
77
|
field: 'organization.name',
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
81
81
|
throw new SimpleError({
|
|
82
82
|
code: 'invalid_field',
|
|
83
83
|
message: 'Field is too short',
|
|
84
|
-
human: $t(`
|
|
84
|
+
human: $t(`%D0`),
|
|
85
85
|
field: 'organization.name',
|
|
86
86
|
});
|
|
87
87
|
}
|
|
@@ -92,7 +92,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
92
92
|
throw new SimpleError({
|
|
93
93
|
code: 'invalid_field',
|
|
94
94
|
message: 'Field is too long',
|
|
95
|
-
human: $t(`
|
|
95
|
+
human: $t(`%D1`),
|
|
96
96
|
field: 'organization.name',
|
|
97
97
|
});
|
|
98
98
|
}
|
|
@@ -102,7 +102,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
102
102
|
throw new SimpleError({
|
|
103
103
|
code: 'name_taken',
|
|
104
104
|
message: 'An organization with the same name already exists',
|
|
105
|
-
human: $t(`
|
|
105
|
+
human: $t(`%D2`),
|
|
106
106
|
field: 'name',
|
|
107
107
|
});
|
|
108
108
|
}
|
|
@@ -113,7 +113,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
113
113
|
throw new SimpleError({
|
|
114
114
|
code: 'name_taken',
|
|
115
115
|
message: 'An organization with the same name already exists',
|
|
116
|
-
human: $t(`
|
|
116
|
+
human: $t(`%D3`),
|
|
117
117
|
field: 'name',
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -49,7 +49,7 @@ export class ChargeRegistrationsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
49
49
|
throw new SimpleError({
|
|
50
50
|
code: 'charge_pending',
|
|
51
51
|
message: 'Charge registrations already pending',
|
|
52
|
-
human: $t(`
|
|
52
|
+
human: $t(`%Cu`),
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -59,7 +59,7 @@ export class CreateAdminEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
59
59
|
throw new SimpleError({
|
|
60
60
|
code: 'internal_error',
|
|
61
61
|
message: 'Something went wrong while creating the admin',
|
|
62
|
-
human: $t(`
|
|
62
|
+
human: $t(`%D4`),
|
|
63
63
|
statusCode: 500,
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -101,7 +101,7 @@ export class CreateAdminEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
101
101
|
const platformName = ((await Platform.getSharedStruct()).config.name);
|
|
102
102
|
|
|
103
103
|
const name = organization?.name ?? platformName;
|
|
104
|
-
const what = organization ? $t('
|
|
104
|
+
const what = organization ? $t('%C4', { name, platform: platformName }) : platformName;
|
|
105
105
|
|
|
106
106
|
const emailTo = admin.getEmailTo();
|
|
107
107
|
const email: string = typeof emailTo === 'string' ? emailTo : emailTo[0]?.email;
|
|
@@ -123,7 +123,7 @@ export class CreateAdminEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
123
123
|
}),
|
|
124
124
|
Replacement.create({
|
|
125
125
|
token: 'inviterName',
|
|
126
|
-
value: user.firstName ?? $t(`
|
|
126
|
+
value: user.firstName ?? $t(`%D5`),
|
|
127
127
|
}),
|
|
128
128
|
Replacement.create({
|
|
129
129
|
token: 'validUntil',
|
|
@@ -74,7 +74,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
74
74
|
throw new SimpleError({
|
|
75
75
|
code: 'error',
|
|
76
76
|
message: 'Could not generate token',
|
|
77
|
-
human: $t(`
|
|
77
|
+
human: $t(`%D6`),
|
|
78
78
|
statusCode: 500,
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -91,7 +91,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
91
91
|
throw new SimpleError({
|
|
92
92
|
code: 'not_supported',
|
|
93
93
|
message: 'This platform does not support password login',
|
|
94
|
-
human: $t(`
|
|
94
|
+
human: $t(`%D7`),
|
|
95
95
|
statusCode: 400,
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -100,7 +100,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
100
100
|
throw new SimpleError({
|
|
101
101
|
code: 'not_supported',
|
|
102
102
|
message: 'Login method not supported',
|
|
103
|
-
human: $t(`
|
|
103
|
+
human: $t(`%D8`),
|
|
104
104
|
statusCode: 400,
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -111,7 +111,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
111
111
|
const errBody = {
|
|
112
112
|
code: 'invalid_username_or_password',
|
|
113
113
|
message: 'Invalid username or password',
|
|
114
|
-
human: $t(`
|
|
114
|
+
human: $t(`%D9`),
|
|
115
115
|
statusCode: 400,
|
|
116
116
|
};
|
|
117
117
|
|
|
@@ -130,7 +130,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
130
130
|
throw new SimpleError({
|
|
131
131
|
code: 'verify_email',
|
|
132
132
|
message: 'Your email address needs verification',
|
|
133
|
-
human: $t(`
|
|
133
|
+
human: $t(`%DA`),
|
|
134
134
|
meta: SignupResponse.create({
|
|
135
135
|
token: code.token,
|
|
136
136
|
}).encode({ version: request.request.getVersion() }),
|
|
@@ -144,7 +144,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
144
144
|
throw new SimpleError({
|
|
145
145
|
code: 'error',
|
|
146
146
|
message: 'Could not generate token',
|
|
147
|
-
human: $t(`
|
|
147
|
+
human: $t(`%D6`),
|
|
148
148
|
statusCode: 500,
|
|
149
149
|
});
|
|
150
150
|
}
|
|
@@ -159,7 +159,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
159
159
|
throw new SimpleError({
|
|
160
160
|
code: 'invalid_token',
|
|
161
161
|
message: 'Invalid token',
|
|
162
|
-
human: $t(`
|
|
162
|
+
human: $t(`%DB`),
|
|
163
163
|
statusCode: 400,
|
|
164
164
|
});
|
|
165
165
|
}
|
|
@@ -170,7 +170,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
170
170
|
throw new SimpleError({
|
|
171
171
|
code: 'invalid_token',
|
|
172
172
|
message: 'Invalid token',
|
|
173
|
-
human: $t(`
|
|
173
|
+
human: $t(`%DB`),
|
|
174
174
|
statusCode: 400,
|
|
175
175
|
});
|
|
176
176
|
}
|
|
@@ -180,7 +180,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
180
180
|
throw new SimpleError({
|
|
181
181
|
code: 'invalid_token',
|
|
182
182
|
message: 'Invalid token',
|
|
183
|
-
human: $t(`
|
|
183
|
+
human: $t(`%DB`),
|
|
184
184
|
statusCode: 400,
|
|
185
185
|
});
|
|
186
186
|
}
|
|
@@ -194,7 +194,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
194
194
|
throw new SimpleError({
|
|
195
195
|
code: 'error',
|
|
196
196
|
message: 'Could not generate token',
|
|
197
|
-
human: $t(`
|
|
197
|
+
human: $t(`%DC`),
|
|
198
198
|
statusCode: 500,
|
|
199
199
|
});
|
|
200
200
|
}
|
|
@@ -37,7 +37,7 @@ export class ForgotPasswordEndpoint extends Endpoint<Params, Query, Body, Respon
|
|
|
37
37
|
throw new SimpleError({
|
|
38
38
|
code: 'not_supported',
|
|
39
39
|
message: 'This platform does not support password login',
|
|
40
|
-
human: $t(`
|
|
40
|
+
human: $t(`%D7`),
|
|
41
41
|
statusCode: 400,
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -46,7 +46,7 @@ export class ForgotPasswordEndpoint extends Endpoint<Params, Query, Body, Respon
|
|
|
46
46
|
throw new SimpleError({
|
|
47
47
|
code: 'not_supported',
|
|
48
48
|
message: 'Login method not supported',
|
|
49
|
-
human: $t(`
|
|
49
|
+
human: $t(`%DD`),
|
|
50
50
|
statusCode: 400,
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -44,7 +44,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
44
44
|
const editUser = request.body.id === user.id ? user : await User.getByID(request.body.id);
|
|
45
45
|
|
|
46
46
|
if (!editUser || !await Context.auth.canAccessUser(editUser, PermissionLevel.Write) || editUser.isApiUser) {
|
|
47
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
47
|
+
throw Context.auth.notFoundOrNoAccess($t(`%DE`));
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (await Context.auth.canEditUserName(editUser)) {
|
|
@@ -72,7 +72,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
72
72
|
if (!await Context.auth.canAccessUser(editUser, PermissionLevel.Full)) {
|
|
73
73
|
throw new SimpleError({
|
|
74
74
|
code: 'permission_denied',
|
|
75
|
-
message: $t(`
|
|
75
|
+
message: $t(`%DF`),
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -83,7 +83,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
83
83
|
if (editUser.id === user.id && (!editUser.permissions || !editUser.permissions.forOrganization(organization)?.hasFullAccess()) && STAMHOOFD.environment !== 'development') {
|
|
84
84
|
throw new SimpleError({
|
|
85
85
|
code: 'permission_denied',
|
|
86
|
-
message: $t(`
|
|
86
|
+
message: $t(`%DG`),
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -102,7 +102,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
102
102
|
if (editUser.id === user.id && !editUser.permissions?.platform?.hasFullAccess() && STAMHOOFD.environment !== 'development') {
|
|
103
103
|
throw new SimpleError({
|
|
104
104
|
code: 'permission_denied',
|
|
105
|
-
message: $t(`
|
|
105
|
+
message: $t(`%DG`),
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -124,7 +124,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
124
124
|
throw new SimpleError({
|
|
125
125
|
code: 'invalid_request',
|
|
126
126
|
message: 'You cannot remove the last login provider',
|
|
127
|
-
human: $t(`
|
|
127
|
+
human: $t(`%DH`),
|
|
128
128
|
statusCode: 400,
|
|
129
129
|
});
|
|
130
130
|
}
|
|
@@ -142,7 +142,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
142
142
|
throw new SimpleError({
|
|
143
143
|
code: 'not_supported',
|
|
144
144
|
message: 'This platform does not support password login',
|
|
145
|
-
human: $t(`
|
|
145
|
+
human: $t(`%D7`),
|
|
146
146
|
statusCode: 400,
|
|
147
147
|
});
|
|
148
148
|
}
|
|
@@ -151,7 +151,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
151
151
|
throw new SimpleError({
|
|
152
152
|
code: 'not_supported',
|
|
153
153
|
message: 'Login method not supported',
|
|
154
|
-
human: $t(`
|
|
154
|
+
human: $t(`%DD`),
|
|
155
155
|
statusCode: 400,
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -170,7 +170,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
170
170
|
throw new SimpleError({
|
|
171
171
|
code: 'invalid_request',
|
|
172
172
|
message: 'You cannot remove the last login provider',
|
|
173
|
-
human: $t(`
|
|
173
|
+
human: $t(`%DI`),
|
|
174
174
|
statusCode: 400,
|
|
175
175
|
});
|
|
176
176
|
}
|
|
@@ -192,7 +192,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
192
192
|
throw new SimpleError({
|
|
193
193
|
code: 'verify_email',
|
|
194
194
|
message: 'Your email address needs verification',
|
|
195
|
-
human: editUser.id === user.id ? $t(`
|
|
195
|
+
human: editUser.id === user.id ? $t(`%DJ`) : $t(`%DK`) + ' ' + request.body.email + ' ' + $t(`%DL`),
|
|
196
196
|
meta: SignupResponse.create({
|
|
197
197
|
token: code.token,
|
|
198
198
|
}).encode({ version: request.request.getVersion() }),
|
|
@@ -36,7 +36,7 @@ export class SignupEndpoint extends Endpoint<Params, Query, Body, ResponseBody>
|
|
|
36
36
|
throw new SimpleError({
|
|
37
37
|
code: 'not_supported',
|
|
38
38
|
message: 'This platform does not support password login',
|
|
39
|
-
human: $t(`
|
|
39
|
+
human: $t(`%D7`),
|
|
40
40
|
statusCode: 400,
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -62,7 +62,7 @@ export class SignupEndpoint extends Endpoint<Params, Query, Body, ResponseBody>
|
|
|
62
62
|
throw new SimpleError({
|
|
63
63
|
code: 'unexpected_error',
|
|
64
64
|
message: 'Something went wrong',
|
|
65
|
-
human: $t(`
|
|
65
|
+
human: $t(`%DM`),
|
|
66
66
|
statusCode: 500,
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -36,7 +36,7 @@ export class VerifyEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
36
36
|
throw new SimpleError({
|
|
37
37
|
code: 'invalid_code',
|
|
38
38
|
message: 'This code is invalid',
|
|
39
|
-
human: $t(`
|
|
39
|
+
human: $t(`%DN`),
|
|
40
40
|
statusCode: 400,
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -47,7 +47,7 @@ export class VerifyEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
47
47
|
throw new SimpleError({
|
|
48
48
|
code: 'invalid_code',
|
|
49
49
|
message: 'This code is invalid',
|
|
50
|
-
human: $t(`
|
|
50
|
+
human: $t(`%DN`),
|
|
51
51
|
statusCode: 400,
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -77,7 +77,7 @@ export class VerifyEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
77
77
|
throw new SimpleError({
|
|
78
78
|
code: 'email_in_use',
|
|
79
79
|
message: 'This e-mail is already in use, we cannot set it',
|
|
80
|
-
human: $t(
|
|
80
|
+
human: $t(`%DO`, { email: code.email, contactEmail: request.$t('%2a') }),
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
throw e;
|
|
@@ -81,7 +81,7 @@ export class GetAuditLogsEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
81
81
|
throw new SimpleError({
|
|
82
82
|
code: 'not_supported',
|
|
83
83
|
message: 'Search is not possible in audit logs',
|
|
84
|
-
human: $t(`
|
|
84
|
+
human: $t(`%DP`),
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -48,7 +48,7 @@ export class ActivatePackagesEndpoint extends Endpoint<Params, Query, Body, Resp
|
|
|
48
48
|
if (!foundCompany) {
|
|
49
49
|
throw new SimpleError({
|
|
50
50
|
code: 'invalid_data',
|
|
51
|
-
message: $t(`
|
|
51
|
+
message: $t(`%w1`),
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -100,7 +100,7 @@ export class ActivatePackagesEndpoint extends Endpoint<Params, Query, Body, Resp
|
|
|
100
100
|
throw new SimpleError({
|
|
101
101
|
code: 'not_found',
|
|
102
102
|
message: 'Package not found',
|
|
103
|
-
human: $t('
|
|
103
|
+
human: $t('%1L1'),
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -181,7 +181,7 @@ export class ActivatePackagesEndpoint extends Endpoint<Params, Query, Body, Resp
|
|
|
181
181
|
throw new SimpleError({
|
|
182
182
|
code: 'missing_data',
|
|
183
183
|
message: 'Checkout was empty',
|
|
184
|
-
human: $t('
|
|
184
|
+
human: $t('%1L2'),
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -39,7 +39,7 @@ export class DeactivatePackageEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
39
39
|
throw new SimpleError({
|
|
40
40
|
code: 'not_found',
|
|
41
41
|
message: 'Package not found',
|
|
42
|
-
human: $t('
|
|
42
|
+
human: $t('%1L3'),
|
|
43
43
|
statusCode: 404,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -48,7 +48,7 @@ export class DeactivatePackageEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
48
48
|
throw new SimpleError({
|
|
49
49
|
code: 'not_allowed',
|
|
50
50
|
message: "Can't deactivate this package",
|
|
51
|
-
human: $t('
|
|
51
|
+
human: $t('%1L4'),
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -68,7 +68,7 @@ export class CreateEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
68
68
|
if (!await Context.auth.canSendEmails(organization)) {
|
|
69
69
|
throw Context.auth.error({
|
|
70
70
|
message: 'Cannot send emails',
|
|
71
|
-
human: $t('
|
|
71
|
+
human: $t('%1Cv'),
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -98,7 +98,7 @@ export class CreateEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
98
98
|
if (!await Context.auth.canSendEmailsFrom(organization, sender.id)) {
|
|
99
99
|
throw Context.auth.error({
|
|
100
100
|
message: 'Cannot send emails from this sender',
|
|
101
|
-
human: $t('
|
|
101
|
+
human: $t('%1Cw'),
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
model.senderId = sender.id;
|
|
@@ -110,7 +110,7 @@ export class CreateEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
110
110
|
throw new SimpleError({
|
|
111
111
|
code: 'invalid_sender',
|
|
112
112
|
message: 'Sender not found',
|
|
113
|
-
human: $t(`
|
|
113
|
+
human: $t(`%1Cx`),
|
|
114
114
|
statusCode: 400,
|
|
115
115
|
});
|
|
116
116
|
}
|
|
@@ -134,7 +134,7 @@ export class CreateEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
134
134
|
if (!await Context.auth.canSendEmail(model)) {
|
|
135
135
|
throw Context.auth.error({
|
|
136
136
|
message: 'Cannot send emails from this sender',
|
|
137
|
-
human: $t('
|
|
137
|
+
human: $t('%1Cw'),
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
await model.queueForSending();
|
|
@@ -53,7 +53,7 @@ export class GetEmailAddressEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
53
53
|
throw new SimpleError({
|
|
54
54
|
code: 'invalid_fields',
|
|
55
55
|
message: 'Invalid token or id',
|
|
56
|
-
human: $t(`
|
|
56
|
+
human: $t(`%DQ`),
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -95,7 +95,7 @@ export class GetEmailAddressEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
95
95
|
throw new SimpleError({
|
|
96
96
|
code: 'not_found',
|
|
97
97
|
message: 'Email not found',
|
|
98
|
-
human: $t(`
|
|
98
|
+
human: $t(`%DR`),
|
|
99
99
|
statusCode: 404,
|
|
100
100
|
});
|
|
101
101
|
}
|
|
@@ -41,7 +41,7 @@ export class GetEmailEndpoint extends Endpoint<Params, Query, Body, ResponseBody
|
|
|
41
41
|
throw new SimpleError({
|
|
42
42
|
code: 'not_found',
|
|
43
43
|
message: 'Email not found',
|
|
44
|
-
human: $t(`
|
|
44
|
+
human: $t(`%DR`),
|
|
45
45
|
statusCode: 404,
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -548,7 +548,7 @@ describe('Endpoint.GetUserEmails', () => {
|
|
|
548
548
|
// Check balanceTable replacement
|
|
549
549
|
const balanceTableReplacement = recipient.replacements.find(r => r.token === 'balanceTable');
|
|
550
550
|
expect(balanceTableReplacement).toBeDefined();
|
|
551
|
-
expect(balanceTableReplacement!.html).toBe('<p class="description">' + $t('
|
|
551
|
+
expect(balanceTableReplacement!.html).toBe('<p class="description">' + $t('%hX') + '</p>');
|
|
552
552
|
});
|
|
553
553
|
|
|
554
554
|
test('Should return one recipient for each member the user is associated with, if the email is different for each member', async () => {
|