@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,12 +1,16 @@
|
|
|
1
|
-
import { DecodedRequest
|
|
1
|
+
import type { DecodedRequest} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { isSimpleError, isSimpleErrors, SimpleError } from '@simonbackx/simple-errors';
|
|
3
|
-
import { Organization
|
|
4
|
-
import {
|
|
4
|
+
import type { Organization} from '@stamhoofd/models';
|
|
5
|
+
import { Platform, Token, User, Webshop } from '@stamhoofd/models';
|
|
6
|
+
import type { LoginMethod, StartOpenIDFlowStruct} from '@stamhoofd/structures';
|
|
7
|
+
import { LoginProviderType, OpenIDClientConfiguration, Token as TokenStruct } from '@stamhoofd/structures';
|
|
5
8
|
import crypto from 'crypto';
|
|
6
9
|
import { generators, Issuer } from 'openid-client';
|
|
7
10
|
import { Context } from '../helpers/Context.js';
|
|
8
11
|
|
|
9
|
-
import {
|
|
12
|
+
import type { ObjectWithHeaders } from '../helpers/CookieHelper.js';
|
|
13
|
+
import { CookieHelper } from '../helpers/CookieHelper.js';
|
|
10
14
|
|
|
11
15
|
async function randomBytes(size: number): Promise<Buffer> {
|
|
12
16
|
return new Promise((resolve, reject) => {
|
|
@@ -204,7 +208,7 @@ export class SSOService {
|
|
|
204
208
|
throw new SimpleError({
|
|
205
209
|
code: 'invalid_user',
|
|
206
210
|
message: 'User not allowed to use this login method',
|
|
207
|
-
human: $t(`
|
|
211
|
+
human: $t(`%Fz`),
|
|
208
212
|
statusCode: 400,
|
|
209
213
|
});
|
|
210
214
|
}
|
|
@@ -463,7 +467,7 @@ export class SSOService {
|
|
|
463
467
|
return response;
|
|
464
468
|
}
|
|
465
469
|
catch (e) {
|
|
466
|
-
const message = (isSimpleError(e) || isSimpleErrors(e) ? e.getHuman() : $t(`
|
|
470
|
+
const message = (isSimpleError(e) || isSimpleErrors(e) ? e.getHuman() : $t(`%G0`));
|
|
467
471
|
console.error('Error in openID callback', e);
|
|
468
472
|
return SSOServiceWithSession.getErrorRedirectResponse(session, message);
|
|
469
473
|
}
|
|
@@ -574,7 +578,7 @@ export class SSOServiceWithSession {
|
|
|
574
578
|
throw new SimpleError({
|
|
575
579
|
code: 'invalid_user',
|
|
576
580
|
message: 'User not found: please log in with the same email address as the user you are trying to link',
|
|
577
|
-
human: $t(`
|
|
581
|
+
human: $t(`%G1`),
|
|
578
582
|
statusCode: 404,
|
|
579
583
|
});
|
|
580
584
|
}
|
|
@@ -628,7 +632,7 @@ export class SSOServiceWithSession {
|
|
|
628
632
|
throw new SimpleError({
|
|
629
633
|
code: 'error',
|
|
630
634
|
message: 'Could not generate token',
|
|
631
|
-
human: $t(`
|
|
635
|
+
human: $t(`%D6`),
|
|
632
636
|
statusCode: 500,
|
|
633
637
|
});
|
|
634
638
|
}
|
|
@@ -648,7 +652,7 @@ export class SSOServiceWithSession {
|
|
|
648
652
|
return response;
|
|
649
653
|
}
|
|
650
654
|
catch (e) {
|
|
651
|
-
const message = (isSimpleError(e) || isSimpleErrors(e) ? e.getHuman() : $t(`
|
|
655
|
+
const message = (isSimpleError(e) || isSimpleErrors(e) ? e.getHuman() : $t(`%G0`));
|
|
652
656
|
console.error('Error in openID callback', e);
|
|
653
657
|
return SSOServiceWithSession.getErrorRedirectResponse(session, message);
|
|
654
658
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
2
|
-
import { BalanceItem, Organization, Platform,
|
|
2
|
+
import { BalanceItem, Organization, Platform, STPackage } from '@stamhoofd/models';
|
|
3
3
|
import { SQL } from '@stamhoofd/sql';
|
|
4
|
-
import {
|
|
4
|
+
import type { PaymentCustomer, STPackageStatus, STPackageType } from '@stamhoofd/structures';
|
|
5
|
+
import { BalanceItemRelation, BalanceItemRelationType, BalanceItemStatus, BalanceItemType, STPricingType, TranslatedString, VATExcemptReason } from '@stamhoofd/structures';
|
|
6
|
+
import { Country } from '@stamhoofd/types/Country';
|
|
5
7
|
import { Formatter } from '@stamhoofd/utility';
|
|
6
8
|
import { GroupBuilder } from '../helpers/GroupBuilder.js';
|
|
7
9
|
|
|
@@ -27,7 +29,7 @@ export class STPackageService {
|
|
|
27
29
|
let membersCount: number | null = null;
|
|
28
30
|
|
|
29
31
|
if (membersCount === null && pack.meta.pricingType === STPricingType.PerMember) {
|
|
30
|
-
membersCount = await
|
|
32
|
+
membersCount = await Organization.getActiveMembers(pack.organizationId);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
if (pack.meta.pricingType === STPricingType.PerMember) {
|
|
@@ -149,8 +151,8 @@ export class STPackageService {
|
|
|
149
151
|
item.type = BalanceItemType.STPackage;
|
|
150
152
|
item.description = pack.meta.name + ' ' + (
|
|
151
153
|
pack.validUntil
|
|
152
|
-
? $t('
|
|
153
|
-
: $t('
|
|
154
|
+
? $t('%1LM', { startDate: Formatter.date(now, true), endDate: Formatter.date(pack.validUntil, true) })
|
|
155
|
+
: $t('%1LN', { startDate: Formatter.date(pack.meta.startDate, true) })
|
|
154
156
|
);
|
|
155
157
|
item.relations.set(BalanceItemRelationType.STPackage, BalanceItemRelation.create({
|
|
156
158
|
id: pack.id,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class StartupHealthService {
|
|
2
|
+
private static readonly errors = new Set<string>();
|
|
3
|
+
|
|
4
|
+
static markUnhealthy(error: string) {
|
|
5
|
+
this.errors.add(error);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static getErrors() {
|
|
9
|
+
return [...this.errors];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static clearForTesting() {
|
|
13
|
+
this.errors.clear();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -67,7 +67,7 @@ export class PassholderEndpoints {
|
|
|
67
67
|
throw new SimpleError({
|
|
68
68
|
code: 'https://api.publiq.be/probs/uitpas/pass-not-found',
|
|
69
69
|
message: 'Pass not found',
|
|
70
|
-
human: $t('
|
|
70
|
+
human: $t('%1Iy'),
|
|
71
71
|
statusCode: 404,
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -174,7 +174,7 @@ function assertValidGetPassResponse(json: unknown): asserts json is GetPassRespo
|
|
|
174
174
|
throw new SimpleError({
|
|
175
175
|
code: 'invalid_response_retrieving_pass_by_uitpas_number',
|
|
176
176
|
message: `Invalid response when retrieving pass by UiTPAS number: ${error.message}`,
|
|
177
|
-
human: $t(`
|
|
177
|
+
human: $t(`%1BQ`),
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -2,7 +2,8 @@ import { Model } from '@simonbackx/simple-database';
|
|
|
2
2
|
import { isSimpleError, SimpleError } from '@simonbackx/simple-errors';
|
|
3
3
|
import { Order, WebshopUitpasNumber } from '@stamhoofd/models';
|
|
4
4
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
5
|
-
import { Cart,
|
|
5
|
+
import type { Cart, Product, ProductPrice, UitpasClientCredentialsStatus, UitpasOrganizersResponse } from '@stamhoofd/structures';
|
|
6
|
+
import { OrderStatus } from '@stamhoofd/structures';
|
|
6
7
|
import { Formatter } from '@stamhoofd/utility';
|
|
7
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
9
|
import { UitpasTokenRepository } from '../../helpers/UitpasTokenRepository.js';
|
|
@@ -11,8 +12,10 @@ import { checkPermissionsFor } from './checkPermissionsFor.js';
|
|
|
11
12
|
import { checkUitpasNumbers } from './checkUitpasNumbers.js';
|
|
12
13
|
import { getSocialTariffForEvent } from './getSocialTariffForEvent.js';
|
|
13
14
|
import { getSocialTariffForUitpasNumbers } from './getSocialTariffForUitpasNumbers.js';
|
|
14
|
-
import { GetPassResponse
|
|
15
|
-
import {
|
|
15
|
+
import type { GetPassResponse} from './PassholderEndpoints.js';
|
|
16
|
+
import { PassholderEndpoints } from './PassholderEndpoints.js';
|
|
17
|
+
import type { RegisterTicketSaleRequest, RegisterTicketSaleResponse} from './registerTicketSales.js';
|
|
18
|
+
import { registerTicketSales } from './registerTicketSales.js';
|
|
16
19
|
import { searchUitpasEvents } from './searchUitpasEvents.js';
|
|
17
20
|
import { searchUitpasOrganizers } from './searchUitpasOrganizers.js';
|
|
18
21
|
|
|
@@ -79,7 +82,7 @@ function getUitpasTicketSales(order: Order): UitpasTicketSale[] {
|
|
|
79
82
|
throw new SimpleError({
|
|
80
83
|
code: 'missing_uitpas_base_product_price',
|
|
81
84
|
message: `Missing UiTPAS base product price`,
|
|
82
|
-
human: $t(`
|
|
85
|
+
human: $t(`%1DP`),
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
88
|
const label = makeBaseProductPriceLabel(item.product, baseProductPrice);
|
|
@@ -401,7 +404,7 @@ export class UitpasService {
|
|
|
401
404
|
throw new SimpleError({
|
|
402
405
|
code: 'uitpas_number_already_used',
|
|
403
406
|
message: 'One or more uitpas numbers are already used',
|
|
404
|
-
human: $t('
|
|
407
|
+
human: $t('%1DM'),
|
|
405
408
|
field: 'uitpasNumbers',
|
|
406
409
|
});
|
|
407
410
|
}
|
|
@@ -413,7 +416,7 @@ export class UitpasService {
|
|
|
413
416
|
throw new SimpleError({
|
|
414
417
|
code: 'missing_uitpas_base_product_price',
|
|
415
418
|
message: `Missing UiTPAS base product price`,
|
|
416
|
-
human: $t(`
|
|
419
|
+
human: $t(`%1DP`),
|
|
417
420
|
});
|
|
418
421
|
}
|
|
419
422
|
|
|
@@ -423,7 +426,7 @@ export class UitpasService {
|
|
|
423
426
|
throw new SimpleError({
|
|
424
427
|
code: 'uitpas_social_tariff_price_mismatch',
|
|
425
428
|
message: 'UiTPAS wrong number of prices returned',
|
|
426
|
-
human: $t('
|
|
429
|
+
human: $t('%1DN'),
|
|
427
430
|
field: 'uitpasNumbers',
|
|
428
431
|
});
|
|
429
432
|
}
|
|
@@ -436,7 +439,7 @@ export class UitpasService {
|
|
|
436
439
|
throw new SimpleError({
|
|
437
440
|
code: 'uitpas_social_tariff_price_mismatch',
|
|
438
441
|
message: 'UiTPAS social tariff have a different price',
|
|
439
|
-
human: $t('
|
|
442
|
+
human: $t('%1DO', { correctPrice: Formatter.price(verified[i].price), orderPrice: Formatter.price(item.uitpasNumbers[i].price) }),
|
|
440
443
|
field: 'uitpasNumbers.' + i.toString(),
|
|
441
444
|
});
|
|
442
445
|
}
|
|
@@ -24,7 +24,7 @@ async function cancelTicketSale(access_token: string, ticketSaleId: string) {
|
|
|
24
24
|
throw new SimpleError({
|
|
25
25
|
code: 'unsuccessful_response_registering_ticket_sales',
|
|
26
26
|
message: `Unsuccessful response when registering UiTPAS ticket sales`,
|
|
27
|
-
human: $t(`
|
|
27
|
+
human: $t(`%18C`),
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
return ticketSaleId;
|
|
@@ -16,7 +16,7 @@ function assertIsPermissionsResponse(json: unknown): asserts json is Permissions
|
|
|
16
16
|
throw new SimpleError({
|
|
17
17
|
code: 'invalid_permissions_response',
|
|
18
18
|
message: 'Invalid response format for permissions',
|
|
19
|
-
human: $t('
|
|
19
|
+
human: $t('%1BL'),
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -35,7 +35,7 @@ function assertIsPermissionsResponse(json: unknown): asserts json is Permissions
|
|
|
35
35
|
throw new SimpleError({
|
|
36
36
|
code: 'invalid_permissions_response',
|
|
37
37
|
message: 'Invalid response format for permissions',
|
|
38
|
-
human: $t('
|
|
38
|
+
human: $t('%1BL'),
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -54,7 +54,7 @@ export async function checkPermissionsFor(access_token: string, organizationId:
|
|
|
54
54
|
throw new SimpleError({
|
|
55
55
|
code: 'uitpas_unreachable_checking_permissions',
|
|
56
56
|
message: `Network issue when checking UiTPAS permissions`,
|
|
57
|
-
human: $t(`
|
|
57
|
+
human: $t(`%1BP`),
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
60
|
if (!response.ok) {
|
|
@@ -62,7 +62,7 @@ export async function checkPermissionsFor(access_token: string, organizationId:
|
|
|
62
62
|
throw new SimpleError({
|
|
63
63
|
code: 'unsuccessful_response_checking_permissions',
|
|
64
64
|
message: `Unsuccesful response when checking UiTPAS permissions`,
|
|
65
|
-
human: $t(`
|
|
65
|
+
human: $t(`%18C`),
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
const json = await response.json().catch(() => {
|
|
@@ -70,7 +70,7 @@ export async function checkPermissionsFor(access_token: string, organizationId:
|
|
|
70
70
|
throw new SimpleError({
|
|
71
71
|
code: 'invalid_json_checking_permissions',
|
|
72
72
|
message: `Invalid json when checking UiTPAS permissions`,
|
|
73
|
-
human: $t(`
|
|
73
|
+
human: $t(`%18A`),
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
assertIsPermissionsResponse(json);
|
|
@@ -91,18 +91,18 @@ export async function checkPermissionsFor(access_token: string, organizationId:
|
|
|
91
91
|
}];
|
|
92
92
|
const item = json.find(item => item.organizer.id === uitpasOrganizerId);
|
|
93
93
|
if (!item) {
|
|
94
|
-
const organizers = Formatter.joinLast(json.map(i => i.organizer.name), ', ', ' ' + $t('
|
|
94
|
+
const organizers = Formatter.joinLast(json.map(i => i.organizer.name), ', ', ' ' + $t('%1BM') + ' ');
|
|
95
95
|
return {
|
|
96
96
|
status: UitpasClientCredentialsStatus.NoPermissions,
|
|
97
|
-
human: $t('
|
|
97
|
+
human: $t('%1BN') + organizers,
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
const missingPermissions = neededPermissions.filter(needed => !item.permissions.includes(needed.permission));
|
|
101
101
|
if (missingPermissions.length > 0) {
|
|
102
|
-
const missingPermissionsHuman = Formatter.joinLast(missingPermissions.map(p => p.human), ', ', ' ' + $t('
|
|
102
|
+
const missingPermissionsHuman = Formatter.joinLast(missingPermissions.map(p => p.human), ', ', ' ' + $t('%1BM') + ' ');
|
|
103
103
|
return {
|
|
104
104
|
status: UitpasClientCredentialsStatus.MissingPermissions,
|
|
105
|
-
human: $t('
|
|
105
|
+
human: $t('%1BO') + missingPermissionsHuman,
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
return {
|
|
@@ -21,7 +21,7 @@ function assertsIsStaticSocialTariffResponse(json: unknown): asserts json is Sta
|
|
|
21
21
|
throw new SimpleError({
|
|
22
22
|
code: 'invalid_response_getting_static_uitpas_social_tariff',
|
|
23
23
|
message: `Invalid response when getting static UiTPAS social tariff`,
|
|
24
|
-
human: $t(`
|
|
24
|
+
human: $t(`%1BR`),
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -35,7 +35,7 @@ export async function getSocialTariffForEvent(access_token: string, basePrice: n
|
|
|
35
35
|
throw new SimpleError({
|
|
36
36
|
code: 'invalid_uitpas_event_url',
|
|
37
37
|
message: `Invalid UiTPAS event URL: ${uitpasEventUrl}`,
|
|
38
|
-
human: $t(`
|
|
38
|
+
human: $t(`%1BS`),
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
params.append('eventId', eventId);
|
|
@@ -61,7 +61,7 @@ export async function getSocialTariffForEvent(access_token: string, basePrice: n
|
|
|
61
61
|
throw new SimpleError({
|
|
62
62
|
code: 'unsuccessful_response_getting_static_uitpas_social_tariff',
|
|
63
63
|
message: `Unsuccessful response when getting static UiTPAS social tariff`,
|
|
64
|
-
human: $t(`
|
|
64
|
+
human: $t(`%18C`),
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
const json = await response.json().catch(() => {
|
|
@@ -80,7 +80,7 @@ export async function getSocialTariffForEvent(access_token: string, basePrice: n
|
|
|
80
80
|
throw new SimpleError({
|
|
81
81
|
code: 'no_social_tariff_available',
|
|
82
82
|
message: `No social tariff available for event ${eventId}`,
|
|
83
|
-
human: $t(`
|
|
83
|
+
human: $t(`%1BT`),
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
if (json.available.length > 1) {
|
|
@@ -34,7 +34,7 @@ function assertsIsSocialTariffResponse(json: unknown): asserts json is SocialTar
|
|
|
34
34
|
throw new SimpleError({
|
|
35
35
|
code: 'invalid_response_getting_uitpas_social_tariff',
|
|
36
36
|
message: `Invalid response when getting UiTPAS social tariff`,
|
|
37
|
-
human: $t(`
|
|
37
|
+
human: $t(`%1BU`),
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -60,7 +60,7 @@ async function getSocialTariffForUitpasNumber(access_token: string, uitpasNumber
|
|
|
60
60
|
throw new SimpleError({
|
|
61
61
|
code: 'invalid_uitpas_event_url',
|
|
62
62
|
message: `Invalid UiTPAS event URL: ${uitpasEventUrl}`,
|
|
63
|
-
human: $t(`
|
|
63
|
+
human: $t(`%1BS`),
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
params.append('eventId', eventId);
|
|
@@ -110,7 +110,7 @@ async function getSocialTariffForUitpasNumber(access_token: string, uitpasNumber
|
|
|
110
110
|
throw new SimpleError({
|
|
111
111
|
code: 'unsuccessful_and_unexpected_response_retrieving_social_tariff_by_uitpas_number',
|
|
112
112
|
message: `Unsuccesful response without message when retrieving social tariff by UiTPAS number`,
|
|
113
|
-
human: $t(`
|
|
113
|
+
human: $t(`%1BV`),
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
const json = await response.json().catch(() => {
|
|
@@ -136,7 +136,7 @@ async function getSocialTariffForUitpasNumber(access_token: string, uitpasNumber
|
|
|
136
136
|
throw new SimpleError({
|
|
137
137
|
code: 'no_social_tariff_available',
|
|
138
138
|
message: `No social tariff available for event ${uitpasEventUrl}`,
|
|
139
|
-
human: $t(`
|
|
139
|
+
human: $t(`%1BT`),
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
if (json.available.length > 1) {
|
|
@@ -150,7 +150,7 @@ async function getSocialTariffForUitpasNumber(access_token: string, uitpasNumber
|
|
|
150
150
|
throw new SimpleError({
|
|
151
151
|
code: 'no_remaining_social_tariff',
|
|
152
152
|
message: `No remaining social tariff for event ${uitpasEventUrl} and UiTPAS number ${uitpasNumber}`,
|
|
153
|
-
human: $t(`
|
|
153
|
+
human: $t(`%1BW`),
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
console.log('Social tariff for UiTPAS number', uitpasNumber, 'with event id', uitpasEventUrl, 'is', json.available[0].price, 'euros');
|
|
@@ -45,7 +45,7 @@ async function uitpasErrorToSimpleError(response: Response) {
|
|
|
45
45
|
statusCode,
|
|
46
46
|
code: code ?? 'get-uitpas-error',
|
|
47
47
|
message: message ?? `Error when retrieving pass by UiTPAS number`,
|
|
48
|
-
human: human ?? $t('
|
|
48
|
+
human: human ?? $t('%1Iz'),
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -46,7 +46,7 @@ function assertisSuccessResponse(json: unknown): asserts json is SuccessResponse
|
|
|
46
46
|
throw new SimpleError({
|
|
47
47
|
code: 'invalid_register_ticket_sale_response',
|
|
48
48
|
message: `Invalid register ticket sale response`,
|
|
49
|
-
human: $t(`
|
|
49
|
+
human: $t(`%1BX`),
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -69,7 +69,7 @@ export async function registerTicketSales(access_token: string, registerTicketSa
|
|
|
69
69
|
throw new SimpleError({
|
|
70
70
|
code: 'invalid_uitpas_event_url',
|
|
71
71
|
message: `Invalid UiTPAS event URL: ${ticketSale.uitpasEventUrl}`,
|
|
72
|
-
human: $t(`
|
|
72
|
+
human: $t(`%1BS`),
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -108,7 +108,7 @@ export async function registerTicketSales(access_token: string, registerTicketSa
|
|
|
108
108
|
throw new SimpleError({
|
|
109
109
|
code: 'unsuccessful_response_registering_ticket_sales',
|
|
110
110
|
message: `Unsuccessful response when registering UiTPAS ticket sales`,
|
|
111
|
-
human: $t(`
|
|
111
|
+
human: $t(`%18C`),
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
const json = await response.json().catch(() => {});
|
|
@@ -117,7 +117,7 @@ export async function registerTicketSales(access_token: string, registerTicketSa
|
|
|
117
117
|
throw new SimpleError({
|
|
118
118
|
code: 'invalid_response_registering_ticket_sales',
|
|
119
119
|
message: `Invalid response when registering ticket sales`,
|
|
120
|
-
human: $t(`
|
|
120
|
+
human: $t(`%1BX`),
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
const now = new Date();
|
|
@@ -49,7 +49,7 @@ function assertIsEventsResponse(json: unknown): asserts json is EventsResponse {
|
|
|
49
49
|
throw new SimpleError({
|
|
50
50
|
code: 'invalid_events_response',
|
|
51
51
|
message: `Invalid events response`,
|
|
52
|
-
human: $t(`
|
|
52
|
+
human: $t(`%1BY`),
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -61,7 +61,7 @@ export async function searchUitpasEvents(clientId: string, uitpasOrganizerId: st
|
|
|
61
61
|
throw new SimpleError({
|
|
62
62
|
code: 'no_client_id_for_uitpas_events',
|
|
63
63
|
message: `No client ID configured for Uitpas events`,
|
|
64
|
-
human: $t(`
|
|
64
|
+
human: $t(`%1BZ`),
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
const baseUrl = 'https://search-test.uitdatabank.be/events';
|
|
@@ -97,7 +97,7 @@ export async function searchUitpasEvents(clientId: string, uitpasOrganizerId: st
|
|
|
97
97
|
throw new SimpleError({
|
|
98
98
|
code: 'unsuccessful_response_searching_uitpas_events',
|
|
99
99
|
message: `Unsuccessful response when searching for UiTPAS events`,
|
|
100
|
-
human: $t(`
|
|
100
|
+
human: $t(`%18C`),
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
const json = await response.json().catch(() => {
|
|
@@ -25,7 +25,7 @@ function assertIsOrganizersResponse(json: unknown): asserts json is OrganizersRe
|
|
|
25
25
|
throw new SimpleError({
|
|
26
26
|
code: 'invalid_response_searching_uitpas_organizers',
|
|
27
27
|
message: `Invalid response when searching for UiTPAS organizers`,
|
|
28
|
-
human: $t(`
|
|
28
|
+
human: $t(`%1Ba`),
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -37,7 +37,7 @@ export async function searchUitpasOrganizers(access_token: string, name: string)
|
|
|
37
37
|
throw new SimpleError({
|
|
38
38
|
code: 'empty_uitpas_organizer_name',
|
|
39
39
|
message: `Empty name when searching for UiTPAS organizers`,
|
|
40
|
-
human: $t(`
|
|
40
|
+
human: $t(`%1Bb`),
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
const baseUrl = 'https://api-test.uitpas.be/organizers';
|
|
@@ -66,7 +66,7 @@ export async function searchUitpasOrganizers(access_token: string, name: string)
|
|
|
66
66
|
throw new SimpleError({
|
|
67
67
|
code: 'unsuccessful_response_searching_uitpas_organizers',
|
|
68
68
|
message: `Unsuccessful response when searching for UiTPAS organizers`,
|
|
69
|
-
human: $t(`
|
|
69
|
+
human: $t(`%18C`),
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
const json = await response.json().catch(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
|
|
3
4
|
export const auditLogFilterCompilers: SQLFilterDefinitions = {
|
|
4
5
|
...baseSQLFilterCompilers,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
|
|
3
4
|
export const balanceItemPaymentsCompilers: SQLFilterDefinitions = {
|
|
4
5
|
...baseSQLFilterCompilers,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Defines how to filter balance items in the database from StamhoofdFilter objects
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
3
|
+
import { baseSQLFilterCompilers, createColumnFilter, createExistsFilter, createJoinedRelationFilter, SQL, SQLIfNull, SQLValueType } from '@stamhoofd/sql';
|
|
4
|
+
import type { StamhoofdFilter} from '@stamhoofd/structures';
|
|
5
|
+
import { FilterWrapperMarker, PermissionLevel, unwrapFilter } from '@stamhoofd/structures';
|
|
4
6
|
import { Context } from '../helpers/Context.js';
|
|
5
7
|
import { memberCachedBalanceForOrganizationJoin, registrationCachedBalanceJoin } from '../helpers/outstandingBalanceJoin.js';
|
|
6
8
|
import { SQLTranslatedString } from '../helpers/SQLTranslatedString.js';
|
|
@@ -18,7 +20,7 @@ async function checkGroupIdFilterAccess(filter: StamhoofdFilter, permissionLevel
|
|
|
18
20
|
code: 'invalid_field',
|
|
19
21
|
field: 'filter',
|
|
20
22
|
message: 'You must filter on a group of the organization you are trying to access',
|
|
21
|
-
human: $t(`
|
|
23
|
+
human: $t(`%1HG`),
|
|
22
24
|
});
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -48,7 +50,7 @@ async function checkGroupIdFilterAccess(filter: StamhoofdFilter, permissionLevel
|
|
|
48
50
|
}
|
|
49
51
|
throw Context.auth.error({
|
|
50
52
|
message: 'You do not have access to this group',
|
|
51
|
-
human: $t(
|
|
53
|
+
human: $t(`%15f`, { groupName: group.settings.name }),
|
|
52
54
|
});
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
|
|
3
4
|
export const documentTemplateFilterCompilers: SQLFilterDefinitions = {
|
|
4
5
|
...baseSQLFilterCompilers,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
|
|
3
4
|
export const documentFilterCompilers: SQLFilterDefinitions = {
|
|
4
5
|
...baseSQLFilterCompilers,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, SQL, SQLConcat, SQLScalar, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
|
|
3
4
|
export const emailRecipientsFilterCompilers: SQLFilterDefinitions = {
|
|
4
5
|
...baseSQLFilterCompilers,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, createExistsFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
import { emailRecipientsFilterCompilers } from './email-recipients.js';
|
|
3
4
|
|
|
4
5
|
export const userEmailFilterCompilers: SQLFilterDefinitions = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, createJoinedRelationFilter, createExistsFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
import { eventFilterCompilers } from './events.js';
|
|
3
4
|
import { organizationFilterCompilers } from './organizations.js';
|
|
4
5
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, createExistsFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
|
|
3
4
|
export const eventFilterCompilers: SQLFilterDefinitions = {
|
|
4
5
|
...baseSQLFilterCompilers,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, createWildcardColumnFilter, SQL, SQLJsonExtract, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
import { SQLTranslatedString } from '../helpers/SQLTranslatedString.js';
|
|
3
4
|
|
|
4
5
|
export const groupFilterCompilers: SQLFilterDefinitions = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
|
|
3
4
|
export const invoicedBalanceItemCompilers: SQLFilterDefinitions = {
|
|
4
5
|
...baseSQLFilterCompilers,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
2
|
+
import { baseSQLFilterCompilers, createColumnFilter, createExistsFilter, SQL, SQLCast, SQLConcat, SQLJsonUnquote, SQLScalar, SQLValueType } from '@stamhoofd/sql';
|
|
2
3
|
import { invoicedBalanceItemCompilers } from './invoiced-balance-items.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MemberResponsibilityRecord } from '@stamhoofd/models';
|
|
2
|
-
import {
|
|
2
|
+
import type { SQLFilterDefinitions} from '@stamhoofd/sql';
|
|
3
|
+
import { baseSQLFilterCompilers, createColumnFilter, SQL, SQLValueType } from '@stamhoofd/sql';
|
|
3
4
|
|
|
4
5
|
const baseTable = SQL.table(MemberResponsibilityRecord.table);
|
|
5
6
|
|