@stamhoofd/backend 2.118.1 → 2.120.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 +32 -22
- package/src/audit-logs/ModelLogger.ts +4 -2
- package/src/audit-logs/OrderLogger.ts +1 -1
- package/src/boot.ts +32 -14
- package/src/crons/balance-emails.ts +4 -2
- package/src/crons/clearExcelCache.test.ts +8 -8
- package/src/crons/update-cached-balances.ts +40 -14
- package/src/debug.ts +3 -2
- package/src/decoders/StringArrayDecoder.ts +1 -1
- package/src/decoders/StringNullableDecoder.ts +1 -1
- package/src/email-recipient-loaders/documents.ts +2 -1
- package/src/email-recipient-loaders/members.ts +2 -1
- package/src/email-recipient-loaders/orders.ts +2 -1
- package/src/email-recipient-loaders/payments.ts +6 -3
- package/src/email-recipient-loaders/receivable-balances.ts +2 -1
- package/src/email-recipient-loaders/registrations.ts +2 -1
- package/src/email-replacements/getEmailReplacementsForPayment.ts +8 -7
- package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +7 -6
- package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +3 -2
- package/src/endpoints/admin/memberships/GetChargeMembershipsSummaryEndpoint.ts +2 -1
- package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +4 -3
- package/src/endpoints/admin/organizations/GetOrganizationsCountEndpoint.ts +3 -2
- package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +7 -5
- package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +12 -10
- package/src/endpoints/admin/registrations/ChargeRegistrationsEndpoint.ts +4 -3
- package/src/endpoints/auth/CreateAdminEndpoint.ts +8 -6
- package/src/endpoints/auth/CreateTokenEndpoint.ts +14 -12
- package/src/endpoints/auth/DeleteTokenEndpoint.ts +2 -1
- package/src/endpoints/auth/DeleteUserEndpoint.ts +2 -1
- package/src/endpoints/auth/ForgotPasswordEndpoint.ts +5 -4
- package/src/endpoints/auth/GetOtherUserEndpoint.ts +3 -2
- package/src/endpoints/auth/GetUserEndpoint.ts +3 -2
- package/src/endpoints/auth/OpenIDConnectAuthTokenEndpoint.ts +2 -1
- package/src/endpoints/auth/OpenIDConnectCallbackEndpoint.ts +4 -2
- package/src/endpoints/auth/OpenIDConnectStartEndpoint.ts +3 -2
- package/src/endpoints/auth/PatchUserEndpoint.ts +15 -12
- package/src/endpoints/auth/PollEmailVerificationEndpoint.ts +3 -2
- package/src/endpoints/auth/RetryEmailVerificationEndpoint.ts +3 -2
- package/src/endpoints/auth/SignupEndpoint.ts +5 -4
- package/src/endpoints/auth/VerifyEmailEndpoint.ts +6 -5
- package/src/endpoints/frontend/FrontendEnvironmentEndpoint.ts +3 -2
- package/src/endpoints/global/addresses/SearchRegionsEndpoint.ts +8 -5
- package/src/endpoints/global/addresses/ValidateAddressEndpoint.ts +5 -3
- package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +8 -5
- package/src/endpoints/global/billing/ActivatePackagesEndpoint.ts +9 -7
- package/src/endpoints/global/billing/DeactivatePackageEndpoint.ts +4 -3
- package/src/endpoints/global/caddy/CheckDomainCertEndpoint.ts +4 -2
- package/src/endpoints/global/email/CreateEmailEndpoint.ts +9 -7
- package/src/endpoints/global/email/GetAdminEmailsEndpoint.test.ts +2 -1
- package/src/endpoints/global/email/GetAdminEmailsEndpoint.ts +22 -19
- package/src/endpoints/global/email/GetEmailAddressEndpoint.ts +6 -4
- package/src/endpoints/global/email/GetEmailEndpoint.ts +4 -3
- package/src/endpoints/global/email/GetUserEmailsEndpoint.test.ts +3 -2
- package/src/endpoints/global/email/GetUserEmailsEndpoint.ts +7 -4
- package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +7 -5
- package/src/endpoints/global/email/PatchEmailEndpoint.test.ts +11 -11
- package/src/endpoints/global/email/PatchEmailEndpoint.ts +14 -11
- package/src/endpoints/global/email-recipients/GetEmailRecipientsCountEndpoint.ts +3 -2
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.test.ts +2 -1
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.ts +8 -5
- package/src/endpoints/global/email-recipients/RetryEmailRecipientEndpoint.ts +7 -5
- package/src/endpoints/global/email-recipients/helpers/validateEmailRecipientFilter.ts +4 -3
- package/src/endpoints/global/events/GetEventNotificationsCountEndpoint.ts +3 -2
- package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +9 -6
- package/src/endpoints/global/events/GetEventsEndpoint.ts +7 -4
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.test.ts +4 -2
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.ts +17 -15
- package/src/endpoints/global/events/PatchEventsEndpoint.test.ts +4 -2
- package/src/endpoints/global/events/PatchEventsEndpoint.ts +28 -26
- package/src/endpoints/global/files/ExportToExcelEndpoint.ts +8 -5
- package/src/endpoints/global/files/GetFileCache.ts +5 -3
- package/src/endpoints/global/files/UploadFile.ts +10 -4
- package/src/endpoints/global/files/UploadImage.ts +4 -2
- package/src/endpoints/global/groups/GetGroupsEndpoint.test.ts +4 -2
- package/src/endpoints/global/groups/GetGroupsEndpoint.ts +8 -5
- package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +7 -5
- package/src/endpoints/global/members/GetMembersCountEndpoint.ts +3 -2
- package/src/endpoints/global/members/GetMembersEndpoint.test.ts +4 -2
- package/src/endpoints/global/members/GetMembersEndpoint.ts +10 -8
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.test.ts +257 -6
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +162 -107
- package/src/endpoints/global/members/helpers/validateGroupFilter.ts +4 -3
- package/src/endpoints/global/members/shouldCheckIfMemberIsDuplicate.ts +3 -2
- package/src/endpoints/global/organizations/CheckRegisterCodeEndpoint.ts +3 -2
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.test.ts +3 -2
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +8 -7
- package/src/endpoints/global/organizations/GetOrganizationFromDomainEndpoint.ts +5 -3
- package/src/endpoints/global/organizations/GetOrganizationFromUriEndpoint.ts +5 -3
- package/src/endpoints/global/organizations/SearchOrganizationEndpoint.ts +8 -5
- package/src/endpoints/global/payments/StripeWebhookEndpoint.ts +4 -2
- package/src/endpoints/global/platform/GetPlatformAdminsEndpoint.ts +2 -1
- package/src/endpoints/global/platform/GetPlatformEndpoint.ts +3 -2
- package/src/endpoints/global/platform/PatchPlatformEnpoint.test.ts +3 -2
- package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +7 -4
- package/src/endpoints/global/platform-memberships/GetPlatformMembershipsCountEndpoint.ts +47 -0
- package/src/endpoints/global/platform-memberships/GetPlatformMembershipsEndpoint.ts +206 -0
- package/src/endpoints/global/registration/GetRegistrationsCountEndpoint.ts +3 -2
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.test.ts +2 -1
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.ts +10 -7
- package/src/endpoints/global/registration/GetUserDetailedPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/global/registration/GetUserDocumentsEndpoint.ts +4 -2
- package/src/endpoints/global/registration/GetUserMembersEndpoint.ts +3 -2
- package/src/endpoints/global/registration/GetUserPayableBalanceEndpoint.ts +2 -1
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.test.ts +5 -3
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +13 -9
- package/src/endpoints/global/registration/RegisterMembersEndpoint.test.ts +50 -49
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +25 -22
- package/src/endpoints/global/registration-periods/GetRegistrationPeriodsEndpoint.ts +8 -5
- package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +9 -7
- package/src/endpoints/global/sso/GetSSOEndpoint.ts +4 -2
- package/src/endpoints/global/sso/SetSSOEndpoint.ts +3 -2
- package/src/endpoints/global/webshops/GetWebshopFromDomainEndpoint.ts +4 -2
- package/src/endpoints/global/webshops/GetWebshopsCountEndpoint.ts +43 -0
- package/src/endpoints/global/webshops/GetWebshopsEndpoint.test.ts +808 -0
- package/src/endpoints/global/webshops/GetWebshopsEndpoint.ts +221 -0
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/balance-items/PatchBalanceItemsEndpoint.ts +15 -13
- package/src/endpoints/organization/dashboard/billing/GetOrganizationDetailedPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/billing/GetOrganizationPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/billing/GetPackagesEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplateXML.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplatesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplatesEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/documents/GetDocumentsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentsEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/documents/PatchDocumentEndpoint.ts +9 -7
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/email-templates/GetEmailTemplatesEndpoint.test.ts +36 -1
- package/src/endpoints/organization/dashboard/email-templates/GetEmailTemplatesEndpoint.ts +13 -4
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/invoices/PatchInvoicesEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/mollie/CheckMollieEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/mollie/ConnectMollieEndpoint.ts +6 -3
- package/src/endpoints/organization/dashboard/mollie/DisconnectMollieEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/mollie/GetMollieDashboardEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/nolt/CreateNoltTokenEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/organization/GetOrganizationArchivedGroups.ts +4 -2
- package/src/endpoints/organization/dashboard/organization/GetOrganizationDeletedGroups.ts +3 -2
- package/src/endpoints/organization/dashboard/organization/GetUitpasClientIdEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.test.ts +5 -3
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +22 -19
- package/src/endpoints/organization/dashboard/organization/SearchUitpasOrganizersEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/organization/SetOrganizationDomainEndpoint.ts +11 -9
- package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts +8 -7
- package/src/endpoints/organization/dashboard/payments/GetMemberBalanceEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/payments/GetPaymentsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +18 -16
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalanceEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.test.ts +2 -1
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.ts +8 -5
- package/src/endpoints/organization/dashboard/registration-periods/MoveRegistrationPeriods.test.ts +4 -2
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +32 -29
- package/src/endpoints/organization/dashboard/registration-periods/SetupStepReviewEndpoint.ts +6 -3
- package/src/endpoints/organization/dashboard/stripe/ConnectStripeEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/stripe/DeleteStripeAccountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountsEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/users/GetApiUsersEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/users/GetOrganizationAdminsEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +7 -6
- package/src/endpoints/organization/dashboard/webshops/DeleteWebshopEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/webshops/GetDiscountCodesEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/webshops/{GetWebshopTicketsCountEndpoint → GetWebshopTicketsCountEndpoint.ts} +7 -7
- package/src/endpoints/organization/dashboard/webshops/GetWebshopTicketsEndpoint.ts +9 -6
- package/src/endpoints/organization/dashboard/webshops/GetWebshopUriAvailabilityEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/PatchDiscountCodesEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +13 -12
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopOrdersEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/webshops/SearchUitpasEventsEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/VerifyWebshopDomainEndpoint.ts +2 -1
- package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +6 -4
- package/src/endpoints/organization/shared/GetDocumentHtml.ts +4 -3
- package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +4 -3
- package/src/endpoints/organization/shared/GetUitpasNumberDetailsEndpoint.ts +3 -2
- package/src/endpoints/organization/shared/auth/GetOrganizationEndpoint.ts +3 -2
- package/src/endpoints/organization/webshops/CheckWebshopDiscountCodesEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +5 -4
- package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +7 -5
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.test.ts +7 -3
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +11 -10
- package/src/endpoints/organization/webshops/RetrieveUitpasSocialTariffPriceEndpoint.ts +5 -4
- package/src/endpoints/system/HealthEndpoint.test.ts +44 -0
- package/src/endpoints/system/HealthEndpoint.ts +14 -6
- package/src/excel-loaders/balance-items.ts +19 -17
- package/src/excel-loaders/event-notifications.ts +15 -13
- package/src/excel-loaders/index.ts +1 -0
- package/src/excel-loaders/members.ts +45 -43
- package/src/excel-loaders/organizations.ts +26 -25
- package/src/excel-loaders/payments.ts +44 -42
- package/src/excel-loaders/platform-memberships.ts +202 -0
- package/src/excel-loaders/receivable-balances.ts +25 -23
- package/src/excel-loaders/registrations.ts +30 -28
- package/src/helpers/AddressValidator.test.ts +2 -1
- package/src/helpers/AddressValidator.ts +13 -10
- package/src/helpers/AdminPermissionChecker.ts +193 -95
- package/src/helpers/AuthenticatedStructures.ts +13 -11
- package/src/helpers/BuckarooHelper.ts +3 -2
- package/src/helpers/Context.ts +8 -6
- package/src/helpers/CookieHelper.ts +2 -2
- package/src/helpers/FileCache.ts +9 -9
- package/src/helpers/ForwardHandler.ts +3 -2
- package/src/helpers/GlobalHelper.ts +2 -0
- package/src/helpers/GroupBuilder.ts +2 -1
- package/src/helpers/GroupedThrottledQueue.test.ts +19 -19
- package/src/helpers/LimitedFilteredRequestHelper.ts +1 -1
- package/src/helpers/MemberCharger.ts +2 -1
- package/src/helpers/MemberUserSyncer.ts +6 -3
- package/src/helpers/MembershipCharger.ts +2 -2
- package/src/helpers/OrganizationCharger.ts +2 -1
- package/src/helpers/PeriodHelper.ts +2 -1
- package/src/helpers/SQLTranslatedString.ts +3 -2
- package/src/helpers/ServiceFeeHelper.ts +1 -1
- package/src/helpers/SetupStepUpdater.ts +6 -5
- package/src/helpers/StripeHelper.ts +9 -8
- package/src/helpers/TagHelper.test.ts +5 -5
- package/src/helpers/TagHelper.ts +2 -1
- package/src/helpers/TemporaryMemberAccess.ts +2 -1
- package/src/helpers/ThrottledQueue.test.ts +20 -20
- package/src/helpers/UitpasTokenRepository.ts +7 -7
- package/src/helpers/ViesHelper.ts +5 -4
- package/src/helpers/XlsxTransformerColumnHelper.ts +21 -19
- package/src/helpers/email-html-helpers.ts +13 -12
- package/src/helpers/fetchToAsyncIterator.ts +1 -1
- package/src/helpers/outstandingBalanceJoin.ts +2 -1
- package/src/helpers/updateMemberDetailsUitpasNumber.ts +5 -4
- package/src/middleware/ContextMiddleware.ts +1 -1
- package/src/migrate.ts +21 -4
- package/src/seeds/0000000003-default-email-templates.ts +1 -1
- package/src/seeds/0000000004-single-organization.ts +2 -1
- package/src/seeds/1752848561-groups-registration-periods.ts +3 -2
- package/src/seeds/1754560914-groups-prices.test.ts +2 -1
- package/src/seeds/1754560914-groups-prices.ts +2 -1
- package/src/seeds/1755790070-fill-email-recipient-errors.ts +6 -6
- package/src/seeds/1755876819-remove-duplicate-members.ts +2 -1
- package/src/seeds/1765896674-document-update-year.test.ts +2 -1
- package/src/seeds/1773754928-force-save-members.ts +15 -0
- package/src/services/AuditLogService.ts +3 -2
- package/src/services/BalanceItemPaymentService.ts +2 -2
- package/src/services/BalanceItemService.ts +2 -1
- package/src/services/BootChecksService.test.ts +33 -0
- package/src/services/BootChecksService.ts +21 -0
- package/src/services/DatabaseCollationService.test.ts +18 -0
- package/src/services/DatabaseCollationService.ts +81 -0
- package/src/services/DocumentService.ts +1 -1
- package/src/services/EventNotificationService.ts +5 -4
- package/src/services/FileSignService.ts +2 -2
- package/src/services/InvoiceService.ts +3 -3
- package/src/services/MemberNumberService.ts +6 -4
- package/src/services/MemberRecordStore.ts +28 -19
- package/src/services/PaymentReallocationService.test.ts +2 -1
- package/src/services/PaymentReallocationService.ts +2 -1
- package/src/services/PaymentService.ts +28 -26
- package/src/services/RegistrationService.ts +65 -3
- package/src/services/SSOService.ts +13 -9
- package/src/services/STPackageService.ts +7 -5
- package/src/services/StartupHealthService.ts +15 -0
- package/src/services/uitpas/PassholderEndpoints.ts +2 -2
- package/src/services/uitpas/UitpasService.ts +11 -8
- 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/audit-logs.ts +2 -1
- package/src/sql-filters/balance-item-payments.ts +2 -1
- package/src/sql-filters/balance-items.ts +2 -1
- package/src/sql-filters/base-registration-filter-compilers.ts +6 -4
- package/src/sql-filters/document-templates.ts +2 -1
- package/src/sql-filters/documents.ts +2 -1
- package/src/sql-filters/email-recipients.ts +2 -1
- package/src/sql-filters/emails.ts +2 -1
- package/src/sql-filters/event-notifications.ts +2 -1
- package/src/sql-filters/events.ts +2 -1
- package/src/sql-filters/groups.ts +2 -1
- package/src/sql-filters/invoiced-balance-items.ts +2 -1
- package/src/sql-filters/invoices.ts +2 -1
- package/src/sql-filters/member-responsibility-records.ts +2 -1
- package/src/sql-filters/members.ts +8 -7
- package/src/sql-filters/orders.ts +3 -2
- package/src/sql-filters/organization-registration-periods.ts +2 -1
- package/src/sql-filters/organizations.ts +2 -1
- package/src/sql-filters/payments.ts +2 -1
- package/src/sql-filters/platform-memberships.ts +67 -0
- package/src/sql-filters/receivable-balances.ts +2 -1
- package/src/sql-filters/registration-periods.ts +2 -1
- package/src/sql-filters/registrations.ts +2 -1
- package/src/sql-filters/tickets.ts +2 -1
- package/src/sql-filters/users.ts +2 -1
- package/src/sql-filters/webshops.ts +38 -0
- package/src/sql-sorters/audit-logs.ts +3 -2
- package/src/sql-sorters/balance-items.ts +3 -2
- package/src/sql-sorters/document-templates.ts +3 -2
- package/src/sql-sorters/documents.ts +3 -2
- package/src/sql-sorters/email-recipients.ts +3 -2
- package/src/sql-sorters/emails.ts +3 -2
- package/src/sql-sorters/event-notifications.ts +3 -2
- package/src/sql-sorters/events.ts +3 -2
- package/src/sql-sorters/groups.ts +3 -2
- package/src/sql-sorters/invoices.ts +3 -2
- package/src/sql-sorters/members.ts +3 -2
- package/src/sql-sorters/orders.ts +3 -2
- package/src/sql-sorters/organization-registration-periods.ts +3 -2
- package/src/sql-sorters/organizations.ts +3 -2
- package/src/sql-sorters/payments.ts +3 -2
- package/src/sql-sorters/platform-memberships.ts +40 -0
- package/src/sql-sorters/receivable-balances.ts +3 -2
- package/src/sql-sorters/registration-periods.ts +3 -2
- package/src/sql-sorters/registrations.ts +3 -2
- package/src/sql-sorters/tickets.ts +3 -2
- package/src/sql-sorters/webshops.ts +40 -0
- package/tests/actions/patchOrganizationMember.ts +5 -4
- package/tests/actions/patchPaymentStatus.ts +2 -2
- package/tests/actions/patchUserMember.ts +6 -4
- package/tests/e2e/api-rate-limits.test.ts +4 -5
- package/tests/e2e/bundle-discounts.test.ts +3 -2
- package/tests/e2e/charge-members.test.ts +7 -5
- package/tests/e2e/documents.test.ts +3 -2
- package/tests/e2e/private-files.test.ts +11 -13
- package/tests/e2e/register.test.ts +6 -5
- package/tests/e2e/stock.test.ts +6 -8
- package/tests/e2e/tickets.test.ts +4 -2
- package/tests/helpers/StripeMocker.ts +3 -3
- package/tests/init/initAdmin.ts +4 -2
- package/tests/init/initBundleDiscount.ts +3 -2
- package/tests/init/initPayconiq.ts +1 -1
- package/tests/init/initPermissionRole.ts +4 -2
- package/tests/init/initPlatformRecordCategory.ts +1 -1
- package/tests/init/initStripe.ts +1 -1
- package/tests/vitest.global.setup.ts +26 -0
- package/tests/{jest.setup.ts → vitest.setup.ts} +4 -3
- package/tsconfig.build.json +17 -0
- package/tsconfig.json +10 -41
- package/tsconfig.test.json +17 -0
- package/vitest.config.js +13 -0
- package/eslint.config.mjs +0 -5
- package/jest.config.cjs +0 -27
- package/tests/jest.global.setup.ts +0 -33
- package/tests/toMatchMap.ts +0 -68
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { DecodedRequest,
|
|
1
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
3
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
4
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
5
|
import { EventNotification } from '@stamhoofd/models';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import type { SQLSortDefinitions} from '@stamhoofd/sql';
|
|
7
|
+
import { SQL, applySQLSorter, compileToSQLFilter } from '@stamhoofd/sql';
|
|
8
|
+
import type { CountFilteredRequest, EventNotification as EventNotificationStruct, StamhoofdFilter} from '@stamhoofd/structures';
|
|
9
|
+
import { AccessRight, LimitedFilteredRequest, PaginatedResponse, assertSort, getSortFilter } from '@stamhoofd/structures';
|
|
7
10
|
|
|
8
|
-
import { SQLResultNamespacedRow } from '@simonbackx/simple-database';
|
|
11
|
+
import type { SQLResultNamespacedRow } from '@simonbackx/simple-database';
|
|
9
12
|
import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures.js';
|
|
10
13
|
import { Context } from '../../../helpers/Context.js';
|
|
11
14
|
import { eventNotificationsFilterCompilers } from '../../../sql-filters/event-notifications.js';
|
|
@@ -142,7 +145,7 @@ export class GetEventNotificationsEndpoint extends Endpoint<Params, Query, Body,
|
|
|
142
145
|
|
|
143
146
|
for (const notification of notifications) {
|
|
144
147
|
if (!await Context.auth.canAccessEventNotification(notification)) {
|
|
145
|
-
throw Context.auth.error($t(`
|
|
148
|
+
throw Context.auth.error($t(`%DT`));
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { DecodedRequest,
|
|
1
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
3
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
4
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
5
|
import { Event } from '@stamhoofd/models';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import type { SQLSortDefinitions} from '@stamhoofd/sql';
|
|
7
|
+
import { SQL, applySQLSorter, compileToSQLFilter } from '@stamhoofd/sql';
|
|
8
|
+
import type { CountFilteredRequest, Event as EventStruct, StamhoofdFilter} from '@stamhoofd/structures';
|
|
9
|
+
import { LimitedFilteredRequest, PaginatedResponse, assertSort, getSortFilter } from '@stamhoofd/structures';
|
|
7
10
|
|
|
8
11
|
import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures.js';
|
|
9
12
|
import { Context } from '../../../helpers/Context.js';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { PatchableArray, PatchMap, patchObject } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { Endpoint
|
|
2
|
+
import type { Endpoint} from '@simonbackx/simple-endpoints';
|
|
3
|
+
import { Request } from '@simonbackx/simple-endpoints';
|
|
3
4
|
import { EmailMocker } from '@stamhoofd/email';
|
|
4
|
-
import {
|
|
5
|
+
import type { User} from '@stamhoofd/models';
|
|
6
|
+
import { EmailTemplateFactory, EventFactory, EventNotification, EventNotificationFactory, EventNotificationTypeFactory, Organization, OrganizationFactory, Platform, RecordAnswerFactory, RecordCategoryFactory, RegistrationPeriod, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
5
7
|
import { AccessRight, BaseOrganization, EmailTemplateType, Event, EventNotificationStatus, EventNotification as EventNotificationStruct, Permissions, PermissionsResourceType, RecordType, ResourcePermissions } from '@stamhoofd/structures';
|
|
6
8
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
7
9
|
import { testServer } from '../../../../tests/helpers/TestServer.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { AutoEncoderPatchType, Decoder, PatchableArrayAutoEncoder
|
|
2
|
-
import {
|
|
1
|
+
import type { AutoEncoderPatchType, Decoder, PatchableArrayAutoEncoder} from '@simonbackx/simple-encoding';
|
|
2
|
+
import { PatchableArrayDecoder, patchObject, StringDecoder } from '@simonbackx/simple-encoding';
|
|
3
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
4
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
5
|
import { Event, EventNotification, Platform, RegistrationPeriod } from '@stamhoofd/models';
|
|
4
6
|
import { EmailTemplateType, EventNotificationStatus, EventNotification as EventNotificationStruct, PermissionLevel, RecordCategory } from '@stamhoofd/structures';
|
|
5
7
|
|
|
@@ -69,7 +71,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
69
71
|
throw new SimpleError({
|
|
70
72
|
code: 'invalid_field',
|
|
71
73
|
message: 'Invalid event',
|
|
72
|
-
human: $t(`
|
|
74
|
+
human: $t(`%DU`),
|
|
73
75
|
field: 'events',
|
|
74
76
|
});
|
|
75
77
|
}
|
|
@@ -87,7 +89,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
87
89
|
throw new SimpleError({
|
|
88
90
|
code: 'invalid_period',
|
|
89
91
|
message: 'No period found for this start date',
|
|
90
|
-
human: Context.i18n.$t('
|
|
92
|
+
human: Context.i18n.$t('%8F'),
|
|
91
93
|
field: 'startDate',
|
|
92
94
|
});
|
|
93
95
|
}
|
|
@@ -96,7 +98,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
96
98
|
throw new SimpleError({
|
|
97
99
|
code: 'invalid_period',
|
|
98
100
|
message: 'Period is locked',
|
|
99
|
-
human: Context.i18n.$t('
|
|
101
|
+
human: Context.i18n.$t('%AM'),
|
|
100
102
|
field: 'startDate',
|
|
101
103
|
});
|
|
102
104
|
}
|
|
@@ -132,7 +134,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
132
134
|
throw new SimpleError({
|
|
133
135
|
code: 'not_found',
|
|
134
136
|
message: 'EventNotification not found',
|
|
135
|
-
human: Context.i18n.$t('
|
|
137
|
+
human: Context.i18n.$t('%AN'),
|
|
136
138
|
});
|
|
137
139
|
}
|
|
138
140
|
|
|
@@ -150,12 +152,12 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
150
152
|
if (!await Context.auth.canAccessEventNotification(notification, requiredPermissionLevel)) {
|
|
151
153
|
// Requires `OrganizationEventNotificationReviewer` access right for the organization
|
|
152
154
|
if (notification.status === EventNotificationStatus.Pending) {
|
|
153
|
-
throw Context.auth.error(Context.i18n.$t('
|
|
155
|
+
throw Context.auth.error(Context.i18n.$t('%AO'));
|
|
154
156
|
}
|
|
155
157
|
if (notification.status === EventNotificationStatus.Accepted) {
|
|
156
|
-
throw Context.auth.error(Context.i18n.$t('
|
|
158
|
+
throw Context.auth.error(Context.i18n.$t('%AP'));
|
|
157
159
|
}
|
|
158
|
-
throw Context.auth.error(Context.i18n.$t('
|
|
160
|
+
throw Context.auth.error(Context.i18n.$t('%AQ'));
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
const period = await RegistrationPeriod.getByID(notification.periodId);
|
|
@@ -163,7 +165,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
163
165
|
throw new SimpleError({
|
|
164
166
|
code: 'not_found',
|
|
165
167
|
message: 'Period not found',
|
|
166
|
-
human: Context.i18n.$t('
|
|
168
|
+
human: Context.i18n.$t('%AR'),
|
|
167
169
|
});
|
|
168
170
|
}
|
|
169
171
|
|
|
@@ -171,7 +173,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
171
173
|
throw new SimpleError({
|
|
172
174
|
code: 'invalid_period',
|
|
173
175
|
message: 'Period is locked',
|
|
174
|
-
human: Context.i18n.$t('
|
|
176
|
+
human: Context.i18n.$t('%AS'),
|
|
175
177
|
});
|
|
176
178
|
}
|
|
177
179
|
|
|
@@ -234,7 +236,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
234
236
|
throw new SimpleError({
|
|
235
237
|
code: 'not_found',
|
|
236
238
|
message: 'EventNotification not found',
|
|
237
|
-
human: Context.i18n.$t('
|
|
239
|
+
human: Context.i18n.$t('%AN'),
|
|
238
240
|
});
|
|
239
241
|
}
|
|
240
242
|
|
|
@@ -259,7 +261,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
259
261
|
throw new SimpleError({
|
|
260
262
|
code: 'invalid_field',
|
|
261
263
|
message: 'Invalid type',
|
|
262
|
-
human: Context.i18n.$t('
|
|
264
|
+
human: Context.i18n.$t('%AT'),
|
|
263
265
|
field: 'typeId',
|
|
264
266
|
});
|
|
265
267
|
}
|
|
@@ -287,7 +289,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
287
289
|
throw new SimpleError({
|
|
288
290
|
code: 'invalid_field',
|
|
289
291
|
message: 'Invalid start date',
|
|
290
|
-
human: Context.i18n.$t('
|
|
292
|
+
human: Context.i18n.$t('%AU'),
|
|
291
293
|
field: 'startDate',
|
|
292
294
|
});
|
|
293
295
|
}
|
|
@@ -296,7 +298,7 @@ export class PatchEventNotificationsEndpoint extends Endpoint<Params, Query, Bod
|
|
|
296
298
|
throw new SimpleError({
|
|
297
299
|
code: 'invalid_field',
|
|
298
300
|
message: 'Invalid end date',
|
|
299
|
-
human: Context.i18n.$t('
|
|
301
|
+
human: Context.i18n.$t('%AV'),
|
|
300
302
|
field: 'endDate',
|
|
301
303
|
});
|
|
302
304
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PatchableArray } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { Endpoint
|
|
3
|
-
import {
|
|
2
|
+
import type { Endpoint} from '@simonbackx/simple-endpoints';
|
|
3
|
+
import { Request } from '@simonbackx/simple-endpoints';
|
|
4
|
+
import type { Organization, User} from '@stamhoofd/models';
|
|
5
|
+
import { EventFactory, OrganizationFactory, OrganizationRegistrationPeriodFactory, PlatformEventTypeFactory, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
4
6
|
import { AccessRight, Event, Group, GroupSettings, GroupType, PermissionLevel, Permissions, PermissionsResourceType, ResourcePermissions, TranslatedString } from '@stamhoofd/structures';
|
|
5
7
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
6
8
|
import { testServer } from '../../../../tests/helpers/TestServer.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { AutoEncoderPatchType, Decoder, PatchableArrayAutoEncoder
|
|
2
|
-
import {
|
|
1
|
+
import type { AutoEncoderPatchType, Decoder, PatchableArrayAutoEncoder} from '@simonbackx/simple-encoding';
|
|
2
|
+
import { PatchableArrayDecoder, patchObject, StringDecoder } from '@simonbackx/simple-encoding';
|
|
3
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
4
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
5
|
import { Event, Group, OrganizationRegistrationPeriod, Platform, RegistrationPeriod, Webshop } from '@stamhoofd/models';
|
|
4
6
|
import { AuditLogSource, Event as EventStruct, Group as GroupStruct, GroupType, NamedObject, PermissionLevel } from '@stamhoofd/structures';
|
|
5
7
|
|
|
@@ -39,7 +41,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
39
41
|
throw new SimpleError({
|
|
40
42
|
code: 'invalid_period',
|
|
41
43
|
message: 'No period found for this start date: ' + Formatter.dateIso(event.startDate),
|
|
42
|
-
human: Context.i18n.$t('
|
|
44
|
+
human: Context.i18n.$t('%8F'),
|
|
43
45
|
field: 'startDate',
|
|
44
46
|
});
|
|
45
47
|
}
|
|
@@ -53,7 +55,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
if (!await Context.auth.canAccessGroupsInPeriod(period.id, putGroup.organizationId)) {
|
|
56
|
-
throw Context.auth.error($t(`
|
|
58
|
+
throw Context.auth.error($t(`%1HQ`));
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
if (!group) {
|
|
@@ -109,7 +111,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
109
111
|
throw new SimpleError({
|
|
110
112
|
code: 'invalid_field',
|
|
111
113
|
message: 'Empty groups',
|
|
112
|
-
human: $t(`
|
|
114
|
+
human: $t(`%DV`),
|
|
113
115
|
});
|
|
114
116
|
}
|
|
115
117
|
|
|
@@ -117,7 +119,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
117
119
|
throw new SimpleError({
|
|
118
120
|
code: 'invalid_field',
|
|
119
121
|
message: 'Empty default age groups',
|
|
120
|
-
human: $t(`
|
|
122
|
+
human: $t(`%DW`),
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
125
|
|
|
@@ -125,7 +127,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
125
127
|
throw new SimpleError({
|
|
126
128
|
code: 'invalid_field',
|
|
127
129
|
message: 'Empty organization tag ids',
|
|
128
|
-
human: $t(`
|
|
130
|
+
human: $t(`%DX`),
|
|
129
131
|
});
|
|
130
132
|
}
|
|
131
133
|
|
|
@@ -158,7 +160,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
158
160
|
throw new SimpleError({
|
|
159
161
|
code: 'not_found',
|
|
160
162
|
message: 'Event not found',
|
|
161
|
-
human: $t(`
|
|
163
|
+
human: $t(`%DY`),
|
|
162
164
|
});
|
|
163
165
|
}
|
|
164
166
|
|
|
@@ -168,7 +170,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
168
170
|
throw new SimpleError({
|
|
169
171
|
code: 'invalid_field',
|
|
170
172
|
message: 'Cannot patch organizationCache',
|
|
171
|
-
human: $t(`
|
|
173
|
+
human: $t(`%DZ`),
|
|
172
174
|
field: 'meta.organizationCache',
|
|
173
175
|
});
|
|
174
176
|
}
|
|
@@ -188,7 +190,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
188
190
|
throw new SimpleError({
|
|
189
191
|
code: 'invalid_field',
|
|
190
192
|
message: 'Empty groups',
|
|
191
|
-
human: $t(`
|
|
193
|
+
human: $t(`%DV`),
|
|
192
194
|
});
|
|
193
195
|
}
|
|
194
196
|
|
|
@@ -196,7 +198,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
196
198
|
throw new SimpleError({
|
|
197
199
|
code: 'invalid_field',
|
|
198
200
|
message: 'Empty default age groups',
|
|
199
|
-
human: $t(`
|
|
201
|
+
human: $t(`%DW`),
|
|
200
202
|
});
|
|
201
203
|
}
|
|
202
204
|
|
|
@@ -204,7 +206,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
204
206
|
throw new SimpleError({
|
|
205
207
|
code: 'invalid_field',
|
|
206
208
|
message: 'Empty organization tag ids',
|
|
207
|
-
human: $t(`
|
|
209
|
+
human: $t(`%DX`),
|
|
208
210
|
});
|
|
209
211
|
}
|
|
210
212
|
|
|
@@ -300,7 +302,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
300
302
|
throw new SimpleError({
|
|
301
303
|
code: 'invalid_group',
|
|
302
304
|
message: 'Group is not of the same organization',
|
|
303
|
-
human: $t('
|
|
305
|
+
human: $t('%15c'),
|
|
304
306
|
});
|
|
305
307
|
}
|
|
306
308
|
}
|
|
@@ -317,12 +319,12 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
317
319
|
throw new SimpleError({
|
|
318
320
|
code: 'not_found',
|
|
319
321
|
message: 'Webshop not found',
|
|
320
|
-
human: $t(`
|
|
322
|
+
human: $t(`%DY`),
|
|
321
323
|
field: 'webshopId',
|
|
322
324
|
});
|
|
323
325
|
}
|
|
324
326
|
if (!await Context.auth.canAccessWebshop(webshop, PermissionLevel.Read)) {
|
|
325
|
-
throw Context.auth.error($t('
|
|
327
|
+
throw Context.auth.error($t('%185'));
|
|
326
328
|
}
|
|
327
329
|
event.webshopId = webshop.id;
|
|
328
330
|
}
|
|
@@ -375,7 +377,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
375
377
|
throw new SimpleError({
|
|
376
378
|
code: 'invalid_field',
|
|
377
379
|
message: 'Invalid typeId',
|
|
378
|
-
human: $t(`
|
|
380
|
+
human: $t(`%Da`),
|
|
379
381
|
field: 'typeId',
|
|
380
382
|
});
|
|
381
383
|
}
|
|
@@ -392,7 +394,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
392
394
|
throw new SimpleError({
|
|
393
395
|
code: 'invalid_field',
|
|
394
396
|
message: 'Empty number',
|
|
395
|
-
human: $t(`
|
|
397
|
+
human: $t(`%vQ`),
|
|
396
398
|
field: 'event_required',
|
|
397
399
|
});
|
|
398
400
|
}
|
|
@@ -404,7 +406,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
404
406
|
throw new SimpleError({
|
|
405
407
|
code: 'invalid_field',
|
|
406
408
|
message: 'Name is too short',
|
|
407
|
-
human: $t(`
|
|
409
|
+
human: $t(`%Db`),
|
|
408
410
|
field: 'name',
|
|
409
411
|
});
|
|
410
412
|
}
|
|
@@ -413,7 +415,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
413
415
|
throw new SimpleError({
|
|
414
416
|
code: 'invalid_dates',
|
|
415
417
|
message: 'End date is before start date',
|
|
416
|
-
human: $t(`
|
|
418
|
+
human: $t(`%Dc`),
|
|
417
419
|
field: 'endDate',
|
|
418
420
|
});
|
|
419
421
|
}
|
|
@@ -430,9 +432,9 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
430
432
|
throw new SimpleError({
|
|
431
433
|
code: 'minimum_days',
|
|
432
434
|
message: 'An event with this type has a minimum of ' + type.minimumDays + ' days',
|
|
433
|
-
human: $t(
|
|
435
|
+
human: $t(`%14D`, {
|
|
434
436
|
name: type.name,
|
|
435
|
-
days: Formatter.pluralText(type.minimumDays, $t(`
|
|
437
|
+
days: Formatter.pluralText(type.minimumDays, $t(`%1N7`), $t(`%1N6`)),
|
|
436
438
|
}),
|
|
437
439
|
field: 'startDate',
|
|
438
440
|
});
|
|
@@ -442,9 +444,9 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
442
444
|
throw new SimpleError({
|
|
443
445
|
code: 'maximum_days',
|
|
444
446
|
message: 'An event with this type has a maximum of ' + type.maximumDays + ' days',
|
|
445
|
-
human: $t(
|
|
447
|
+
human: $t(`%14E`, {
|
|
446
448
|
name: type.name,
|
|
447
|
-
days: Formatter.pluralText(type.maximumDays, $t(`
|
|
449
|
+
days: Formatter.pluralText(type.maximumDays, $t(`%1N7`), $t(`%1N6`)),
|
|
448
450
|
}),
|
|
449
451
|
field: 'startDate',
|
|
450
452
|
});
|
|
@@ -469,7 +471,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
469
471
|
throw new SimpleError({
|
|
470
472
|
code: 'type_maximum_reached',
|
|
471
473
|
message: 'Maximum number of events with this type reached',
|
|
472
|
-
human: $t(`
|
|
474
|
+
human: $t(`%Dd`) + ' ' + type.name + ' ' + $t(`%De`) + type.maximum + ')',
|
|
473
475
|
field: 'typeId',
|
|
474
476
|
});
|
|
475
477
|
}
|
|
@@ -478,7 +480,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
478
480
|
throw new SimpleError({
|
|
479
481
|
code: 'invalid_period',
|
|
480
482
|
message: 'No period found for this start date',
|
|
481
|
-
human: $t(`
|
|
483
|
+
human: $t(`%Df`),
|
|
482
484
|
field: 'startDate',
|
|
483
485
|
});
|
|
484
486
|
}
|
|
@@ -499,7 +501,7 @@ export class PatchEventsEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
499
501
|
const originalGroupType = existingGroup.type;
|
|
500
502
|
|
|
501
503
|
if (!await Context.auth.canAccessGroup(existingGroup)) {
|
|
502
|
-
throw Context.auth.error($t(`
|
|
504
|
+
throw Context.auth.error($t(`%1N9`));
|
|
503
505
|
}
|
|
504
506
|
|
|
505
507
|
if (event.organizationId !== existingGroup.organizationId) {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { DecodedRequest,
|
|
1
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
3
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
4
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
|
-
import {
|
|
5
|
+
import type { XlsxTransformerSheet} from '@stamhoofd/excel-writer';
|
|
6
|
+
import { ArchiverWriterAdapter, exportToExcel, XlsxWriter } from '@stamhoofd/excel-writer';
|
|
5
7
|
import { Platform, RateLimiter, sendEmailTemplate } from '@stamhoofd/models';
|
|
6
8
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
7
|
-
import {
|
|
9
|
+
import type { ExcelExportType, IPaginatedResponse, LimitedFilteredRequest} from '@stamhoofd/structures';
|
|
10
|
+
import { EmailTemplateType, ExcelExportRequest, ExcelExportResponse, Replacement, Version } from '@stamhoofd/structures';
|
|
8
11
|
import { sleep } from '@stamhoofd/utility';
|
|
9
12
|
import { Context } from '../../../helpers/Context.js';
|
|
10
13
|
import { fetchToAsyncIterator } from '../../../helpers/fetchToAsyncIterator.js';
|
|
@@ -65,7 +68,7 @@ export class ExportToExcelEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
65
68
|
throw new SimpleError({
|
|
66
69
|
code: 'not_allowed',
|
|
67
70
|
message: 'Export is pending',
|
|
68
|
-
human: $t(`
|
|
71
|
+
human: $t(`%Dg`),
|
|
69
72
|
statusCode: 403,
|
|
70
73
|
});
|
|
71
74
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Decoder} from '@simonbackx/simple-encoding';
|
|
2
|
+
import { AutoEncoder, field, StringDecoder } from '@simonbackx/simple-encoding';
|
|
3
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
4
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
5
|
+
import type { Readable } from 'node:stream';
|
|
4
6
|
import { Context } from '../../../helpers/Context.js';
|
|
5
7
|
import { FileCache } from '../../../helpers/FileCache.js';
|
|
6
8
|
import { Formatter } from '@stamhoofd/utility';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'; // ES Modules import
|
|
2
|
-
import { DecodedRequest,
|
|
2
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
3
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
4
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
5
|
import { File } from '@stamhoofd/structures';
|
|
5
6
|
import { Formatter } from '@stamhoofd/utility';
|
|
@@ -7,7 +8,8 @@ import formidable from 'formidable';
|
|
|
7
8
|
import { promises as fs } from 'fs';
|
|
8
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
+
import type { Decoder} from '@simonbackx/simple-encoding';
|
|
12
|
+
import { AutoEncoder, BooleanDecoder, field } from '@simonbackx/simple-encoding';
|
|
11
13
|
import { Context } from '../../../helpers/Context.js';
|
|
12
14
|
import { limiter } from './UploadImage.js';
|
|
13
15
|
import { Image } from '@stamhoofd/models';
|
|
@@ -121,7 +123,11 @@ export class UploadFile extends Endpoint<Params, Query, Body, ResponseBody> {
|
|
|
121
123
|
prefix += '/';
|
|
122
124
|
}
|
|
123
125
|
|
|
124
|
-
|
|
126
|
+
const envPrefix = STAMHOOFD.environment !== 'production' ? STAMHOOFD.environment : null;
|
|
127
|
+
|
|
128
|
+
if (envPrefix && envPrefix !== (STAMHOOFD.SPACES_PREFIX ?? '')) {
|
|
129
|
+
prefix += envPrefix + '/';
|
|
130
|
+
}
|
|
125
131
|
|
|
126
132
|
// Prepend user id to the file path
|
|
127
133
|
if (request.query.isPrivate && user) {
|
|
@@ -156,7 +162,7 @@ export class UploadFile extends Endpoint<Params, Query, Body, ResponseBody> {
|
|
|
156
162
|
throw new SimpleError({
|
|
157
163
|
code: 'failed_to_sign',
|
|
158
164
|
message: 'Failed to sign file',
|
|
159
|
-
human: $t('
|
|
165
|
+
human: $t('%B6'),
|
|
160
166
|
statusCode: 500,
|
|
161
167
|
});
|
|
162
168
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Decoder} from '@simonbackx/simple-encoding';
|
|
2
|
+
import { AutoEncoder, BooleanDecoder, field, ObjectData } from '@simonbackx/simple-encoding';
|
|
3
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
4
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
5
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
6
|
import { Image, RateLimiter } from '@stamhoofd/models';
|
|
5
7
|
import { Image as ImageStruct, ResolutionRequest } from '@stamhoofd/structures';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { Organization, RegistrationPeriod} from '@stamhoofd/models';
|
|
3
|
+
import { GroupFactory, OrganizationFactory, OrganizationRegistrationPeriodFactory, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
4
|
+
import type { StamhoofdFilter } from '@stamhoofd/structures';
|
|
5
|
+
import { BundleDiscountGroupPriceSettings, GroupPrice, GroupType, LimitedFilteredRequest } from '@stamhoofd/structures';
|
|
4
6
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
5
7
|
import { testServer } from '../../../../tests/helpers/TestServer.js';
|
|
6
8
|
import { initAdmin, initBundleDiscount, initPlatformAdmin } from '../../../../tests/init/index.js';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
2
|
-
import {
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
|
+
import type { CountFilteredRequest, Group as GroupStruct, StamhoofdFilter } from '@stamhoofd/structures';
|
|
4
|
+
import { assertSort, getSortFilter, LimitedFilteredRequest, PaginatedResponse } from '@stamhoofd/structures';
|
|
3
5
|
|
|
4
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
6
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
5
7
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
6
8
|
import { Group } from '@stamhoofd/models';
|
|
7
|
-
import {
|
|
9
|
+
import type { SQLFilterDefinitions, SQLSortDefinitions } from '@stamhoofd/sql';
|
|
10
|
+
import { applySQLSorter, compileToSQLFilter } from '@stamhoofd/sql';
|
|
8
11
|
import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures.js';
|
|
9
12
|
import { Context } from '../../../helpers/Context.js';
|
|
10
13
|
import { groupFilterCompilers } from '../../../sql-filters/groups.js';
|
|
@@ -115,7 +118,7 @@ export class GetGroupsEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
115
118
|
code: 'client_update_required',
|
|
116
119
|
statusCode: 400,
|
|
117
120
|
message: 'Er is een noodzakelijke update beschikbaar. Herlaad de pagina en wis indien nodig de cache van jouw browser.',
|
|
118
|
-
human: $t(`
|
|
121
|
+
human: $t(`%G8`),
|
|
119
122
|
});
|
|
120
123
|
}
|
|
121
124
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
2
|
-
import {
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
|
+
import type { MemberWithUsersRegistrationsAndGroups } from '@stamhoofd/models';
|
|
4
|
+
import { Member } from '@stamhoofd/models';
|
|
3
5
|
|
|
4
|
-
import { MembersBlob } from '@stamhoofd/structures';
|
|
6
|
+
import type { MembersBlob } from '@stamhoofd/structures';
|
|
5
7
|
import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures.js';
|
|
6
8
|
import { Context } from '../../../helpers/Context.js';
|
|
7
9
|
type Params = { id: string };
|
|
@@ -55,7 +57,7 @@ export class GetMemberFamilyEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
55
57
|
|
|
56
58
|
// Check access to this member (this will automatically give access to the family)
|
|
57
59
|
if (!await Context.auth.canAccessMember(member)) {
|
|
58
|
-
throw Context.auth.error($t(`
|
|
60
|
+
throw Context.auth.error($t(`%Dh`));
|
|
59
61
|
}
|
|
60
62
|
validatedMembers.push(member);
|
|
61
63
|
continue;
|
|
@@ -67,7 +69,7 @@ export class GetMemberFamilyEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
if (!foundMember) {
|
|
70
|
-
throw Context.auth.error($t(`
|
|
72
|
+
throw Context.auth.error($t(`%Dh`));
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
return new Response(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { DecodedRequest,
|
|
1
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
3
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
4
|
import { CountFilteredRequest, CountResponse } from '@stamhoofd/structures';
|
|
4
5
|
|
|
5
6
|
import { Context } from '../../../helpers/Context.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { Endpoint
|
|
2
|
-
import {
|
|
1
|
+
import type { Endpoint} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Request } from '@simonbackx/simple-endpoints';
|
|
3
|
+
import type { RegistrationPeriod} from '@stamhoofd/models';
|
|
4
|
+
import { EventFactory, GroupFactory, MemberFactory, OrganizationFactory, RecordCategoryFactory, RegistrationFactory, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
3
5
|
import { AccessRight, EventMeta, GroupType, LimitedFilteredRequest, NamedObject, PermissionLevel, PermissionRoleDetailed, Permissions, PermissionsResourceType, RecordAnswer, RecordTextAnswer, RecordType, ResourcePermissions } from '@stamhoofd/structures';
|
|
4
6
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
5
7
|
import { GetMembersEndpoint } from './GetMembersEndpoint.js';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { DecodedRequest,
|
|
1
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
+
import type { DecodedRequest, Request } from '@simonbackx/simple-endpoints';
|
|
3
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
3
4
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
5
|
import { Group, Member, Platform } from '@stamhoofd/models';
|
|
5
6
|
import { SQL, applySQLSorter, compileToSQLFilter } from '@stamhoofd/sql';
|
|
6
|
-
import { CountFilteredRequest,
|
|
7
|
+
import type { CountFilteredRequest, MembersBlob, StamhoofdFilter } from '@stamhoofd/structures';
|
|
8
|
+
import { GroupType, LimitedFilteredRequest, PaginatedResponse, PermissionLevel, assertSort, getSortFilter } from '@stamhoofd/structures';
|
|
9
|
+
import type { CountryCode } from '@stamhoofd/types/Country';
|
|
10
|
+
import { Country } from '@stamhoofd/types/Country';
|
|
7
11
|
import { DataValidator } from '@stamhoofd/utility';
|
|
8
|
-
|
|
9
|
-
import { SQLResultNamespacedRow } from '@simonbackx/simple-database';
|
|
10
12
|
import parsePhoneNumber from 'libphonenumber-js/max';
|
|
11
13
|
import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures.js';
|
|
12
14
|
import { Context } from '../../../helpers/Context.js';
|
|
@@ -109,7 +111,7 @@ export class GetMembersEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
109
111
|
if (groupIds.length === 0) {
|
|
110
112
|
throw Context.auth.error({
|
|
111
113
|
message: 'You must filter on a group of the organization you are trying to access',
|
|
112
|
-
human: $t(`
|
|
114
|
+
human: $t(`%15d`),
|
|
113
115
|
});
|
|
114
116
|
}
|
|
115
117
|
|
|
@@ -202,7 +204,7 @@ export class GetMembersEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
// Is lidnummer?
|
|
205
|
-
if (!searchFilter && (search.match(
|
|
207
|
+
if (!searchFilter && (search.match(/^\d{4}-\d{6}-\d{1,2}$/) || search.match(/^\d{9,10}$/))) {
|
|
206
208
|
searchFilter = {
|
|
207
209
|
memberNumber: {
|
|
208
210
|
$eq: search,
|
|
@@ -264,7 +266,7 @@ export class GetMembersEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
264
266
|
throw new SimpleError({
|
|
265
267
|
code: 'timeout',
|
|
266
268
|
message: 'Query took too long',
|
|
267
|
-
human: $t(`
|
|
269
|
+
human: $t(`%Cv`),
|
|
268
270
|
});
|
|
269
271
|
}
|
|
270
272
|
throw error;
|