@stamhoofd/backend 2.119.0 → 2.120.1
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/boot.ts +40 -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 +2 -1
- package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +3 -2
- package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +2 -1
- package/src/endpoints/admin/memberships/GetChargeMembershipsSummaryEndpoint.ts +2 -1
- package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +3 -2
- package/src/endpoints/admin/organizations/GetOrganizationsCountEndpoint.ts +3 -2
- package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +6 -4
- package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +4 -2
- package/src/endpoints/admin/registrations/ChargeRegistrationsEndpoint.ts +3 -2
- package/src/endpoints/auth/CreateAdminEndpoint.ts +5 -3
- package/src/endpoints/auth/CreateTokenEndpoint.ts +4 -2
- package/src/endpoints/auth/DeleteTokenEndpoint.ts +2 -1
- package/src/endpoints/auth/DeleteUserEndpoint.ts +2 -1
- package/src/endpoints/auth/ForgotPasswordEndpoint.ts +3 -2
- 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 +6 -3
- package/src/endpoints/auth/PollEmailVerificationEndpoint.ts +3 -2
- package/src/endpoints/auth/RetryEmailVerificationEndpoint.ts +3 -2
- package/src/endpoints/auth/SignupEndpoint.ts +3 -2
- package/src/endpoints/auth/VerifyEmailEndpoint.ts +3 -2
- 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 +7 -4
- package/src/endpoints/global/billing/ActivatePackagesEndpoint.ts +6 -4
- package/src/endpoints/global/billing/DeactivatePackageEndpoint.ts +2 -1
- package/src/endpoints/global/caddy/CheckDomainCertEndpoint.ts +4 -2
- package/src/endpoints/global/email/CreateEmailEndpoint.ts +5 -3
- 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 +4 -2
- package/src/endpoints/global/email/GetEmailEndpoint.ts +3 -2
- package/src/endpoints/global/email/GetUserEmailsEndpoint.test.ts +2 -1
- package/src/endpoints/global/email/GetUserEmailsEndpoint.ts +7 -4
- package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +4 -2
- package/src/endpoints/global/email/PatchEmailEndpoint.test.ts +11 -11
- package/src/endpoints/global/email/PatchEmailEndpoint.ts +6 -3
- 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 +7 -4
- package/src/endpoints/global/email-recipients/RetryEmailRecipientEndpoint.ts +4 -2
- package/src/endpoints/global/email-recipients/helpers/validateEmailRecipientFilter.ts +2 -1
- package/src/endpoints/global/events/GetEventNotificationsCountEndpoint.ts +3 -2
- package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +8 -5
- 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 +4 -2
- package/src/endpoints/global/events/PatchEventsEndpoint.test.ts +4 -2
- package/src/endpoints/global/events/PatchEventsEndpoint.ts +4 -2
- package/src/endpoints/global/files/ExportToExcelEndpoint.ts +7 -4
- package/src/endpoints/global/files/GetFileCache.ts +5 -3
- package/src/endpoints/global/files/UploadFile.ts +9 -3
- 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 +7 -4
- package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +5 -3
- 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 +8 -6
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.test.ts +257 -6
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +114 -59
- package/src/endpoints/global/members/helpers/validateGroupFilter.ts +2 -1
- package/src/endpoints/global/members/shouldCheckIfMemberIsDuplicate.ts +3 -2
- package/src/endpoints/global/organizations/CheckRegisterCodeEndpoint.ts +2 -1
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.test.ts +3 -2
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +3 -2
- 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 +6 -3
- package/src/endpoints/global/platform-memberships/GetPlatformMembershipsCountEndpoint.ts +47 -0
- package/src/endpoints/global/platform-memberships/GetPlatformMembershipsEndpoint.ts +211 -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 +8 -5
- 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 +9 -5
- package/src/endpoints/global/registration/RegisterMembersEndpoint.test.ts +50 -49
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +7 -4
- package/src/endpoints/global/registration-periods/GetRegistrationPeriodsEndpoint.ts +7 -4
- package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +4 -2
- 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 +3 -2
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/balance-items/PatchBalanceItemsEndpoint.ts +4 -2
- 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 +2 -1
- 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 +4 -2
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +2 -1
- 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 +4 -2
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesEndpoint.ts +5 -3
- 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 +6 -3
- 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 +3 -2
- 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 +6 -4
- package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +5 -3
- 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 +7 -4
- 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 +6 -3
- 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 +2 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountsEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +2 -1
- 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 +4 -2
- package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/webshops/DeleteWebshopEndpoint.ts +2 -1
- 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 +4 -2
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopOrdersEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/SearchUitpasEventsEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/webshops/VerifyWebshopDomainEndpoint.ts +2 -1
- package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +5 -3
- package/src/endpoints/organization/shared/GetDocumentHtml.ts +2 -1
- package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +3 -2
- 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 +3 -2
- package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +3 -2
- package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +3 -2
- package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +4 -2
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +3 -2
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.test.ts +7 -3
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +3 -2
- package/src/endpoints/organization/webshops/RetrieveUitpasSocialTariffPriceEndpoint.ts +3 -2
- package/src/endpoints/system/HealthEndpoint.test.ts +44 -0
- package/src/endpoints/system/HealthEndpoint.ts +14 -6
- package/src/excel-loaders/balance-items.ts +4 -2
- package/src/excel-loaders/event-notifications.ts +7 -5
- package/src/excel-loaders/index.ts +1 -0
- package/src/excel-loaders/members.ts +6 -4
- package/src/excel-loaders/organizations.ts +8 -7
- package/src/excel-loaders/payments.ts +5 -3
- package/src/excel-loaders/platform-memberships.ts +262 -0
- package/src/excel-loaders/receivable-balances.ts +7 -5
- package/src/excel-loaders/registrations.ts +9 -7
- package/src/helpers/AddressValidator.test.ts +2 -1
- package/src/helpers/AddressValidator.ts +7 -4
- package/src/helpers/AdminPermissionChecker.ts +190 -92
- package/src/helpers/AuthenticatedStructures.ts +4 -2
- package/src/helpers/BuckarooHelper.ts +2 -1
- package/src/helpers/Context.ts +4 -2
- package/src/helpers/CookieHelper.ts +2 -2
- package/src/helpers/FileCache.ts +2 -2
- package/src/helpers/ForwardHandler.ts +2 -1
- 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/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 +5 -4
- package/src/helpers/StripeHelper.ts +3 -2
- 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/ViesHelper.ts +4 -3
- package/src/helpers/XlsxTransformerColumnHelper.ts +4 -2
- package/src/helpers/email-html-helpers.ts +5 -4
- package/src/helpers/fetchToAsyncIterator.ts +1 -1
- package/src/helpers/outstandingBalanceJoin.ts +2 -1
- package/src/helpers/updateMemberDetailsUitpasNumber.ts +4 -3
- 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 +2 -1
- package/src/seeds/1754560914-groups-prices.test.ts +2 -1
- package/src/seeds/1754560914-groups-prices.ts +2 -1
- 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 +2 -1
- package/src/services/FileSignService.ts +1 -1
- package/src/services/MemberNumberService.ts +3 -1
- 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 +5 -3
- package/src/services/RegistrationService.ts +65 -3
- package/src/services/SSOService.ts +8 -4
- package/src/services/STPackageService.ts +5 -3
- package/src/services/StartupHealthService.ts +15 -0
- package/src/services/uitpas/UitpasService.ts +6 -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 +4 -2
- 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 +2 -1
- package/src/sql-filters/orders.ts +2 -1
- 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 +72 -0
- package/src/sql-filters/receivable-balances.ts +2 -1
- package/src/sql-filters/registration-periods.ts +2 -1
- package/src/sql-filters/registrations.ts +2 -1
- package/src/sql-filters/tickets.ts +2 -1
- package/src/sql-filters/users.ts +2 -1
- package/src/sql-filters/webshops.ts +38 -0
- package/src/sql-sorters/audit-logs.ts +3 -2
- package/src/sql-sorters/balance-items.ts +3 -2
- package/src/sql-sorters/document-templates.ts +3 -2
- package/src/sql-sorters/documents.ts +3 -2
- package/src/sql-sorters/email-recipients.ts +3 -2
- package/src/sql-sorters/emails.ts +3 -2
- package/src/sql-sorters/event-notifications.ts +3 -2
- package/src/sql-sorters/events.ts +3 -2
- package/src/sql-sorters/groups.ts +3 -2
- package/src/sql-sorters/invoices.ts +3 -2
- package/src/sql-sorters/members.ts +3 -2
- package/src/sql-sorters/orders.ts +3 -2
- package/src/sql-sorters/organization-registration-periods.ts +3 -2
- package/src/sql-sorters/organizations.ts +3 -2
- package/src/sql-sorters/payments.ts +3 -2
- package/src/sql-sorters/platform-memberships.ts +40 -0
- package/src/sql-sorters/receivable-balances.ts +3 -2
- package/src/sql-sorters/registration-periods.ts +3 -2
- package/src/sql-sorters/registrations.ts +3 -2
- package/src/sql-sorters/tickets.ts +3 -2
- package/src/sql-sorters/webshops.ts +40 -0
- package/tests/actions/patchOrganizationMember.ts +5 -4
- package/tests/actions/patchPaymentStatus.ts +2 -2
- package/tests/actions/patchUserMember.ts +6 -4
- package/tests/e2e/api-rate-limits.test.ts +4 -5
- package/tests/e2e/bundle-discounts.test.ts +3 -2
- package/tests/e2e/charge-members.test.ts +7 -5
- package/tests/e2e/documents.test.ts +3 -2
- package/tests/e2e/private-files.test.ts +11 -13
- package/tests/e2e/register.test.ts +6 -5
- package/tests/e2e/stock.test.ts +6 -8
- package/tests/e2e/tickets.test.ts +4 -2
- package/tests/helpers/StripeMocker.ts +3 -3
- package/tests/init/initAdmin.ts +4 -2
- package/tests/init/initBundleDiscount.ts +3 -2
- package/tests/init/initPayconiq.ts +1 -1
- package/tests/init/initPermissionRole.ts +4 -2
- package/tests/init/initPlatformRecordCategory.ts +1 -1
- package/tests/init/initStripe.ts +1 -1
- package/tests/vitest.global.setup.ts +26 -0
- package/tests/{jest.setup.ts → vitest.setup.ts} +4 -3
- package/tsconfig.build.json +17 -0
- package/tsconfig.json +10 -41
- package/tsconfig.test.json +17 -0
- package/vitest.config.js +13 -0
- package/eslint.config.mjs +0 -5
- package/jest.config.cjs +0 -27
- package/tests/jest.global.setup.ts +0 -33
- package/tests/toMatchMap.ts +0 -68
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
@@ -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';
|
|
@@ -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;
|
|
@@ -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';
|
|
@@ -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>;
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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
|
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -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';
|
|
@@ -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 { Webshop } from '@stamhoofd/models';
|
|
4
|
-
import { PrivateWebshop, Webshop as WebshopStruct } from '@stamhoofd/structures';
|
|
5
|
+
import type { PrivateWebshop, Webshop as WebshopStruct } from '@stamhoofd/structures';
|
|
5
6
|
|
|
6
7
|
import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures.js';
|
|
7
8
|
import { Context } from '../../../helpers/Context.js';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Response } from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Request } from '@simonbackx/simple-endpoints';
|
|
3
|
+
import type { Organization, StripeAccount, User} from '@stamhoofd/models';
|
|
4
|
+
import { OrganizationFactory, Token, UserFactory, Webshop, WebshopFactory } from '@stamhoofd/models';
|
|
5
|
+
import type { OrderResponse} from '@stamhoofd/structures';
|
|
6
|
+
import { Address, Cart, CartItem, CartItemOption, Customer, Option, OptionMenu, OrderData, PaymentConfiguration, PaymentMethod, PermissionLevel, Permissions, PrivatePaymentConfiguration, Product, ProductPrice, ProductType, SeatingPlan, SeatingPlanRow, SeatingPlanSeat, SeatingPlanSection, TransferSettings, WebshopDeliveryMethod, WebshopMetaData, WebshopOnSiteMethod, WebshopPrivateMetaData, WebshopTakeoutMethod, WebshopTimeSlot } from '@stamhoofd/structures';
|
|
7
|
+
import { Country } from '@stamhoofd/types/Country';
|
|
4
8
|
import sinon from 'sinon';
|
|
5
9
|
|
|
6
10
|
import { StripeMocker } from '../../../../tests/helpers/StripeMocker.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createMollieClient, PaymentMethod as molliePaymentMethod } from '@mollie/api-client';
|
|
2
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
3
|
-
import { DecodedRequest,
|
|
2
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
3
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
4
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
4
5
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
5
6
|
import { Email } from '@stamhoofd/email';
|
|
6
7
|
import { BalanceItem, BalanceItemPayment, MolliePayment, MollieToken, Order, PayconiqPayment, Payment, RateLimiter, Webshop, WebshopDiscountCode } from '@stamhoofd/models';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
3
4
|
import { UitpasPriceCheckRequest, UitpasPriceCheckResponse } from '@stamhoofd/structures';
|
|
4
5
|
|
|
5
|
-
import { Decoder } from '@simonbackx/simple-encoding';
|
|
6
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
6
7
|
import { Context } from '../../../helpers/Context.js';
|
|
7
8
|
import { UitpasService } from '../../../services/uitpas/UitpasService.js';
|
|
8
9
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { TestUtils } from '@stamhoofd/test-utils';
|
|
3
|
+
import { testServer } from '../../../tests/helpers/TestServer.js';
|
|
4
|
+
import { StartupHealthService } from '../../services/StartupHealthService.js';
|
|
5
|
+
import { HealthEndpoint } from './HealthEndpoint.js';
|
|
6
|
+
|
|
7
|
+
describe('Endpoint.HealthEndpoint', () => {
|
|
8
|
+
const endpoint = new HealthEndpoint();
|
|
9
|
+
const key = 'health-test-key';
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
TestUtils.setEnvironment('HEALTH_ACCESS_KEY', key);
|
|
13
|
+
StartupHealthService.clearForTesting();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
StartupHealthService.clearForTesting();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('Returns 200 when healthy', async () => {
|
|
21
|
+
const request = Request.get({
|
|
22
|
+
path: '/health',
|
|
23
|
+
query: { key },
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const response = await testServer.test(endpoint, request);
|
|
27
|
+
expect(response.status).toBe(200);
|
|
28
|
+
expect(response.body.status).toBe('ok');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('Returns 503 with startup error details', async () => {
|
|
32
|
+
StartupHealthService.markUnhealthy('MySQL collation mismatch: expected utf8mb4_0900_ai_ci, got collation_connection=utf8mb4_general_ci');
|
|
33
|
+
|
|
34
|
+
const request = Request.get({
|
|
35
|
+
path: '/health',
|
|
36
|
+
query: { key },
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const response = await testServer.test(endpoint, request);
|
|
40
|
+
expect(response.status).toBe(503);
|
|
41
|
+
expect(response.body.status).toBe('error');
|
|
42
|
+
expect(response.body.errors).toContain('MySQL collation mismatch: expected utf8mb4_0900_ai_ci, got collation_connection=utf8mb4_general_ci');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { AutoEncoder, field, StringDecoder } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { DecodedRequest,
|
|
1
|
+
import { ArrayDecoder, AutoEncoder, field, StringDecoder } 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 { CpuService } from '../../services/CpuService.js';
|
|
6
|
+
import { StartupHealthService } from '../../services/StartupHealthService.js';
|
|
5
7
|
|
|
6
8
|
type Params = Record<string, never>;
|
|
7
9
|
type Body = undefined;
|
|
@@ -14,6 +16,9 @@ class Query extends AutoEncoder {
|
|
|
14
16
|
export class ResponseBody extends AutoEncoder {
|
|
15
17
|
@field({ decoder: StringDecoder })
|
|
16
18
|
status: 'ok' | 'error';
|
|
19
|
+
|
|
20
|
+
@field({ decoder: new ArrayDecoder(StringDecoder), optional: true })
|
|
21
|
+
errors?: string[];
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
/**
|
|
@@ -57,14 +62,17 @@ export class HealthEndpoint extends Endpoint<Params, Query, Body, ResponseBody>
|
|
|
57
62
|
});
|
|
58
63
|
}
|
|
59
64
|
|
|
60
|
-
const
|
|
61
|
-
status: 'ok',
|
|
62
|
-
});
|
|
65
|
+
const errors = [...StartupHealthService.getErrors()];
|
|
63
66
|
|
|
64
67
|
if (CpuService.getAverage(60) > 80) {
|
|
65
|
-
|
|
68
|
+
errors.push('CPU usage is too high');
|
|
66
69
|
}
|
|
67
70
|
|
|
71
|
+
const health = ResponseBody.create({
|
|
72
|
+
status: errors.length > 0 ? 'error' : 'ok',
|
|
73
|
+
errors: errors.length > 0 ? errors : undefined,
|
|
74
|
+
});
|
|
75
|
+
|
|
68
76
|
const response = new Response(
|
|
69
77
|
health,
|
|
70
78
|
);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { XlsxTransformerColumn } from '@stamhoofd/excel-writer';
|
|
2
|
+
import { XlsxBuiltInNumberFormat } from '@stamhoofd/excel-writer';
|
|
2
3
|
import { BalanceItem } from '@stamhoofd/models';
|
|
3
|
-
import {
|
|
4
|
+
import type { BalanceItemWithPayments} from '@stamhoofd/structures';
|
|
5
|
+
import { BalanceItemRelationType, ExcelExportType, getBalanceItemRelationTypeName, getBalanceItemTypeName, PaginatedResponse, PaymentStatus } from '@stamhoofd/structures';
|
|
4
6
|
import { Formatter } from '@stamhoofd/utility';
|
|
5
7
|
import { ExportToExcelEndpoint } from '../endpoints/global/files/ExportToExcelEndpoint.js';
|
|
6
8
|
import { GetBalanceItemsEndpoint } from '../endpoints/organization/dashboard/balance-items/GetBalanceItemsEndpoint.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { XlsxTransformerSheet } from '@stamhoofd/excel-writer';
|
|
2
|
+
import { XlsxBuiltInNumberFormat } from '@stamhoofd/excel-writer';
|
|
3
|
+
import type { EventNotification, LimitedFilteredRequest} from '@stamhoofd/structures';
|
|
4
|
+
import { EventNotificationStatus, EventNotificationStatusHelper, ExcelExportType, Platform as PlatformStruct } from '@stamhoofd/structures';
|
|
3
5
|
import { Formatter } from '@stamhoofd/utility';
|
|
4
6
|
import { GetEventNotificationsEndpoint } from '../endpoints/global/events/GetEventNotificationsEndpoint.js';
|
|
5
7
|
import { ExportToExcelEndpoint } from '../endpoints/global/files/ExportToExcelEndpoint.js';
|
|
@@ -36,7 +38,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
36
38
|
},
|
|
37
39
|
{
|
|
38
40
|
id: 'organization.uri',
|
|
39
|
-
name: $t(`%
|
|
41
|
+
name: $t(`%1O1`),
|
|
40
42
|
width: 30,
|
|
41
43
|
getValue: (notification: EventNotification) => ({
|
|
42
44
|
value: notification.organization.uri,
|
|
@@ -65,7 +67,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
id: 'startDate',
|
|
68
|
-
name: $t(`%
|
|
70
|
+
name: $t(`%1Of`),
|
|
69
71
|
width: 20,
|
|
70
72
|
getValue: (notification: EventNotification) => ({
|
|
71
73
|
value: notification.startDate,
|
|
@@ -78,7 +80,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
78
80
|
},
|
|
79
81
|
{
|
|
80
82
|
id: 'endDate',
|
|
81
|
-
name: $t(`%
|
|
83
|
+
name: $t(`%1P8`),
|
|
82
84
|
width: 20,
|
|
83
85
|
getValue: (notification: EventNotification) => ({
|
|
84
86
|
value: notification.endDate,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { XlsxTransformerColumn, XlsxTransformerSheet } from '@stamhoofd/excel-writer';
|
|
2
|
+
import { XlsxBuiltInNumberFormat } from '@stamhoofd/excel-writer';
|
|
2
3
|
import { Platform } from '@stamhoofd/models';
|
|
3
|
-
import {
|
|
4
|
+
import type { LimitedFilteredRequest, PlatformMember} from '@stamhoofd/structures';
|
|
5
|
+
import { ExcelExportType, Gender, GroupType, MembershipStatus, PlatformFamily, Platform as PlatformStruct, UnencodeablePaginatedResponse } from '@stamhoofd/structures';
|
|
4
6
|
import { Formatter } from '@stamhoofd/utility';
|
|
5
7
|
import { ExportToExcelEndpoint } from '../endpoints/global/files/ExportToExcelEndpoint.js';
|
|
6
8
|
import { GetMembersEndpoint } from '../endpoints/global/members/GetMembersEndpoint.js';
|
|
@@ -152,7 +154,7 @@ export const baseMemberColumns: XlsxTransformerColumn<PlatformMember>[] = [
|
|
|
152
154
|
},
|
|
153
155
|
{
|
|
154
156
|
id: 'membership',
|
|
155
|
-
name: $t(`%
|
|
157
|
+
name: $t(`%1Ny`),
|
|
156
158
|
width: 20,
|
|
157
159
|
getValue: (member: PlatformMember) => {
|
|
158
160
|
return {
|
|
@@ -175,7 +177,7 @@ export const baseMemberColumns: XlsxTransformerColumn<PlatformMember>[] = [
|
|
|
175
177
|
},
|
|
176
178
|
{
|
|
177
179
|
id: 'uri',
|
|
178
|
-
name: $t(`%
|
|
180
|
+
name: $t(`%1O1`),
|
|
179
181
|
width: 30,
|
|
180
182
|
getValue: (member: PlatformMember) => {
|
|
181
183
|
const organizations = member.filterOrganizations({ currentPeriod: true, types: [GroupType.Membership] });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ArrayDecoder, field } from '@simonbackx/simple-encoding';
|
|
2
|
-
import { XlsxTransformerSheet } from '@stamhoofd/excel-writer';
|
|
2
|
+
import type { XlsxTransformerSheet } from '@stamhoofd/excel-writer';
|
|
3
3
|
import { Group, Member, MemberResponsibilityRecord } from '@stamhoofd/models';
|
|
4
|
-
import {
|
|
4
|
+
import type { LimitedFilteredRequest, Premise } from '@stamhoofd/structures';
|
|
5
|
+
import { ExcelExportType, MemberResponsibilityRecord as MemberResponsibilityRecordStruct, MemberWithRegistrationsBlob, Organization as OrganizationStruct, PaginatedResponse, Platform as PlatformStruct } from '@stamhoofd/structures';
|
|
5
6
|
import { Formatter, Sorter } from '@stamhoofd/utility';
|
|
6
7
|
import { GetOrganizationsEndpoint } from '../endpoints/admin/organizations/GetOrganizationsEndpoint.js';
|
|
7
8
|
import { ExportToExcelEndpoint } from '../endpoints/global/files/ExportToExcelEndpoint.js';
|
|
@@ -40,7 +41,7 @@ const sheet: XlsxTransformerSheet<Object, Object> = {
|
|
|
40
41
|
},
|
|
41
42
|
{
|
|
42
43
|
id: 'uri',
|
|
43
|
-
name: $t(`%
|
|
44
|
+
name: $t(`%1O1`),
|
|
44
45
|
width: 20,
|
|
45
46
|
getValue: (object: Object) => ({
|
|
46
47
|
value: object.uri,
|
|
@@ -48,7 +49,7 @@ const sheet: XlsxTransformerSheet<Object, Object> = {
|
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
51
|
id: 'name',
|
|
51
|
-
name: $t(`%
|
|
52
|
+
name: $t(`%1Os`),
|
|
52
53
|
width: 50,
|
|
53
54
|
getValue: (object: Object) => ({
|
|
54
55
|
value: object.name,
|
|
@@ -105,7 +106,7 @@ const responsibilities: XlsxTransformerSheet<Object, MemberResponsibilityRecordW
|
|
|
105
106
|
},
|
|
106
107
|
{
|
|
107
108
|
id: 'organization.uri',
|
|
108
|
-
name: $t(`%
|
|
109
|
+
name: $t(`%1O1`),
|
|
109
110
|
width: 20,
|
|
110
111
|
getValue: (object: MemberResponsibilityRecordWithMemberAndOrganization) => ({
|
|
111
112
|
value: object.organization.uri,
|
|
@@ -190,7 +191,7 @@ const premises: XlsxTransformerSheet<Object, PremiseWithOrganization> = {
|
|
|
190
191
|
},
|
|
191
192
|
{
|
|
192
193
|
id: 'organization.uri',
|
|
193
|
-
name: $t(`%
|
|
194
|
+
name: $t(`%1O1`),
|
|
194
195
|
width: 20,
|
|
195
196
|
getValue: (object: PremiseWithOrganization) => ({
|
|
196
197
|
value: object.organization.uri,
|
|
@@ -206,7 +207,7 @@ const premises: XlsxTransformerSheet<Object, PremiseWithOrganization> = {
|
|
|
206
207
|
},
|
|
207
208
|
{
|
|
208
209
|
id: 'premise.name',
|
|
209
|
-
name: $t(`%
|
|
210
|
+
name: $t(`%1Os`),
|
|
210
211
|
width: 20,
|
|
211
212
|
getValue: (object: PremiseWithOrganization) => ({
|
|
212
213
|
value: object.premise.name,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { field } from '@simonbackx/simple-encoding';
|
|
2
|
-
import {
|
|
2
|
+
import type { XlsxTransformerColumn, XlsxTransformerConcreteColumn } from '@stamhoofd/excel-writer';
|
|
3
|
+
import { XlsxBuiltInNumberFormat } from '@stamhoofd/excel-writer';
|
|
3
4
|
import { StripeAccount } from '@stamhoofd/models';
|
|
4
|
-
import { BalanceItemPaymentDetailed
|
|
5
|
+
import type { BalanceItemPaymentDetailed} from '@stamhoofd/structures';
|
|
6
|
+
import { BalanceItemRelationType, ExcelExportType, getBalanceItemRelationTypeName, getBalanceItemTypeName, PaginatedResponse, PaymentGeneral, PaymentMethodHelper, PaymentStatusHelper, StripeAccount as StripeAccountStruct } from '@stamhoofd/structures';
|
|
5
7
|
import { Formatter } from '@stamhoofd/utility';
|
|
6
8
|
import { ExportToExcelEndpoint } from '../endpoints/global/files/ExportToExcelEndpoint.js';
|
|
7
9
|
import { GetPaymentsEndpoint } from '../endpoints/organization/dashboard/payments/GetPaymentsEndpoint.js';
|
|
@@ -521,7 +523,7 @@ function getInvoiceColumns(): XlsxTransformerColumn<PaymentGeneral>[] {
|
|
|
521
523
|
return [
|
|
522
524
|
{
|
|
523
525
|
id: 'customer.name',
|
|
524
|
-
name: $t(`%
|
|
526
|
+
name: $t(`%1Os`),
|
|
525
527
|
width: 30,
|
|
526
528
|
getValue: (object: PaymentGeneralWithStripeAccount) => {
|
|
527
529
|
return {
|