@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,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 { SimpleError } from '@simonbackx/simple-errors';
|
|
4
6
|
import { BalanceItem, BalanceItemPayment, Payment, User } from '@stamhoofd/models';
|
|
5
7
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
@@ -53,7 +55,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
53
55
|
throw new SimpleError({
|
|
54
56
|
code: 'invalid_field',
|
|
55
57
|
message: 'You need to add at least one balance item payment',
|
|
56
|
-
human: $t(`
|
|
58
|
+
human: $t(`%Em`),
|
|
57
59
|
field: 'balanceItemPayments',
|
|
58
60
|
});
|
|
59
61
|
}
|
|
@@ -62,7 +64,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
62
64
|
throw new SimpleError({
|
|
63
65
|
code: 'invalid_field',
|
|
64
66
|
message: 'Invalid payment method',
|
|
65
|
-
human: $t(`
|
|
67
|
+
human: $t(`%En`),
|
|
66
68
|
field: 'method',
|
|
67
69
|
});
|
|
68
70
|
}
|
|
@@ -115,7 +117,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
115
117
|
throw new SimpleError({
|
|
116
118
|
code: 'invalid_field',
|
|
117
119
|
message: 'Transfer settings are required',
|
|
118
|
-
human: $t(`
|
|
120
|
+
human: $t(`%Eo`),
|
|
119
121
|
field: 'transferSettings',
|
|
120
122
|
});
|
|
121
123
|
}
|
|
@@ -126,7 +128,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
126
128
|
throw new SimpleError({
|
|
127
129
|
code: 'invalid_field',
|
|
128
130
|
message: 'Transfer description is required',
|
|
129
|
-
human: $t(`
|
|
131
|
+
human: $t(`%Ep`),
|
|
130
132
|
field: 'transferDescription',
|
|
131
133
|
});
|
|
132
134
|
}
|
|
@@ -140,7 +142,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
140
142
|
for (const item of put.balanceItemPayments) {
|
|
141
143
|
const balanceItem = await BalanceItem.getByID(item.balanceItem.id);
|
|
142
144
|
if (!balanceItem || balanceItem.organizationId !== organization.id) {
|
|
143
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
145
|
+
throw Context.auth.notFoundOrNoAccess($t(`%Eq`));
|
|
144
146
|
}
|
|
145
147
|
balanceItems.push(balanceItem);
|
|
146
148
|
|
|
@@ -158,7 +160,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
158
160
|
|
|
159
161
|
// Check permissions
|
|
160
162
|
if (!(await Context.auth.canAccessBalanceItems(balanceItems, PermissionLevel.Write))) {
|
|
161
|
-
throw Context.auth.error($t(`
|
|
163
|
+
throw Context.auth.error($t(`%Er`));
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
// Check total price
|
|
@@ -172,7 +174,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
172
174
|
throw new SimpleError({
|
|
173
175
|
code: 'invalid_field',
|
|
174
176
|
message: 'The price should be greater than zero',
|
|
175
|
-
human: $t(`
|
|
177
|
+
human: $t(`%Es`),
|
|
176
178
|
field: 'price',
|
|
177
179
|
});
|
|
178
180
|
}
|
|
@@ -185,7 +187,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
185
187
|
throw new SimpleError({
|
|
186
188
|
code: 'invalid_field',
|
|
187
189
|
message: 'The price should be smaller than zero',
|
|
188
|
-
human: $t(`
|
|
190
|
+
human: $t(`%Et`),
|
|
189
191
|
field: 'price',
|
|
190
192
|
});
|
|
191
193
|
}
|
|
@@ -198,7 +200,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
198
200
|
throw new SimpleError({
|
|
199
201
|
code: 'invalid_field',
|
|
200
202
|
message: 'Total price should be zero',
|
|
201
|
-
human: $t(`
|
|
203
|
+
human: $t(`%Eu`),
|
|
202
204
|
field: 'price',
|
|
203
205
|
});
|
|
204
206
|
}
|
|
@@ -207,7 +209,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
207
209
|
throw new SimpleError({
|
|
208
210
|
code: 'missing_items',
|
|
209
211
|
message: 'At least two items are required for a reallocation',
|
|
210
|
-
human: $t(`
|
|
212
|
+
human: $t(`%Ev`),
|
|
211
213
|
});
|
|
212
214
|
}
|
|
213
215
|
break;
|
|
@@ -249,7 +251,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
249
251
|
throw new SimpleError({
|
|
250
252
|
code: 'not_found',
|
|
251
253
|
message: 'Payment not found',
|
|
252
|
-
human: $t(`
|
|
254
|
+
human: $t(`%Ew`),
|
|
253
255
|
});
|
|
254
256
|
}
|
|
255
257
|
|
|
@@ -258,7 +260,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
258
260
|
throw new SimpleError({
|
|
259
261
|
code: 'invalid_field',
|
|
260
262
|
message: 'Invalid payment method',
|
|
261
|
-
human: $t(`
|
|
263
|
+
human: $t(`%Ex`),
|
|
262
264
|
});
|
|
263
265
|
}
|
|
264
266
|
}
|
|
@@ -277,7 +279,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
277
279
|
throw new SimpleError({
|
|
278
280
|
code: 'invalid_field',
|
|
279
281
|
message: 'Invalid payment method',
|
|
280
|
-
human: $t(`
|
|
282
|
+
human: $t(`%Ey`),
|
|
281
283
|
field: 'method',
|
|
282
284
|
});
|
|
283
285
|
}
|
|
@@ -300,7 +302,7 @@ export class PatchPaymentsEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
300
302
|
}
|
|
301
303
|
|
|
302
304
|
if (patch.customer) {
|
|
303
|
-
payment.customer = patchObject(payment.customer, patch.customer, {
|
|
305
|
+
// payment.customer = patchObject(payment.customer, patch.customer, { getDefaultValue: () => PaymentCustomer.create({}) });
|
|
304
306
|
}
|
|
305
307
|
|
|
306
308
|
const payingOrganizationId = patch.payingOrganizationId ?? patch.payingOrganization?.id ?? null;
|
package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalanceEndpoint.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { DetailedReceivableBalance, PaymentStatus, ReceivableBalanceType } from '@stamhoofd/structures';
|
|
3
4
|
|
|
4
5
|
import { BalanceItem, BalanceItemPayment, CachedBalance, MemberUser, Payment } from '@stamhoofd/models';
|
|
@@ -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';
|
package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesEndpoint.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
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 { CachedBalance } from '@stamhoofd/models';
|
|
5
6
|
import { applySQLSorter, compileToSQLFilter } from '@stamhoofd/sql';
|
|
6
|
-
import {
|
|
7
|
+
import type { CountFilteredRequest, DetailedReceivableBalance, ReceivableBalance as ReceivableBalanceStruct, StamhoofdFilter } from '@stamhoofd/structures';
|
|
8
|
+
import { assertSort, getSortFilter, LimitedFilteredRequest, PaginatedResponse } from '@stamhoofd/structures';
|
|
7
9
|
|
|
8
10
|
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
9
11
|
import { Context } from '../../../../helpers/Context.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
|
-
import {
|
|
2
|
+
import type { Organization, RegistrationPeriod} from '@stamhoofd/models';
|
|
3
|
+
import { GroupFactory, OrganizationFactory, OrganizationRegistrationPeriodFactory, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
3
4
|
import { GroupType, LimitedFilteredRequest, PermissionLevel, Permissions } from '@stamhoofd/structures';
|
|
4
5
|
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
5
6
|
import { GetOrganizationRegistrationPeriodsEndpoint } from './GetOrganizationRegistrationPeriodsEndpoint.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, OrganizationRegistrationPeriod as OrganizationRegistrationPeriodStruct, 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 { OrganizationRegistrationPeriod } 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 { organizationRegistrationPeriodFilterCompilers } from '../../../../sql-filters/organization-registration-periods.js';
|
|
@@ -115,7 +118,7 @@ export class GetOrganizationRegistrationPeriodsEndpoint extends Endpoint<Params,
|
|
|
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
|
|
package/src/endpoints/organization/dashboard/registration-periods/MoveRegistrationPeriods.test.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
|
-
import {
|
|
2
|
+
import type { Organization, OrganizationRegistrationPeriod, RegistrationPeriod} from '@stamhoofd/models';
|
|
3
|
+
import { GroupFactory, MemberFactory, OrganizationFactory, OrganizationRegistrationPeriodFactory, Registration, RegistrationFactory, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
3
4
|
import { Group, GroupType, OrganizationRegistrationPeriod as OrganizationRegistrationPeriodStruct, PermissionLevel, Permissions, PermissionsResourceType, ResourcePermissions, Version } from '@stamhoofd/structures';
|
|
4
5
|
import { PatchOrganizationRegistrationPeriodsEndpoint } from './PatchOrganizationRegistrationPeriodsEndpoint.js';
|
|
5
6
|
|
|
6
|
-
import {
|
|
7
|
+
import type { PatchableArrayAutoEncoder } from '@simonbackx/simple-encoding';
|
|
8
|
+
import { PatchableArray } from '@simonbackx/simple-encoding';
|
|
7
9
|
|
|
8
10
|
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
9
11
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
|
-
import {
|
|
2
|
+
import type { Organization} from '@stamhoofd/models';
|
|
3
|
+
import { GroupFactory, OrganizationFactory, OrganizationRegistrationPeriod, OrganizationRegistrationPeriodFactory, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
3
4
|
import { GroupSettings, Group as GroupStruct, OrganizationRegistrationPeriod as OrganizationRegistrationPeriodStruct, PermissionLevel, Permissions, Version } from '@stamhoofd/structures';
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import type { PatchableArrayAutoEncoder } from '@simonbackx/simple-encoding';
|
|
7
|
+
import { PatchableArray } from '@simonbackx/simple-encoding';
|
|
6
8
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
7
9
|
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
8
10
|
import { PatchOrganizationRegistrationPeriodsEndpoint } from './PatchOrganizationRegistrationPeriodsEndpoint.js';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { GroupPrivateSettings, Group as GroupStruct, GroupType, OrganizationRegistrationPeriod as OrganizationRegistrationPeriodStruct, PermissionLevel, PermissionsResourceType, ResourcePermissions, Version } from '@stamhoofd/structures';
|
|
3
4
|
|
|
4
|
-
import { AutoEncoderPatchType, Decoder, PatchableArrayAutoEncoder
|
|
5
|
+
import type { AutoEncoderPatchType, Decoder, PatchableArrayAutoEncoder} from '@simonbackx/simple-encoding';
|
|
6
|
+
import { PatchableArrayDecoder, StringDecoder } from '@simonbackx/simple-encoding';
|
|
5
7
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
6
|
-
import {
|
|
8
|
+
import type { Organization} from '@stamhoofd/models';
|
|
9
|
+
import { Event, Group, OrganizationRegistrationPeriod, Platform, Registration, RegistrationPeriod } from '@stamhoofd/models';
|
|
7
10
|
import { SQL } from '@stamhoofd/sql';
|
|
8
11
|
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
9
12
|
import { Context } from '../../../../helpers/Context.js';
|
|
@@ -60,7 +63,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
60
63
|
throw new SimpleError({
|
|
61
64
|
code: 'not_found',
|
|
62
65
|
message: 'Period not found',
|
|
63
|
-
human: $t('
|
|
66
|
+
human: $t('%15j'),
|
|
64
67
|
statusCode: 404,
|
|
65
68
|
});
|
|
66
69
|
}
|
|
@@ -71,7 +74,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
71
74
|
throw new SimpleError({
|
|
72
75
|
code: 'not_found',
|
|
73
76
|
message: 'Period not found',
|
|
74
|
-
human: $t('
|
|
77
|
+
human: $t('%15j'),
|
|
75
78
|
statusCode: 404,
|
|
76
79
|
});
|
|
77
80
|
}
|
|
@@ -80,7 +83,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
80
83
|
throw new SimpleError({
|
|
81
84
|
code: 'locked_period',
|
|
82
85
|
message: 'This period is locked',
|
|
83
|
-
human: $t(
|
|
86
|
+
human: $t(`%15m`, { '2000-2001': period.getStructure().nameShort }),
|
|
84
87
|
});
|
|
85
88
|
}
|
|
86
89
|
|
|
@@ -125,7 +128,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
if (!await Context.auth.canCreateGroupInCategory(organization.id, category)) {
|
|
128
|
-
throw Context.auth.error($t(`
|
|
131
|
+
throw Context.auth.error($t(`%Ez`));
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
// Only process puts
|
|
@@ -149,7 +152,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
149
152
|
code: 'invalid_field',
|
|
150
153
|
field: 'categories',
|
|
151
154
|
message: 'Cannot have groups and categories combined',
|
|
152
|
-
human: $t(`
|
|
155
|
+
human: $t(`%F0`),
|
|
153
156
|
});
|
|
154
157
|
}
|
|
155
158
|
}
|
|
@@ -170,7 +173,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
170
173
|
const isDeleted = refCountAfter < refCountBefore;
|
|
171
174
|
|
|
172
175
|
if (isDeleted) {
|
|
173
|
-
throw Context.auth.error($t(`
|
|
176
|
+
throw Context.auth.error($t(`%F1`));
|
|
174
177
|
}
|
|
175
178
|
}
|
|
176
179
|
|
|
@@ -178,11 +181,11 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
178
181
|
|
|
179
182
|
if (!categoryAfter) {
|
|
180
183
|
if (locked) {
|
|
181
|
-
throw Context.auth.error($t(`
|
|
184
|
+
throw Context.auth.error($t(`%F1`));
|
|
182
185
|
}
|
|
183
186
|
}
|
|
184
187
|
else if (locked !== categoryAfter.settings.locked) {
|
|
185
|
-
throw Context.auth.error($t(`
|
|
188
|
+
throw Context.auth.error($t(`%F2`));
|
|
186
189
|
}
|
|
187
190
|
|
|
188
191
|
if (!locked || !categoryAfter) {
|
|
@@ -193,7 +196,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
193
196
|
const settingsAfter = categoryAfter.settings;
|
|
194
197
|
|
|
195
198
|
if (settingsBefore.name !== settingsAfter.name) {
|
|
196
|
-
throw Context.auth.error($t(`
|
|
199
|
+
throw Context.auth.error($t(`%F3`));
|
|
197
200
|
}
|
|
198
201
|
}
|
|
199
202
|
}
|
|
@@ -219,7 +222,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
219
222
|
throw new SimpleError({
|
|
220
223
|
code: 'invalid_group_type',
|
|
221
224
|
message: 'Cannot create groups for events via this endpoint',
|
|
222
|
-
human: $t(`
|
|
225
|
+
human: $t(`%1HF`),
|
|
223
226
|
});
|
|
224
227
|
}
|
|
225
228
|
|
|
@@ -272,7 +275,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
272
275
|
throw new SimpleError({
|
|
273
276
|
code: 'invalid_default_age_group',
|
|
274
277
|
message: 'Invalid default age group',
|
|
275
|
-
human: $t(`
|
|
278
|
+
human: $t(`%F4`),
|
|
276
279
|
statusCode: 400,
|
|
277
280
|
});
|
|
278
281
|
}
|
|
@@ -280,7 +283,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
280
283
|
throw new SimpleError({
|
|
281
284
|
code: 'invalid_default_age_group',
|
|
282
285
|
message: 'Invalid default age group',
|
|
283
|
-
human: $t(`
|
|
286
|
+
human: $t(`%F5`),
|
|
284
287
|
statusCode: 400,
|
|
285
288
|
});
|
|
286
289
|
}
|
|
@@ -292,7 +295,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
292
295
|
throw new SimpleError({
|
|
293
296
|
code: 'not_found',
|
|
294
297
|
message: 'Period not found',
|
|
295
|
-
human: $t('
|
|
298
|
+
human: $t('%15j'),
|
|
296
299
|
statusCode: 404,
|
|
297
300
|
});
|
|
298
301
|
}
|
|
@@ -309,7 +312,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
309
312
|
throw new SimpleError({
|
|
310
313
|
code: 'locked_period',
|
|
311
314
|
message: 'Period is locked',
|
|
312
|
-
human: $t(
|
|
315
|
+
human: $t(`%15m`, { '2000-2001': period.getStructure().nameShort }),
|
|
313
316
|
});
|
|
314
317
|
}
|
|
315
318
|
|
|
@@ -318,7 +321,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
318
321
|
throw new SimpleError({
|
|
319
322
|
code: 'invalid_field',
|
|
320
323
|
message: 'Period start date is too far in the future',
|
|
321
|
-
human: $t('
|
|
324
|
+
human: $t('%15k'),
|
|
322
325
|
field: 'period',
|
|
323
326
|
});
|
|
324
327
|
}
|
|
@@ -328,7 +331,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
328
331
|
throw new SimpleError({
|
|
329
332
|
code: 'invalid_field',
|
|
330
333
|
message: 'Period has ended',
|
|
331
|
-
human: $t('
|
|
334
|
+
human: $t('%15l'),
|
|
332
335
|
field: 'period',
|
|
333
336
|
});
|
|
334
337
|
}
|
|
@@ -363,7 +366,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
363
366
|
static async deleteGroup(id: string) {
|
|
364
367
|
const model = await Group.getByID(id);
|
|
365
368
|
if (!model || !await Context.auth.canAccessGroup(model, PermissionLevel.Full)) {
|
|
366
|
-
throw Context.auth.error($t(`
|
|
369
|
+
throw Context.auth.error($t(`%F6`));
|
|
367
370
|
}
|
|
368
371
|
|
|
369
372
|
model.deletedAt = new Date();
|
|
@@ -382,7 +385,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
382
385
|
const model = await Group.getByID(struct.id);
|
|
383
386
|
|
|
384
387
|
if (!model || !await Context.auth.canAccessGroup(model, PermissionLevel.Full)) {
|
|
385
|
-
throw Context.auth.error($t(`
|
|
388
|
+
throw Context.auth.error($t(`%F7`));
|
|
386
389
|
}
|
|
387
390
|
|
|
388
391
|
if (struct.settings) {
|
|
@@ -401,7 +404,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
401
404
|
throw new SimpleError({
|
|
402
405
|
code: 'missing_permissions',
|
|
403
406
|
message: 'You cannot restrict your own permissions',
|
|
404
|
-
human: $t(`
|
|
407
|
+
human: $t(`%F8`),
|
|
405
408
|
});
|
|
406
409
|
}
|
|
407
410
|
}
|
|
@@ -440,7 +443,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
440
443
|
throw new SimpleError({
|
|
441
444
|
code: 'locked_period',
|
|
442
445
|
message: 'This period is locked',
|
|
443
|
-
human: Context.i18n.$t('
|
|
446
|
+
human: Context.i18n.$t('%AW'),
|
|
444
447
|
});
|
|
445
448
|
}
|
|
446
449
|
}
|
|
@@ -478,7 +481,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
478
481
|
throw new SimpleError({
|
|
479
482
|
code: 'locked_period',
|
|
480
483
|
message: 'This period is locked',
|
|
481
|
-
human: $t('
|
|
484
|
+
human: $t('%1HS'),
|
|
482
485
|
});
|
|
483
486
|
}
|
|
484
487
|
}
|
|
@@ -536,7 +539,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
536
539
|
code: 'invalid_field',
|
|
537
540
|
field: 'periodId',
|
|
538
541
|
message: 'Group has waiting list with other groups in the current period',
|
|
539
|
-
human: $t('
|
|
542
|
+
human: $t('%1HT'),
|
|
540
543
|
});
|
|
541
544
|
}
|
|
542
545
|
}
|
|
@@ -591,7 +594,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
591
594
|
code: 'invalid_field',
|
|
592
595
|
field: 'waitingList',
|
|
593
596
|
message: 'Waiting list group is already used in another period',
|
|
594
|
-
human: $t(`
|
|
597
|
+
human: $t(`%F9`),
|
|
595
598
|
});
|
|
596
599
|
}
|
|
597
600
|
|
|
@@ -658,7 +661,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
658
661
|
|
|
659
662
|
if (struct.type !== GroupType.EventRegistration && !allowedIds.includes(struct.id)) {
|
|
660
663
|
if (!await Context.auth.hasFullAccess(organizationId)) {
|
|
661
|
-
throw Context.auth.error($t(`
|
|
664
|
+
throw Context.auth.error($t(`%FA`));
|
|
662
665
|
}
|
|
663
666
|
}
|
|
664
667
|
else {
|
|
@@ -669,7 +672,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
669
672
|
throw new SimpleError({
|
|
670
673
|
code: 'invalid_period',
|
|
671
674
|
message: 'Period is locked',
|
|
672
|
-
human: Context.i18n.$t('
|
|
675
|
+
human: Context.i18n.$t('%AW'),
|
|
673
676
|
});
|
|
674
677
|
}
|
|
675
678
|
|
|
@@ -730,7 +733,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
|
|
|
730
733
|
throw new SimpleError({
|
|
731
734
|
code: 'missing_permissions',
|
|
732
735
|
message: 'You cannot restrict your own permissions',
|
|
733
|
-
human: $t(`
|
|
736
|
+
human: $t(`%FB`),
|
|
734
737
|
});
|
|
735
738
|
}
|
|
736
739
|
}
|
package/src/endpoints/organization/dashboard/registration-periods/SetupStepReviewEndpoint.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
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 { OrganizationRegistrationPeriod as OrganizationRegistrationPeriodStruct} from '@stamhoofd/structures';
|
|
4
|
+
import { SetupStepType } from '@stamhoofd/structures';
|
|
3
5
|
|
|
4
|
-
import {
|
|
6
|
+
import type { Decoder} from '@simonbackx/simple-encoding';
|
|
7
|
+
import { AutoEncoder, BooleanDecoder, EnumDecoder, field } from '@simonbackx/simple-encoding';
|
|
5
8
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
6
9
|
import { OrganizationRegistrationPeriod } from '@stamhoofd/models';
|
|
7
10
|
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
3
4
|
import { StripeAccount } from '@stamhoofd/models';
|
|
4
5
|
import { AuditLogType, PermissionLevel, StripeAccount as StripeAccountStruct } from '@stamhoofd/structures';
|
|
5
|
-
import Stripe from 'stripe';
|
|
6
|
+
import type Stripe from 'stripe';
|
|
6
7
|
|
|
7
8
|
import { Context } from '../../../../helpers/Context.js';
|
|
8
9
|
import { StripeHelper } from '../../../../helpers/StripeHelper.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { StripeAccount } from '@stamhoofd/models';
|
|
3
4
|
import { AuditLogType, PermissionLevel } from '@stamhoofd/structures';
|
|
4
5
|
|
|
@@ -39,7 +40,7 @@ export class DeleteStripeAccountEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
39
40
|
// Search account in database
|
|
40
41
|
const model = await StripeAccount.getByID(request.params.id);
|
|
41
42
|
if (!model || model.organizationId !== organization.id || model.status !== 'active') {
|
|
42
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
43
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FC`));
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
if (STAMHOOFD.STRIPE_ACCOUNT_ID && model.accountId === STAMHOOFD.STRIPE_ACCOUNT_ID) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
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';
|
|
3
5
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
6
|
import { StripeAccount } from '@stamhoofd/models';
|
|
5
7
|
import { PermissionLevel } from '@stamhoofd/structures';
|
|
@@ -57,7 +59,7 @@ export class GetStripeAccountLinkEndpoint extends Endpoint<Params, Query, Body,
|
|
|
57
59
|
// Search account in database
|
|
58
60
|
const model = await StripeAccount.getByID(request.body.accountId);
|
|
59
61
|
if (!model || model.organizationId !== organization.id || model.status !== 'active') {
|
|
60
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
62
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FC`));
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
// Get account
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { StripeAccount } from '@stamhoofd/models';
|
|
3
4
|
import { PermissionLevel, StripeAccount as StripeAccountStruct } from '@stamhoofd/structures';
|
|
4
5
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
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';
|
|
3
5
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
6
|
import { StripeAccount, Token } from '@stamhoofd/models';
|
|
5
7
|
import { PermissionLevel } from '@stamhoofd/structures';
|
|
@@ -53,7 +55,7 @@ export class GetStripeLoginLinkEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
53
55
|
if (!model || model.organizationId !== organization.id || model.status !== 'active') {
|
|
54
56
|
throw new SimpleError({
|
|
55
57
|
code: 'not_found',
|
|
56
|
-
message: $t(`
|
|
58
|
+
message: $t(`%FC`),
|
|
57
59
|
statusCode: 400,
|
|
58
60
|
});
|
|
59
61
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { StripeAccount } from '@stamhoofd/models';
|
|
3
4
|
import { AuditLogSource, PermissionLevel, StripeAccount as StripeAccountStruct } from '@stamhoofd/structures';
|
|
4
5
|
|
|
@@ -38,7 +39,7 @@ export class UpdateStripeAccountEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
38
39
|
// Search account in database
|
|
39
40
|
const model = await StripeAccount.getByID(request.params.id);
|
|
40
41
|
if (!model || model.organizationId !== organization.id) {
|
|
41
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
42
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FC`));
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
// Get account
|
|
@@ -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 { SimpleError } from '@simonbackx/simple-errors';
|
|
4
5
|
import { Token, User } from '@stamhoofd/models';
|
|
5
6
|
import { ApiUser, ApiUserWithToken, UserMeta, UserPermissions } from '@stamhoofd/structures';
|
|
@@ -61,7 +62,7 @@ export class CreateApiUserEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
61
62
|
const rateLimits = request.body.meta.rateLimits;
|
|
62
63
|
if (rateLimits) {
|
|
63
64
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
64
|
-
throw Context.auth.error($t('
|
|
65
|
+
throw Context.auth.error($t('%FD'));
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
admin.meta = admin.meta ?? UserMeta.create({});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
3
4
|
import { User } from '@stamhoofd/models';
|
|
4
5
|
|
|
@@ -41,7 +42,7 @@ export class DeleteUserEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
41
42
|
if (user.id == request.params.id) {
|
|
42
43
|
throw new SimpleError({
|
|
43
44
|
code: 'permission_denied',
|
|
44
|
-
message: $t(`
|
|
45
|
+
message: $t(`%FE`),
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -49,7 +50,7 @@ export class DeleteUserEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
49
50
|
if (!editUser || !Context.auth.checkScope(editUser.organizationId)) {
|
|
50
51
|
throw new SimpleError({
|
|
51
52
|
code: 'permission_denied',
|
|
52
|
-
message: $t(`
|
|
53
|
+
message: $t(`%FF`),
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
|