@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,7 +1,8 @@
|
|
|
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 { Token, User } from '@stamhoofd/models';
|
|
4
|
-
import { ApiUser } from '@stamhoofd/structures';
|
|
5
|
+
import type { ApiUser } from '@stamhoofd/structures';
|
|
5
6
|
|
|
6
7
|
import { Context } from '../../../../helpers/Context.js';
|
|
7
8
|
type Params = Record<string, never>;
|
|
@@ -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 { User } from '@stamhoofd/models';
|
|
3
4
|
import { OrganizationAdmins } from '@stamhoofd/structures';
|
|
4
5
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { AutoEncoderPatchType, Decoder
|
|
2
|
-
import {
|
|
1
|
+
import type { AutoEncoderPatchType, Decoder} from '@simonbackx/simple-encoding';
|
|
2
|
+
import { isPatch } 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 { Token, User } from '@stamhoofd/models';
|
|
5
7
|
import { ApiUser, PermissionLevel, UserMeta, UserPermissions } from '@stamhoofd/structures';
|
|
@@ -41,7 +43,7 @@ export class PatchApiUserEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
41
43
|
const editUser = request.body.id === user.id ? user : await User.getByID(request.body.id);
|
|
42
44
|
|
|
43
45
|
if (!editUser || !await Context.auth.canAccessUser(editUser, PermissionLevel.Write) || !editUser.isApiUser) {
|
|
44
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
46
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FG`));
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
editUser.firstName = request.body.name ?? editUser.name;
|
|
@@ -96,7 +98,7 @@ export class PatchApiUserEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
96
98
|
const rateLimits = request.body.meta.rateLimits;
|
|
97
99
|
if (rateLimits && rateLimits !== editUser.meta?.rateLimits) {
|
|
98
100
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
99
|
-
throw Context.auth.error($t('
|
|
101
|
+
throw Context.auth.error($t('%FD'));
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
editUser.meta = editUser.meta ?? UserMeta.create({});
|
|
@@ -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, SimpleErrors } from '@simonbackx/simple-errors';
|
|
4
5
|
import { Webshop } from '@stamhoofd/models';
|
|
5
6
|
import { PermissionLevel, PermissionsResourceType, PrivateWebshop, ResourcePermissions, Version, WebshopPrivateMetaData } from '@stamhoofd/structures';
|
|
@@ -38,7 +39,7 @@ export class CreateWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
38
39
|
|
|
39
40
|
// Fast throw first (more in depth checking for patches later)
|
|
40
41
|
if (!await Context.auth.canCreateWebshops(organization.id)) {
|
|
41
|
-
throw Context.auth.error($t(`
|
|
42
|
+
throw Context.auth.error($t(`%FH`));
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
const errors = new SimpleErrors();
|
|
@@ -141,7 +142,7 @@ export class CreateWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
141
142
|
throw new SimpleError({
|
|
142
143
|
code: 'failed_to_generate_unique_uri',
|
|
143
144
|
message: 'Failed to generate unique uri',
|
|
144
|
-
human: $t(`
|
|
145
|
+
human: $t(`%FI`),
|
|
145
146
|
statusCode: 500,
|
|
146
147
|
});
|
|
147
148
|
}
|
|
@@ -168,7 +169,7 @@ export class CreateWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
168
169
|
throw new SimpleError({
|
|
169
170
|
code: 'missing_permissions',
|
|
170
171
|
message: 'You cannot create a webshop without having full permissions on the created webshop',
|
|
171
|
-
human: $t(`
|
|
172
|
+
human: $t(`%FJ`),
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
175
|
|
|
@@ -211,7 +212,7 @@ export class CreateWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
211
212
|
throw new SimpleError({
|
|
212
213
|
code: 'failed_to_generate_unique_domainUri',
|
|
213
214
|
message: 'Failed to generate unique domainUri',
|
|
214
|
-
human: $t(`
|
|
215
|
+
human: $t(`%FI`),
|
|
215
216
|
statusCode: 500,
|
|
216
217
|
});
|
|
217
218
|
}
|
|
@@ -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 { BalanceItem, Order, Webshop } from '@stamhoofd/models';
|
|
3
4
|
import { PermissionLevel } from '@stamhoofd/structures';
|
|
4
5
|
|
|
@@ -47,7 +48,7 @@ export class DeleteWebshopEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
47
48
|
throw new SimpleError({
|
|
48
49
|
code: 'webshop_has_registered_ticket_sales',
|
|
49
50
|
message: `Webshop ${webshop.id} has registered ticket sales`,
|
|
50
|
-
human: $t(`
|
|
51
|
+
human: $t(`%1DL`),
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
|
|
@@ -1,7 +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 { Webshop, WebshopDiscountCode } from '@stamhoofd/models';
|
|
4
|
-
import { DiscountCode
|
|
5
|
+
import type { DiscountCode} from '@stamhoofd/structures';
|
|
6
|
+
import { PermissionLevel } from '@stamhoofd/structures';
|
|
5
7
|
|
|
6
8
|
import { Context } from '../../../../helpers/Context.js';
|
|
7
9
|
|
|
@@ -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,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, PrivateOrder, StamhoofdFilter } from '@stamhoofd/structures';
|
|
4
|
+
import { assertSort, getOrderSearchFilter, getSortFilter, LimitedFilteredRequest, PaginatedResponse } from '@stamhoofd/structures';
|
|
3
5
|
|
|
4
6
|
import { Order } from '@stamhoofd/models';
|
|
5
|
-
import {
|
|
7
|
+
import type { SQLFilterDefinitions, SQLSortDefinitions } from '@stamhoofd/sql';
|
|
8
|
+
import { applySQLSorter, compileToSQLFilter, SQL } from '@stamhoofd/sql';
|
|
6
9
|
|
|
7
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
10
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
8
11
|
import { parsePhoneNumber } from 'libphonenumber-js/max';
|
|
9
12
|
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
10
13
|
import { Context } from '../../../../helpers/Context.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
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
|
-
import { GetWebshopTicketsEndpoint } from './GetWebshopTicketsEndpoint';
|
|
5
|
+
import { GetWebshopTicketsEndpoint } from './GetWebshopTicketsEndpoint.js';
|
|
5
6
|
|
|
6
|
-
import { Context } from '../../../../helpers/Context';
|
|
7
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
7
8
|
|
|
8
9
|
type Params = Record<string, never>;
|
|
9
10
|
type Query = CountFilteredRequest;
|
|
@@ -35,10 +36,9 @@ export class GetWebshopTicketsCountEndpoint extends Endpoint<Params, Query, Body
|
|
|
35
36
|
throw Context.auth.error();
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
const query = GetWebshopTicketsEndpoint.buildQuery(request.query);
|
|
39
|
+
const query = await GetWebshopTicketsEndpoint.buildQuery(request.query);
|
|
39
40
|
|
|
40
|
-
const count = await query
|
|
41
|
-
.count();
|
|
41
|
+
const count = await query.count();
|
|
42
42
|
|
|
43
43
|
return new Response(
|
|
44
44
|
CountResponse.create({
|
|
@@ -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 { Ticket } from '@stamhoofd/models';
|
|
4
|
-
import {
|
|
5
|
+
import type { CountFilteredRequest, TicketPrivate } from '@stamhoofd/structures';
|
|
6
|
+
import { assertSort, getSortFilter, LimitedFilteredRequest, PaginatedResponse } from '@stamhoofd/structures';
|
|
5
7
|
|
|
6
|
-
import {
|
|
8
|
+
import type { SQLFilterDefinitions, SQLSortDefinitions } from '@stamhoofd/sql';
|
|
9
|
+
import { applySQLSorter, compileToSQLFilter, SQL } from '@stamhoofd/sql';
|
|
7
10
|
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
8
11
|
import { Context } from '../../../../helpers/Context.js';
|
|
9
12
|
import { LimitedFilteredRequestHelper } from '../../../../helpers/LimitedFilteredRequestHelper.js';
|
|
@@ -47,7 +50,7 @@ export class GetWebshopTicketsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
47
50
|
}, filterCompilers)));
|
|
48
51
|
|
|
49
52
|
if (q.filter) {
|
|
50
|
-
query.where(await
|
|
53
|
+
query.where(await compileToSQLFilter(q.filter, filterCompilers));
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
// currently no search supported, probably not needed?
|
|
@@ -56,7 +59,7 @@ export class GetWebshopTicketsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
56
59
|
|
|
57
60
|
if (q instanceof LimitedFilteredRequest) {
|
|
58
61
|
if (q.pageFilter) {
|
|
59
|
-
query.where(await
|
|
62
|
+
query.where(await compileToSQLFilter(q.pageFilter, filterCompilers));
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
q.sort = assertSort(q.sort, [{ key: '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 { Webshop } from '@stamhoofd/models';
|
|
4
6
|
import { PermissionLevel, WebshopUriAvailabilityResponse } from '@stamhoofd/structures';
|
|
5
7
|
|
|
@@ -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 { Webshop, WebshopDiscountCode } from '@stamhoofd/models';
|
|
5
7
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
@@ -66,7 +68,7 @@ export class PatchWebshopDiscountCodesEndpoint extends Endpoint<Params, Query, B
|
|
|
66
68
|
throw new SimpleError({
|
|
67
69
|
code: 'used_code',
|
|
68
70
|
message: 'Discount code already in use',
|
|
69
|
-
human: $t(`
|
|
71
|
+
human: $t(`%FK`) + ' ' + struct.code + $t(`%FL`),
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
throw e;
|
|
@@ -98,7 +100,7 @@ export class PatchWebshopDiscountCodesEndpoint extends Endpoint<Params, Query, B
|
|
|
98
100
|
throw new SimpleError({
|
|
99
101
|
code: 'used_code',
|
|
100
102
|
message: 'Discount code already in use',
|
|
101
|
-
human: $t(`
|
|
103
|
+
human: $t(`%FK`) + ' ' + model.code + $t(`%FL`),
|
|
102
104
|
});
|
|
103
105
|
}
|
|
104
106
|
throw e;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AutoEncoderPatchType, Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { DecodedRequest,
|
|
1
|
+
import type { AutoEncoderPatchType, 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 { Webshop } from '@stamhoofd/models';
|
|
5
6
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
@@ -53,7 +54,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
53
54
|
if (request.body.meta) {
|
|
54
55
|
request.body.meta.domainActive = undefined;
|
|
55
56
|
if (request.body.meta.customCode !== undefined && !await Context.auth.hasFullAccess(organization.id)) {
|
|
56
|
-
throw Context.auth.error($t('
|
|
57
|
+
throw Context.auth.error($t('%15n'));
|
|
57
58
|
}
|
|
58
59
|
webshop.meta.patchOrPut(request.body.meta);
|
|
59
60
|
}
|
|
@@ -74,7 +75,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
74
75
|
|
|
75
76
|
if (request.body.domain !== undefined) {
|
|
76
77
|
if (request.body.domain !== null) {
|
|
77
|
-
const cleaned = request.body.domain.toLowerCase().replace(/[^a-
|
|
78
|
+
const cleaned = request.body.domain.toLowerCase().replace(/[^a-z0-9-.]/gi, '');
|
|
78
79
|
|
|
79
80
|
if (cleaned !== webshop.domain) {
|
|
80
81
|
webshop.domain = cleaned;
|
|
@@ -94,7 +95,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
94
95
|
throw new SimpleError({
|
|
95
96
|
code: 'domain_already_used',
|
|
96
97
|
message: 'This domain is already used by another organization',
|
|
97
|
-
human: $t(`
|
|
98
|
+
human: $t(`%FM`),
|
|
98
99
|
statusCode: 400,
|
|
99
100
|
});
|
|
100
101
|
}
|
|
@@ -110,7 +111,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
110
111
|
throw new SimpleError({
|
|
111
112
|
code: 'invalid_field',
|
|
112
113
|
message: 'Invalid domain',
|
|
113
|
-
human: $t(`
|
|
114
|
+
human: $t(`%FN`),
|
|
114
115
|
field: 'customUrl',
|
|
115
116
|
});
|
|
116
117
|
}
|
|
@@ -131,7 +132,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
131
132
|
throw new SimpleError({
|
|
132
133
|
code: 'invalid_field',
|
|
133
134
|
message: 'domainUri contains invalid characters',
|
|
134
|
-
human: $t(`
|
|
135
|
+
human: $t(`%FO`),
|
|
135
136
|
field: 'customUrl',
|
|
136
137
|
});
|
|
137
138
|
}
|
|
@@ -142,7 +143,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
142
143
|
throw new SimpleError({
|
|
143
144
|
code: 'invalid_domain',
|
|
144
145
|
message: 'This domain is already in use',
|
|
145
|
-
human: $t(`
|
|
146
|
+
human: $t(`%FP`) + ' ' + existing.meta.name + $t(`%FQ`),
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
149
|
}
|
|
@@ -162,7 +163,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
162
163
|
throw new SimpleError({
|
|
163
164
|
code: 'invalid_field',
|
|
164
165
|
message: 'Uri cannot be empty',
|
|
165
|
-
human: $t(`
|
|
166
|
+
human: $t(`%FR`),
|
|
166
167
|
field: 'uri',
|
|
167
168
|
});
|
|
168
169
|
}
|
|
@@ -171,7 +172,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
171
172
|
throw new SimpleError({
|
|
172
173
|
code: 'invalid_field',
|
|
173
174
|
message: 'Uri contains invalid characters',
|
|
174
|
-
human: $t(`
|
|
175
|
+
human: $t(`%FO`),
|
|
175
176
|
field: 'uri',
|
|
176
177
|
});
|
|
177
178
|
}
|
|
@@ -184,7 +185,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
184
185
|
throw new SimpleError({
|
|
185
186
|
code: 'missing_permissions',
|
|
186
187
|
message: 'You cannot restrict your own permissions',
|
|
187
|
-
human: $t(`
|
|
188
|
+
human: $t(`%FS`),
|
|
188
189
|
});
|
|
189
190
|
}
|
|
190
191
|
|
|
@@ -197,7 +198,7 @@ export class PatchWebshopEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
197
198
|
throw new SimpleError({
|
|
198
199
|
code: 'invalid_field',
|
|
199
200
|
message: 'Uri already in use',
|
|
200
|
-
human: $t(`
|
|
201
|
+
human: $t(`%FT`),
|
|
201
202
|
field: 'uri',
|
|
202
203
|
});
|
|
203
204
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AutoEncoderPatchType, Data, Decoder, PatchableArrayAutoEncoder} from '@simonbackx/simple-encoding';
|
|
2
|
+
import { ArrayDecoder, PatchableArray, PatchableArrayDecoder, 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, Order, Payment, Webshop, WebshopCounter } from '@stamhoofd/models';
|
|
5
7
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AutoEncoderPatchType, Decoder } from '@simonbackx/simple-encoding';
|
|
2
|
+
import { ArrayDecoder } 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, SimpleErrors } from '@simonbackx/simple-errors';
|
|
4
6
|
import { Ticket, Token, Webshop } from '@stamhoofd/models';
|
|
5
7
|
import { PermissionLevel, TicketPrivate } from '@stamhoofd/structures';
|
|
@@ -42,7 +44,7 @@ export class PatchWebshopTicketsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
42
44
|
|
|
43
45
|
const webshop = await Webshop.getByID(request.params.id);
|
|
44
46
|
if (!webshop || !await Context.auth.canAccessWebshopTickets(webshop, PermissionLevel.Write)) {
|
|
45
|
-
throw Context.auth.notFoundOrNoAccess($t(`
|
|
47
|
+
throw Context.auth.notFoundOrNoAccess($t(`%FU`));
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
const tickets: Ticket[] = [];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { UitpasService } from '../../../../services/uitpas/UitpasService.js';
|
|
3
|
-
import {
|
|
4
|
+
import type { Decoder} from '@simonbackx/simple-encoding';
|
|
5
|
+
import { AutoEncoder, field, StringDecoder } from '@simonbackx/simple-encoding';
|
|
4
6
|
import { Context } from '../../../../helpers/Context.js';
|
|
5
|
-
import { UitpasEventsResponse } from '@stamhoofd/structures';
|
|
7
|
+
import type { UitpasEventsResponse } from '@stamhoofd/structures';
|
|
6
8
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
7
9
|
|
|
8
10
|
type Params = Record<string, never>;
|
|
@@ -41,7 +43,7 @@ export class SearchUitpasEventsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
41
43
|
throw new SimpleError({
|
|
42
44
|
code: 'no_uitpas_organizer_id',
|
|
43
45
|
message: `No UiTPAS organizer ID set for organization`,
|
|
44
|
-
human: $t(`
|
|
46
|
+
human: $t(`%1BH`),
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
const uitpasOrganizersResponse = await UitpasService.searchUitpasEvents(organization.id, organization.meta.uitpasOrganizerId, request.query.text);
|
|
@@ -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 { Token, Webshop } from '@stamhoofd/models';
|
|
4
5
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Decoder} from '@simonbackx/simple-encoding';
|
|
2
|
+
import { AutoEncoder, BooleanDecoder, field } 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 { Order } from '@stamhoofd/models';
|
|
5
|
-
import { PaymentGeneral } from '@stamhoofd/structures';
|
|
7
|
+
import type { PaymentGeneral } from '@stamhoofd/structures';
|
|
6
8
|
|
|
7
9
|
import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures.js';
|
|
8
10
|
import { Context } from '../../../helpers/Context.js';
|
|
@@ -53,7 +55,7 @@ export class ExchangePaymentEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
53
55
|
if (!payment) {
|
|
54
56
|
throw new SimpleError({
|
|
55
57
|
code: '',
|
|
56
|
-
message: $t('
|
|
58
|
+
message: $t('%EF'),
|
|
57
59
|
});
|
|
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 { SimpleError } from '@simonbackx/simple-errors';
|
|
3
4
|
import { signInternal } from '@stamhoofd/backend-env';
|
|
4
5
|
import { Document, Organization } from '@stamhoofd/models';
|
|
@@ -31,7 +32,7 @@ export class GetDocumentHtml extends Endpoint<Params, Query, Body, ResponseBody>
|
|
|
31
32
|
if (!document || !(await Context.auth.canAccessDocument(document))) {
|
|
32
33
|
throw new SimpleError({
|
|
33
34
|
code: 'not_found',
|
|
34
|
-
message: $t('
|
|
35
|
+
message: $t('%EK'),
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -48,7 +49,7 @@ export class GetDocumentHtml extends Endpoint<Params, Query, Body, ResponseBody>
|
|
|
48
49
|
if (!html) {
|
|
49
50
|
throw new SimpleError({
|
|
50
51
|
code: 'failed_generating',
|
|
51
|
-
message: $t('
|
|
52
|
+
message: $t('%FV'),
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -1,7 +1,8 @@
|
|
|
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 { Payment } from '@stamhoofd/models';
|
|
4
|
-
import { PaymentGeneral } from '@stamhoofd/structures';
|
|
5
|
+
import type { PaymentGeneral } from '@stamhoofd/structures';
|
|
5
6
|
|
|
6
7
|
import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures.js';
|
|
7
8
|
import { Context } from '../../../helpers/Context.js';
|
|
@@ -34,7 +35,7 @@ export class GetPaymentEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
34
35
|
throw new SimpleError({
|
|
35
36
|
code: 'not_found',
|
|
36
37
|
message: 'Payment not found',
|
|
37
|
-
human: $t(`
|
|
38
|
+
human: $t(`%FW`),
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { UitpasNumberDetails, UitpasNumbersGetDetailsRequest } from '@stamhoofd/structures';
|
|
3
4
|
|
|
4
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
5
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
5
6
|
import { isSimpleError, isSimpleErrors, SimpleError, SimpleErrors } from '@simonbackx/simple-errors';
|
|
6
7
|
import { uitpasApiResponseToSocialTariff } from '../../../helpers/updateMemberDetailsUitpasNumber.js';
|
|
7
8
|
import { UitpasService } from '../../../services/uitpas/UitpasService.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
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 { Organization as OrganizationStruct } from '@stamhoofd/structures';
|
|
3
4
|
|
|
4
5
|
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
5
6
|
import { Context } from '../../../../helpers/Context.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ArrayDecoder, StringDecoder } from '@simonbackx/simple-encoding';
|
|
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 { Webshop, WebshopDiscountCode } from '@stamhoofd/models';
|
|
5
|
-
import { DiscountCode } from '@stamhoofd/structures';
|
|
6
|
+
import type { DiscountCode } from '@stamhoofd/structures';
|
|
6
7
|
|
|
7
8
|
import { Context } from '../../../helpers/Context.js';
|
|
8
9
|
|
|
@@ -34,7 +35,7 @@ export class CheckWebshopDiscountCodesEndpoint extends Endpoint<Params, Query, B
|
|
|
34
35
|
throw new SimpleError({
|
|
35
36
|
code: 'not_found',
|
|
36
37
|
message: 'Webshop not found',
|
|
37
|
-
human: $t(`
|
|
38
|
+
human: $t(`%FX`),
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { PartialWithoutMethods } from '@simonbackx/simple-encoding';
|
|
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 { Order } from '@stamhoofd/models';
|
|
5
6
|
import { Payment } from '@stamhoofd/models';
|
|
6
|
-
import { Order as OrderStruct } from '@stamhoofd/structures';
|
|
7
|
+
import type { Order as OrderStruct } from '@stamhoofd/structures';
|
|
7
8
|
|
|
8
9
|
import { Context } from '../../../helpers/Context.js';
|
|
9
10
|
type Params = { id: string; paymentId: string };
|
|
@@ -33,7 +34,7 @@ export class GetOrderByPaymentEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
33
34
|
throw new SimpleError({
|
|
34
35
|
code: 'not_found',
|
|
35
36
|
message: 'Order not found',
|
|
36
|
-
human: $t(`
|
|
37
|
+
human: $t(`%FY`),
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
const [order] = await Order.where({ paymentId: payment.id }, { limit: 1 });
|
|
@@ -41,7 +42,7 @@ export class GetOrderByPaymentEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
41
42
|
throw new SimpleError({
|
|
42
43
|
code: 'not_found',
|
|
43
44
|
message: 'Order not found',
|
|
44
|
-
human: $t(`
|
|
45
|
+
human: $t(`%FY`),
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -1,7 +1,8 @@
|
|
|
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 { Order } from '@stamhoofd/models';
|
|
4
|
-
import { Order as OrderStruct } from '@stamhoofd/structures';
|
|
5
|
+
import type { Order as OrderStruct } from '@stamhoofd/structures';
|
|
5
6
|
|
|
6
7
|
import { Context } from '../../../helpers/Context.js';
|
|
7
8
|
type Params = { id: string; orderId: string };
|
|
@@ -31,7 +32,7 @@ export class GetOrderEndpoint extends Endpoint<Params, Query, Body, ResponseBody
|
|
|
31
32
|
throw new SimpleError({
|
|
32
33
|
code: 'not_found',
|
|
33
34
|
message: 'Order not found',
|
|
34
|
-
human: $t(`
|
|
35
|
+
human: $t(`%FY`),
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -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 { Order, Ticket } from '@stamhoofd/models';
|
|
5
7
|
import { TicketOrder, TicketPublic } from '@stamhoofd/structures';
|
|
@@ -55,7 +57,7 @@ export class GetTicketsEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
55
57
|
throw new SimpleError({
|
|
56
58
|
code: 'not_found',
|
|
57
59
|
message: 'Ticket not found',
|
|
58
|
-
human: $t(`
|
|
60
|
+
human: $t(`%FZ`),
|
|
59
61
|
});
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -67,7 +69,7 @@ export class GetTicketsEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
67
69
|
throw new SimpleError({
|
|
68
70
|
code: 'not_found',
|
|
69
71
|
message: 'Ticket not found',
|
|
70
|
-
human: $t(`
|
|
72
|
+
human: $t(`%FZ`),
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -79,7 +81,7 @@ export class GetTicketsEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
79
81
|
throw new SimpleError({
|
|
80
82
|
code: 'not_found',
|
|
81
83
|
message: 'Ticket not found',
|
|
82
|
-
human: $t(`
|
|
84
|
+
human: $t(`%FZ`),
|
|
83
85
|
});
|
|
84
86
|
}
|
|
85
87
|
|