@stamhoofd/backend 2.118.1 → 2.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +32 -22
- package/src/audit-logs/ModelLogger.ts +4 -2
- package/src/audit-logs/OrderLogger.ts +1 -1
- package/src/boot.ts +32 -14
- package/src/crons/balance-emails.ts +4 -2
- package/src/crons/clearExcelCache.test.ts +8 -8
- package/src/crons/update-cached-balances.ts +40 -14
- package/src/debug.ts +3 -2
- package/src/decoders/StringArrayDecoder.ts +1 -1
- package/src/decoders/StringNullableDecoder.ts +1 -1
- package/src/email-recipient-loaders/documents.ts +2 -1
- package/src/email-recipient-loaders/members.ts +2 -1
- package/src/email-recipient-loaders/orders.ts +2 -1
- package/src/email-recipient-loaders/payments.ts +6 -3
- package/src/email-recipient-loaders/receivable-balances.ts +2 -1
- package/src/email-recipient-loaders/registrations.ts +2 -1
- package/src/email-replacements/getEmailReplacementsForPayment.ts +8 -7
- package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +7 -6
- package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +3 -2
- package/src/endpoints/admin/memberships/GetChargeMembershipsSummaryEndpoint.ts +2 -1
- package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +4 -3
- package/src/endpoints/admin/organizations/GetOrganizationsCountEndpoint.ts +3 -2
- package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +7 -5
- package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +12 -10
- package/src/endpoints/admin/registrations/ChargeRegistrationsEndpoint.ts +4 -3
- package/src/endpoints/auth/CreateAdminEndpoint.ts +8 -6
- package/src/endpoints/auth/CreateTokenEndpoint.ts +14 -12
- package/src/endpoints/auth/DeleteTokenEndpoint.ts +2 -1
- package/src/endpoints/auth/DeleteUserEndpoint.ts +2 -1
- package/src/endpoints/auth/ForgotPasswordEndpoint.ts +5 -4
- package/src/endpoints/auth/GetOtherUserEndpoint.ts +3 -2
- package/src/endpoints/auth/GetUserEndpoint.ts +3 -2
- package/src/endpoints/auth/OpenIDConnectAuthTokenEndpoint.ts +2 -1
- package/src/endpoints/auth/OpenIDConnectCallbackEndpoint.ts +4 -2
- package/src/endpoints/auth/OpenIDConnectStartEndpoint.ts +3 -2
- package/src/endpoints/auth/PatchUserEndpoint.ts +15 -12
- package/src/endpoints/auth/PollEmailVerificationEndpoint.ts +3 -2
- package/src/endpoints/auth/RetryEmailVerificationEndpoint.ts +3 -2
- package/src/endpoints/auth/SignupEndpoint.ts +5 -4
- package/src/endpoints/auth/VerifyEmailEndpoint.ts +6 -5
- package/src/endpoints/frontend/FrontendEnvironmentEndpoint.ts +3 -2
- package/src/endpoints/global/addresses/SearchRegionsEndpoint.ts +8 -5
- package/src/endpoints/global/addresses/ValidateAddressEndpoint.ts +5 -3
- package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +8 -5
- package/src/endpoints/global/billing/ActivatePackagesEndpoint.ts +9 -7
- package/src/endpoints/global/billing/DeactivatePackageEndpoint.ts +4 -3
- package/src/endpoints/global/caddy/CheckDomainCertEndpoint.ts +4 -2
- package/src/endpoints/global/email/CreateEmailEndpoint.ts +9 -7
- package/src/endpoints/global/email/GetAdminEmailsEndpoint.test.ts +2 -1
- package/src/endpoints/global/email/GetAdminEmailsEndpoint.ts +22 -19
- package/src/endpoints/global/email/GetEmailAddressEndpoint.ts +6 -4
- package/src/endpoints/global/email/GetEmailEndpoint.ts +4 -3
- package/src/endpoints/global/email/GetUserEmailsEndpoint.test.ts +3 -2
- package/src/endpoints/global/email/GetUserEmailsEndpoint.ts +7 -4
- package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +7 -5
- package/src/endpoints/global/email/PatchEmailEndpoint.test.ts +11 -11
- package/src/endpoints/global/email/PatchEmailEndpoint.ts +14 -11
- package/src/endpoints/global/email-recipients/GetEmailRecipientsCountEndpoint.ts +3 -2
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.test.ts +2 -1
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.ts +8 -5
- package/src/endpoints/global/email-recipients/RetryEmailRecipientEndpoint.ts +7 -5
- package/src/endpoints/global/email-recipients/helpers/validateEmailRecipientFilter.ts +4 -3
- package/src/endpoints/global/events/GetEventNotificationsCountEndpoint.ts +3 -2
- package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +9 -6
- package/src/endpoints/global/events/GetEventsEndpoint.ts +7 -4
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.test.ts +4 -2
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.ts +17 -15
- package/src/endpoints/global/events/PatchEventsEndpoint.test.ts +4 -2
- package/src/endpoints/global/events/PatchEventsEndpoint.ts +28 -26
- package/src/endpoints/global/files/ExportToExcelEndpoint.ts +8 -5
- package/src/endpoints/global/files/GetFileCache.ts +5 -3
- package/src/endpoints/global/files/UploadFile.ts +10 -4
- package/src/endpoints/global/files/UploadImage.ts +4 -2
- package/src/endpoints/global/groups/GetGroupsEndpoint.test.ts +4 -2
- package/src/endpoints/global/groups/GetGroupsEndpoint.ts +8 -5
- package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +7 -5
- package/src/endpoints/global/members/GetMembersCountEndpoint.ts +3 -2
- package/src/endpoints/global/members/GetMembersEndpoint.test.ts +4 -2
- package/src/endpoints/global/members/GetMembersEndpoint.ts +10 -8
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.test.ts +257 -6
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +162 -107
- package/src/endpoints/global/members/helpers/validateGroupFilter.ts +4 -3
- package/src/endpoints/global/members/shouldCheckIfMemberIsDuplicate.ts +3 -2
- package/src/endpoints/global/organizations/CheckRegisterCodeEndpoint.ts +3 -2
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.test.ts +3 -2
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +8 -7
- package/src/endpoints/global/organizations/GetOrganizationFromDomainEndpoint.ts +5 -3
- package/src/endpoints/global/organizations/GetOrganizationFromUriEndpoint.ts +5 -3
- package/src/endpoints/global/organizations/SearchOrganizationEndpoint.ts +8 -5
- package/src/endpoints/global/payments/StripeWebhookEndpoint.ts +4 -2
- package/src/endpoints/global/platform/GetPlatformAdminsEndpoint.ts +2 -1
- package/src/endpoints/global/platform/GetPlatformEndpoint.ts +3 -2
- package/src/endpoints/global/platform/PatchPlatformEnpoint.test.ts +3 -2
- package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +7 -4
- package/src/endpoints/global/platform-memberships/GetPlatformMembershipsCountEndpoint.ts +47 -0
- package/src/endpoints/global/platform-memberships/GetPlatformMembershipsEndpoint.ts +206 -0
- package/src/endpoints/global/registration/GetRegistrationsCountEndpoint.ts +3 -2
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.test.ts +2 -1
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.ts +10 -7
- package/src/endpoints/global/registration/GetUserDetailedPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/global/registration/GetUserDocumentsEndpoint.ts +4 -2
- package/src/endpoints/global/registration/GetUserMembersEndpoint.ts +3 -2
- package/src/endpoints/global/registration/GetUserPayableBalanceEndpoint.ts +2 -1
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.test.ts +5 -3
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +13 -9
- package/src/endpoints/global/registration/RegisterMembersEndpoint.test.ts +50 -49
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +25 -22
- package/src/endpoints/global/registration-periods/GetRegistrationPeriodsEndpoint.ts +8 -5
- package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +9 -7
- package/src/endpoints/global/sso/GetSSOEndpoint.ts +4 -2
- package/src/endpoints/global/sso/SetSSOEndpoint.ts +3 -2
- package/src/endpoints/global/webshops/GetWebshopFromDomainEndpoint.ts +4 -2
- package/src/endpoints/global/webshops/GetWebshopsCountEndpoint.ts +43 -0
- package/src/endpoints/global/webshops/GetWebshopsEndpoint.test.ts +808 -0
- package/src/endpoints/global/webshops/GetWebshopsEndpoint.ts +221 -0
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/balance-items/PatchBalanceItemsEndpoint.ts +15 -13
- package/src/endpoints/organization/dashboard/billing/GetOrganizationDetailedPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/billing/GetOrganizationPayableBalanceEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/billing/GetPackagesEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplateXML.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplatesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplatesEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/documents/GetDocumentsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentsEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/documents/PatchDocumentEndpoint.ts +9 -7
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplatesEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/email-templates/GetEmailTemplatesEndpoint.test.ts +36 -1
- package/src/endpoints/organization/dashboard/email-templates/GetEmailTemplatesEndpoint.ts +13 -4
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/invoices/GetInvoicesEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/invoices/PatchInvoicesEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/mollie/CheckMollieEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/mollie/ConnectMollieEndpoint.ts +6 -3
- package/src/endpoints/organization/dashboard/mollie/DisconnectMollieEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/mollie/GetMollieDashboardEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/nolt/CreateNoltTokenEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/organization/GetOrganizationArchivedGroups.ts +4 -2
- package/src/endpoints/organization/dashboard/organization/GetOrganizationDeletedGroups.ts +3 -2
- package/src/endpoints/organization/dashboard/organization/GetUitpasClientIdEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.test.ts +5 -3
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +22 -19
- package/src/endpoints/organization/dashboard/organization/SearchUitpasOrganizersEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/organization/SetOrganizationDomainEndpoint.ts +11 -9
- package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts +8 -7
- package/src/endpoints/organization/dashboard/payments/GetMemberBalanceEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/payments/GetPaymentsCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +7 -5
- package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +18 -16
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalanceEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.test.ts +2 -1
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.ts +8 -5
- package/src/endpoints/organization/dashboard/registration-periods/MoveRegistrationPeriods.test.ts +4 -2
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.test.ts +4 -2
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +32 -29
- package/src/endpoints/organization/dashboard/registration-periods/SetupStepReviewEndpoint.ts +6 -3
- package/src/endpoints/organization/dashboard/stripe/ConnectStripeEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/stripe/DeleteStripeAccountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountsEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +4 -3
- package/src/endpoints/organization/dashboard/users/GetApiUsersEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/users/GetOrganizationAdminsEndpoint.ts +2 -1
- package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +7 -6
- package/src/endpoints/organization/dashboard/webshops/DeleteWebshopEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/webshops/GetDiscountCodesEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersCountEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersEndpoint.ts +7 -4
- package/src/endpoints/organization/dashboard/webshops/{GetWebshopTicketsCountEndpoint → GetWebshopTicketsCountEndpoint.ts} +7 -7
- package/src/endpoints/organization/dashboard/webshops/GetWebshopTicketsEndpoint.ts +9 -6
- package/src/endpoints/organization/dashboard/webshops/GetWebshopUriAvailabilityEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/PatchDiscountCodesEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +13 -12
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopOrdersEndpoint.ts +4 -2
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +5 -3
- package/src/endpoints/organization/dashboard/webshops/SearchUitpasEventsEndpoint.ts +6 -4
- package/src/endpoints/organization/dashboard/webshops/VerifyWebshopDomainEndpoint.ts +2 -1
- package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +6 -4
- package/src/endpoints/organization/shared/GetDocumentHtml.ts +4 -3
- package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +4 -3
- package/src/endpoints/organization/shared/GetUitpasNumberDetailsEndpoint.ts +3 -2
- package/src/endpoints/organization/shared/auth/GetOrganizationEndpoint.ts +3 -2
- package/src/endpoints/organization/webshops/CheckWebshopDiscountCodesEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +5 -4
- package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +7 -5
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +4 -3
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.test.ts +7 -3
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +11 -10
- package/src/endpoints/organization/webshops/RetrieveUitpasSocialTariffPriceEndpoint.ts +5 -4
- package/src/endpoints/system/HealthEndpoint.test.ts +44 -0
- package/src/endpoints/system/HealthEndpoint.ts +14 -6
- package/src/excel-loaders/balance-items.ts +19 -17
- package/src/excel-loaders/event-notifications.ts +15 -13
- package/src/excel-loaders/index.ts +1 -0
- package/src/excel-loaders/members.ts +45 -43
- package/src/excel-loaders/organizations.ts +26 -25
- package/src/excel-loaders/payments.ts +44 -42
- package/src/excel-loaders/platform-memberships.ts +202 -0
- package/src/excel-loaders/receivable-balances.ts +25 -23
- package/src/excel-loaders/registrations.ts +30 -28
- package/src/helpers/AddressValidator.test.ts +2 -1
- package/src/helpers/AddressValidator.ts +13 -10
- package/src/helpers/AdminPermissionChecker.ts +193 -95
- package/src/helpers/AuthenticatedStructures.ts +13 -11
- package/src/helpers/BuckarooHelper.ts +3 -2
- package/src/helpers/Context.ts +8 -6
- package/src/helpers/CookieHelper.ts +2 -2
- package/src/helpers/FileCache.ts +9 -9
- package/src/helpers/ForwardHandler.ts +3 -2
- package/src/helpers/GlobalHelper.ts +2 -0
- package/src/helpers/GroupBuilder.ts +2 -1
- package/src/helpers/GroupedThrottledQueue.test.ts +19 -19
- package/src/helpers/LimitedFilteredRequestHelper.ts +1 -1
- package/src/helpers/MemberCharger.ts +2 -1
- package/src/helpers/MemberUserSyncer.ts +6 -3
- package/src/helpers/MembershipCharger.ts +2 -2
- package/src/helpers/OrganizationCharger.ts +2 -1
- package/src/helpers/PeriodHelper.ts +2 -1
- package/src/helpers/SQLTranslatedString.ts +3 -2
- package/src/helpers/ServiceFeeHelper.ts +1 -1
- package/src/helpers/SetupStepUpdater.ts +6 -5
- package/src/helpers/StripeHelper.ts +9 -8
- package/src/helpers/TagHelper.test.ts +5 -5
- package/src/helpers/TagHelper.ts +2 -1
- package/src/helpers/TemporaryMemberAccess.ts +2 -1
- package/src/helpers/ThrottledQueue.test.ts +20 -20
- package/src/helpers/UitpasTokenRepository.ts +7 -7
- package/src/helpers/ViesHelper.ts +5 -4
- package/src/helpers/XlsxTransformerColumnHelper.ts +21 -19
- package/src/helpers/email-html-helpers.ts +13 -12
- package/src/helpers/fetchToAsyncIterator.ts +1 -1
- package/src/helpers/outstandingBalanceJoin.ts +2 -1
- package/src/helpers/updateMemberDetailsUitpasNumber.ts +5 -4
- package/src/middleware/ContextMiddleware.ts +1 -1
- package/src/migrate.ts +21 -4
- package/src/seeds/0000000003-default-email-templates.ts +1 -1
- package/src/seeds/0000000004-single-organization.ts +2 -1
- package/src/seeds/1752848561-groups-registration-periods.ts +3 -2
- package/src/seeds/1754560914-groups-prices.test.ts +2 -1
- package/src/seeds/1754560914-groups-prices.ts +2 -1
- package/src/seeds/1755790070-fill-email-recipient-errors.ts +6 -6
- package/src/seeds/1755876819-remove-duplicate-members.ts +2 -1
- package/src/seeds/1765896674-document-update-year.test.ts +2 -1
- package/src/seeds/1773754928-force-save-members.ts +15 -0
- package/src/services/AuditLogService.ts +3 -2
- package/src/services/BalanceItemPaymentService.ts +2 -2
- package/src/services/BalanceItemService.ts +2 -1
- package/src/services/BootChecksService.test.ts +33 -0
- package/src/services/BootChecksService.ts +21 -0
- package/src/services/DatabaseCollationService.test.ts +18 -0
- package/src/services/DatabaseCollationService.ts +81 -0
- package/src/services/DocumentService.ts +1 -1
- package/src/services/EventNotificationService.ts +5 -4
- package/src/services/FileSignService.ts +2 -2
- package/src/services/InvoiceService.ts +3 -3
- package/src/services/MemberNumberService.ts +6 -4
- package/src/services/MemberRecordStore.ts +28 -19
- package/src/services/PaymentReallocationService.test.ts +2 -1
- package/src/services/PaymentReallocationService.ts +2 -1
- package/src/services/PaymentService.ts +28 -26
- package/src/services/RegistrationService.ts +65 -3
- package/src/services/SSOService.ts +13 -9
- package/src/services/STPackageService.ts +7 -5
- package/src/services/StartupHealthService.ts +15 -0
- package/src/services/uitpas/PassholderEndpoints.ts +2 -2
- package/src/services/uitpas/UitpasService.ts +11 -8
- package/src/services/uitpas/cancelTicketSales.ts +1 -1
- package/src/services/uitpas/checkPermissionsFor.ts +9 -9
- package/src/services/uitpas/getSocialTariffForEvent.ts +4 -4
- package/src/services/uitpas/getSocialTariffForUitpasNumbers.ts +5 -5
- package/src/services/uitpas/handleUitpasResponse.ts +1 -1
- package/src/services/uitpas/registerTicketSales.ts +4 -4
- package/src/services/uitpas/searchUitpasEvents.ts +3 -3
- package/src/services/uitpas/searchUitpasOrganizers.ts +3 -3
- package/src/sql-filters/audit-logs.ts +2 -1
- package/src/sql-filters/balance-item-payments.ts +2 -1
- package/src/sql-filters/balance-items.ts +2 -1
- package/src/sql-filters/base-registration-filter-compilers.ts +6 -4
- package/src/sql-filters/document-templates.ts +2 -1
- package/src/sql-filters/documents.ts +2 -1
- package/src/sql-filters/email-recipients.ts +2 -1
- package/src/sql-filters/emails.ts +2 -1
- package/src/sql-filters/event-notifications.ts +2 -1
- package/src/sql-filters/events.ts +2 -1
- package/src/sql-filters/groups.ts +2 -1
- package/src/sql-filters/invoiced-balance-items.ts +2 -1
- package/src/sql-filters/invoices.ts +2 -1
- package/src/sql-filters/member-responsibility-records.ts +2 -1
- package/src/sql-filters/members.ts +8 -7
- package/src/sql-filters/orders.ts +3 -2
- package/src/sql-filters/organization-registration-periods.ts +2 -1
- package/src/sql-filters/organizations.ts +2 -1
- package/src/sql-filters/payments.ts +2 -1
- package/src/sql-filters/platform-memberships.ts +67 -0
- package/src/sql-filters/receivable-balances.ts +2 -1
- package/src/sql-filters/registration-periods.ts +2 -1
- package/src/sql-filters/registrations.ts +2 -1
- package/src/sql-filters/tickets.ts +2 -1
- package/src/sql-filters/users.ts +2 -1
- package/src/sql-filters/webshops.ts +38 -0
- package/src/sql-sorters/audit-logs.ts +3 -2
- package/src/sql-sorters/balance-items.ts +3 -2
- package/src/sql-sorters/document-templates.ts +3 -2
- package/src/sql-sorters/documents.ts +3 -2
- package/src/sql-sorters/email-recipients.ts +3 -2
- package/src/sql-sorters/emails.ts +3 -2
- package/src/sql-sorters/event-notifications.ts +3 -2
- package/src/sql-sorters/events.ts +3 -2
- package/src/sql-sorters/groups.ts +3 -2
- package/src/sql-sorters/invoices.ts +3 -2
- package/src/sql-sorters/members.ts +3 -2
- package/src/sql-sorters/orders.ts +3 -2
- package/src/sql-sorters/organization-registration-periods.ts +3 -2
- package/src/sql-sorters/organizations.ts +3 -2
- package/src/sql-sorters/payments.ts +3 -2
- package/src/sql-sorters/platform-memberships.ts +40 -0
- package/src/sql-sorters/receivable-balances.ts +3 -2
- package/src/sql-sorters/registration-periods.ts +3 -2
- package/src/sql-sorters/registrations.ts +3 -2
- package/src/sql-sorters/tickets.ts +3 -2
- package/src/sql-sorters/webshops.ts +40 -0
- package/tests/actions/patchOrganizationMember.ts +5 -4
- package/tests/actions/patchPaymentStatus.ts +2 -2
- package/tests/actions/patchUserMember.ts +6 -4
- package/tests/e2e/api-rate-limits.test.ts +4 -5
- package/tests/e2e/bundle-discounts.test.ts +3 -2
- package/tests/e2e/charge-members.test.ts +7 -5
- package/tests/e2e/documents.test.ts +3 -2
- package/tests/e2e/private-files.test.ts +11 -13
- package/tests/e2e/register.test.ts +6 -5
- package/tests/e2e/stock.test.ts +6 -8
- package/tests/e2e/tickets.test.ts +4 -2
- package/tests/helpers/StripeMocker.ts +3 -3
- package/tests/init/initAdmin.ts +4 -2
- package/tests/init/initBundleDiscount.ts +3 -2
- package/tests/init/initPayconiq.ts +1 -1
- package/tests/init/initPermissionRole.ts +4 -2
- package/tests/init/initPlatformRecordCategory.ts +1 -1
- package/tests/init/initStripe.ts +1 -1
- package/tests/vitest.global.setup.ts +26 -0
- package/tests/{jest.setup.ts → vitest.setup.ts} +4 -3
- package/tsconfig.build.json +17 -0
- package/tsconfig.json +10 -41
- package/tsconfig.test.json +17 -0
- package/vitest.config.js +13 -0
- package/eslint.config.mjs +0 -5
- package/jest.config.cjs +0 -27
- package/tests/jest.global.setup.ts +0 -33
- package/tests/toMatchMap.ts +0 -68
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { XlsxTransformerColumn, XlsxTransformerConcreteColumn } from '@stamhoofd/excel-writer';
|
|
2
|
+
import { XlsxBuiltInNumberFormat } from '@stamhoofd/excel-writer';
|
|
3
|
+
import type { BalanceItemWithPayments, DetailedReceivableBalance, ReceivableBalance } from '@stamhoofd/structures';
|
|
4
|
+
import { BalanceItemRelationType, ExcelExportType, getBalanceItemRelationTypeName, getBalanceItemStatusName, getBalanceItemTypeName, getReceivableBalanceTypeName, PaginatedResponse } from '@stamhoofd/structures';
|
|
3
5
|
import { Formatter } from '@stamhoofd/utility';
|
|
4
6
|
import { ExportToExcelEndpoint } from '../endpoints/global/files/ExportToExcelEndpoint.js';
|
|
5
7
|
import { GetReceivableBalancesEndpoint } from '../endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesEndpoint.js';
|
|
@@ -20,12 +22,12 @@ ExportToExcelEndpoint.loaders.set(ExcelExportType.ReceivableBalances, {
|
|
|
20
22
|
sheets: [
|
|
21
23
|
{
|
|
22
24
|
id: 'receivableBalances',
|
|
23
|
-
name: $t(`
|
|
25
|
+
name: $t(`%99`),
|
|
24
26
|
columns: getGeneralColumns(),
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
29
|
id: 'balanceItems',
|
|
28
|
-
name: $t(`
|
|
30
|
+
name: $t(`%Mg`),
|
|
29
31
|
transform: (data: DetailedReceivableBalance): ReceivableBalanceWithItem[] => data.balanceItems.map(balanceItem => ({
|
|
30
32
|
receivableBalance: data,
|
|
31
33
|
balanceItem,
|
|
@@ -53,7 +55,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
53
55
|
return [
|
|
54
56
|
{
|
|
55
57
|
id: 'id',
|
|
56
|
-
name: $t(`
|
|
58
|
+
name: $t(`%d`),
|
|
57
59
|
width: 40,
|
|
58
60
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
59
61
|
value: object.balanceItem.id,
|
|
@@ -66,7 +68,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
66
68
|
},
|
|
67
69
|
{
|
|
68
70
|
id: 'type',
|
|
69
|
-
name: $t(`
|
|
71
|
+
name: $t(`%1B`),
|
|
70
72
|
width: 30,
|
|
71
73
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
72
74
|
value: getBalanceItemTypeName(object.balanceItem.type),
|
|
@@ -74,7 +76,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
74
76
|
},
|
|
75
77
|
{
|
|
76
78
|
id: 'category',
|
|
77
|
-
name: $t(`
|
|
79
|
+
name: $t(`%M2`),
|
|
78
80
|
width: 30,
|
|
79
81
|
getValue: (object: ReceivableBalanceWithItem) => {
|
|
80
82
|
return {
|
|
@@ -84,7 +86,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
84
86
|
},
|
|
85
87
|
{
|
|
86
88
|
id: 'description',
|
|
87
|
-
name: $t(`
|
|
89
|
+
name: $t(`%6o`),
|
|
88
90
|
width: 40,
|
|
89
91
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
90
92
|
value: object.balanceItem.description,
|
|
@@ -92,7 +94,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
92
94
|
},
|
|
93
95
|
{
|
|
94
96
|
id: 'amount',
|
|
95
|
-
name: $t(`
|
|
97
|
+
name: $t(`%M4`),
|
|
96
98
|
width: 20,
|
|
97
99
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
98
100
|
value: object.balanceItem.amount,
|
|
@@ -105,7 +107,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
105
107
|
},
|
|
106
108
|
{
|
|
107
109
|
id: 'unitPrice',
|
|
108
|
-
name: $t(`
|
|
110
|
+
name: $t(`%6q`),
|
|
109
111
|
width: 20,
|
|
110
112
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
111
113
|
value: object.balanceItem.unitPrice / 1_0000,
|
|
@@ -118,7 +120,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
118
120
|
},
|
|
119
121
|
{
|
|
120
122
|
id: 'price',
|
|
121
|
-
name: $t(`
|
|
123
|
+
name: $t(`%1IP`),
|
|
122
124
|
width: 20,
|
|
123
125
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
124
126
|
value: object.balanceItem.priceWithVAT / 1_0000,
|
|
@@ -131,7 +133,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
131
133
|
},
|
|
132
134
|
{
|
|
133
135
|
id: 'pricePaid',
|
|
134
|
-
name: $t(`
|
|
136
|
+
name: $t(`%Ml`),
|
|
135
137
|
width: 20,
|
|
136
138
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
137
139
|
value: object.balanceItem.pricePaid / 1_0000,
|
|
@@ -144,7 +146,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
144
146
|
},
|
|
145
147
|
{
|
|
146
148
|
id: 'pricePending',
|
|
147
|
-
name: $t(`
|
|
149
|
+
name: $t(`%wc`),
|
|
148
150
|
width: 20,
|
|
149
151
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
150
152
|
value: object.balanceItem.pricePending / 1_0000,
|
|
@@ -157,7 +159,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
157
159
|
},
|
|
158
160
|
{
|
|
159
161
|
id: 'priceOpen',
|
|
160
|
-
name: $t(`
|
|
162
|
+
name: $t(`%76`),
|
|
161
163
|
width: 20,
|
|
162
164
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
163
165
|
value: object.balanceItem.priceOpen / 1_0000,
|
|
@@ -170,7 +172,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
170
172
|
},
|
|
171
173
|
{
|
|
172
174
|
id: 'createdAt',
|
|
173
|
-
name: $t(`
|
|
175
|
+
name: $t(`%1JJ`),
|
|
174
176
|
width: 20,
|
|
175
177
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
176
178
|
value: object.balanceItem.createdAt,
|
|
@@ -183,7 +185,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
183
185
|
},
|
|
184
186
|
{
|
|
185
187
|
id: 'dueAt',
|
|
186
|
-
name: $t(`
|
|
188
|
+
name: $t(`%wW`),
|
|
187
189
|
width: 20,
|
|
188
190
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
189
191
|
value: object.balanceItem.dueAt,
|
|
@@ -196,7 +198,7 @@ function getBalanceItemColumns(): XlsxTransformerColumn<ReceivableBalanceWithIte
|
|
|
196
198
|
},
|
|
197
199
|
{
|
|
198
200
|
id: 'status',
|
|
199
|
-
name: $t(`
|
|
201
|
+
name: $t(`%1A`),
|
|
200
202
|
width: 20,
|
|
201
203
|
getValue: (object: ReceivableBalanceWithItem) => ({
|
|
202
204
|
value: getBalanceItemStatusName(object.balanceItem.status),
|
|
@@ -229,7 +231,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
|
|
|
229
231
|
return [
|
|
230
232
|
{
|
|
231
233
|
id: 'id',
|
|
232
|
-
name: $t(`
|
|
234
|
+
name: $t(`%wd`),
|
|
233
235
|
width: 40,
|
|
234
236
|
getValue: (object: ReceivableBalance) => ({
|
|
235
237
|
value: object.id,
|
|
@@ -242,7 +244,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
|
|
|
242
244
|
},
|
|
243
245
|
{
|
|
244
246
|
id: 'name',
|
|
245
|
-
name: $t(`
|
|
247
|
+
name: $t(`%Mn`),
|
|
246
248
|
width: 40,
|
|
247
249
|
getValue: (object: ReceivableBalance) => ({
|
|
248
250
|
value: object.object.name,
|
|
@@ -250,7 +252,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
|
|
|
250
252
|
},
|
|
251
253
|
{
|
|
252
254
|
id: 'uri',
|
|
253
|
-
name: $t(`
|
|
255
|
+
name: $t(`%7C`),
|
|
254
256
|
width: 16,
|
|
255
257
|
getValue: (object: ReceivableBalance) => ({
|
|
256
258
|
value: object.object.uri,
|
|
@@ -258,7 +260,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
|
|
|
258
260
|
},
|
|
259
261
|
{
|
|
260
262
|
id: 'amountOpen',
|
|
261
|
-
name: $t(`
|
|
263
|
+
name: $t(`%76`),
|
|
262
264
|
width: 10,
|
|
263
265
|
getValue: (object: ReceivableBalance) => ({
|
|
264
266
|
value: object.amountOpen / 1_0000,
|
|
@@ -271,7 +273,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
|
|
|
271
273
|
},
|
|
272
274
|
{
|
|
273
275
|
id: 'amountPending',
|
|
274
|
-
name: $t(`
|
|
276
|
+
name: $t(`%wc`),
|
|
275
277
|
width: 18,
|
|
276
278
|
getValue: (object: ReceivableBalance) => ({
|
|
277
279
|
value: object.amountPending / 1_0000,
|
|
@@ -284,7 +286,7 @@ function getGeneralColumns(): XlsxTransformerConcreteColumn<ReceivableBalance>[]
|
|
|
284
286
|
},
|
|
285
287
|
{
|
|
286
288
|
id: 'objectType',
|
|
287
|
-
name: $t(`
|
|
289
|
+
name: $t(`%1f`),
|
|
288
290
|
width: 10,
|
|
289
291
|
getValue: (object: ReceivableBalance) => ({
|
|
290
292
|
value: getReceivableBalanceTypeName(object.objectType),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { 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, getGroupTypeName, PlatformRegistration, Platform as PlatformStruct, UnencodeablePaginatedResponse } from '@stamhoofd/structures';
|
|
4
6
|
import { ExportToExcelEndpoint } from '../endpoints/global/files/ExportToExcelEndpoint.js';
|
|
5
7
|
import { GetRegistrationsEndpoint } from '../endpoints/global/registration/GetRegistrationsEndpoint.js';
|
|
6
8
|
import { AuthenticatedStructures } from '../helpers/AuthenticatedStructures.js';
|
|
@@ -11,11 +13,11 @@ import { baseMemberColumns } from './members.js';
|
|
|
11
13
|
// Assign to a typed variable to assure we have correct type checking in place
|
|
12
14
|
const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
13
15
|
id: 'registrations',
|
|
14
|
-
name: $t('
|
|
16
|
+
name: $t('%1EI'),
|
|
15
17
|
columns: [
|
|
16
18
|
{
|
|
17
19
|
id: 'id',
|
|
18
|
-
name: $t(`
|
|
20
|
+
name: $t(`%d`),
|
|
19
21
|
width: 40,
|
|
20
22
|
getValue: (registration: PlatformRegistration) => ({
|
|
21
23
|
value: registration.id,
|
|
@@ -23,7 +25,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
23
25
|
},
|
|
24
26
|
{
|
|
25
27
|
id: 'priceName',
|
|
26
|
-
name: $t(`
|
|
28
|
+
name: $t(`%62`),
|
|
27
29
|
width: 30,
|
|
28
30
|
getValue: (registration: PlatformRegistration) => {
|
|
29
31
|
return {
|
|
@@ -33,7 +35,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
33
35
|
},
|
|
34
36
|
{
|
|
35
37
|
id: 'price',
|
|
36
|
-
name: $t(`
|
|
38
|
+
name: $t(`%62`),
|
|
37
39
|
width: 30,
|
|
38
40
|
getValue: (registration: PlatformRegistration) => {
|
|
39
41
|
return {
|
|
@@ -49,7 +51,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
49
51
|
{
|
|
50
52
|
id: 'toPay',
|
|
51
53
|
width: 30,
|
|
52
|
-
name: $t(`
|
|
54
|
+
name: $t(`%m0`),
|
|
53
55
|
getValue: (registration: PlatformRegistration) => {
|
|
54
56
|
return {
|
|
55
57
|
value: registration.balances.reduce((sum, r) => sum + (r.amountOpen + r.amountPending), 0) / 1_0000,
|
|
@@ -64,7 +66,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
64
66
|
},
|
|
65
67
|
{
|
|
66
68
|
id: 'outstandingBalance',
|
|
67
|
-
name: $t(`
|
|
69
|
+
name: $t(`%76`),
|
|
68
70
|
width: 30,
|
|
69
71
|
getValue: (v) => {
|
|
70
72
|
return {
|
|
@@ -80,7 +82,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
80
82
|
},
|
|
81
83
|
{
|
|
82
84
|
id: 'registeredAt',
|
|
83
|
-
name: $t(`
|
|
85
|
+
name: $t(`%zg`),
|
|
84
86
|
width: 20,
|
|
85
87
|
getValue: (registration: PlatformRegistration) => ({
|
|
86
88
|
value: registration.registeredAt,
|
|
@@ -93,7 +95,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
93
95
|
},
|
|
94
96
|
{
|
|
95
97
|
id: 'startDate',
|
|
96
|
-
name: $t(`
|
|
98
|
+
name: $t(`%7e`),
|
|
97
99
|
width: 20,
|
|
98
100
|
getValue: (registration: PlatformRegistration) => ({
|
|
99
101
|
value: registration.startDate,
|
|
@@ -106,7 +108,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
106
108
|
},
|
|
107
109
|
{
|
|
108
110
|
id: 'endDate',
|
|
109
|
-
name: $t(`
|
|
111
|
+
name: $t(`%wB`),
|
|
110
112
|
width: 20,
|
|
111
113
|
getValue: (registration: PlatformRegistration) => ({
|
|
112
114
|
value: registration.endDate,
|
|
@@ -119,7 +121,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
119
121
|
},
|
|
120
122
|
{
|
|
121
123
|
id: 'createdAt',
|
|
122
|
-
name: $t('
|
|
124
|
+
name: $t('%1IG'),
|
|
123
125
|
width: 20,
|
|
124
126
|
getValue: (registration: PlatformRegistration) => ({
|
|
125
127
|
value: registration.member.member.createdAt,
|
|
@@ -132,39 +134,39 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
132
134
|
},
|
|
133
135
|
{
|
|
134
136
|
id: 'organization',
|
|
135
|
-
name: $t('
|
|
137
|
+
name: $t('%5E'),
|
|
136
138
|
width: 40,
|
|
137
139
|
getValue: (registration: PlatformRegistration) => {
|
|
138
140
|
const organization = registration.member.family.getOrganization(registration.group.organizationId);
|
|
139
141
|
return ({
|
|
140
|
-
value: organization?.name ?? $t('
|
|
142
|
+
value: organization?.name ?? $t('%Gr'),
|
|
141
143
|
});
|
|
142
144
|
},
|
|
143
145
|
},
|
|
144
146
|
{
|
|
145
147
|
id: 'uri',
|
|
146
|
-
name: $t('
|
|
148
|
+
name: $t('%7C'),
|
|
147
149
|
width: 40,
|
|
148
150
|
getValue: (registration: PlatformRegistration) => {
|
|
149
151
|
const organization = registration.member.family.getOrganization(registration.group.organizationId);
|
|
150
152
|
return ({
|
|
151
|
-
value: organization?.uri ?? $t('
|
|
153
|
+
value: organization?.uri ?? $t('%Gr'),
|
|
152
154
|
});
|
|
153
155
|
},
|
|
154
156
|
},
|
|
155
157
|
{
|
|
156
158
|
id: 'groupRegistration',
|
|
157
|
-
name: $t('
|
|
159
|
+
name: $t('%8t'),
|
|
158
160
|
width: 40,
|
|
159
161
|
getValue: (registration: PlatformRegistration) => {
|
|
160
162
|
let value: string;
|
|
161
163
|
|
|
162
164
|
if (registration.payingOrganizationId) {
|
|
163
165
|
const organization = registration.member.organizations.find(o => o.id === registration.payingOrganizationId);
|
|
164
|
-
value = organization ? organization.name : $t(`
|
|
166
|
+
value = organization ? organization.name : $t(`%Gr`);
|
|
165
167
|
}
|
|
166
168
|
else {
|
|
167
|
-
value = $t(`
|
|
169
|
+
value = $t(`%18s`);
|
|
168
170
|
}
|
|
169
171
|
|
|
170
172
|
return ({
|
|
@@ -174,7 +176,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
174
176
|
},
|
|
175
177
|
{
|
|
176
178
|
id: 'trialUntil',
|
|
177
|
-
name: $t(`
|
|
179
|
+
name: $t(`%1IH`),
|
|
178
180
|
width: 40,
|
|
179
181
|
getValue: (registration: PlatformRegistration) => {
|
|
180
182
|
let value: Date | null = null;
|
|
@@ -213,7 +215,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
213
215
|
|
|
214
216
|
return [{
|
|
215
217
|
id: `optionMenu.${menuId}.${optionId}${returnAmount ? '.amount' : ''}`,
|
|
216
|
-
name: $t(`
|
|
218
|
+
name: $t(`%wO`),
|
|
217
219
|
width: 30,
|
|
218
220
|
getValue: (registration: PlatformRegistration) => {
|
|
219
221
|
const options = registration.options.filter(o => o.optionMenu.id === menuId && o.option.id === optionId);
|
|
@@ -241,7 +243,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
241
243
|
return [
|
|
242
244
|
{
|
|
243
245
|
id: `optionMenu.${menuId}`,
|
|
244
|
-
name: $t(`
|
|
246
|
+
name: $t(`%Tb`),
|
|
245
247
|
width: 30,
|
|
246
248
|
getValue: (registration: PlatformRegistration) => {
|
|
247
249
|
const options = registration.options.filter(o => o.optionMenu.id === menuId);
|
|
@@ -295,7 +297,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
295
297
|
})),
|
|
296
298
|
{
|
|
297
299
|
id: 'organization',
|
|
298
|
-
name: $t(`
|
|
300
|
+
name: $t(`%wA`),
|
|
299
301
|
width: 40,
|
|
300
302
|
getValue: (registration: PlatformRegistration) => {
|
|
301
303
|
return {
|
|
@@ -305,7 +307,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
305
307
|
},
|
|
306
308
|
{
|
|
307
309
|
id: 'uri',
|
|
308
|
-
name: $t(`
|
|
310
|
+
name: $t(`%7C`),
|
|
309
311
|
width: 30,
|
|
310
312
|
getValue: (registration: PlatformRegistration) => {
|
|
311
313
|
return {
|
|
@@ -315,7 +317,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
315
317
|
},
|
|
316
318
|
{
|
|
317
319
|
id: 'group',
|
|
318
|
-
name: $t(`
|
|
320
|
+
name: $t(`%wH`),
|
|
319
321
|
width: 40,
|
|
320
322
|
getValue: (registration: PlatformRegistration) => {
|
|
321
323
|
return {
|
|
@@ -325,7 +327,7 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
325
327
|
},
|
|
326
328
|
{
|
|
327
329
|
id: 'defaultAgeGroup',
|
|
328
|
-
name: $t(`
|
|
330
|
+
name: $t(`%wI`),
|
|
329
331
|
width: 40,
|
|
330
332
|
getValue: (registration: PlatformRegistration) => {
|
|
331
333
|
const defaultAgeGroupId = registration.group.defaultAgeGroupId;
|
|
@@ -335,13 +337,13 @@ const sheet: XlsxTransformerSheet<PlatformMember, PlatformRegistration> = {
|
|
|
335
337
|
};
|
|
336
338
|
}
|
|
337
339
|
return {
|
|
338
|
-
value: PlatformStruct.shared.config.defaultAgeGroups.find(g => g.id === defaultAgeGroupId)?.name ?? $t(`
|
|
340
|
+
value: PlatformStruct.shared.config.defaultAgeGroups.find(g => g.id === defaultAgeGroupId)?.name ?? $t(`%wJ`),
|
|
339
341
|
};
|
|
340
342
|
},
|
|
341
343
|
},
|
|
342
344
|
{
|
|
343
345
|
id: 'group.type',
|
|
344
|
-
name: $t('
|
|
346
|
+
name: $t('%1LP'),
|
|
345
347
|
width: 20,
|
|
346
348
|
getValue: (registration: PlatformRegistration) => {
|
|
347
349
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { City, PostalCode, Province } from '@stamhoofd/models';
|
|
2
|
-
import { Address
|
|
2
|
+
import { Address } from '@stamhoofd/structures';
|
|
3
|
+
import { Country } from '@stamhoofd/types/Country';
|
|
3
4
|
|
|
4
5
|
import { AddressValidator } from './AddressValidator.js';
|
|
5
6
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Database } from '@simonbackx/simple-database';
|
|
2
|
-
import {
|
|
2
|
+
import type { Decoder } from '@simonbackx/simple-encoding';
|
|
3
|
+
import { ArrayDecoder, AutoEncoder, field, ObjectData, StringDecoder } from '@simonbackx/simple-encoding';
|
|
3
4
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
5
|
import { City, PostalCode, Street } from '@stamhoofd/models';
|
|
5
|
-
import { Address
|
|
6
|
+
import type { Address } from '@stamhoofd/structures';
|
|
7
|
+
import { ValidatedAddress } from '@stamhoofd/structures';
|
|
8
|
+
import { Country } from '@stamhoofd/types/Country';
|
|
6
9
|
import { sleep, StringCompare } from '@stamhoofd/utility';
|
|
7
10
|
import axios from 'axios';
|
|
8
11
|
import { v4 as uuidv4 } from 'uuid';
|
|
@@ -20,17 +23,17 @@ export class AddressValidatorStatic {
|
|
|
20
23
|
throw new SimpleError({
|
|
21
24
|
code: 'invalid_field',
|
|
22
25
|
message: 'Invalid postal code format (NL)',
|
|
23
|
-
human: $t(`
|
|
26
|
+
human: $t(`%Fb`),
|
|
24
27
|
field: 'postalCode',
|
|
25
28
|
});
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
const numbers = stripped.slice(0, 4);
|
|
29
|
-
if (
|
|
32
|
+
if (!/\d{4}/.test(numbers)) {
|
|
30
33
|
throw new SimpleError({
|
|
31
34
|
code: 'invalid_field',
|
|
32
35
|
message: 'Invalid postal code format (NL)',
|
|
33
|
-
human: $t(`
|
|
36
|
+
human: $t(`%Fb`),
|
|
34
37
|
field: 'postalCode',
|
|
35
38
|
});
|
|
36
39
|
}
|
|
@@ -44,7 +47,7 @@ export class AddressValidatorStatic {
|
|
|
44
47
|
|
|
45
48
|
if (postalCode.length == 0) {
|
|
46
49
|
const numbers = address.city.substring(0, 4);
|
|
47
|
-
if (
|
|
50
|
+
if (!/\d{4}/.test(numbers)) {
|
|
48
51
|
postalCode = numbers;
|
|
49
52
|
address.city = address.city.substring(4).trim();
|
|
50
53
|
}
|
|
@@ -52,7 +55,7 @@ export class AddressValidatorStatic {
|
|
|
52
55
|
throw new SimpleError({
|
|
53
56
|
code: 'invalid_field',
|
|
54
57
|
message: 'Postal code is required',
|
|
55
|
-
human: $t(`
|
|
58
|
+
human: $t(`%Fc`),
|
|
56
59
|
field: 'postalCode',
|
|
57
60
|
});
|
|
58
61
|
}
|
|
@@ -75,7 +78,7 @@ export class AddressValidatorStatic {
|
|
|
75
78
|
throw new SimpleError({
|
|
76
79
|
code: 'invalid_field',
|
|
77
80
|
message: 'Invalid postal code or city',
|
|
78
|
-
human: $t(`
|
|
81
|
+
human: $t(`%Fd`),
|
|
79
82
|
field: 'postalCode',
|
|
80
83
|
});
|
|
81
84
|
}
|
|
@@ -129,7 +132,7 @@ export class AddressValidatorStatic {
|
|
|
129
132
|
throw new SimpleError({
|
|
130
133
|
code: 'invalid_field',
|
|
131
134
|
message: 'Invalid street',
|
|
132
|
-
human: $t(`
|
|
135
|
+
human: $t(`%Fe`),
|
|
133
136
|
field: 'street',
|
|
134
137
|
});
|
|
135
138
|
}
|
|
@@ -137,7 +140,7 @@ export class AddressValidatorStatic {
|
|
|
137
140
|
throw new SimpleError({
|
|
138
141
|
code: 'invalid_field',
|
|
139
142
|
message: 'Invalid street, do you mean ' + bestStreet.name + '?',
|
|
140
|
-
human: $t('
|
|
143
|
+
human: $t('%Fa', { street: bestStreet.name }),
|
|
141
144
|
field: 'street',
|
|
142
145
|
});
|
|
143
146
|
}
|