@stamhoofd/backend 2.118.1 → 2.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +32 -22
- package/src/audit-logs/ModelLogger.ts +4 -2
- package/src/audit-logs/OrderLogger.ts +1 -1
- package/src/boot.ts +32 -14
- package/src/crons/balance-emails.ts +4 -2
- package/src/crons/clearExcelCache.test.ts +8 -8
- package/src/crons/update-cached-balances.ts +40 -14
- package/src/debug.ts +3 -2
- package/src/decoders/StringArrayDecoder.ts +1 -1
- package/src/decoders/StringNullableDecoder.ts +1 -1
- package/src/email-recipient-loaders/documents.ts +2 -1
- package/src/email-recipient-loaders/members.ts +2 -1
- package/src/email-recipient-loaders/orders.ts +2 -1
- package/src/email-recipient-loaders/payments.ts +6 -3
- package/src/email-recipient-loaders/receivable-balances.ts +2 -1
- package/src/email-recipient-loaders/registrations.ts +2 -1
- package/src/email-replacements/getEmailReplacementsForPayment.ts +8 -7
- package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +7 -6
- package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +3 -2
- package/src/endpoints/admin/memberships/GetChargeMembershipsSummaryEndpoint.ts +2 -1
- package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +4 -3
- package/src/endpoints/admin/organizations/GetOrganizationsCountEndpoint.ts +3 -2
- package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +7 -5
- package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +12 -10
- package/src/endpoints/admin/registrations/ChargeRegistrationsEndpoint.ts +4 -3
- package/src/endpoints/auth/CreateAdminEndpoint.ts +8 -6
- package/src/endpoints/auth/CreateTokenEndpoint.ts +14 -12
- package/src/endpoints/auth/DeleteTokenEndpoint.ts +2 -1
- package/src/endpoints/auth/DeleteUserEndpoint.ts +2 -1
- package/src/endpoints/auth/ForgotPasswordEndpoint.ts +5 -4
- package/src/endpoints/auth/GetOtherUserEndpoint.ts +3 -2
- package/src/endpoints/auth/GetUserEndpoint.ts +3 -2
- package/src/endpoints/auth/OpenIDConnectAuthTokenEndpoint.ts +2 -1
- package/src/endpoints/auth/OpenIDConnectCallbackEndpoint.ts +4 -2
- package/src/endpoints/auth/OpenIDConnectStartEndpoint.ts +3 -2
- package/src/endpoints/auth/PatchUserEndpoint.ts +15 -12
- package/src/endpoints/auth/PollEmailVerificationEndpoint.ts +3 -2
- package/src/endpoints/auth/RetryEmailVerificationEndpoint.ts +3 -2
- package/src/endpoints/auth/SignupEndpoint.ts +5 -4
- package/src/endpoints/auth/VerifyEmailEndpoint.ts +6 -5
- package/src/endpoints/frontend/FrontendEnvironmentEndpoint.ts +3 -2
- package/src/endpoints/global/addresses/SearchRegionsEndpoint.ts +8 -5
- package/src/endpoints/global/addresses/ValidateAddressEndpoint.ts +5 -3
- package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +8 -5
- package/src/endpoints/global/billing/ActivatePackagesEndpoint.ts +9 -7
- package/src/endpoints/global/billing/DeactivatePackageEndpoint.ts +4 -3
- package/src/endpoints/global/caddy/CheckDomainCertEndpoint.ts +4 -2
- package/src/endpoints/global/email/CreateEmailEndpoint.ts +9 -7
- package/src/endpoints/global/email/GetAdminEmailsEndpoint.test.ts +2 -1
- package/src/endpoints/global/email/GetAdminEmailsEndpoint.ts +22 -19
- package/src/endpoints/global/email/GetEmailAddressEndpoint.ts +6 -4
- package/src/endpoints/global/email/GetEmailEndpoint.ts +4 -3
- package/src/endpoints/global/email/GetUserEmailsEndpoint.test.ts +3 -2
- package/src/endpoints/global/email/GetUserEmailsEndpoint.ts +7 -4
- package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +7 -5
- package/src/endpoints/global/email/PatchEmailEndpoint.test.ts +11 -11
- package/src/endpoints/global/email/PatchEmailEndpoint.ts +14 -11
- package/src/endpoints/global/email-recipients/GetEmailRecipientsCountEndpoint.ts +3 -2
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.test.ts +2 -1
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.ts +8 -5
- package/src/endpoints/global/email-recipients/RetryEmailRecipientEndpoint.ts +7 -5
- package/src/endpoints/global/email-recipients/helpers/validateEmailRecipientFilter.ts +4 -3
- package/src/endpoints/global/events/GetEventNotificationsCountEndpoint.ts +3 -2
- package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +9 -6
- package/src/endpoints/global/events/GetEventsEndpoint.ts +7 -4
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.test.ts +4 -2
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.ts +17 -15
- package/src/endpoints/global/events/PatchEventsEndpoint.test.ts +4 -2
- package/src/endpoints/global/events/PatchEventsEndpoint.ts +28 -26
- package/src/endpoints/global/files/ExportToExcelEndpoint.ts +8 -5
- package/src/endpoints/global/files/GetFileCache.ts +5 -3
- package/src/endpoints/global/files/UploadFile.ts +10 -4
- package/src/endpoints/global/files/UploadImage.ts +4 -2
- package/src/endpoints/global/groups/GetGroupsEndpoint.test.ts +4 -2
- package/src/endpoints/global/groups/GetGroupsEndpoint.ts +8 -5
- package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +7 -5
- package/src/endpoints/global/members/GetMembersCountEndpoint.ts +3 -2
- package/src/endpoints/global/members/GetMembersEndpoint.test.ts +4 -2
- package/src/endpoints/global/members/GetMembersEndpoint.ts +10 -8
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.test.ts +257 -6
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +162 -107
- package/src/endpoints/global/members/helpers/validateGroupFilter.ts +4 -3
- package/src/endpoints/global/members/shouldCheckIfMemberIsDuplicate.ts +3 -2
- package/src/endpoints/global/organizations/CheckRegisterCodeEndpoint.ts +3 -2
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.test.ts +3 -2
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +8 -7
- package/src/endpoints/global/organizations/GetOrganizationFromDomainEndpoint.ts +5 -3
- package/src/endpoints/global/organizations/GetOrganizationFromUriEndpoint.ts +5 -3
- package/src/endpoints/global/organizations/SearchOrganizationEndpoint.ts +8 -5
- package/src/endpoints/global/payments/StripeWebhookEndpoint.ts +4 -2
- package/src/endpoints/global/platform/GetPlatformAdminsEndpoint.ts +2 -1
- package/src/endpoints/global/platform/GetPlatformEndpoint.ts +3 -2
- package/src/endpoints/global/platform/PatchPlatformEnpoint.test.ts +3 -2
- package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +7 -4
- package/src/endpoints/global/platform-memberships/GetPlatformMembershipsCountEndpoint.ts +47 -0
- package/src/endpoints/global/platform-memberships/GetPlatformMembershipsEndpoint.ts +206 -0
- package/src/endpoints/global/registration/GetRegistrationsCountEndpoint.ts +3 -2
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.test.ts +2 -1
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.ts +10 -7
- package/src/endpoints/global/registration/GetUserDetailedPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/global/registration/GetUserDocumentsEndpoint.ts +4 -2
- package/src/endpoints/global/registration/GetUserMembersEndpoint.ts +3 -2
- package/src/endpoints/global/registration/GetUserPayableBalanceEndpoint.ts +2 -1
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.test.ts +5 -3
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +13 -9
- package/src/endpoints/global/registration/RegisterMembersEndpoint.test.ts +50 -49
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +25 -22
- package/src/endpoints/global/registration-periods/GetRegistrationPeriodsEndpoint.ts +8 -5
- package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +9 -7
- package/src/endpoints/global/sso/GetSSOEndpoint.ts +4 -2
- package/src/endpoints/global/sso/SetSSOEndpoint.ts +3 -2
- package/src/endpoints/global/webshops/GetWebshopFromDomainEndpoint.ts +4 -2
- package/src/endpoints/global/webshops/GetWebshopsCountEndpoint.ts +43 -0
- package/src/endpoints/global/webshops/GetWebshopsEndpoint.test.ts +808 -0
- package/src/endpoints/global/webshops/GetWebshopsEndpoint.ts +221 -0
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/balance-items/PatchBalanceItemsEndpoint.ts +15 -13
- package/src/endpoints/organization/dashboard/billing/GetOrganizationDetailedPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/billing/GetOrganizationPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/billing/GetPackagesEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplateXML.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplatesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplatesEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/documents/GetDocumentsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentsEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/documents/PatchDocumentEndpoint.ts +9 -7
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/email-templates/GetEmailTemplatesEndpoint.test.ts +36 -1
- package/src/endpoints/organization/dashboard/email-templates/GetEmailTemplatesEndpoint.ts +13 -4
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/invoices/PatchInvoicesEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/mollie/CheckMollieEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/mollie/ConnectMollieEndpoint.ts +6 -3
- package/src/endpoints/organization/dashboard/mollie/DisconnectMollieEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/mollie/GetMollieDashboardEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/nolt/CreateNoltTokenEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/organization/GetOrganizationArchivedGroups.ts +4 -2
- package/src/endpoints/organization/dashboard/organization/GetOrganizationDeletedGroups.ts +3 -2
- package/src/endpoints/organization/dashboard/organization/GetUitpasClientIdEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.test.ts +5 -3
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +22 -19
- package/src/endpoints/organization/dashboard/organization/SearchUitpasOrganizersEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/organization/SetOrganizationDomainEndpoint.ts +11 -9
- package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts +8 -7
- package/src/endpoints/organization/dashboard/payments/GetMemberBalanceEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/payments/GetPaymentsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +18 -16
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalanceEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.test.ts +2 -1
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.ts +8 -5
- package/src/endpoints/organization/dashboard/registration-periods/MoveRegistrationPeriods.test.ts +4 -2
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +32 -29
- package/src/endpoints/organization/dashboard/registration-periods/SetupStepReviewEndpoint.ts +6 -3
- package/src/endpoints/organization/dashboard/stripe/ConnectStripeEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/stripe/DeleteStripeAccountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountsEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/users/GetApiUsersEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/users/GetOrganizationAdminsEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +7 -6
- package/src/endpoints/organization/dashboard/webshops/DeleteWebshopEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/webshops/GetDiscountCodesEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/webshops/{GetWebshopTicketsCountEndpoint → GetWebshopTicketsCountEndpoint.ts} +7 -7
- package/src/endpoints/organization/dashboard/webshops/GetWebshopTicketsEndpoint.ts +9 -6
- package/src/endpoints/organization/dashboard/webshops/GetWebshopUriAvailabilityEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/PatchDiscountCodesEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +13 -12
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopOrdersEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/webshops/SearchUitpasEventsEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/VerifyWebshopDomainEndpoint.ts +2 -1
- package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +6 -4
- package/src/endpoints/organization/shared/GetDocumentHtml.ts +4 -3
- package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +4 -3
- package/src/endpoints/organization/shared/GetUitpasNumberDetailsEndpoint.ts +3 -2
- package/src/endpoints/organization/shared/auth/GetOrganizationEndpoint.ts +3 -2
- package/src/endpoints/organization/webshops/CheckWebshopDiscountCodesEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +5 -4
- package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +7 -5
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.test.ts +7 -3
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +11 -10
- package/src/endpoints/organization/webshops/RetrieveUitpasSocialTariffPriceEndpoint.ts +5 -4
- package/src/endpoints/system/HealthEndpoint.test.ts +44 -0
- package/src/endpoints/system/HealthEndpoint.ts +14 -6
- package/src/excel-loaders/balance-items.ts +19 -17
- package/src/excel-loaders/event-notifications.ts +15 -13
- package/src/excel-loaders/index.ts +1 -0
- package/src/excel-loaders/members.ts +45 -43
- package/src/excel-loaders/organizations.ts +26 -25
- package/src/excel-loaders/payments.ts +44 -42
- package/src/excel-loaders/platform-memberships.ts +202 -0
- package/src/excel-loaders/receivable-balances.ts +25 -23
- package/src/excel-loaders/registrations.ts +30 -28
- package/src/helpers/AddressValidator.test.ts +2 -1
- package/src/helpers/AddressValidator.ts +13 -10
- package/src/helpers/AdminPermissionChecker.ts +193 -95
- package/src/helpers/AuthenticatedStructures.ts +13 -11
- package/src/helpers/BuckarooHelper.ts +3 -2
- package/src/helpers/Context.ts +8 -6
- package/src/helpers/CookieHelper.ts +2 -2
- package/src/helpers/FileCache.ts +9 -9
- package/src/helpers/ForwardHandler.ts +3 -2
- package/src/helpers/GlobalHelper.ts +2 -0
- package/src/helpers/GroupBuilder.ts +2 -1
- package/src/helpers/GroupedThrottledQueue.test.ts +19 -19
- package/src/helpers/LimitedFilteredRequestHelper.ts +1 -1
- package/src/helpers/MemberCharger.ts +2 -1
- package/src/helpers/MemberUserSyncer.ts +6 -3
- package/src/helpers/MembershipCharger.ts +2 -2
- package/src/helpers/OrganizationCharger.ts +2 -1
- package/src/helpers/PeriodHelper.ts +2 -1
- package/src/helpers/SQLTranslatedString.ts +3 -2
- package/src/helpers/ServiceFeeHelper.ts +1 -1
- package/src/helpers/SetupStepUpdater.ts +6 -5
- package/src/helpers/StripeHelper.ts +9 -8
- package/src/helpers/TagHelper.test.ts +5 -5
- package/src/helpers/TagHelper.ts +2 -1
- package/src/helpers/TemporaryMemberAccess.ts +2 -1
- package/src/helpers/ThrottledQueue.test.ts +20 -20
- package/src/helpers/UitpasTokenRepository.ts +7 -7
- package/src/helpers/ViesHelper.ts +5 -4
- package/src/helpers/XlsxTransformerColumnHelper.ts +21 -19
- package/src/helpers/email-html-helpers.ts +13 -12
- package/src/helpers/fetchToAsyncIterator.ts +1 -1
- package/src/helpers/outstandingBalanceJoin.ts +2 -1
- package/src/helpers/updateMemberDetailsUitpasNumber.ts +5 -4
- package/src/middleware/ContextMiddleware.ts +1 -1
- package/src/migrate.ts +21 -4
- package/src/seeds/0000000003-default-email-templates.ts +1 -1
- package/src/seeds/0000000004-single-organization.ts +2 -1
- package/src/seeds/1752848561-groups-registration-periods.ts +3 -2
- package/src/seeds/1754560914-groups-prices.test.ts +2 -1
- package/src/seeds/1754560914-groups-prices.ts +2 -1
- package/src/seeds/1755790070-fill-email-recipient-errors.ts +6 -6
- package/src/seeds/1755876819-remove-duplicate-members.ts +2 -1
- package/src/seeds/1765896674-document-update-year.test.ts +2 -1
- package/src/seeds/1773754928-force-save-members.ts +15 -0
- package/src/services/AuditLogService.ts +3 -2
- package/src/services/BalanceItemPaymentService.ts +2 -2
- package/src/services/BalanceItemService.ts +2 -1
- package/src/services/BootChecksService.test.ts +33 -0
- package/src/services/BootChecksService.ts +21 -0
- package/src/services/DatabaseCollationService.test.ts +18 -0
- package/src/services/DatabaseCollationService.ts +81 -0
- package/src/services/DocumentService.ts +1 -1
- package/src/services/EventNotificationService.ts +5 -4
- package/src/services/FileSignService.ts +2 -2
- package/src/services/InvoiceService.ts +3 -3
- package/src/services/MemberNumberService.ts +6 -4
- package/src/services/MemberRecordStore.ts +28 -19
- package/src/services/PaymentReallocationService.test.ts +2 -1
- package/src/services/PaymentReallocationService.ts +2 -1
- package/src/services/PaymentService.ts +28 -26
- package/src/services/RegistrationService.ts +65 -3
- package/src/services/SSOService.ts +13 -9
- package/src/services/STPackageService.ts +7 -5
- package/src/services/StartupHealthService.ts +15 -0
- package/src/services/uitpas/PassholderEndpoints.ts +2 -2
- package/src/services/uitpas/UitpasService.ts +11 -8
- package/src/services/uitpas/cancelTicketSales.ts +1 -1
- package/src/services/uitpas/checkPermissionsFor.ts +9 -9
- package/src/services/uitpas/getSocialTariffForEvent.ts +4 -4
- package/src/services/uitpas/getSocialTariffForUitpasNumbers.ts +5 -5
- package/src/services/uitpas/handleUitpasResponse.ts +1 -1
- package/src/services/uitpas/registerTicketSales.ts +4 -4
- package/src/services/uitpas/searchUitpasEvents.ts +3 -3
- package/src/services/uitpas/searchUitpasOrganizers.ts +3 -3
- package/src/sql-filters/audit-logs.ts +2 -1
- package/src/sql-filters/balance-item-payments.ts +2 -1
- package/src/sql-filters/balance-items.ts +2 -1
- package/src/sql-filters/base-registration-filter-compilers.ts +6 -4
- package/src/sql-filters/document-templates.ts +2 -1
- package/src/sql-filters/documents.ts +2 -1
- package/src/sql-filters/email-recipients.ts +2 -1
- package/src/sql-filters/emails.ts +2 -1
- package/src/sql-filters/event-notifications.ts +2 -1
- package/src/sql-filters/events.ts +2 -1
- package/src/sql-filters/groups.ts +2 -1
- package/src/sql-filters/invoiced-balance-items.ts +2 -1
- package/src/sql-filters/invoices.ts +2 -1
- package/src/sql-filters/member-responsibility-records.ts +2 -1
- package/src/sql-filters/members.ts +8 -7
- package/src/sql-filters/orders.ts +3 -2
- package/src/sql-filters/organization-registration-periods.ts +2 -1
- package/src/sql-filters/organizations.ts +2 -1
- package/src/sql-filters/payments.ts +2 -1
- package/src/sql-filters/platform-memberships.ts +67 -0
- package/src/sql-filters/receivable-balances.ts +2 -1
- package/src/sql-filters/registration-periods.ts +2 -1
- package/src/sql-filters/registrations.ts +2 -1
- package/src/sql-filters/tickets.ts +2 -1
- package/src/sql-filters/users.ts +2 -1
- package/src/sql-filters/webshops.ts +38 -0
- package/src/sql-sorters/audit-logs.ts +3 -2
- package/src/sql-sorters/balance-items.ts +3 -2
- package/src/sql-sorters/document-templates.ts +3 -2
- package/src/sql-sorters/documents.ts +3 -2
- package/src/sql-sorters/email-recipients.ts +3 -2
- package/src/sql-sorters/emails.ts +3 -2
- package/src/sql-sorters/event-notifications.ts +3 -2
- package/src/sql-sorters/events.ts +3 -2
- package/src/sql-sorters/groups.ts +3 -2
- package/src/sql-sorters/invoices.ts +3 -2
- package/src/sql-sorters/members.ts +3 -2
- package/src/sql-sorters/orders.ts +3 -2
- package/src/sql-sorters/organization-registration-periods.ts +3 -2
- package/src/sql-sorters/organizations.ts +3 -2
- package/src/sql-sorters/payments.ts +3 -2
- package/src/sql-sorters/platform-memberships.ts +40 -0
- package/src/sql-sorters/receivable-balances.ts +3 -2
- package/src/sql-sorters/registration-periods.ts +3 -2
- package/src/sql-sorters/registrations.ts +3 -2
- package/src/sql-sorters/tickets.ts +3 -2
- package/src/sql-sorters/webshops.ts +40 -0
- package/tests/actions/patchOrganizationMember.ts +5 -4
- package/tests/actions/patchPaymentStatus.ts +2 -2
- package/tests/actions/patchUserMember.ts +6 -4
- package/tests/e2e/api-rate-limits.test.ts +4 -5
- package/tests/e2e/bundle-discounts.test.ts +3 -2
- package/tests/e2e/charge-members.test.ts +7 -5
- package/tests/e2e/documents.test.ts +3 -2
- package/tests/e2e/private-files.test.ts +11 -13
- package/tests/e2e/register.test.ts +6 -5
- package/tests/e2e/stock.test.ts +6 -8
- package/tests/e2e/tickets.test.ts +4 -2
- package/tests/helpers/StripeMocker.ts +3 -3
- package/tests/init/initAdmin.ts +4 -2
- package/tests/init/initBundleDiscount.ts +3 -2
- package/tests/init/initPayconiq.ts +1 -1
- package/tests/init/initPermissionRole.ts +4 -2
- package/tests/init/initPlatformRecordCategory.ts +1 -1
- package/tests/init/initStripe.ts +1 -1
- package/tests/vitest.global.setup.ts +26 -0
- package/tests/{jest.setup.ts → vitest.setup.ts} +4 -3
- package/tsconfig.build.json +17 -0
- package/tsconfig.json +10 -41
- package/tsconfig.test.json +17 -0
- package/vitest.config.js +13 -0
- package/eslint.config.mjs +0 -5
- package/jest.config.cjs +0 -27
- package/tests/jest.global.setup.ts +0 -33
- package/tests/toMatchMap.ts +0 -68
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { DecodedRequest,
|
|
1
|
+
import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
|
|
2
|
+
import { Endpoint, Response } from '@simonbackx/simple-endpoints';
|
|
2
3
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
3
4
|
import { 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';
|
|
@@ -34,7 +35,7 @@ export class GetWebshopEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
34
35
|
throw new SimpleError({
|
|
35
36
|
code: 'not_found',
|
|
36
37
|
message: 'Webshop not found',
|
|
37
|
-
human: $t(`
|
|
38
|
+
human: $t(`%FX`),
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -1,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';
|
|
@@ -66,7 +67,7 @@ export class PlaceOrderEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
66
67
|
throw new SimpleError({
|
|
67
68
|
code: 'not_found',
|
|
68
69
|
message: 'Webshop not found',
|
|
69
|
-
human: $t(`
|
|
70
|
+
human: $t(`%FX`),
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
|
|
@@ -77,7 +78,7 @@ export class PlaceOrderEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
77
78
|
throw new SimpleError({
|
|
78
79
|
code: 'not_authenticated',
|
|
79
80
|
message: 'Not authenticated',
|
|
80
|
-
human: $t(`
|
|
81
|
+
human: $t(`%w5`),
|
|
81
82
|
statusCode: 401,
|
|
82
83
|
});
|
|
83
84
|
}
|
|
@@ -98,7 +99,7 @@ export class PlaceOrderEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
98
99
|
throw new SimpleError({
|
|
99
100
|
code: 'too_many_emails_period',
|
|
100
101
|
message: 'Too many e-mails limited',
|
|
101
|
-
human: $t(`
|
|
102
|
+
human: $t(`%w6`),
|
|
102
103
|
field: 'recipients',
|
|
103
104
|
});
|
|
104
105
|
}
|
|
@@ -113,7 +114,7 @@ export class PlaceOrderEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
113
114
|
throw new SimpleError({
|
|
114
115
|
code: 'duplicate_codes',
|
|
115
116
|
message: 'Duplicate usage of discount codes',
|
|
116
|
-
human: $t(`
|
|
117
|
+
human: $t(`%w7`),
|
|
117
118
|
field: 'cart.discountCodes',
|
|
118
119
|
});
|
|
119
120
|
}
|
|
@@ -125,7 +126,7 @@ export class PlaceOrderEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
125
126
|
throw new SimpleError({
|
|
126
127
|
code: 'invalid_code',
|
|
127
128
|
message: 'Invalid discount code',
|
|
128
|
-
human: $t(`
|
|
129
|
+
human: $t(`%w8`),
|
|
129
130
|
field: 'cart.discountCodes',
|
|
130
131
|
});
|
|
131
132
|
}
|
|
@@ -301,14 +302,14 @@ export class PlaceOrderEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
301
302
|
if (!token) {
|
|
302
303
|
throw new SimpleError({
|
|
303
304
|
code: '',
|
|
304
|
-
message: $t(
|
|
305
|
+
message: $t(`%w3`, { method: PaymentMethodHelper.getName(payment.method) }),
|
|
305
306
|
});
|
|
306
307
|
}
|
|
307
308
|
const profileId = organization.privateMeta.mollieProfile?.id ?? await token.getProfileId(webshop.getHost());
|
|
308
309
|
if (!profileId) {
|
|
309
310
|
throw new SimpleError({
|
|
310
311
|
code: '',
|
|
311
|
-
message: $t(
|
|
312
|
+
message: $t(`%w4`, { method: PaymentMethodHelper.getName(payment.method) }),
|
|
312
313
|
});
|
|
313
314
|
}
|
|
314
315
|
const mollieClient = createMollieClient({ accessToken: await token.getAccessToken() });
|
|
@@ -356,7 +357,7 @@ export class PlaceOrderEndpoint extends Endpoint<Params, Query, Body, ResponseBo
|
|
|
356
357
|
if ((payment.status as any) === PaymentStatus.Failed) {
|
|
357
358
|
throw new SimpleError({
|
|
358
359
|
code: 'payment_failed',
|
|
359
|
-
message: $t(
|
|
360
|
+
message: $t(`%w3`, {
|
|
360
361
|
method: PaymentMethodHelper.getName(payment.method),
|
|
361
362
|
}),
|
|
362
363
|
});
|
|
@@ -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
|
|
|
@@ -65,7 +66,7 @@ export class RetrieveUitpasSocialTariffPricesEndpoint extends Endpoint<Params, Q
|
|
|
65
66
|
throw new SimpleError({
|
|
66
67
|
code: 'missing_reduced_price',
|
|
67
68
|
message: 'Reduced price must be provided for non-official flow.',
|
|
68
|
-
human: $t('
|
|
69
|
+
human: $t('%188'),
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
72
|
const reducedPrice = request.body.reducedPrice;
|
|
@@ -73,7 +74,7 @@ export class RetrieveUitpasSocialTariffPricesEndpoint extends Endpoint<Params, Q
|
|
|
73
74
|
throw new SimpleError({
|
|
74
75
|
code: 'missing_uitpas_numbers',
|
|
75
76
|
message: 'Uitpas numbers must be provided for non-official flow.',
|
|
76
|
-
human: $t('
|
|
77
|
+
human: $t('%189'),
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
await UitpasService.checkUitpasNumbers(request.body.uitpasNumbers); // Throws if invalid
|
|
@@ -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';
|
|
@@ -17,7 +19,7 @@ ExportToExcelEndpoint.loaders.set(ExcelExportType.BalanceItems, {
|
|
|
17
19
|
sheets: [
|
|
18
20
|
{
|
|
19
21
|
id: 'balanceItems',
|
|
20
|
-
name: $t(`
|
|
22
|
+
name: $t(`%1LA`),
|
|
21
23
|
columns: [
|
|
22
24
|
...getBalanceItemColumns(),
|
|
23
25
|
],
|
|
@@ -29,7 +31,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
29
31
|
return [
|
|
30
32
|
{
|
|
31
33
|
id: 'id',
|
|
32
|
-
name: $t(`
|
|
34
|
+
name: $t(`%d`),
|
|
33
35
|
width: 40,
|
|
34
36
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
35
37
|
value: object.id,
|
|
@@ -42,7 +44,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
46
|
id: 'type',
|
|
45
|
-
name: $t(`
|
|
47
|
+
name: $t(`%1B`),
|
|
46
48
|
width: 30,
|
|
47
49
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
48
50
|
value: getBalanceItemTypeName(object.type),
|
|
@@ -50,7 +52,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
50
52
|
},
|
|
51
53
|
{
|
|
52
54
|
id: 'category',
|
|
53
|
-
name: $t(`
|
|
55
|
+
name: $t(`%M2`),
|
|
54
56
|
width: 30,
|
|
55
57
|
getValue: (object: BalanceItemWithPayments) => {
|
|
56
58
|
return {
|
|
@@ -60,7 +62,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
60
62
|
},
|
|
61
63
|
{
|
|
62
64
|
id: 'description',
|
|
63
|
-
name: $t(`
|
|
65
|
+
name: $t(`%6o`),
|
|
64
66
|
width: 40,
|
|
65
67
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
66
68
|
value: object.description,
|
|
@@ -68,7 +70,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
68
70
|
},
|
|
69
71
|
{
|
|
70
72
|
id: 'createdAt',
|
|
71
|
-
name: $t(`
|
|
73
|
+
name: $t(`%wV`),
|
|
72
74
|
width: 16,
|
|
73
75
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
74
76
|
value: object.createdAt,
|
|
@@ -81,7 +83,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
81
83
|
},
|
|
82
84
|
{
|
|
83
85
|
id: 'dueAt',
|
|
84
|
-
name: $t(`
|
|
86
|
+
name: $t(`%wW`),
|
|
85
87
|
width: 16,
|
|
86
88
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
87
89
|
value: object.dueAt,
|
|
@@ -113,7 +115,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
113
115
|
},
|
|
114
116
|
{
|
|
115
117
|
id: 'quantity',
|
|
116
|
-
name: $t(`
|
|
118
|
+
name: $t(`%M4`),
|
|
117
119
|
width: 20,
|
|
118
120
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
119
121
|
value: object.quantity,
|
|
@@ -126,7 +128,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
126
128
|
},
|
|
127
129
|
{
|
|
128
130
|
id: 'unitPrice',
|
|
129
|
-
name: $t(`
|
|
131
|
+
name: $t(`%6q`),
|
|
130
132
|
width: 20,
|
|
131
133
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
132
134
|
value: object.unitPrice / 1_0000,
|
|
@@ -139,7 +141,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
139
141
|
},
|
|
140
142
|
{
|
|
141
143
|
id: 'payablePriceWithVAT',
|
|
142
|
-
name: $t(`
|
|
144
|
+
name: $t(`%1IP`),
|
|
143
145
|
width: 20,
|
|
144
146
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
145
147
|
value: object.payablePriceWithVAT / 1_0000,
|
|
@@ -153,7 +155,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
153
155
|
|
|
154
156
|
{
|
|
155
157
|
id: 'priceOpen',
|
|
156
|
-
name: $t(`
|
|
158
|
+
name: $t(`%1LB`),
|
|
157
159
|
width: 40,
|
|
158
160
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
159
161
|
value: object.priceOpen / 1_0000,
|
|
@@ -167,7 +169,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
167
169
|
|
|
168
170
|
{
|
|
169
171
|
id: 'pricePaid',
|
|
170
|
-
name: $t(`
|
|
172
|
+
name: $t(`%1LC`),
|
|
171
173
|
width: 40,
|
|
172
174
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
173
175
|
value: object.pricePaid / 1_0000,
|
|
@@ -181,7 +183,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
181
183
|
|
|
182
184
|
{
|
|
183
185
|
id: 'pricePending',
|
|
184
|
-
name: $t(`
|
|
186
|
+
name: $t(`%1LD`),
|
|
185
187
|
width: 40,
|
|
186
188
|
getValue: (object: BalanceItemWithPayments) => ({
|
|
187
189
|
value: object.pricePending / 1_0000,
|
|
@@ -203,7 +205,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
203
205
|
return [
|
|
204
206
|
{
|
|
205
207
|
id: `paidIn[${year}]`,
|
|
206
|
-
name: $t('
|
|
208
|
+
name: $t('%1L8', { year: year.toFixed(0) }),
|
|
207
209
|
width: 35,
|
|
208
210
|
getValue: (object: BalanceItemWithPayments) => {
|
|
209
211
|
let value = 0;
|
|
@@ -241,7 +243,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<BalanceItemWithPayments>
|
|
|
241
243
|
return [
|
|
242
244
|
{
|
|
243
245
|
id: `chargedIn[${year}]`,
|
|
244
|
-
name: $t('
|
|
246
|
+
name: $t('%1L9', { year: year.toFixed(0) }),
|
|
245
247
|
width: 35,
|
|
246
248
|
getValue: (object: BalanceItemWithPayments) => {
|
|
247
249
|
let value = 0;
|
|
@@ -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';
|
|
@@ -8,11 +10,11 @@ import { XlsxTransformerColumnHelper } from '../helpers/XlsxTransformerColumnHel
|
|
|
8
10
|
// Assign to a typed variable to assure we have correct type checking in place
|
|
9
11
|
const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
10
12
|
id: 'event-notifications',
|
|
11
|
-
name: $t(`
|
|
13
|
+
name: $t(`%1FR`),
|
|
12
14
|
columns: [
|
|
13
15
|
{
|
|
14
16
|
id: 'id',
|
|
15
|
-
name: $t(`
|
|
17
|
+
name: $t(`%d`),
|
|
16
18
|
width: 40,
|
|
17
19
|
getValue: (notification: EventNotification) => ({
|
|
18
20
|
value: notification.id,
|
|
@@ -20,7 +22,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
20
22
|
},
|
|
21
23
|
{
|
|
22
24
|
id: 'name',
|
|
23
|
-
name: $t(`
|
|
25
|
+
name: $t(`%w9`),
|
|
24
26
|
width: 40,
|
|
25
27
|
getValue: (notification: EventNotification) => ({
|
|
26
28
|
value: notification.events.map(e => e.name).join(', '),
|
|
@@ -28,7 +30,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
28
30
|
},
|
|
29
31
|
{
|
|
30
32
|
id: 'organization.name',
|
|
31
|
-
name: $t(`
|
|
33
|
+
name: $t(`%wA`),
|
|
32
34
|
width: 40,
|
|
33
35
|
getValue: (notification: EventNotification) => ({
|
|
34
36
|
value: notification.organization.name,
|
|
@@ -36,7 +38,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
36
38
|
},
|
|
37
39
|
{
|
|
38
40
|
id: 'organization.uri',
|
|
39
|
-
name: $t(`
|
|
41
|
+
name: $t(`%7C`),
|
|
40
42
|
width: 30,
|
|
41
43
|
getValue: (notification: EventNotification) => ({
|
|
42
44
|
value: notification.organization.uri,
|
|
@@ -44,7 +46,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
44
46
|
},
|
|
45
47
|
{
|
|
46
48
|
id: 'status',
|
|
47
|
-
name: $t(`
|
|
49
|
+
name: $t(`%1A`),
|
|
48
50
|
width: 30,
|
|
49
51
|
getValue: (notification: EventNotification) => ({
|
|
50
52
|
value: Formatter.capitalizeFirstLetter(EventNotificationStatusHelper.getName(notification.status)),
|
|
@@ -52,7 +54,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
52
54
|
},
|
|
53
55
|
{
|
|
54
56
|
id: 'feedbackText',
|
|
55
|
-
name: $t(`
|
|
57
|
+
name: $t(`%YT`),
|
|
56
58
|
width: 80,
|
|
57
59
|
getValue: (notification: EventNotification) => ({
|
|
58
60
|
value: notification.status !== EventNotificationStatus.Accepted ? notification.feedbackText : null,
|
|
@@ -65,7 +67,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
id: 'startDate',
|
|
68
|
-
name: $t(`
|
|
70
|
+
name: $t(`%7e`),
|
|
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(`%wB`),
|
|
82
84
|
width: 20,
|
|
83
85
|
getValue: (notification: EventNotification) => ({
|
|
84
86
|
value: notification.endDate,
|
|
@@ -91,7 +93,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
91
93
|
},
|
|
92
94
|
{
|
|
93
95
|
id: 'submittedAt',
|
|
94
|
-
name: $t(`
|
|
96
|
+
name: $t(`%Aw`),
|
|
95
97
|
width: 20,
|
|
96
98
|
getValue: (notification: EventNotification) => ({
|
|
97
99
|
value: notification.submittedAt,
|
|
@@ -104,7 +106,7 @@ const sheet: XlsxTransformerSheet<EventNotification, EventNotification> = {
|
|
|
104
106
|
},
|
|
105
107
|
{
|
|
106
108
|
id: 'submittedBy',
|
|
107
|
-
name: $t(`
|
|
109
|
+
name: $t(`%wC`),
|
|
108
110
|
width: 40,
|
|
109
111
|
getValue: (notification: EventNotification) => ({
|
|
110
112
|
value: notification.submittedBy?.name ?? '',
|