@stamhoofd/backend 2.118.0 → 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/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts
CHANGED
|
@@ -51,7 +51,7 @@ export class SetUitpasClientCredentialsEndpoint extends Endpoint<Params, Query,
|
|
|
51
51
|
throw new SimpleError({
|
|
52
52
|
message: 'You must provide a client id',
|
|
53
53
|
code: 'missing_client_id',
|
|
54
|
-
human: $t('
|
|
54
|
+
human: $t('%1BC'),
|
|
55
55
|
field: 'clientId',
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -59,7 +59,7 @@ export class SetUitpasClientCredentialsEndpoint extends Endpoint<Params, Query,
|
|
|
59
59
|
throw new SimpleError({
|
|
60
60
|
message: 'You must provide a client secret',
|
|
61
61
|
code: 'missing_client_secret',
|
|
62
|
-
human: $t('
|
|
62
|
+
human: $t('%1BD'),
|
|
63
63
|
field: 'clientSecret',
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -67,7 +67,7 @@ export class SetUitpasClientCredentialsEndpoint extends Endpoint<Params, Query,
|
|
|
67
67
|
throw new SimpleError({
|
|
68
68
|
message: 'You cannot use the placeholder client secret for a different client id',
|
|
69
69
|
code: 'invalid_client_secret',
|
|
70
|
-
human: $t('
|
|
70
|
+
human: $t('%1BE'),
|
|
71
71
|
field: 'clientSecret',
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -77,7 +77,7 @@ export class SetUitpasClientCredentialsEndpoint extends Endpoint<Params, Query,
|
|
|
77
77
|
throw new SimpleError({
|
|
78
78
|
message: 'This organization does not have a uitpas organizer id set',
|
|
79
79
|
code: 'missing_uitpas_organizer_id',
|
|
80
|
-
human: $t('
|
|
80
|
+
human: $t('%1BF'),
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -88,7 +88,7 @@ export class SetUitpasClientCredentialsEndpoint extends Endpoint<Params, Query,
|
|
|
88
88
|
throw new SimpleError({
|
|
89
89
|
message: 'The provided client credentials are not valid',
|
|
90
90
|
code: 'invalid_client_credentials',
|
|
91
|
-
human: $t('
|
|
91
|
+
human: $t('%1BG'),
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -171,7 +171,7 @@ export class GetPaymentsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
171
171
|
throw new SimpleError({
|
|
172
172
|
code: 'timeout',
|
|
173
173
|
message: 'Query took too long',
|
|
174
|
-
human: $t(`
|
|
174
|
+
human: $t(`%Cv`),
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
throw error;
|
|
@@ -53,7 +53,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
53
53
|
throw new SimpleError({
|
|
54
54
|
code: 'invalid_field',
|
|
55
55
|
message: 'You need to add at least one balance item payment',
|
|
56
|
-
human: $t(`
|
|
56
|
+
human: $t(`%Em`),
|
|
57
57
|
field: 'balanceItemPayments',
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -62,7 +62,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
62
62
|
throw new SimpleError({
|
|
63
63
|
code: 'invalid_field',
|
|
64
64
|
message: 'Invalid payment method',
|
|
65
|
-
human: $t(`
|
|
65
|
+
human: $t(`%En`),
|
|
66
66
|
field: 'method',
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -115,7 +115,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
115
115
|
throw new SimpleError({
|
|
116
116
|
code: 'invalid_field',
|
|
117
117
|
message: 'Transfer settings are required',
|
|
118
|
-
human: $t(`
|
|
118
|
+
human: $t(`%Eo`),
|
|
119
119
|
field: 'transferSettings',
|
|
120
120
|
});
|
|
121
121
|
}
|
|
@@ -126,7 +126,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
126
126
|
throw new SimpleError({
|
|
127
127
|
code: 'invalid_field',
|
|
128
128
|
message: 'Transfer description is required',
|
|
129
|
-
human: $t(`
|
|
129
|
+
human: $t(`%Ep`),
|
|
130
130
|
field: 'transferDescription',
|
|
131
131
|
});
|
|
132
132
|
}
|
|
@@ -140,7 +140,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
140
140
|
for (const item of put.balanceItemPayments) {
|
|
141
141
|
const balanceItem = await BalanceItem.getByID(item.balanceItem.id);
|
|
142
142
|
if (!balanceItem || balanceItem.organizationId !== organization.id) {
|
|
143
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
143
|
+
throw Context.auth.notFoundOrNoAccess($t(`%Eq`));
|
|
144
144
|
}
|
|
145
145
|
balanceItems.push(balanceItem);
|
|
146
146
|
|
|
@@ -158,7 +158,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
158
158
|
|
|
159
159
|
// Check permissions
|
|
160
160
|
if (!(await Context.auth.canAccessBalanceItems(balanceItems, PermissionLevel.Write))) {
|
|
161
|
-
throw Context.auth.error($t(`
|
|
161
|
+
throw Context.auth.error($t(`%Er`));
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
// Check total price
|
|
@@ -172,7 +172,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
172
172
|
throw new SimpleError({
|
|
173
173
|
code: 'invalid_field',
|
|
174
174
|
message: 'The price should be greater than zero',
|
|
175
|
-
human: $t(`
|
|
175
|
+
human: $t(`%Es`),
|
|
176
176
|
field: 'price',
|
|
177
177
|
});
|
|
178
178
|
}
|
|
@@ -185,7 +185,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
185
185
|
throw new SimpleError({
|
|
186
186
|
code: 'invalid_field',
|
|
187
187
|
message: 'The price should be smaller than zero',
|
|
188
|
-
human: $t(`
|
|
188
|
+
human: $t(`%Et`),
|
|
189
189
|
field: 'price',
|
|
190
190
|
});
|
|
191
191
|
}
|
|
@@ -198,7 +198,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
198
198
|
throw new SimpleError({
|
|
199
199
|
code: 'invalid_field',
|
|
200
200
|
message: 'Total price should be zero',
|
|
201
|
-
human: $t(`
|
|
201
|
+
human: $t(`%Eu`),
|
|
202
202
|
field: 'price',
|
|
203
203
|
});
|
|
204
204
|
}
|
|
@@ -207,7 +207,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
207
207
|
throw new SimpleError({
|
|
208
208
|
code: 'missing_items',
|
|
209
209
|
message: 'At least two items are required for a reallocation',
|
|
210
|
-
human: $t(`
|
|
210
|
+
human: $t(`%Ev`),
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
break;
|
|
@@ -249,7 +249,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
249
249
|
throw new SimpleError({
|
|
250
250
|
code: 'not_found',
|
|
251
251
|
message: 'Payment not found',
|
|
252
|
-
human: $t(`
|
|
252
|
+
human: $t(`%Ew`),
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
|
|
@@ -258,7 +258,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
258
258
|
throw new SimpleError({
|
|
259
259
|
code: 'invalid_field',
|
|
260
260
|
message: 'Invalid payment method',
|
|
261
|
-
human: $t(`
|
|
261
|
+
human: $t(`%Ex`),
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -277,7 +277,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
277
277
|
throw new SimpleError({
|
|
278
278
|
code: 'invalid_field',
|
|
279
279
|
message: 'Invalid payment method',
|
|
280
|
-
human: $t(`
|
|
280
|
+
human: $t(`%Ey`),
|
|
281
281
|
field: 'method',
|
|
282
282
|
});
|
|
283
283
|
}
|
|
@@ -115,7 +115,7 @@ export class GetOrganizationRegistrationPeriodsEndpoint extends Endpoint<Params,
|
|
|
115
115
|
code: 'client_update_required',
|
|
116
116
|
statusCode: 400,
|
|
117
117
|
message: 'Er is een noodzakelijke update beschikbaar. Herlaad de pagina en wis indien nodig de cache van jouw browser.',
|
|
118
|
-
human: $t(`
|
|
118
|
+
human: $t(`%G8`),
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -60,7 +60,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
60
60
|
throw new SimpleError({
|
|
61
61
|
code: 'not_found',
|
|
62
62
|
message: 'Period not found',
|
|
63
|
-
human: $t('
|
|
63
|
+
human: $t('%15j'),
|
|
64
64
|
statusCode: 404,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
@@ -71,7 +71,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
71
71
|
throw new SimpleError({
|
|
72
72
|
code: 'not_found',
|
|
73
73
|
message: 'Period not found',
|
|
74
|
-
human: $t('
|
|
74
|
+
human: $t('%15j'),
|
|
75
75
|
statusCode: 404,
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -80,7 +80,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
80
80
|
throw new SimpleError({
|
|
81
81
|
code: 'locked_period',
|
|
82
82
|
message: 'This period is locked',
|
|
83
|
-
human: $t(
|
|
83
|
+
human: $t(`%15m`, { '2000-2001': period.getStructure().nameShort }),
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -125,7 +125,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
if (!await Context.auth.canCreateGroupInCategory(organization.id, category)) {
|
|
128
|
-
throw Context.auth.error($t(`
|
|
128
|
+
throw Context.auth.error($t(`%Ez`));
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
// Only process puts
|
|
@@ -149,7 +149,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
149
149
|
code: 'invalid_field',
|
|
150
150
|
field: 'categories',
|
|
151
151
|
message: 'Cannot have groups and categories combined',
|
|
152
|
-
human: $t(`
|
|
152
|
+
human: $t(`%F0`),
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -170,7 +170,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
170
170
|
const isDeleted = refCountAfter < refCountBefore;
|
|
171
171
|
|
|
172
172
|
if (isDeleted) {
|
|
173
|
-
throw Context.auth.error($t(`
|
|
173
|
+
throw Context.auth.error($t(`%F1`));
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -178,11 +178,11 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
178
178
|
|
|
179
179
|
if (!categoryAfter) {
|
|
180
180
|
if (locked) {
|
|
181
|
-
throw Context.auth.error($t(`
|
|
181
|
+
throw Context.auth.error($t(`%F1`));
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
else if (locked !== categoryAfter.settings.locked) {
|
|
185
|
-
throw Context.auth.error($t(`
|
|
185
|
+
throw Context.auth.error($t(`%F2`));
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
if (!locked || !categoryAfter) {
|
|
@@ -193,7 +193,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
193
193
|
const settingsAfter = categoryAfter.settings;
|
|
194
194
|
|
|
195
195
|
if (settingsBefore.name !== settingsAfter.name) {
|
|
196
|
-
throw Context.auth.error($t(`
|
|
196
|
+
throw Context.auth.error($t(`%F3`));
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
@@ -219,7 +219,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
219
219
|
throw new SimpleError({
|
|
220
220
|
code: 'invalid_group_type',
|
|
221
221
|
message: 'Cannot create groups for events via this endpoint',
|
|
222
|
-
human: $t(`
|
|
222
|
+
human: $t(`%1HF`),
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
|
|
@@ -272,7 +272,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
272
272
|
throw new SimpleError({
|
|
273
273
|
code: 'invalid_default_age_group',
|
|
274
274
|
message: 'Invalid default age group',
|
|
275
|
-
human: $t(`
|
|
275
|
+
human: $t(`%F4`),
|
|
276
276
|
statusCode: 400,
|
|
277
277
|
});
|
|
278
278
|
}
|
|
@@ -280,7 +280,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
280
280
|
throw new SimpleError({
|
|
281
281
|
code: 'invalid_default_age_group',
|
|
282
282
|
message: 'Invalid default age group',
|
|
283
|
-
human: $t(`
|
|
283
|
+
human: $t(`%F5`),
|
|
284
284
|
statusCode: 400,
|
|
285
285
|
});
|
|
286
286
|
}
|
|
@@ -292,7 +292,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
292
292
|
throw new SimpleError({
|
|
293
293
|
code: 'not_found',
|
|
294
294
|
message: 'Period not found',
|
|
295
|
-
human: $t('
|
|
295
|
+
human: $t('%15j'),
|
|
296
296
|
statusCode: 404,
|
|
297
297
|
});
|
|
298
298
|
}
|
|
@@ -309,7 +309,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
309
309
|
throw new SimpleError({
|
|
310
310
|
code: 'locked_period',
|
|
311
311
|
message: 'Period is locked',
|
|
312
|
-
human: $t(
|
|
312
|
+
human: $t(`%15m`, { '2000-2001': period.getStructure().nameShort }),
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
315
|
|
|
@@ -318,7 +318,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
318
318
|
throw new SimpleError({
|
|
319
319
|
code: 'invalid_field',
|
|
320
320
|
message: 'Period start date is too far in the future',
|
|
321
|
-
human: $t('
|
|
321
|
+
human: $t('%15k'),
|
|
322
322
|
field: 'period',
|
|
323
323
|
});
|
|
324
324
|
}
|
|
@@ -328,7 +328,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
328
328
|
throw new SimpleError({
|
|
329
329
|
code: 'invalid_field',
|
|
330
330
|
message: 'Period has ended',
|
|
331
|
-
human: $t('
|
|
331
|
+
human: $t('%15l'),
|
|
332
332
|
field: 'period',
|
|
333
333
|
});
|
|
334
334
|
}
|
|
@@ -363,7 +363,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
363
363
|
static async deleteGroup(id: string) {
|
|
364
364
|
const model = await Group.getByID(id);
|
|
365
365
|
if (!model || !await Context.auth.canAccessGroup(model, PermissionLevel.Full)) {
|
|
366
|
-
throw Context.auth.error($t(`
|
|
366
|
+
throw Context.auth.error($t(`%F6`));
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
model.deletedAt = new Date();
|
|
@@ -382,7 +382,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
382
382
|
const model = await Group.getByID(struct.id);
|
|
383
383
|
|
|
384
384
|
if (!model || !await Context.auth.canAccessGroup(model, PermissionLevel.Full)) {
|
|
385
|
-
throw Context.auth.error($t(`
|
|
385
|
+
throw Context.auth.error($t(`%F7`));
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
if (struct.settings) {
|
|
@@ -401,7 +401,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
401
401
|
throw new SimpleError({
|
|
402
402
|
code: 'missing_permissions',
|
|
403
403
|
message: 'You cannot restrict your own permissions',
|
|
404
|
-
human: $t(`
|
|
404
|
+
human: $t(`%F8`),
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
407
|
}
|
|
@@ -440,7 +440,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
440
440
|
throw new SimpleError({
|
|
441
441
|
code: 'locked_period',
|
|
442
442
|
message: 'This period is locked',
|
|
443
|
-
human: Context.i18n.$t('
|
|
443
|
+
human: Context.i18n.$t('%AW'),
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
}
|
|
@@ -478,7 +478,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
478
478
|
throw new SimpleError({
|
|
479
479
|
code: 'locked_period',
|
|
480
480
|
message: 'This period is locked',
|
|
481
|
-
human: $t('
|
|
481
|
+
human: $t('%1HS'),
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
}
|
|
@@ -536,7 +536,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
536
536
|
code: 'invalid_field',
|
|
537
537
|
field: 'periodId',
|
|
538
538
|
message: 'Group has waiting list with other groups in the current period',
|
|
539
|
-
human: $t('
|
|
539
|
+
human: $t('%1HT'),
|
|
540
540
|
});
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -591,7 +591,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
591
591
|
code: 'invalid_field',
|
|
592
592
|
field: 'waitingList',
|
|
593
593
|
message: 'Waiting list group is already used in another period',
|
|
594
|
-
human: $t(`
|
|
594
|
+
human: $t(`%F9`),
|
|
595
595
|
});
|
|
596
596
|
}
|
|
597
597
|
|
|
@@ -658,7 +658,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
658
658
|
|
|
659
659
|
if (struct.type !== GroupType.EventRegistration && !allowedIds.includes(struct.id)) {
|
|
660
660
|
if (!await Context.auth.hasFullAccess(organizationId)) {
|
|
661
|
-
throw Context.auth.error($t(`
|
|
661
|
+
throw Context.auth.error($t(`%FA`));
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
else {
|
|
@@ -669,7 +669,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
669
669
|
throw new SimpleError({
|
|
670
670
|
code: 'invalid_period',
|
|
671
671
|
message: 'Period is locked',
|
|
672
|
-
human: Context.i18n.$t('
|
|
672
|
+
human: Context.i18n.$t('%AW'),
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
|
|
@@ -730,7 +730,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
730
730
|
throw new SimpleError({
|
|
731
731
|
code: 'missing_permissions',
|
|
732
732
|
message: 'You cannot restrict your own permissions',
|
|
733
|
-
human: $t(`
|
|
733
|
+
human: $t(`%FB`),
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
736
|
}
|
|
@@ -39,7 +39,7 @@ export class DeleteStripeAccountEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
39
39
|
// Search account in database
|
|
40
40
|
const model = await StripeAccount.getByID(request.params.id);
|
|
41
41
|
if (!model || model.organizationId !== organization.id || model.status !== 'active') {
|
|
42
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
42
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FC`));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (STAMHOOFD.STRIPE_ACCOUNT_ID && model.accountId === STAMHOOFD.STRIPE_ACCOUNT_ID) {
|
|
@@ -57,7 +57,7 @@ export class GetStripeAccountLinkEndpoint extends Endpoint<Params, Query, Body,
|
|
|
57
57
|
// Search account in database
|
|
58
58
|
const model = await StripeAccount.getByID(request.body.accountId);
|
|
59
59
|
if (!model || model.organizationId !== organization.id || model.status !== 'active') {
|
|
60
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
60
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FC`));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
// Get account
|
|
@@ -53,7 +53,7 @@ export class GetStripeLoginLinkEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
53
53
|
if (!model || model.organizationId !== organization.id || model.status !== 'active') {
|
|
54
54
|
throw new SimpleError({
|
|
55
55
|
code: 'not_found',
|
|
56
|
-
message: $t(`
|
|
56
|
+
message: $t(`%FC`),
|
|
57
57
|
statusCode: 400,
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -38,7 +38,7 @@ export class UpdateStripeAccountEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
38
38
|
// Search account in database
|
|
39
39
|
const model = await StripeAccount.getByID(request.params.id);
|
|
40
40
|
if (!model || model.organizationId !== organization.id) {
|
|
41
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
41
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FC`));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// Get account
|
|
@@ -61,7 +61,7 @@ export class CreateApiUserEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
61
61
|
const rateLimits = request.body.meta.rateLimits;
|
|
62
62
|
if (rateLimits) {
|
|
63
63
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
64
|
-
throw Context.auth.error($t('
|
|
64
|
+
throw Context.auth.error($t('%FD'));
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
admin.meta = admin.meta ?? UserMeta.create({});
|
|
@@ -41,7 +41,7 @@ export class DeleteUserEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
41
41
|
if (user.id == request.params.id) {
|
|
42
42
|
throw new SimpleError({
|
|
43
43
|
code: 'permission_denied',
|
|
44
|
-
message: $t(`
|
|
44
|
+
message: $t(`%FE`),
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ export class DeleteUserEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
49
49
|
if (!editUser || !Context.auth.checkScope(editUser.organizationId)) {
|
|
50
50
|
throw new SimpleError({
|
|
51
51
|
code: 'permission_denied',
|
|
52
|
-
message: $t(`
|
|
52
|
+
message: $t(`%FF`),
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -41,7 +41,7 @@ export class PatchApiUserEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
41
41
|
const editUser = request.body.id === user.id ? user : await User.getByID(request.body.id);
|
|
42
42
|
|
|
43
43
|
if (!editUser || !await Context.auth.canAccessUser(editUser, PermissionLevel.Write) || !editUser.isApiUser) {
|
|
44
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
44
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FG`));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
editUser.firstName = request.body.name ?? editUser.name;
|
|
@@ -96,7 +96,7 @@ export class PatchApiUserEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
96
96
|
const rateLimits = request.body.meta.rateLimits;
|
|
97
97
|
if (rateLimits && rateLimits !== editUser.meta?.rateLimits) {
|
|
98
98
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
99
|
-
throw Context.auth.error($t('
|
|
99
|
+
throw Context.auth.error($t('%FD'));
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
editUser.meta = editUser.meta ?? UserMeta.create({});
|
|
@@ -38,7 +38,7 @@ export class CreateWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
38
38
|
|
|
39
39
|
// Fast throw first (more in depth checking for patches later)
|
|
40
40
|
if (!await Context.auth.canCreateWebshops(organization.id)) {
|
|
41
|
-
throw Context.auth.error($t(`
|
|
41
|
+
throw Context.auth.error($t(`%FH`));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
const errors = new SimpleErrors();
|
|
@@ -141,7 +141,7 @@ export class CreateWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
141
141
|
throw new SimpleError({
|
|
142
142
|
code: 'failed_to_generate_unique_uri',
|
|
143
143
|
message: 'Failed to generate unique uri',
|
|
144
|
-
human: $t(`
|
|
144
|
+
human: $t(`%FI`),
|
|
145
145
|
statusCode: 500,
|
|
146
146
|
});
|
|
147
147
|
}
|
|
@@ -168,7 +168,7 @@ export class CreateWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
168
168
|
throw new SimpleError({
|
|
169
169
|
code: 'missing_permissions',
|
|
170
170
|
message: 'You cannot create a webshop without having full permissions on the created webshop',
|
|
171
|
-
human: $t(`
|
|
171
|
+
human: $t(`%FJ`),
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -211,7 +211,7 @@ export class CreateWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
211
211
|
throw new SimpleError({
|
|
212
212
|
code: 'failed_to_generate_unique_domainUri',
|
|
213
213
|
message: 'Failed to generate unique domainUri',
|
|
214
|
-
human: $t(`
|
|
214
|
+
human: $t(`%FI`),
|
|
215
215
|
statusCode: 500,
|
|
216
216
|
});
|
|
217
217
|
}
|
|
@@ -47,7 +47,7 @@ export class DeleteWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
47
47
|
throw new SimpleError({
|
|
48
48
|
code: 'webshop_has_registered_ticket_sales',
|
|
49
49
|
message: `Webshop ${webshop.id} has registered ticket sales`,
|
|
50
|
-
human: $t(`
|
|
50
|
+
human: $t(`%1DL`),
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -66,7 +66,7 @@ export class PatchWebshopDiscountCodesEndpoint extends Endpoint<Params, Query, B
|
|
|
66
66
|
throw new SimpleError({
|
|
67
67
|
code: 'used_code',
|
|
68
68
|
message: 'Discount code already in use',
|
|
69
|
-
human: $t(`
|
|
69
|
+
human: $t(`%FK`) + ' ' + struct.code + $t(`%FL`),
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
throw e;
|
|
@@ -98,7 +98,7 @@ export class PatchWebshopDiscountCodesEndpoint extends Endpoint<Params, Query, B
|
|
|
98
98
|
throw new SimpleError({
|
|
99
99
|
code: 'used_code',
|
|
100
100
|
message: 'Discount code already in use',
|
|
101
|
-
human: $t(`
|
|
101
|
+
human: $t(`%FK`) + ' ' + model.code + $t(`%FL`),
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
throw e;
|
|
@@ -53,7 +53,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
53
53
|
if (request.body.meta) {
|
|
54
54
|
request.body.meta.domainActive = undefined;
|
|
55
55
|
if (request.body.meta.customCode !== undefined && !await Context.auth.hasFullAccess(organization.id)) {
|
|
56
|
-
throw Context.auth.error($t('
|
|
56
|
+
throw Context.auth.error($t('%15n'));
|
|
57
57
|
}
|
|
58
58
|
webshop.meta.patchOrPut(request.body.meta);
|
|
59
59
|
}
|
|
@@ -94,7 +94,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
94
94
|
throw new SimpleError({
|
|
95
95
|
code: 'domain_already_used',
|
|
96
96
|
message: 'This domain is already used by another organization',
|
|
97
|
-
human: $t(`
|
|
97
|
+
human: $t(`%FM`),
|
|
98
98
|
statusCode: 400,
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -110,7 +110,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
110
110
|
throw new SimpleError({
|
|
111
111
|
code: 'invalid_field',
|
|
112
112
|
message: 'Invalid domain',
|
|
113
|
-
human: $t(`
|
|
113
|
+
human: $t(`%FN`),
|
|
114
114
|
field: 'customUrl',
|
|
115
115
|
});
|
|
116
116
|
}
|
|
@@ -131,7 +131,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
131
131
|
throw new SimpleError({
|
|
132
132
|
code: 'invalid_field',
|
|
133
133
|
message: 'domainUri contains invalid characters',
|
|
134
|
-
human: $t(`
|
|
134
|
+
human: $t(`%FO`),
|
|
135
135
|
field: 'customUrl',
|
|
136
136
|
});
|
|
137
137
|
}
|
|
@@ -142,7 +142,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
142
142
|
throw new SimpleError({
|
|
143
143
|
code: 'invalid_domain',
|
|
144
144
|
message: 'This domain is already in use',
|
|
145
|
-
human: $t(`
|
|
145
|
+
human: $t(`%FP`) + ' ' + existing.meta.name + $t(`%FQ`),
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -162,7 +162,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
162
162
|
throw new SimpleError({
|
|
163
163
|
code: 'invalid_field',
|
|
164
164
|
message: 'Uri cannot be empty',
|
|
165
|
-
human: $t(`
|
|
165
|
+
human: $t(`%FR`),
|
|
166
166
|
field: 'uri',
|
|
167
167
|
});
|
|
168
168
|
}
|
|
@@ -171,7 +171,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
171
171
|
throw new SimpleError({
|
|
172
172
|
code: 'invalid_field',
|
|
173
173
|
message: 'Uri contains invalid characters',
|
|
174
|
-
human: $t(`
|
|
174
|
+
human: $t(`%FO`),
|
|
175
175
|
field: 'uri',
|
|
176
176
|
});
|
|
177
177
|
}
|
|
@@ -184,7 +184,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
184
184
|
throw new SimpleError({
|
|
185
185
|
code: 'missing_permissions',
|
|
186
186
|
message: 'You cannot restrict your own permissions',
|
|
187
|
-
human: $t(`
|
|
187
|
+
human: $t(`%FS`),
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
|
|
@@ -197,7 +197,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
197
197
|
throw new SimpleError({
|
|
198
198
|
code: 'invalid_field',
|
|
199
199
|
message: 'Uri already in use',
|
|
200
|
-
human: $t(`
|
|
200
|
+
human: $t(`%FT`),
|
|
201
201
|
field: 'uri',
|
|
202
202
|
});
|
|
203
203
|
}
|
|
@@ -42,7 +42,7 @@ export class PatchWebshopTicketsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
42
42
|
|
|
43
43
|
const webshop = await Webshop.getByID(request.params.id);
|
|
44
44
|
if (!webshop || !await Context.auth.canAccessWebshopTickets(webshop, PermissionLevel.Write)) {
|
|
45
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
45
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FU`));
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const tickets: Ticket[] = [];
|