@stamhoofd/backend 2.82.0 → 2.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/package.json +10 -10
  2. package/src/audit-logs/GroupLogger.ts +3 -3
  3. package/src/audit-logs/MemberResponsibilityRecordLogger.ts +1 -1
  4. package/src/audit-logs/OrderLogger.ts +1 -1
  5. package/src/audit-logs/RegistrationLogger.ts +1 -1
  6. package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +4 -4
  7. package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +1 -1
  8. package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +5 -5
  9. package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +1 -1
  10. package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +8 -8
  11. package/src/endpoints/auth/CreateAdminEndpoint.ts +2 -2
  12. package/src/endpoints/auth/CreateTokenEndpoint.ts +10 -10
  13. package/src/endpoints/auth/ForgotPasswordEndpoint.ts +2 -2
  14. package/src/endpoints/auth/PatchUserEndpoint.ts +9 -9
  15. package/src/endpoints/auth/SignupEndpoint.ts +2 -2
  16. package/src/endpoints/auth/VerifyEmailEndpoint.ts +3 -3
  17. package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +1 -1
  18. package/src/endpoints/global/email/GetEmailAddressEndpoint.ts +1 -1
  19. package/src/endpoints/global/email/GetEmailEndpoint.ts +1 -1
  20. package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +1 -1
  21. package/src/endpoints/global/email/PatchEmailEndpoint.ts +4 -4
  22. package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +1 -1
  23. package/src/endpoints/global/events/PatchEventNotificationsEndpoint.ts +1 -1
  24. package/src/endpoints/global/events/PatchEventsEndpoint.ts +22 -16
  25. package/src/endpoints/global/files/ExportToExcelEndpoint.ts +1 -1
  26. package/src/endpoints/global/files/UploadFile.ts +14 -2
  27. package/src/endpoints/global/files/UploadImage.ts +2 -2
  28. package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +2 -2
  29. package/src/endpoints/global/members/GetMembersEndpoint.ts +1 -1
  30. package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.test.ts +11 -11
  31. package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +34 -34
  32. package/src/endpoints/global/organizations/CheckRegisterCodeEndpoint.ts +1 -1
  33. package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +5 -5
  34. package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +1 -1
  35. package/src/endpoints/global/registration/GetPaymentRegistrations.ts +2 -2
  36. package/src/endpoints/global/registration/PatchUserMembersEndpoint.test.ts +10 -10
  37. package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +4 -4
  38. package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +37 -37
  39. package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +2 -2
  40. package/src/endpoints/organization/dashboard/documents/GetDocumentTemplateXML.ts +1 -1
  41. package/src/endpoints/organization/dashboard/documents/PatchDocumentEndpoint.ts +5 -5
  42. package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplateEndpoint.ts +2 -2
  43. package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +1 -1
  44. package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.ts +3 -3
  45. package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +9 -9
  46. package/src/endpoints/organization/dashboard/organization/SetOrganizationDomainEndpoint.ts +3 -3
  47. package/src/endpoints/organization/dashboard/payments/GetMemberBalanceEndpoint.ts +1 -1
  48. package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +1 -1
  49. package/src/endpoints/organization/dashboard/payments/PatchBalanceItemsEndpoint.ts +11 -11
  50. package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +13 -13
  51. package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +16 -16
  52. package/src/endpoints/organization/dashboard/stripe/DeleteStripeAccountEndpoint.ts +1 -1
  53. package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +1 -1
  54. package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +1 -1
  55. package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +1 -1
  56. package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +1 -1
  57. package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +2 -2
  58. package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.ts +2 -2
  59. package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +4 -4
  60. package/src/endpoints/organization/dashboard/webshops/PatchDiscountCodesEndpoint.ts +2 -2
  61. package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +8 -8
  62. package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +1 -1
  63. package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +1 -1
  64. package/src/endpoints/organization/shared/GetDocumentHtml.ts +2 -2
  65. package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +1 -1
  66. package/src/endpoints/organization/webshops/CheckWebshopDiscountCodesEndpoint.ts +1 -1
  67. package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +2 -2
  68. package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +1 -1
  69. package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +3 -3
  70. package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +1 -1
  71. package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +10 -8
  72. package/src/excel-loaders/event-notifications.ts +11 -11
  73. package/src/excel-loaders/members.ts +34 -34
  74. package/src/excel-loaders/organizations.ts +23 -23
  75. package/src/excel-loaders/payments.ts +39 -39
  76. package/src/excel-loaders/receivable-balances.ts +21 -21
  77. package/src/helpers/AddressValidator.ts +6 -6
  78. package/src/helpers/AdminPermissionChecker.ts +7 -4
  79. package/src/helpers/AuthenticatedStructures.ts +8 -8
  80. package/src/helpers/BuckarooHelper.ts +1 -1
  81. package/src/helpers/Context.ts +3 -3
  82. package/src/helpers/FileCache.ts +7 -7
  83. package/src/helpers/ForwardHandler.ts +1 -1
  84. package/src/helpers/GlobalHelper.ts +6 -4
  85. package/src/helpers/MembershipCharger.ts +2 -2
  86. package/src/helpers/SetupStepUpdater.ts +1 -1
  87. package/src/helpers/StripeHelper.ts +7 -7
  88. package/src/helpers/XlsxTransformerColumnHelper.ts +18 -18
  89. package/src/services/DocumentService.ts +1 -1
  90. package/src/services/EventNotificationService.ts +1 -1
  91. package/src/services/MemberNumberService.ts +3 -3
  92. package/src/services/SSOService.ts +5 -5
  93. package/src/sql-filters/members.ts +1 -1
  94. package/tests/e2e/private-files.test.ts +3 -3
@@ -20,12 +20,12 @@ ExportToExcelEndpoint.loaders.set(ExcelExportType.ReceivableBalances, {
20
20
  sheets: [
21
21
  {
22
22
  id: 'receivableBalances',
23
- name: 'Te ontvangen bedragen',
23
+ name: $t(`ecacb29b-6be5-4581-a0bd-5c0824b27cb9`),
24
24
  columns: getGeneralColumns(),
25
25
  },
26
26
  {
27
27
  id: 'balanceItems',
28
- name: 'Lijnen',
28
+ name: $t(`e023f8a6-a91a-48c0-98fc-863697e1e8c6`),
29
29
  transform: (data: DetailedReceivableBalance): ReceivableBalanceWithItem[] => data.balanceItems.map(balanceItem => ({
30
30
  receivableBalance: data,
31
31
  balanceItem,
@@ -53,7 +53,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
53
53
  return [
54
54
  {
55
55
  id: 'id',
56
- name: 'ID',
56
+ name: $t(`29360811-3663-496c-8d8f-c9fdf9467a74`),
57
57
  width: 40,
58
58
  getValue: (object: ReceivableBalanceWithItem) => ({
59
59
  value: object.balanceItem.id,
@@ -66,7 +66,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
66
66
  },
67
67
  {
68
68
  id: 'type',
69
- name: 'Type',
69
+ name: $t(`f97ad8c1-31d2-4b61-9e09-3be86eaeba08`),
70
70
  width: 30,
71
71
  getValue: (object: ReceivableBalanceWithItem) => ({
72
72
  value: getBalanceItemTypeName(object.balanceItem.type),
@@ -74,7 +74,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
74
74
  },
75
75
  {
76
76
  id: 'category',
77
- name: 'Categorie',
77
+ name: $t(`c5d24ab8-a87a-481d-a470-23e9386199f3`),
78
78
  width: 30,
79
79
  getValue: (object: ReceivableBalanceWithItem) => {
80
80
  return {
@@ -84,7 +84,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
84
84
  },
85
85
  {
86
86
  id: 'description',
87
- name: 'Beschrijving',
87
+ name: $t(`9c4977db-1ce9-424b-92cf-4bbe7f6606fd`),
88
88
  width: 40,
89
89
  getValue: (object: ReceivableBalanceWithItem) => ({
90
90
  value: object.balanceItem.description,
@@ -92,7 +92,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
92
92
  },
93
93
  {
94
94
  id: 'amount',
95
- name: 'Aantal',
95
+ name: $t(`f085f874-242d-47cb-a404-96eab69662ec`),
96
96
  width: 20,
97
97
  getValue: (object: ReceivableBalanceWithItem) => ({
98
98
  value: object.balanceItem.amount,
@@ -105,7 +105,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
105
105
  },
106
106
  {
107
107
  id: 'unitPrice',
108
- name: 'Eenheidsprijs',
108
+ name: $t(`7f7fdce2-1fcd-44c9-8c98-856aea11ffc3`),
109
109
  width: 20,
110
110
  getValue: (object: ReceivableBalanceWithItem) => ({
111
111
  value: object.balanceItem.unitPrice / 100,
@@ -118,7 +118,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
118
118
  },
119
119
  {
120
120
  id: 'price',
121
- name: 'Prijs',
121
+ name: $t(`6f3104d4-9b8f-4946-8434-77202efae9f0`),
122
122
  width: 20,
123
123
  getValue: (object: ReceivableBalanceWithItem) => ({
124
124
  value: object.balanceItem.price / 100,
@@ -131,7 +131,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
131
131
  },
132
132
  {
133
133
  id: 'pricePaid',
134
- name: 'Betaald bedrag',
134
+ name: $t(`dc9f65e0-19ce-4908-8830-da48235faa70`),
135
135
  width: 20,
136
136
  getValue: (object: ReceivableBalanceWithItem) => ({
137
137
  value: object.balanceItem.pricePaid / 100,
@@ -144,7 +144,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
144
144
  },
145
145
  {
146
146
  id: 'pricePending',
147
- name: 'In verwerking',
147
+ name: $t(`5c75e9bf-1b64-4d28-a435-6e33247d5170`),
148
148
  width: 20,
149
149
  getValue: (object: ReceivableBalanceWithItem) => ({
150
150
  value: object.balanceItem.pricePending / 100,
@@ -157,7 +157,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
157
157
  },
158
158
  {
159
159
  id: 'priceOpen',
160
- name: 'Openstaand bedrag',
160
+ name: $t(`eb0421f4-6ee9-4d81-b549-2bc4e16c4b63`),
161
161
  width: 20,
162
162
  getValue: (object: ReceivableBalanceWithItem) => ({
163
163
  value: object.balanceItem.priceOpen / 100,
@@ -170,7 +170,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
170
170
  },
171
171
  {
172
172
  id: 'createdAt',
173
- name: 'Aangemaakt op',
173
+ name: $t(`e5902b28-754d-42cd-b245-f403d03b8c56`),
174
174
  width: 20,
175
175
  getValue: (object: ReceivableBalanceWithItem) => ({
176
176
  value: object.balanceItem.createdAt,
@@ -183,7 +183,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
183
183
  },
184
184
  {
185
185
  id: 'dueAt',
186
- name: 'Verschuldigd vanaf',
186
+ name: $t(`3d586760-01f3-42c3-82be-44cea7ad0820`),
187
187
  width: 20,
188
188
  getValue: (object: ReceivableBalanceWithItem) => ({
189
189
  value: object.balanceItem.dueAt,
@@ -196,7 +196,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
196
196
  },
197
197
  {
198
198
  id: 'status',
199
- name: 'Status',
199
+ name: $t(`d7003b29-cc92-4ef4-b07b-f283193ef2ae`),
200
200
  width: 20,
201
201
  getValue: (object: ReceivableBalanceWithItem) => ({
202
202
  value: getBalanceItemStatusName(object.balanceItem.status),
@@ -229,7 +229,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
229
229
  return [
230
230
  {
231
231
  id: 'id',
232
- name: 'ID schuldenaar',
232
+ name: $t(`333e8879-0e98-4233-bc51-93a5c623c75e`),
233
233
  width: 40,
234
234
  getValue: (object: ReceivableBalance) => ({
235
235
  value: object.id,
@@ -242,7 +242,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
242
242
  },
243
243
  {
244
244
  id: 'name',
245
- name: 'Schuldenaar',
245
+ name: $t(`b9c7a57e-6dc1-48a2-bcba-a26c5f59555e`),
246
246
  width: 40,
247
247
  getValue: (object: ReceivableBalance) => ({
248
248
  value: object.object.name,
@@ -250,7 +250,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
250
250
  },
251
251
  {
252
252
  id: 'uri',
253
- name: 'Groepsnummer',
253
+ name: $t(`27cfaf26-6b88-4ebc-a50a-627a9f0f9e64`),
254
254
  width: 16,
255
255
  getValue: (object: ReceivableBalance) => ({
256
256
  value: object.object.uri,
@@ -258,7 +258,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
258
258
  },
259
259
  {
260
260
  id: 'amountOpen',
261
- name: 'Openstaand bedrag',
261
+ name: $t(`eb0421f4-6ee9-4d81-b549-2bc4e16c4b63`),
262
262
  width: 10,
263
263
  getValue: (object: ReceivableBalance) => ({
264
264
  value: object.amountOpen / 100,
@@ -271,7 +271,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
271
271
  },
272
272
  {
273
273
  id: 'amountPending',
274
- name: 'In verwerking',
274
+ name: $t(`5c75e9bf-1b64-4d28-a435-6e33247d5170`),
275
275
  width: 18,
276
276
  getValue: (object: ReceivableBalance) => ({
277
277
  value: object.amountPending / 100,
@@ -284,7 +284,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
284
284
  },
285
285
  {
286
286
  id: 'objectType',
287
- name: 'type',
287
+ name: $t(`a0dfe596-0670-48bc-a5f3-2c9308c70a17`),
288
288
  width: 10,
289
289
  getValue: (object: ReceivableBalance) => ({
290
290
  value: getReceivableBalanceTypeNameNotTranslated(object.objectType),
@@ -20,7 +20,7 @@ export class AddressValidatorStatic {
20
20
  throw new SimpleError({
21
21
  code: 'invalid_field',
22
22
  message: 'Invalid postal code format (NL)',
23
- human: "Ongeldig postcode formaat, voer in zoals '8011 PK'",
23
+ human: $t(`0677422e-58c0-4e6a-9f71-512323d708c5`),
24
24
  field: 'postalCode',
25
25
  });
26
26
  }
@@ -30,7 +30,7 @@ export class AddressValidatorStatic {
30
30
  throw new SimpleError({
31
31
  code: 'invalid_field',
32
32
  message: 'Invalid postal code format (NL)',
33
- human: "Ongeldig postcode formaat, voer in zoals '8011 PK'",
33
+ human: $t(`0677422e-58c0-4e6a-9f71-512323d708c5`),
34
34
  field: 'postalCode',
35
35
  });
36
36
  }
@@ -52,7 +52,7 @@ export class AddressValidatorStatic {
52
52
  throw new SimpleError({
53
53
  code: 'invalid_field',
54
54
  message: 'Postal code is required',
55
- human: 'Voer een postcode in',
55
+ human: $t(`3aee5a0a-d30d-4d30-ba6e-ccfd5689d198`),
56
56
  field: 'postalCode',
57
57
  });
58
58
  }
@@ -75,7 +75,7 @@ export class AddressValidatorStatic {
75
75
  throw new SimpleError({
76
76
  code: 'invalid_field',
77
77
  message: 'Invalid postal code or city',
78
- human: 'Deze postcode en/of gemeente bestaat niet, kijk je even na op een typfout?',
78
+ human: $t(`683fff47-012a-48e6-838c-66c2d13e22a4`),
79
79
  field: 'postalCode',
80
80
  });
81
81
  }
@@ -129,7 +129,7 @@ export class AddressValidatorStatic {
129
129
  throw new SimpleError({
130
130
  code: 'invalid_field',
131
131
  message: 'Invalid street',
132
- human: 'Deze straat bestaat niet, kijk je deze even na op fouten? Formuleer de naam zonder afkortingen.',
132
+ human: $t(`3c20da07-3302-420e-867d-627ae4707e23`),
133
133
  field: 'street',
134
134
  });
135
135
  }
@@ -137,7 +137,7 @@ export class AddressValidatorStatic {
137
137
  throw new SimpleError({
138
138
  code: 'invalid_field',
139
139
  message: 'Invalid street, do you mean ' + bestStreet.name + '?',
140
- human: "Deze straat bestaat niet, bedoel je '" + bestStreet.name + "'?",
140
+ human: $t("f35e3d3a-880e-4703-a018-a24eed53bf64", { street: bestStreet.name }),
141
141
  field: 'street',
142
142
  });
143
143
  }
@@ -86,7 +86,7 @@ export class AdminPermissionChecker {
86
86
  return new SimpleError({
87
87
  code: 'permission_denied',
88
88
  message: 'You do not have permissions for this action',
89
- human: message ?? 'Je hebt geen toegangsrechten voor deze actie',
89
+ human: message ?? $t(`ab071f11-e05b-4bd9-9370-cd4f220c1b54`),
90
90
  statusCode: 403,
91
91
  });
92
92
  }
@@ -99,7 +99,7 @@ export class AdminPermissionChecker {
99
99
  return new SimpleError({
100
100
  code: 'not_found',
101
101
  message: 'Resource not found or no access',
102
- human: message ?? 'Niet gevonden of geen toegang tot dit object',
102
+ human: message ?? $t(`8a8bb10d-9a78-48d0-8589-65d95331530e`),
103
103
  statusCode: 404,
104
104
  });
105
105
  }
@@ -819,7 +819,10 @@ export class AdminPermissionChecker {
819
819
  return false;
820
820
  }
821
821
 
822
- canUpload() {
822
+ canUpload(data: { private: boolean }) {
823
+ if (data.private) {
824
+ return true;
825
+ }
823
826
  return !!this.user.permissions;
824
827
  }
825
828
 
@@ -1222,7 +1225,7 @@ export class AdminPermissionChecker {
1222
1225
  if (!canAccess) {
1223
1226
  throw new SimpleError({
1224
1227
  code: 'permission_denied',
1225
- message: `Je hebt geen toegangsrechten om het antwoord op ${record?.name ?? 'deze vraag'} aan te passen voor dit lid`,
1228
+ message: $t('0823202f-8c46-445b-9b49-f171e1ae85ac', { name: record?.name ?? 'deze vraag' }),
1226
1229
  statusCode: 400,
1227
1230
  });
1228
1231
  }
@@ -35,7 +35,7 @@ export class AuthenticatedStructures {
35
35
  throw new SimpleError({
36
36
  code: 'permission_denied',
37
37
  message: 'Permission denied',
38
- human: 'Je hebt geen toegang tot deze betaling',
38
+ human: $t(`9f5ee239-d01b-4ee1-961b-2e3224489781`),
39
39
  });
40
40
  }
41
41
  }
@@ -611,7 +611,7 @@ export class AuthenticatedStructures {
611
611
  throw new SimpleError({
612
612
  code: 'organization_not_found',
613
613
  message: 'Organization not found',
614
- human: 'Organisatie niet gevonden',
614
+ human: $t(`b6f89130-e727-4f85-b3a9-18b97c4f6ab6`),
615
615
  });
616
616
  }
617
617
 
@@ -647,7 +647,7 @@ export class AuthenticatedStructures {
647
647
  throw new SimpleError({
648
648
  code: 'permission_denied',
649
649
  message: 'Permission denied',
650
- human: 'Je hebt geen toegang tot de orders van deze webshop',
650
+ human: $t(`78cd49fe-260c-4fdc-ad83-e605734c684f`),
651
651
  });
652
652
  }
653
653
  }
@@ -681,7 +681,7 @@ export class AuthenticatedStructures {
681
681
  throw new SimpleError({
682
682
  code: 'permission_denied',
683
683
  message: 'Permission denied',
684
- human: 'Je hebt geen toegang tot de documenten van deze template',
684
+ human: $t(`792f644d-f3eb-4772-88b9-edb88f0b6773`),
685
685
  });
686
686
  }
687
687
  }
@@ -714,7 +714,7 @@ export class AuthenticatedStructures {
714
714
  throw new SimpleError({
715
715
  code: 'permission_denied',
716
716
  message: 'Permission denied',
717
- human: 'Je hebt geen toegang tot de tickets van deze webshop',
717
+ human: $t(`b5079e56-2480-4ce6-a3a2-3f244540fa0e`),
718
718
  });
719
719
  }
720
720
  }
@@ -961,13 +961,13 @@ export class AuthenticatedStructures {
961
961
  if (user.permissions?.platform !== null) {
962
962
  userStruct = NamedObject.create({
963
963
  id: '',
964
- name: 'Beheerder van ' + Platform.shared.config.name,
964
+ name: $t(`da016ffd-45c5-41cc-90e4-d4e81105ebe0`) + ' ' + Platform.shared.config.name,
965
965
  });
966
966
  }
967
967
  else {
968
968
  userStruct = NamedObject.create({
969
969
  id: '',
970
- name: 'Onbekend',
970
+ name: $t(`bd1e59c8-3d4c-4097-ab35-0ce7b20d0e50`),
971
971
  });
972
972
  }
973
973
  }
@@ -986,7 +986,7 @@ export class AuthenticatedStructures {
986
986
  const org = organizations.find(o => o.id === log.organizationId);
987
987
  replacements.set('org', AuditLogReplacement.create({
988
988
  id: log.organizationId,
989
- value: org?.name ?? 'verwijderde vereniging',
989
+ value: org?.name ?? $t(`cc098cc0-d849-4808-b53a-0b99755b3f99`),
990
990
  type: AuditLogReplacementType.Organization,
991
991
  }));
992
992
  }
@@ -210,7 +210,7 @@ export class BuckarooHelper {
210
210
  throw new SimpleError({
211
211
  code: 'buckaroo_error',
212
212
  message: 'Failed to create payment',
213
- human: 'Er ging iets mis bij het starten van de betaling. Herlaad de pagina en probeer het opnieuw.',
213
+ human: $t(`08f883bb-cdc7-4d50-a35e-e2fbeaf6f284`),
214
214
  });
215
215
  }
216
216
  }
@@ -226,7 +226,7 @@ export class ContextInstance {
226
226
  throw new SimpleError({
227
227
  code: 'invalid_access_token',
228
228
  message: 'The access token is invalid',
229
- human: 'Je bent automatisch uitgelogd, log opnieuw in om verder te gaan',
229
+ human: $t(`739f88f4-e87d-4872-aef3-8124a59b160c`),
230
230
  statusCode: 401,
231
231
  });
232
232
  }
@@ -235,7 +235,7 @@ export class ContextInstance {
235
235
  throw new SimpleError({
236
236
  code: 'expired_access_token',
237
237
  message: 'The access token is expired',
238
- human: 'Je bent automatisch uitgelogd, log opnieuw in om verder te gaan',
238
+ human: $t(`739f88f4-e87d-4872-aef3-8124a59b160c`),
239
239
  statusCode: 401,
240
240
  });
241
241
  }
@@ -244,7 +244,7 @@ export class ContextInstance {
244
244
  throw new SimpleError({
245
245
  code: 'not_activated',
246
246
  message: 'This user is not yet activated',
247
- human: 'Maak een account aan op dit e-mailadres om een wachtwoord in te stellen voor je inlogt.',
247
+ human: $t(`28cf3aaf-d6b3-4325-8b01-4c0e754034ed`),
248
248
  statusCode: 401,
249
249
  });
250
250
  }
@@ -61,7 +61,7 @@ export class FileCache {
61
61
  throw new SimpleError({
62
62
  code: 'invalid_file',
63
63
  message: 'Invalid file',
64
- human: 'Ongeldig bestand',
64
+ human: $t(`a175829f-1075-4e04-ab5f-8f65bb715635`),
65
65
  statusCode: 400,
66
66
  });
67
67
  }
@@ -73,7 +73,7 @@ export class FileCache {
73
73
  throw new SimpleError({
74
74
  code: 'invalid_file',
75
75
  message: 'Invalid file',
76
- human: 'Ongeldig bestand',
76
+ human: $t(`a175829f-1075-4e04-ab5f-8f65bb715635`),
77
77
  statusCode: 400,
78
78
  });
79
79
  }
@@ -86,7 +86,7 @@ export class FileCache {
86
86
  throw new SimpleError({
87
87
  code: 'invalid_file',
88
88
  message: 'Invalid file',
89
- human: 'Onbekend karakters in bestandsnaam',
89
+ human: $t(`d5d7b908-50a5-4b3e-94d2-1e54e549764b`),
90
90
  statusCode: 400,
91
91
  });
92
92
  }
@@ -99,7 +99,7 @@ export class FileCache {
99
99
  throw new SimpleError({
100
100
  code: 'invalid_file',
101
101
  message: 'Invalid file',
102
- human: 'Ongelidge datum',
102
+ human: $t(`594fab23-b257-4d51-8d7b-eb3e75bc48ba`),
103
103
  statusCode: 400,
104
104
  });
105
105
  }
@@ -111,7 +111,7 @@ export class FileCache {
111
111
  throw new SimpleError({
112
112
  code: 'invalid_file',
113
113
  message: 'Invalid file',
114
- human: 'Ongeldige datum',
114
+ human: $t(`796645b6-ded0-4d1b-a439-0062f9b6edc1`),
115
115
  statusCode: 400,
116
116
  });
117
117
  }
@@ -126,7 +126,7 @@ export class FileCache {
126
126
  throw new SimpleError({
127
127
  code: 'file_expired',
128
128
  message: 'File expired',
129
- human: 'Het bestand is verlopen',
129
+ human: $t(`8a9a35d5-ff86-48e3-81e1-42cf85708e06`),
130
130
  statusCode: 404,
131
131
  });
132
132
  }
@@ -142,7 +142,7 @@ export class FileCache {
142
142
  throw new SimpleError({
143
143
  code: 'file_expired',
144
144
  message: 'File expired',
145
- human: 'Het bestand bestaat niet',
145
+ human: $t(`d445388b-9062-488b-9fa7-d15682e26fd4`),
146
146
  statusCode: 404,
147
147
  });
148
148
  }
@@ -67,7 +67,7 @@ export class ForwardHandler {
67
67
  let defaultEmail: EmailInterfaceRecipient[] = [Email.getWebmasterToEmail()];
68
68
  let organizationEmails: EmailInterfaceRecipient[] = [];
69
69
  const platform = await Platform.getShared();
70
- const extraDescription = 'Dit bericht werd verstuurd naar ' + email + ', en werd automatisch doorgestuurd naar alle beheerders. Stel in ' + platform.config.name + ' de e-mailadressen in om ervoor te zorgen dat antwoorden naar een specifiek e-mailadres worden verstuurd.';
70
+ const extraDescription = $t(`24bc9aad-bc92-4d27-bfcd-055113d792fa`) + ' ' + email + $t(`97b9b042-c5b6-42dc-8238-e0e8392fcf26`) + ' ' + platform.config.name + ' ' + $t(`f510fb0c-c180-455a-8f23-7e09e344e47a`);
71
71
 
72
72
  function doBounce() {
73
73
  if (!from) {
@@ -1,7 +1,6 @@
1
1
  import { I18n } from '@stamhoofd/backend-i18n';
2
2
  import { FileSignService } from '../services/FileSignService';
3
3
  import { Context, ContextInstance } from './Context';
4
- import { Address, Country } from '@stamhoofd/structures';
5
4
  import { MemberRecordStore } from '../services/MemberRecordStore';
6
5
 
7
6
  export class GlobalHelper {
@@ -13,8 +12,11 @@ export class GlobalHelper {
13
12
  }
14
13
 
15
14
  private static loadGlobalTranslateFunction() {
16
- (global as any).$t = (key: string, replace?: Record<string, string>) => Context.i18n.$t(key, replace);
17
- (global as any).$getLanguage = () => ContextInstance.optional?.i18n.language ?? 'nl';
18
- (global as any).$getCountry = () => ContextInstance.optional?.i18n.country ?? STAMHOOFD.fixedCountry ?? Country.Belgium;
15
+ function getI18n() {
16
+ return ContextInstance.optional?.i18n ?? new I18n(I18n.defaultLanguage, STAMHOOFD.fixedCountry ?? I18n.defaultCountry);
17
+ }
18
+ (global as any).$t = (key: string, replace?: Record<string, string>) => getI18n().$t(key, replace);
19
+ (global as any).$getLanguage = () => getI18n().language;
20
+ (global as any).$getCountry = () => getI18n().country;
19
21
  }
20
22
  }
@@ -18,7 +18,7 @@ export const MembershipCharger = {
18
18
  throw new SimpleError({
19
19
  code: 'missing_membership_organization',
20
20
  message: 'Missing membershipOrganizationId',
21
- human: 'Er is geen lokale groep verantwoordelijk voor de aanrekening van aansluitingen geconfigureerd',
21
+ human: $t(`dd9d20ea-cf50-46be-8eb3-5c85bc5f30c8`),
22
22
  });
23
23
  }
24
24
 
@@ -98,7 +98,7 @@ export const MembershipCharger = {
98
98
  const balanceItem = new BalanceItem();
99
99
  balanceItem.unitPrice = membership.price;
100
100
  balanceItem.amount = 1;
101
- balanceItem.description = Formatter.dateNumber(membership.startDate, true) + ' tot ' + Formatter.dateNumber(membership.expireDate ?? membership.endDate, true);
101
+ balanceItem.description = Formatter.dateNumber(membership.startDate, true) + ' ' + $t(`3e515054-91e7-43ed-a9ce-563b626f337d`) + ' ' + Formatter.dateNumber(membership.expireDate ?? membership.endDate, true);
102
102
  balanceItem.relations = new Map([
103
103
  [
104
104
  BalanceItemRelationType.Member,
@@ -176,7 +176,7 @@ export class SetupStepUpdater {
176
176
  throw new SimpleError({
177
177
  code: 'not_found',
178
178
  message: 'Organization not found',
179
- human: 'De organisatie werd niet gevonden',
179
+ human: $t(`e73b24c3-584d-4a0c-beae-c50f46c33d90`),
180
180
  });
181
181
  }
182
182
 
@@ -10,7 +10,7 @@ export class StripeHelper {
10
10
  return new SimpleError({
11
11
  code: 'not_configured',
12
12
  message: 'Stripe is not yet configured for this platform',
13
- human: $t('Stripe is nog niet geconfigureerd voor dit platform'),
13
+ human: $t('4f1361c2-c860-46e7-a242-933bfe56a7ed'),
14
14
  });
15
15
  }
16
16
 
@@ -215,7 +215,7 @@ export class StripeHelper {
215
215
  if (!stripeAccount) {
216
216
  throw new SimpleError({
217
217
  code: '',
218
- message: 'Betaling via ' + PaymentMethodHelper.getName(payment.method) + ' is onbeschikbaar',
218
+ message: $t(`b77e1f68-8928-42a2-802b-059fa73bedc3`, { method: PaymentMethodHelper.getName(payment.method) }),
219
219
  });
220
220
  }
221
221
 
@@ -225,7 +225,7 @@ export class StripeHelper {
225
225
  throw new SimpleError({
226
226
  code: 'minmum_amount',
227
227
  message: 'The minimum amount for an online payment is € 0,50',
228
- human: 'Het minimum bedrag voor een online betaling is € 0,50',
228
+ human: $t(`dae9058f-0aa7-4fcb-9f1d-fc918c65784b`),
229
229
  });
230
230
  }
231
231
 
@@ -267,7 +267,7 @@ export class StripeHelper {
267
267
  const paymentMethod = await stripe.paymentMethods.create({
268
268
  type: payment.method.toLowerCase() as 'bancontact' | 'ideal',
269
269
  billing_details: {
270
- name: payment.customer?.dynamicName || (customer.name.length > 2 ? customer.name : 'Onbekend'),
270
+ name: payment.customer?.dynamicName || (customer.name.length > 2 ? customer.name : $t(`bd1e59c8-3d4c-4097-ab35-0ce7b20d0e50`)),
271
271
  email: payment.customer?.dynamicEmail || customer.email,
272
272
  address: payment.customer?.company?.address
273
273
  ? {
@@ -306,7 +306,7 @@ export class StripeHelper {
306
306
  console.error('Stripe payment intent status is not requires_action', paymentIntent);
307
307
  throw new SimpleError({
308
308
  code: 'invalid_status',
309
- message: 'Betaling via ' + PaymentMethodHelper.getName(payment.method) + ' is onbeschikbaar',
309
+ message: $t(`55d699ae-3da4-45ca-a30e-0f194b08edf7`) + ' ' + PaymentMethodHelper.getName(payment.method) + ' ' + $t(`277dc49e-922a-444f-ba2b-b3442d855358`),
310
310
  });
311
311
  }
312
312
 
@@ -347,7 +347,7 @@ export class StripeHelper {
347
347
  throw new SimpleError({
348
348
  code: 'invalid_price',
349
349
  message: 'De totale prijs van de betaling komt niet overeen met de prijs van de items',
350
- human: 'Er ging iets mis bij het aanmaken van de betaling. Probeer opnieuw of gebruik een andere betaalmethode.',
350
+ human: $t(`e66b54d3-70fb-4b40-b3e5-21bc795ba704`),
351
351
  statusCode: 500,
352
352
  });
353
353
  }
@@ -389,7 +389,7 @@ export class StripeHelper {
389
389
  console.error('Stripe session has no url', session);
390
390
  throw new SimpleError({
391
391
  code: 'invalid_status',
392
- message: 'Betaling via ' + PaymentMethodHelper.getName(payment.method) + ' is onbeschikbaar',
392
+ message: $t(`55d699ae-3da4-45ca-a30e-0f194b08edf7`) + ' ' + PaymentMethodHelper.getName(payment.method) + ' ' + $t(`277dc49e-922a-444f-ba2b-b3442d855358`),
393
393
  });
394
394
  }
395
395
  paymentUrl = session.url;