@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
|
@@ -57,7 +57,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
57
57
|
throw new SimpleError({
|
|
58
58
|
code: 'not_supported',
|
|
59
59
|
message: 'This version is no longer supported',
|
|
60
|
-
human: $t(`
|
|
60
|
+
human: $t(`%vd`),
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
return [true, params as Params];
|
|
@@ -78,7 +78,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
78
78
|
throw new SimpleError({
|
|
79
79
|
code: 'forbidden',
|
|
80
80
|
message: 'No permission to register members manually',
|
|
81
|
-
human: $t(`
|
|
81
|
+
human: $t(`%ve`),
|
|
82
82
|
statusCode: 403,
|
|
83
83
|
});
|
|
84
84
|
}
|
|
@@ -93,7 +93,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
93
93
|
throw new SimpleError({
|
|
94
94
|
code: 'forbidden',
|
|
95
95
|
message: 'No permission to checkout as this organization for a different organization',
|
|
96
|
-
human: $t(`
|
|
96
|
+
human: $t(`%1HR`),
|
|
97
97
|
statusCode: 403,
|
|
98
98
|
});
|
|
99
99
|
}
|
|
@@ -118,7 +118,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
118
118
|
throw new SimpleError({
|
|
119
119
|
code: 'too_many_emails_period',
|
|
120
120
|
message: 'Too many e-mails limited',
|
|
121
|
-
human: $t(`
|
|
121
|
+
human: $t(`%vf`),
|
|
122
122
|
field: 'recipients',
|
|
123
123
|
});
|
|
124
124
|
}
|
|
@@ -139,7 +139,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
139
139
|
if (balanceItemsModels.length !== balanceItemIds.length) {
|
|
140
140
|
throw new SimpleError({
|
|
141
141
|
code: 'invalid_data',
|
|
142
|
-
message: $t(`
|
|
142
|
+
message: $t(`%vg`),
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
memberBalanceItemsStructs = balanceItemsModels.map(i => i.getStructure());
|
|
@@ -163,7 +163,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
163
163
|
if (group.organizationId !== organization.id) {
|
|
164
164
|
throw new SimpleError({
|
|
165
165
|
code: 'invalid_data',
|
|
166
|
-
message: $t(`
|
|
166
|
+
message: $t(`%vh`),
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
}
|
|
@@ -178,7 +178,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
178
178
|
throw new SimpleError({
|
|
179
179
|
code: 'forbidden',
|
|
180
180
|
message: 'No permission to register this member',
|
|
181
|
-
human: $t(`
|
|
181
|
+
human: $t(`%vi`),
|
|
182
182
|
statusCode: 403,
|
|
183
183
|
});
|
|
184
184
|
}
|
|
@@ -242,7 +242,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
242
242
|
throw new SimpleError({
|
|
243
243
|
code: 'forbidden',
|
|
244
244
|
message: 'No permission to register as this organization for a different organization',
|
|
245
|
-
human: $t(`
|
|
245
|
+
human: $t(`%ve`),
|
|
246
246
|
statusCode: 403,
|
|
247
247
|
});
|
|
248
248
|
}
|
|
@@ -278,7 +278,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
278
278
|
if (checkout.cart.isEmpty) {
|
|
279
279
|
throw new SimpleError({
|
|
280
280
|
code: 'empty_data',
|
|
281
|
-
message: $t(`
|
|
281
|
+
message: $t(`%vj`),
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
|
|
@@ -298,7 +298,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
298
298
|
// This never leaks information because in this case the user already has full access to the organization (asOrganizationId) or the member
|
|
299
299
|
throw new SimpleError({
|
|
300
300
|
code: 'changed_price',
|
|
301
|
-
message: $t(
|
|
301
|
+
message: $t(`%vk`, { total: Formatter.price(totalPrice) }),
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
}
|
|
@@ -318,7 +318,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
318
318
|
if (!member) {
|
|
319
319
|
throw new SimpleError({
|
|
320
320
|
code: 'invalid_member',
|
|
321
|
-
message: $t(`
|
|
321
|
+
message: $t(`%vm`),
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
|
|
@@ -326,7 +326,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
326
326
|
if (!group) {
|
|
327
327
|
throw new SimpleError({
|
|
328
328
|
code: 'invalid_member',
|
|
329
|
-
message: $t(`
|
|
329
|
+
message: $t(`%vn`),
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
332
|
|
|
@@ -336,7 +336,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
336
336
|
throw new SimpleError({
|
|
337
337
|
code: 'forbidden',
|
|
338
338
|
message: 'No permission to register in this group',
|
|
339
|
-
human: $t('
|
|
339
|
+
human: $t('%C9', { group: group.settings.name.toString() }),
|
|
340
340
|
statusCode: 403,
|
|
341
341
|
});
|
|
342
342
|
}
|
|
@@ -359,7 +359,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
359
359
|
if (existingRegistration.registeredAt !== null && existingRegistration.deactivatedAt === null) {
|
|
360
360
|
throw new SimpleError({
|
|
361
361
|
code: 'already_registered',
|
|
362
|
-
message: $t(
|
|
362
|
+
message: $t(`%vo`, { member: member.firstName, group: group.settings.name }),
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
}
|
|
@@ -469,7 +469,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
469
469
|
throw new SimpleError({
|
|
470
470
|
code: 'forbidden',
|
|
471
471
|
message: 'Permission denied: you are not allowed to delete registrations',
|
|
472
|
-
human: $t(`
|
|
472
|
+
human: $t(`%vr`),
|
|
473
473
|
statusCode: 403,
|
|
474
474
|
});
|
|
475
475
|
}
|
|
@@ -478,7 +478,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
478
478
|
if (!existingRegistration || existingRegistration.organizationId !== organization.id) {
|
|
479
479
|
throw new SimpleError({
|
|
480
480
|
code: 'invalid_data',
|
|
481
|
-
message: $t(`
|
|
481
|
+
message: $t(`%vs`),
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
|
|
@@ -486,7 +486,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
486
486
|
throw new SimpleError({
|
|
487
487
|
code: 'forbidden',
|
|
488
488
|
message: 'No permission to delete this registration',
|
|
489
|
-
human: $t(`
|
|
489
|
+
human: $t(`%vt`),
|
|
490
490
|
statusCode: 403,
|
|
491
491
|
});
|
|
492
492
|
}
|
|
@@ -495,7 +495,7 @@ export class RegisterMembersEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
495
495
|
throw new SimpleError({
|
|
496
496
|
code: 'invalid_data',
|
|
497
497
|
message: 'Cannot delete inactive registration',
|
|
498
|
-
human: $t(`
|
|
498
|
+
human: $t(`%vu`),
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
501
|
|
|
@@ -123,7 +123,7 @@ export class GetRegistrationPeriodsEndpoint extends Endpoint<Params, Query, Body
|
|
|
123
123
|
code: 'client_update_required',
|
|
124
124
|
statusCode: 400,
|
|
125
125
|
message: 'Er is een noodzakelijke update beschikbaar. Herlaad de pagina en wis indien nodig de cache van jouw browser.',
|
|
126
|
-
human: $t(`
|
|
126
|
+
human: $t(`%G8`),
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -42,7 +42,7 @@ export class PatchRegistrationPeriodsEndpoint extends Endpoint<Params, Query, Bo
|
|
|
42
42
|
throw new SimpleError({
|
|
43
43
|
code: 'only_platform',
|
|
44
44
|
message: 'Period id should only be used if userMode is platform',
|
|
45
|
-
human: $t(`
|
|
45
|
+
human: $t(`%1AD`),
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -80,7 +80,7 @@ export class PatchRegistrationPeriodsEndpoint extends Endpoint<Params, Query, Bo
|
|
|
80
80
|
if (put.endDate < put.startDate) {
|
|
81
81
|
throw new SimpleError({
|
|
82
82
|
code: 'invalid_field',
|
|
83
|
-
message: $t('
|
|
83
|
+
message: $t('%1Gv'),
|
|
84
84
|
field: 'endDate',
|
|
85
85
|
});
|
|
86
86
|
}
|
|
@@ -102,7 +102,7 @@ export class PatchRegistrationPeriodsEndpoint extends Endpoint<Params, Query, Bo
|
|
|
102
102
|
throw new SimpleError({
|
|
103
103
|
code: 'cannot_lock_current_period',
|
|
104
104
|
message: 'Current registration period cannot be locked',
|
|
105
|
-
human: $t(`
|
|
105
|
+
human: $t(`%EJ`),
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -131,7 +131,7 @@ export class PatchRegistrationPeriodsEndpoint extends Endpoint<Params, Query, Bo
|
|
|
131
131
|
throw new SimpleError({
|
|
132
132
|
code: 'cannot_lock_current_period',
|
|
133
133
|
message: 'Current registration period cannot be locked',
|
|
134
|
-
human: $t(`
|
|
134
|
+
human: $t(`%EJ`),
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -148,7 +148,7 @@ export class PatchRegistrationPeriodsEndpoint extends Endpoint<Params, Query, Bo
|
|
|
148
148
|
if ((patch.startDate || patch.endDate) && model.endDate < model.startDate) {
|
|
149
149
|
throw new SimpleError({
|
|
150
150
|
code: 'invalid_field',
|
|
151
|
-
message: $t('
|
|
151
|
+
message: $t('%1Gv'),
|
|
152
152
|
field: 'endDate',
|
|
153
153
|
});
|
|
154
154
|
}
|
|
@@ -99,7 +99,7 @@ export class GetBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
99
99
|
throw new SimpleError({
|
|
100
100
|
code: 'timeout',
|
|
101
101
|
message: 'Query took too long',
|
|
102
|
-
human: $t(`
|
|
102
|
+
human: $t(`%Cv`),
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
throw error;
|
|
@@ -74,13 +74,13 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
74
74
|
if (put.payingOrganizationId) {
|
|
75
75
|
// Not allowed if not full admin
|
|
76
76
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
77
|
-
throw Context.auth.error($t(`
|
|
77
|
+
throw Context.auth.error($t(`%Ef`));
|
|
78
78
|
}
|
|
79
79
|
if (put.payingOrganizationId === model.organizationId) {
|
|
80
80
|
throw new SimpleError({
|
|
81
81
|
code: 'invalid_field',
|
|
82
82
|
message: 'payingOrganizationId cannot be the same as organizationId',
|
|
83
|
-
human: $t(`
|
|
83
|
+
human: $t(`%Eg`),
|
|
84
84
|
field: 'payingOrganizationId',
|
|
85
85
|
});
|
|
86
86
|
}
|
|
@@ -92,7 +92,7 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
92
92
|
throw new SimpleError({
|
|
93
93
|
code: 'invalid_price',
|
|
94
94
|
message: 'Cannot create negative balance in the future',
|
|
95
|
-
human: $t(`
|
|
95
|
+
human: $t(`%Eh`),
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -100,7 +100,7 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
100
100
|
throw new SimpleError({
|
|
101
101
|
code: 'invalid_field',
|
|
102
102
|
message: 'createdAt cannot be in the future',
|
|
103
|
-
human: $t(`
|
|
103
|
+
human: $t(`%Ei`),
|
|
104
104
|
field: 'createdAt',
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -130,13 +130,13 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
130
130
|
if (patch.payingOrganizationId !== undefined) {
|
|
131
131
|
// Not allowed if not full admin
|
|
132
132
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
133
|
-
throw Context.auth.error($t(`
|
|
133
|
+
throw Context.auth.error($t(`%Ef`));
|
|
134
134
|
}
|
|
135
135
|
if (patch.payingOrganizationId === model.organizationId) {
|
|
136
136
|
throw new SimpleError({
|
|
137
137
|
code: 'invalid_field',
|
|
138
138
|
message: 'payingOrganizationId cannot be the same as organizationId',
|
|
139
|
-
human: $t(`
|
|
139
|
+
human: $t(`%Eg`),
|
|
140
140
|
field: 'payingOrganizationId',
|
|
141
141
|
});
|
|
142
142
|
}
|
|
@@ -158,7 +158,7 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
158
158
|
throw new SimpleError({
|
|
159
159
|
code: 'invalid_field',
|
|
160
160
|
message: 'No user or member provided',
|
|
161
|
-
human: $t(`
|
|
161
|
+
human: $t(`%Ej`),
|
|
162
162
|
field: 'memberId',
|
|
163
163
|
});
|
|
164
164
|
}
|
|
@@ -176,7 +176,7 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
176
176
|
throw new SimpleError({
|
|
177
177
|
code: 'invalid_field',
|
|
178
178
|
message: 'createdAt cannot be in the future',
|
|
179
|
-
human: $t(`
|
|
179
|
+
human: $t(`%Ei`),
|
|
180
180
|
field: 'createdAt',
|
|
181
181
|
});
|
|
182
182
|
}
|
|
@@ -194,7 +194,7 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
194
194
|
throw new SimpleError({
|
|
195
195
|
code: 'invalid_price',
|
|
196
196
|
message: 'Cannot create negative balance in the future',
|
|
197
|
-
human: $t(`
|
|
197
|
+
human: $t(`%Eh`),
|
|
198
198
|
field: 'dueAt',
|
|
199
199
|
});
|
|
200
200
|
}
|
|
@@ -248,7 +248,7 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
248
248
|
throw new SimpleError({
|
|
249
249
|
code: 'permission_denied',
|
|
250
250
|
message: 'No permission to link balance items to this member',
|
|
251
|
-
human: $t(`
|
|
251
|
+
human: $t(`%Ek`),
|
|
252
252
|
field: 'memberId',
|
|
253
253
|
});
|
|
254
254
|
}
|
|
@@ -262,7 +262,7 @@ export class PatchBalanceItemsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
262
262
|
throw new SimpleError({
|
|
263
263
|
code: 'permission_denied',
|
|
264
264
|
message: 'No permission to link balance items to this user',
|
|
265
|
-
human: $t(`
|
|
265
|
+
human: $t(`%El`),
|
|
266
266
|
field: 'userId',
|
|
267
267
|
});
|
|
268
268
|
}
|
|
@@ -37,7 +37,7 @@ export class GetDocumentTemplateXMLEndpoint extends Endpoint<Params, Query, Body
|
|
|
37
37
|
|
|
38
38
|
const template = await DocumentTemplate.getByID(request.params.id);
|
|
39
39
|
if (!template || !await Context.auth.canAccessDocumentTemplate(template)) {
|
|
40
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
40
|
+
throw Context.auth.notFoundOrNoAccess($t(`%EK`));
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Update documents
|
|
@@ -40,7 +40,7 @@ export class PatchDocumentEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
40
40
|
for (const patch of request.body.getPatches()) {
|
|
41
41
|
const document = await Document.getByID(patch.id);
|
|
42
42
|
if (!document || !(await Context.auth.canAccessDocument(document, PermissionLevel.Write))) {
|
|
43
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
43
|
+
throw Context.auth.notFoundOrNoAccess($t(`%EK`));
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (patch.data) {
|
|
@@ -57,7 +57,7 @@ export class PatchDocumentEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
57
57
|
throw new SimpleError({
|
|
58
58
|
code: 'not_found',
|
|
59
59
|
message: 'Document not found',
|
|
60
|
-
human: $t(`
|
|
60
|
+
human: $t(`%EL`),
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -78,7 +78,7 @@ export class PatchDocumentEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
78
78
|
throw new SimpleError({
|
|
79
79
|
code: 'not_found',
|
|
80
80
|
message: 'Document template not found',
|
|
81
|
-
human: $t(`
|
|
81
|
+
human: $t(`%EM`),
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
const document = new Document();
|
|
@@ -97,7 +97,7 @@ export class PatchDocumentEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
97
97
|
throw new SimpleError({
|
|
98
98
|
code: 'not_found',
|
|
99
99
|
message: 'Registration not found',
|
|
100
|
-
human: $t(`
|
|
100
|
+
human: $t(`%EN`),
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
document.registrationId = put.registrationId;
|
|
@@ -109,7 +109,7 @@ export class PatchDocumentEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
109
109
|
throw new SimpleError({
|
|
110
110
|
code: 'not_found',
|
|
111
111
|
message: 'Member not found',
|
|
112
|
-
human: $t(`
|
|
112
|
+
human: $t(`%EO`),
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
document.memberId = put.memberId;
|
|
@@ -67,7 +67,7 @@ export class PatchDocumentTemplatesEndpoint extends Endpoint<Params, Query, Body
|
|
|
67
67
|
for (const patch of request.body.getPatches()) {
|
|
68
68
|
const template = await DocumentTemplate.getByID(patch.id);
|
|
69
69
|
if (!template || !await Context.auth.canAccessDocumentTemplate(template, PermissionLevel.Full)) {
|
|
70
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
70
|
+
throw Context.auth.notFoundOrNoAccess($t(`%EP`));
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
let shouldCheckIfAlreadyHasFiscalDocument = false;
|
|
@@ -124,7 +124,7 @@ export class PatchDocumentTemplatesEndpoint extends Endpoint<Params, Query, Body
|
|
|
124
124
|
throw new SimpleError({
|
|
125
125
|
code: 'not_found',
|
|
126
126
|
message: 'Template not found',
|
|
127
|
-
human: $t(`
|
|
127
|
+
human: $t(`%EQ`),
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -158,7 +158,7 @@ export class PatchDocumentTemplatesEndpoint extends Endpoint<Params, Query, Body
|
|
|
158
158
|
code: 'double_fiscal_document',
|
|
159
159
|
field: 'year',
|
|
160
160
|
message: 'This year already has a fiscal document',
|
|
161
|
-
human: $t('
|
|
161
|
+
human: $t('%1IS'),
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -42,7 +42,7 @@ export class CheckEmailBouncesEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
42
42
|
throw new SimpleError({
|
|
43
43
|
code: 'too_many_recipients',
|
|
44
44
|
message: 'Too many recipients',
|
|
45
|
-
human: $t(`
|
|
45
|
+
human: $t(`%ER`),
|
|
46
46
|
field: 'recipients',
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -43,7 +43,7 @@ export class PatchEmailTemplatesEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
43
43
|
for (const patch of request.body.getPatches()) {
|
|
44
44
|
const template = await EmailTemplate.getByID(patch.id);
|
|
45
45
|
if (!template || !(await Context.auth.canAccessEmailTemplate(template, PermissionLevel.Write))) {
|
|
46
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
46
|
+
throw Context.auth.notFoundOrNoAccess($t(`%ES`));
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
template.html = patch.html ?? template.html;
|
|
@@ -98,7 +98,7 @@ export class PatchEmailTemplatesEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
98
98
|
|
|
99
99
|
// Check if valid + write permissions
|
|
100
100
|
if (!(await Context.auth.canAccessEmailTemplate(template, PermissionLevel.Write))) {
|
|
101
|
-
throw Context.auth.error($t(`
|
|
101
|
+
throw Context.auth.error($t(`%ET`));
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
await template.save();
|
|
@@ -109,7 +109,7 @@ export class PatchEmailTemplatesEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
109
109
|
for (const id of request.body.getDeletes()) {
|
|
110
110
|
const template = await EmailTemplate.getByID(id);
|
|
111
111
|
if (!template || !(await Context.auth.canAccessEmailTemplate(template, PermissionLevel.Write))) {
|
|
112
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
112
|
+
throw Context.auth.notFoundOrNoAccess($t(`%EU`));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
await template.delete();
|
|
@@ -158,7 +158,7 @@ export class GetInvoicesEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
158
158
|
throw new SimpleError({
|
|
159
159
|
code: 'timeout',
|
|
160
160
|
message: 'Query took too long',
|
|
161
|
-
human: $t(`
|
|
161
|
+
human: $t(`%Cv`),
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
throw error;
|
|
@@ -51,7 +51,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
51
51
|
throw new SimpleError({
|
|
52
52
|
code: 'permission_denied',
|
|
53
53
|
message: 'You do not have permissions to edit an inactive organization',
|
|
54
|
-
human: $t(`
|
|
54
|
+
human: $t(`%EV`),
|
|
55
55
|
statusCode: 403,
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -77,7 +77,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
77
77
|
code: 'invalid_field',
|
|
78
78
|
message: 'Name is too short',
|
|
79
79
|
field: 'name',
|
|
80
|
-
human: $t('
|
|
80
|
+
human: $t('%1L7'),
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
organization.name = request.body.name ?? organization.name;
|
|
@@ -97,7 +97,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
97
97
|
throw new SimpleError({
|
|
98
98
|
code: 'invalid_field',
|
|
99
99
|
message: 'Field is too long',
|
|
100
|
-
human: $t(`
|
|
100
|
+
human: $t(`%EW`),
|
|
101
101
|
field: 'uri',
|
|
102
102
|
});
|
|
103
103
|
}
|
|
@@ -106,7 +106,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
106
106
|
throw new SimpleError({
|
|
107
107
|
code: 'invalid_field',
|
|
108
108
|
message: 'Field is too short',
|
|
109
|
-
human: $t(`
|
|
109
|
+
human: $t(`%EX`),
|
|
110
110
|
field: 'uri',
|
|
111
111
|
});
|
|
112
112
|
}
|
|
@@ -116,7 +116,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
116
116
|
throw new SimpleError({
|
|
117
117
|
code: 'name_taken',
|
|
118
118
|
message: 'An organization with the same URI already exists',
|
|
119
|
-
human: $t(`
|
|
119
|
+
human: $t(`%EY`),
|
|
120
120
|
field: 'uri',
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -329,7 +329,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
329
329
|
throw new SimpleError({
|
|
330
330
|
code: 'invalid_field',
|
|
331
331
|
message: 'You cannot set the uitpasClientCredentialsStatus manually',
|
|
332
|
-
human: $t('
|
|
332
|
+
human: $t('%1BB'),
|
|
333
333
|
});
|
|
334
334
|
}
|
|
335
335
|
|
|
@@ -357,7 +357,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
357
357
|
|
|
358
358
|
if (request.body.active !== undefined) {
|
|
359
359
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
360
|
-
throw Context.auth.error($t(`
|
|
360
|
+
throw Context.auth.error($t(`%EZ`));
|
|
361
361
|
}
|
|
362
362
|
organization.active = request.body.active;
|
|
363
363
|
}
|
|
@@ -373,7 +373,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
373
373
|
throw new SimpleError({
|
|
374
374
|
code: 'name_taken',
|
|
375
375
|
message: 'An organization with the same name already exists',
|
|
376
|
-
human: $t(`
|
|
376
|
+
human: $t(`%D2`),
|
|
377
377
|
field: 'name',
|
|
378
378
|
});
|
|
379
379
|
}
|
|
@@ -387,7 +387,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
387
387
|
throw new SimpleError({
|
|
388
388
|
code: 'invalid_field',
|
|
389
389
|
message: 'The period you want to set does not exist (anymore)',
|
|
390
|
-
human: $t('
|
|
390
|
+
human: $t('%15h'),
|
|
391
391
|
field: 'period',
|
|
392
392
|
});
|
|
393
393
|
}
|
|
@@ -398,7 +398,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
398
398
|
throw new SimpleError({
|
|
399
399
|
code: 'invalid_field',
|
|
400
400
|
message: 'The period you want to set does not exist (anymore)',
|
|
401
|
-
human: $t('
|
|
401
|
+
human: $t('%15h'),
|
|
402
402
|
field: 'period',
|
|
403
403
|
});
|
|
404
404
|
}
|
|
@@ -408,7 +408,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
408
408
|
throw new SimpleError({
|
|
409
409
|
code: 'invalid_field',
|
|
410
410
|
message: 'The period has no organization id',
|
|
411
|
-
human: $t('
|
|
411
|
+
human: $t('%1Gw'),
|
|
412
412
|
field: 'period',
|
|
413
413
|
});
|
|
414
414
|
}
|
|
@@ -417,7 +417,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
417
417
|
throw new SimpleError({
|
|
418
418
|
code: 'invalid_field',
|
|
419
419
|
message: 'The period you want to set is already closed',
|
|
420
|
-
human: $t('
|
|
420
|
+
human: $t('%15i'),
|
|
421
421
|
field: 'period',
|
|
422
422
|
});
|
|
423
423
|
}
|
|
@@ -427,7 +427,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
427
427
|
throw new SimpleError({
|
|
428
428
|
code: 'invalid_field',
|
|
429
429
|
message: 'The period you want to set has not started yet',
|
|
430
|
-
human: $t('
|
|
430
|
+
human: $t('%15k'),
|
|
431
431
|
field: 'period',
|
|
432
432
|
});
|
|
433
433
|
}
|
|
@@ -580,7 +580,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
580
580
|
|
|
581
581
|
if (!model || !await Context.auth.canAccessWebshop(model, PermissionLevel.Full)) {
|
|
582
582
|
errors.addError(
|
|
583
|
-
Context.auth.error($t(`
|
|
583
|
+
Context.auth.error($t(`%Ea`)),
|
|
584
584
|
);
|
|
585
585
|
continue;
|
|
586
586
|
}
|
|
@@ -636,7 +636,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
636
636
|
throw new SimpleError({
|
|
637
637
|
code: 'invalid_field',
|
|
638
638
|
message: 'Too many companies',
|
|
639
|
-
human: $t(`
|
|
639
|
+
human: $t(`%Eb`),
|
|
640
640
|
field: 'companies',
|
|
641
641
|
});
|
|
642
642
|
}
|
|
@@ -649,7 +649,7 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
649
649
|
throw new SimpleError({
|
|
650
650
|
code: 'invalid_field',
|
|
651
651
|
message: 'Too many companies',
|
|
652
|
-
human: $t(`
|
|
652
|
+
human: $t(`%Eb`),
|
|
653
653
|
field: 'companies',
|
|
654
654
|
});
|
|
655
655
|
}
|
|
@@ -56,7 +56,7 @@ export class SetOrganizationDomainEndpoint extends Endpoint<Params, Query, Body,
|
|
|
56
56
|
throw new SimpleError({
|
|
57
57
|
code: 'invalid_domain',
|
|
58
58
|
message: 'registerDomain is invalid',
|
|
59
|
-
human: $t(`
|
|
59
|
+
human: $t(`%Ec`),
|
|
60
60
|
field: 'registerDomain',
|
|
61
61
|
});
|
|
62
62
|
}
|
|
@@ -65,7 +65,7 @@ export class SetOrganizationDomainEndpoint extends Endpoint<Params, Query, Body,
|
|
|
65
65
|
throw new SimpleError({
|
|
66
66
|
code: 'invalid_domain',
|
|
67
67
|
message: 'mailDomain is invalid',
|
|
68
|
-
human: $t(`
|
|
68
|
+
human: $t(`%Ed`),
|
|
69
69
|
field: 'mailDomain',
|
|
70
70
|
});
|
|
71
71
|
}
|
|
@@ -165,7 +165,7 @@ export class SetOrganizationDomainEndpoint extends Endpoint<Params, Query, Body,
|
|
|
165
165
|
type: DNSRecordType.TXT,
|
|
166
166
|
name: '_dmarc.' + organization.privateMeta.pendingMailDomain + '.',
|
|
167
167
|
value: 'v=DMARC1; p=quarantine; pct=100; sp=quarantine; aspf=r; adkim=r;',
|
|
168
|
-
description: $t(`
|
|
168
|
+
description: $t(`%Ee`),
|
|
169
169
|
optional: true,
|
|
170
170
|
}));
|
|
171
171
|
}
|