@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.
Files changed (129) hide show
  1. package/package.json +10 -10
  2. package/src/audit-logs/OrderLogger.ts +1 -1
  3. package/src/email-replacements/getEmailReplacementsForPayment.ts +6 -6
  4. package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +4 -4
  5. package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +1 -1
  6. package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +1 -1
  7. package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +1 -1
  8. package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +8 -8
  9. package/src/endpoints/admin/registrations/ChargeRegistrationsEndpoint.ts +1 -1
  10. package/src/endpoints/auth/CreateAdminEndpoint.ts +3 -3
  11. package/src/endpoints/auth/CreateTokenEndpoint.ts +10 -10
  12. package/src/endpoints/auth/ForgotPasswordEndpoint.ts +2 -2
  13. package/src/endpoints/auth/PatchUserEndpoint.ts +9 -9
  14. package/src/endpoints/auth/SignupEndpoint.ts +2 -2
  15. package/src/endpoints/auth/VerifyEmailEndpoint.ts +3 -3
  16. package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +1 -1
  17. package/src/endpoints/global/billing/ActivatePackagesEndpoint.ts +3 -3
  18. package/src/endpoints/global/billing/DeactivatePackageEndpoint.ts +2 -2
  19. package/src/endpoints/global/email/CreateEmailEndpoint.ts +4 -4
  20. package/src/endpoints/global/email/GetEmailAddressEndpoint.ts +2 -2
  21. package/src/endpoints/global/email/GetEmailEndpoint.ts +1 -1
  22. package/src/endpoints/global/email/GetUserEmailsEndpoint.test.ts +1 -1
  23. package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +3 -3
  24. package/src/endpoints/global/email/PatchEmailEndpoint.test.ts +1 -1
  25. package/src/endpoints/global/email/PatchEmailEndpoint.ts +8 -8
  26. package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.ts +1 -1
  27. package/src/endpoints/global/email-recipients/RetryEmailRecipientEndpoint.ts +3 -3
  28. package/src/endpoints/global/email-recipients/helpers/validateEmailRecipientFilter.ts +2 -2
  29. package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +1 -1
  30. package/src/endpoints/global/events/PatchEventNotificationsEndpoint.ts +13 -13
  31. package/src/endpoints/global/events/PatchEventsEndpoint.ts +24 -24
  32. package/src/endpoints/global/files/ExportToExcelEndpoint.ts +1 -1
  33. package/src/endpoints/global/files/UploadFile.ts +1 -1
  34. package/src/endpoints/global/groups/GetGroupsEndpoint.ts +1 -1
  35. package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +2 -2
  36. package/src/endpoints/global/members/GetMembersEndpoint.ts +2 -2
  37. package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +52 -52
  38. package/src/endpoints/global/members/helpers/validateGroupFilter.ts +2 -2
  39. package/src/endpoints/global/organizations/CheckRegisterCodeEndpoint.ts +1 -1
  40. package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +5 -5
  41. package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +1 -1
  42. package/src/endpoints/global/registration/GetRegistrationsEndpoint.ts +2 -2
  43. package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +4 -4
  44. package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +18 -18
  45. package/src/endpoints/global/registration-periods/GetRegistrationPeriodsEndpoint.ts +1 -1
  46. package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +5 -5
  47. package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemEndpoint.ts +1 -1
  48. package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsEndpoint.ts +1 -1
  49. package/src/endpoints/organization/dashboard/balance-items/PatchBalanceItemsEndpoint.ts +11 -11
  50. package/src/endpoints/organization/dashboard/documents/GetDocumentTemplateXML.ts +1 -1
  51. package/src/endpoints/organization/dashboard/documents/PatchDocumentEndpoint.ts +5 -5
  52. package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.ts +3 -3
  53. package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +1 -1
  54. package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.ts +3 -3
  55. package/src/endpoints/organization/dashboard/invoices/GetInvoicesEndpoint.ts +1 -1
  56. package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +16 -16
  57. package/src/endpoints/organization/dashboard/organization/SetOrganizationDomainEndpoint.ts +3 -3
  58. package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts +5 -5
  59. package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +1 -1
  60. package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +13 -13
  61. package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.ts +1 -1
  62. package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +26 -26
  63. package/src/endpoints/organization/dashboard/stripe/DeleteStripeAccountEndpoint.ts +1 -1
  64. package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +1 -1
  65. package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +1 -1
  66. package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +1 -1
  67. package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +1 -1
  68. package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +2 -2
  69. package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.ts +2 -2
  70. package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +4 -4
  71. package/src/endpoints/organization/dashboard/webshops/DeleteWebshopEndpoint.ts +1 -1
  72. package/src/endpoints/organization/dashboard/webshops/PatchDiscountCodesEndpoint.ts +2 -2
  73. package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +9 -9
  74. package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +1 -1
  75. package/src/endpoints/organization/dashboard/webshops/SearchUitpasEventsEndpoint.ts +1 -1
  76. package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +1 -1
  77. package/src/endpoints/organization/shared/GetDocumentHtml.ts +2 -2
  78. package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +1 -1
  79. package/src/endpoints/organization/webshops/CheckWebshopDiscountCodesEndpoint.ts +1 -1
  80. package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +2 -2
  81. package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +1 -1
  82. package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +3 -3
  83. package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +1 -1
  84. package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +8 -8
  85. package/src/endpoints/organization/webshops/RetrieveUitpasSocialTariffPriceEndpoint.ts +2 -2
  86. package/src/excel-loaders/balance-items.ts +15 -15
  87. package/src/excel-loaders/event-notifications.ts +11 -11
  88. package/src/excel-loaders/members.ts +41 -41
  89. package/src/excel-loaders/organizations.ts +23 -23
  90. package/src/excel-loaders/payments.ts +40 -40
  91. package/src/excel-loaders/receivable-balances.ts +21 -21
  92. package/src/excel-loaders/registrations.ts +26 -26
  93. package/src/helpers/AddressValidator.ts +6 -6
  94. package/src/helpers/AdminPermissionChecker.ts +4 -4
  95. package/src/helpers/AuthenticatedStructures.ts +9 -9
  96. package/src/helpers/BuckarooHelper.ts +1 -1
  97. package/src/helpers/Context.ts +4 -4
  98. package/src/helpers/FileCache.ts +7 -7
  99. package/src/helpers/ForwardHandler.ts +1 -1
  100. package/src/helpers/MembershipCharger.ts +2 -2
  101. package/src/helpers/SetupStepUpdater.ts +1 -1
  102. package/src/helpers/StripeHelper.ts +6 -6
  103. package/src/helpers/UitpasTokenRepository.ts +7 -7
  104. package/src/helpers/ViesHelper.ts +1 -1
  105. package/src/helpers/XlsxTransformerColumnHelper.ts +17 -17
  106. package/src/helpers/email-html-helpers.ts +10 -10
  107. package/src/helpers/updateMemberDetailsUitpasNumber.ts +1 -1
  108. package/src/seeds/1752848561-groups-registration-periods.ts +1 -1
  109. package/src/seeds/1755790070-fill-email-recipient-errors.ts +6 -6
  110. package/src/services/EventNotificationService.ts +3 -3
  111. package/src/services/FileSignService.ts +1 -1
  112. package/src/services/InvoiceService.ts +3 -3
  113. package/src/services/MemberNumberService.ts +3 -3
  114. package/src/services/PaymentService.ts +23 -23
  115. package/src/services/SSOService.ts +5 -5
  116. package/src/services/STPackageService.ts +2 -2
  117. package/src/services/uitpas/PassholderEndpoints.ts +2 -2
  118. package/src/services/uitpas/UitpasService.ts +5 -5
  119. package/src/services/uitpas/cancelTicketSales.ts +1 -1
  120. package/src/services/uitpas/checkPermissionsFor.ts +9 -9
  121. package/src/services/uitpas/getSocialTariffForEvent.ts +4 -4
  122. package/src/services/uitpas/getSocialTariffForUitpasNumbers.ts +5 -5
  123. package/src/services/uitpas/handleUitpasResponse.ts +1 -1
  124. package/src/services/uitpas/registerTicketSales.ts +4 -4
  125. package/src/services/uitpas/searchUitpasEvents.ts +3 -3
  126. package/src/services/uitpas/searchUitpasOrganizers.ts +3 -3
  127. package/src/sql-filters/base-registration-filter-compilers.ts +2 -2
  128. package/src/sql-filters/members.ts +6 -6
  129. 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.118.1",
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.118.1",
59
- "@stamhoofd/backend-middleware": "2.118.1",
60
- "@stamhoofd/email": "2.118.1",
61
- "@stamhoofd/models": "2.118.1",
62
- "@stamhoofd/queues": "2.118.1",
63
- "@stamhoofd/sql": "2.118.1",
64
- "@stamhoofd/structures": "2.118.1",
65
- "@stamhoofd/utility": "2.118.1",
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": "7461e7ca17f68233be8a8acf1943f2d7882244fd"
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(`4597a3f5-6a6a-44a3-85da-5240ab08447a`),
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('80c86ad4-5ca1-481a-a408-db018a81f25e', {
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('8bb27033-cf3c-4af1-a3f4-3373734ab189', {
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(`6a156458-b396-4d0f-b562-adb3e38fc51b`) + ' ');
256
- overviewContext.add($t(`01d5fd7e-2960-4eb4-ab3a-2ac6dcb2e39c`) + ' ' + memberNames);
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('7462f89e-db05-452f-804f-b9f2d51bff0d', { count: payment.balanceItemPayments.length });
276
+ return $t('%1Kx', { count: payment.balanceItemPayments.length });
277
277
  }
278
278
 
279
279
  // else return default text for single item
280
- return $t('fe349d88-fecf-4cd8-8ea4-9e3b13cfa0dc');
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(`2449fba5-99dc-496f-a9d6-a67263d56616`),
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(`1e165aac-8a58-45c5-bdd8-c58131a7b7f5`),
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(`0bdf4953-1eae-41fd-b142-5ad3287f17a7`),
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(`d2b84fdd-035b-4307-a897-000081aa814f`),
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(`d2b84fdd-035b-4307-a897-000081aa814f`),
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(`d2b84fdd-035b-4307-a897-000081aa814f`),
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(`dce51638-6129-448b-8a15-e6d778f3a76a`),
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(`d01932d9-e958-4b29-98f2-cc5ff6be29d3`));
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(`a1f57ce7-a96a-4c8d-b43f-79a07a78114f`),
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(`83826ae8-fd89-46c2-ad3f-8f77aadd65b2`));
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(`3f37782a-c07f-457d-994f-f1cc075cff44`),
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(`0e82abec-5467-45d8-ba89-9b9fd10c085d`),
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(`c4d225ea-8e41-4829-bf0c-bc04755492de`),
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(`6e675a7d-b124-4507-bf0c-9b70013e98ca`),
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(`19e5262f-9dc1-40d9-b905-bda8462b6046`),
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(`d2b84fdd-035b-4307-a897-000081aa814f`),
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(`f298a54a-ee0f-462c-a80a-8d8c967dfda3`),
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('a5c0dce2-01df-4a57-8d02-0b79cec9b89d', { name, platform: platformName }) : platformName;
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(`afc47996-7028-43ad-b7d0-8b5bb2979883`),
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(`f40ddd3d-a986-4ec1-9db8-32ec1376c4e8`),
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(`4af15b54-0bbb-4112-adf2-26dd14e8675a`),
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(`ca4ca221-2ce9-4472-b8c7-1a5b2e2fdfa9`),
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(`ef53eb8d-b0ba-4e84-b0e3-1865729aeaa8`),
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(`0da8cd34-d33e-4b54-94f2-531919f3cae1`),
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(`f40ddd3d-a986-4ec1-9db8-32ec1376c4e8`),
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(`dc03dd54-96e9-42b8-811b-3f8cf2b8534f`),
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(`dc03dd54-96e9-42b8-811b-3f8cf2b8534f`),
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(`dc03dd54-96e9-42b8-811b-3f8cf2b8534f`),
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(`b75bc5af-7711-4905-a324-3dca313bbfc2`),
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(`4af15b54-0bbb-4112-adf2-26dd14e8675a`),
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(`52bddf7d-e494-4bdf-9b75-b5e9f9bcb427`),
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(`75c10aef-cdce-4171-b1a1-59dfdec5087c`));
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(`75bf8ddd-48f3-44b6-bd57-0b9838c322d9`),
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(`e0dcbc2f-0881-409b-bb1e-6a19d0a2081c`),
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(`e0dcbc2f-0881-409b-bb1e-6a19d0a2081c`),
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(`15e37a03-07ec-4299-8b9e-d54b7142a045`),
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(`4af15b54-0bbb-4112-adf2-26dd14e8675a`),
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(`52bddf7d-e494-4bdf-9b75-b5e9f9bcb427`),
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(`e4b9b541-a029-47e7-97ca-4aa1bfa2137e`),
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(`2a53e6f7-a6eb-4adf-a218-f28de686d188`) : $t(`919a83c6-c128-4d1c-bd5d-edb8c0106454`) + ' ' + request.body.email + ' ' + $t(`779c7d08-6db2-400c-95f8-af0f327109f8`),
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(`4af15b54-0bbb-4112-adf2-26dd14e8675a`),
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(`44e0c667-07c5-4ff9-8bf2-623d9aa91219`),
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(`6dfd3a88-1de2-4462-b2a4-625026f9a62f`),
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(`6dfd3a88-1de2-4462-b2a4-625026f9a62f`),
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(`3073cc35-f434-4c2c-8347-34db10fc9940`, { email: code.email, contactEmail: request.$t('59b85264-c4c3-4cf6-8923-9b43282b2787') }),
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(`540b9c7e-635f-48b7-a661-cd0700b3c602`),
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(`0ab71307-8f4f-4701-b120-b552a1b6bdd0`),
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('0e5baf7f-89be-4665-a3dd-b1603b5a6627'),
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('c5cf0531-9751-4be0-be0c-31ccfac1722d'),
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('c6adb3c8-c494-4f2a-8287-6bcac853a88a'),
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('242cee92-c0ea-4736-a8c8-6d82c8faf342'),
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('f7b7ac75-f7df-49cc-8961-b2478d9683e3'),
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('1b509614-30b0-484c-af72-57d4bc9ea788'),
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(`94adb4e0-2ef1-4ee8-9f02-5a76efa51c1d`),
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('1b509614-30b0-484c-af72-57d4bc9ea788'),
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(`ceacb5a8-7777-4366-abcb-9dd90ffb832e`),
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(`9ddb6616-f62d-4c91-82a9-e5cf398e4c4a`),
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(`9ddb6616-f62d-4c91-82a9-e5cf398e4c4a`),
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('4c4f6571-f7b5-469d-a16f-b1547b43a610') + '</p>');
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 () => {