@stamhoofd/backend 2.115.1 → 2.117.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/migrations.ts +1 -1
- package/package.json +10 -10
- package/src/audit-logs/DocumentTemplateLogger.ts +1 -1
- package/src/audit-logs/EmailAddressLogger.ts +1 -1
- package/src/audit-logs/EmailLogger.ts +1 -1
- package/src/audit-logs/EmailTemplateLogger.ts +1 -1
- package/src/audit-logs/EventLogger.ts +1 -1
- package/src/audit-logs/GroupLogger.ts +1 -1
- package/src/audit-logs/MemberLogger.ts +1 -1
- package/src/audit-logs/MemberPlatformMembershipLogger.ts +1 -1
- package/src/audit-logs/MemberResponsibilityRecordLogger.ts +1 -1
- package/src/audit-logs/ModelLogger.ts +27 -19
- package/src/audit-logs/OrderLogger.ts +1 -1
- package/src/audit-logs/OrganizationLogger.ts +23 -3
- package/src/audit-logs/OrganizationRegistrationPeriodLogger.ts +1 -1
- package/src/audit-logs/PaymentLogger.ts +1 -1
- package/src/audit-logs/PlatformLogger.ts +1 -1
- package/src/audit-logs/RegistrationLogger.ts +1 -1
- package/src/audit-logs/RegistrationPeriodLogger.ts +1 -1
- package/src/audit-logs/StripeAccountLogger.ts +1 -1
- package/src/audit-logs/UserLogger.ts +1 -1
- package/src/audit-logs/WebshopLogger.ts +1 -1
- package/src/audit-logs/init.ts +40 -0
- package/src/boot.ts +6 -4
- package/src/crons/amazon-ses.ts +1 -1
- package/src/crons/balance-emails.ts +1 -1
- package/src/crons/clearExcelCache.test.ts +1 -1
- package/src/crons/delete-archived-data.ts +47 -0
- package/src/crons/endFunctionsOfUsersWithoutRegistration.ts +1 -1
- package/src/crons/index.ts +1 -0
- package/src/crons.ts +3 -3
- package/src/debug.ts +230 -0
- package/src/email-recipient-loaders/documents.ts +1 -1
- package/src/email-recipient-loaders/members.ts +1 -1
- package/src/email-recipient-loaders/orders.ts +3 -3
- package/src/email-recipient-loaders/payments.ts +118 -353
- package/src/email-replacements/getEmailReplacementsForPayment.ts +321 -0
- package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +9 -7
- package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +2 -2
- package/src/endpoints/admin/memberships/GetChargeMembershipsSummaryEndpoint.ts +1 -1
- package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +16 -50
- package/src/endpoints/admin/organizations/GetOrganizationsCountEndpoint.ts +2 -2
- package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +4 -4
- package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +21 -6
- package/src/endpoints/admin/registrations/ChargeRegistrationsEndpoint.ts +9 -7
- package/src/endpoints/auth/CreateAdminEndpoint.ts +2 -2
- package/src/endpoints/auth/CreateTokenEndpoint.test.ts +2 -2
- package/src/endpoints/auth/CreateTokenEndpoint.ts +1 -1
- package/src/endpoints/auth/DeleteTokenEndpoint.ts +1 -1
- package/src/endpoints/auth/DeleteUserEndpoint.ts +1 -1
- package/src/endpoints/auth/ForgotPasswordEndpoint.ts +1 -1
- package/src/endpoints/auth/GetOtherUserEndpoint.ts +2 -2
- package/src/endpoints/auth/GetUserEndpoint.test.ts +2 -2
- package/src/endpoints/auth/GetUserEndpoint.ts +2 -2
- package/src/endpoints/auth/OpenIDConnectAuthTokenEndpoint.ts +2 -2
- package/src/endpoints/auth/OpenIDConnectCallbackEndpoint.ts +2 -2
- package/src/endpoints/auth/OpenIDConnectStartEndpoint.ts +2 -2
- package/src/endpoints/auth/PatchUserEndpoint.ts +4 -4
- package/src/endpoints/auth/PollEmailVerificationEndpoint.ts +1 -1
- package/src/endpoints/auth/RetryEmailVerificationEndpoint.ts +1 -1
- package/src/endpoints/auth/SignupEndpoint.ts +1 -1
- package/src/endpoints/auth/VerifyEmailEndpoint.ts +1 -1
- package/src/endpoints/global/addresses/ValidateAddressEndpoint.ts +1 -1
- package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +4 -4
- package/src/endpoints/global/billing/ActivatePackagesEndpoint.ts +191 -7
- package/src/endpoints/global/billing/DeactivatePackageEndpoint.ts +64 -0
- package/src/endpoints/global/email/GetAdminEmailsEndpoint.test.ts +2 -2
- package/src/endpoints/global/email/GetAdminEmailsEndpoint.ts +3 -3
- package/src/endpoints/global/email/GetEmailAddressEndpoint.ts +1 -1
- package/src/endpoints/global/email/GetEmailEndpoint.ts +1 -1
- package/src/endpoints/global/email/GetUserEmailsEndpoint.test.ts +2 -2
- package/src/endpoints/global/email/GetUserEmailsEndpoint.ts +3 -3
- package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +62 -16
- package/src/endpoints/global/email/PatchEmailEndpoint.test.ts +6 -6
- package/src/endpoints/global/email-recipients/GetEmailRecipientsCountEndpoint.ts +2 -2
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.test.ts +2 -2
- package/src/endpoints/global/email-recipients/GetEmailRecipientsEndpoint.ts +4 -4
- package/src/endpoints/global/email-recipients/RetryEmailRecipientEndpoint.ts +1 -1
- package/src/endpoints/global/email-recipients/helpers/validateEmailRecipientFilter.ts +1 -1
- package/src/endpoints/global/events/GetEventNotificationsCountEndpoint.ts +2 -2
- package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +4 -4
- package/src/endpoints/global/events/GetEventsEndpoint.ts +4 -4
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.test.ts +2 -2
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.ts +3 -3
- package/src/endpoints/global/events/PatchEventsEndpoint.test.ts +2 -2
- package/src/endpoints/global/events/PatchEventsEndpoint.ts +5 -5
- package/src/endpoints/global/files/ExportToExcelEndpoint.ts +4 -4
- package/src/endpoints/global/files/GetFileCache.ts +2 -2
- package/src/endpoints/global/files/UploadFile.ts +2 -2
- package/src/endpoints/global/files/UploadImage.ts +1 -1
- package/src/endpoints/global/groups/GetGroupsEndpoint.test.ts +3 -3
- package/src/endpoints/global/groups/GetGroupsEndpoint.ts +4 -4
- package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +4 -4
- package/src/endpoints/global/members/GetMembersEndpoint.test.ts +3 -3
- package/src/endpoints/global/members/GetMembersEndpoint.ts +4 -16
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +8 -7
- package/src/endpoints/global/members/helpers/validateGroupFilter.ts +1 -1
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.test.ts +2 -2
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +23 -12
- package/src/endpoints/global/organizations/GetOrganizationFromDomainEndpoint.test.ts +2 -2
- package/src/endpoints/global/organizations/GetOrganizationFromDomainEndpoint.ts +1 -1
- package/src/endpoints/global/organizations/GetOrganizationFromUriEndpoint.ts +1 -1
- package/src/endpoints/global/organizations/SearchOrganizationEndpoint.test.ts +2 -2
- package/src/endpoints/global/organizations/SearchOrganizationEndpoint.ts +1 -1
- package/src/endpoints/global/payments/StripeWebhookEndpoint.ts +3 -3
- package/src/endpoints/global/platform/GetPlatformAdminsEndpoint.ts +1 -1
- package/src/endpoints/global/platform/GetPlatformEndpoint.test.ts +2 -2
- package/src/endpoints/global/platform/GetPlatformEndpoint.ts +1 -1
- package/src/endpoints/global/platform/PatchPlatformEnpoint.test.ts +2 -2
- package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +7 -7
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.test.ts +2 -2
- package/src/endpoints/global/registration/GetRegistrationsEndpoint.ts +1 -2
- package/src/endpoints/global/registration/GetUserDetailedPayableBalanceEndpoint.ts +2 -2
- package/src/endpoints/global/registration/GetUserDocumentsEndpoint.ts +2 -2
- package/src/endpoints/global/registration/GetUserMembersEndpoint.ts +2 -2
- package/src/endpoints/global/registration/GetUserPayableBalanceEndpoint.ts +2 -2
- package/src/endpoints/global/registration/RegisterMembersEndpoint.test.ts +2 -2
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +24 -389
- package/src/endpoints/global/registration-periods/GetRegistrationPeriodsEndpoint.ts +3 -3
- package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +2 -2
- package/src/endpoints/global/sso/GetSSOEndpoint.ts +2 -2
- package/src/endpoints/global/sso/SetSSOEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemEndpoint.ts +55 -0
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsCountEndpoint.ts +43 -0
- package/src/endpoints/organization/dashboard/balance-items/GetBalanceItemsEndpoint.ts +160 -0
- package/src/endpoints/organization/dashboard/{payments → balance-items}/PatchBalanceItemsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/billing/GetOrganizationDetailedPayableBalanceEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/billing/GetOrganizationPayableBalanceEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/billing/GetPackagesEndpoint.test.ts +3 -3
- package/src/endpoints/organization/dashboard/billing/GetPackagesEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplateXML.ts +1 -1
- package/src/endpoints/organization/dashboard/documents/GetDocumentsCountEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/documents/PatchDocumentEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +37 -6
- package/src/endpoints/organization/dashboard/email-templates/GetEmailTemplatesEndpoint.test.ts +2 -2
- package/src/endpoints/organization/dashboard/email-templates/GetEmailTemplatesEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.test.ts +2 -2
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/invoices/PatchInvoicesEndpoint.ts +53 -0
- package/src/endpoints/organization/dashboard/mollie/CheckMollieEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/mollie/ConnectMollieEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/mollie/DisconnectMollieEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/mollie/GetMollieDashboardEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/nolt/CreateNoltTokenEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/organization/GetOrganizationArchivedGroups.ts +2 -2
- package/src/endpoints/organization/dashboard/organization/GetOrganizationDeletedGroups.ts +2 -2
- package/src/endpoints/organization/dashboard/organization/GetUitpasClientIdEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.test.ts +2 -2
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +12 -1
- package/src/endpoints/organization/dashboard/organization/SearchUitpasOrganizersEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/organization/SetOrganizationDomainEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/payments/GetPaymentsCountEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +4 -4
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalanceEndpoint.ts +12 -12
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesCountEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesEndpoint.ts +4 -4
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.test.ts +2 -2
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.ts +4 -4
- package/src/endpoints/organization/dashboard/registration-periods/MoveRegistrationPeriods.test.ts +2 -2
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.test.ts +2 -2
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/registration-periods/SetupStepReviewEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/stripe/ConnectStripeEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/stripe/DeleteStripeAccountEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.test.ts +3 -3
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/users/GetApiUsersEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/users/GetOrganizationAdminsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.test.ts +3 -3
- package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/DeleteWebshopEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/webshops/GetDiscountCodesEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersCountEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersEndpoint.ts +5 -5
- package/src/endpoints/organization/dashboard/webshops/GetWebshopTicketsEndpoint.ts +5 -5
- package/src/endpoints/organization/dashboard/webshops/GetWebshopUriAvailabilityEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/PatchDiscountCodesEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopOrdersEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/webshops/SearchUitpasEventsEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/webshops/VerifyWebshopDomainEndpoint.ts +1 -1
- package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +3 -3
- package/src/endpoints/organization/shared/GetDocumentHtml.ts +1 -1
- package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +2 -2
- package/src/endpoints/organization/shared/auth/GetOrganizationEndpoint.test.ts +2 -2
- package/src/endpoints/organization/shared/auth/GetOrganizationEndpoint.ts +2 -2
- package/src/endpoints/organization/webshops/CheckWebshopDiscountCodesEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.test.ts +2 -2
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +2 -2
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.test.ts +4 -4
- package/src/excel-loaders/balance-items.ts +268 -0
- package/src/excel-loaders/event-notifications.ts +3 -3
- package/src/excel-loaders/index.ts +6 -5
- package/src/excel-loaders/organizations.ts +4 -4
- package/src/excel-loaders/payments.ts +11 -3
- package/src/excel-loaders/receivable-balances.ts +2 -2
- package/src/helpers/AddressValidator.test.ts +1 -1
- package/src/helpers/AddressValidator.ts +1 -1
- package/src/helpers/AdminPermissionChecker.ts +20 -17
- package/src/helpers/AuthenticatedStructures.ts +194 -109
- package/src/helpers/Context.ts +2 -0
- package/src/helpers/EmailResumer.ts +1 -1
- package/src/helpers/FlagMomentCleanup.ts +1 -1
- package/src/helpers/ForwardHandler.test.ts +1 -1
- package/src/helpers/ForwardHandler.ts +1 -1
- package/src/helpers/GlobalHelper.ts +4 -4
- package/src/helpers/GroupBuilder.ts +417 -0
- package/src/helpers/GroupedThrottledQueue.test.ts +1 -1
- package/src/helpers/GroupedThrottledQueue.ts +1 -1
- package/src/helpers/MemberUserSyncer.test.ts +1 -1
- package/src/helpers/MemberUserSyncer.ts +1 -1
- package/src/helpers/PeriodHelper.ts +5 -45
- package/src/helpers/ServiceFeeHelper.ts +5 -1
- package/src/helpers/SetupStepUpdater.ts +5 -4
- package/src/helpers/TagHelper.ts +1 -1
- package/src/helpers/ThrottledQueue.test.ts +1 -1
- package/src/helpers/ViesHelper.ts +9 -0
- package/src/helpers/email-html-helpers.ts +0 -41
- package/src/helpers/outstandingBalanceJoin.ts +3 -1
- package/src/middleware/ContextMiddleware.ts +1 -1
- package/src/seeds/1726572303-schedule-stock-updates.ts +1 -1
- package/src/seeds/1726847064-setup-steps.ts +1 -1
- package/src/seeds/1728928974-update-cached-outstanding-balance-from-items.ts +1 -1
- package/src/seeds/1740046783-update-membership.ts +1 -1
- package/src/seeds/1754560914-groups-prices.test.ts +1 -1
- package/src/seeds/1755876819-remove-duplicate-members.ts +1 -1
- package/src/seeds/1760702454-update-cached-outstanding-balance-from-items.ts +1 -1
- package/src/seeds/1761665607-sync-member-users.ts +1 -1
- package/src/seeds/data/default-email-templates.sql +1 -1
- package/src/seeds-temporary/1732117645-move-rrn.ts +1 -1
- package/src/services/AuditLogService.ts +1 -41
- package/src/services/BalanceItemPaymentService.ts +1 -1
- package/src/services/BalanceItemService.ts +12 -5
- package/src/services/EventNotificationService.ts +3 -3
- package/src/services/InvoiceService.ts +131 -17
- package/src/services/MemberRecordStore.ts +1 -1
- package/src/services/PaymentReallocationService.test.ts +9 -10
- package/src/services/PaymentReallocationService.ts +1 -1
- package/src/services/PaymentService.ts +560 -18
- package/src/services/PlatformMembershipService.ts +3 -3
- package/src/services/RegistrationService.ts +3 -3
- package/src/services/SSOService.ts +2 -2
- package/src/services/STPackageService.ts +241 -0
- package/src/services/uitpas/UitpasService.test.ts +1 -1
- package/src/sql-filters/balance-items.ts +56 -0
- package/src/sql-filters/emails.ts +1 -1
- package/src/sql-filters/event-notifications.ts +2 -2
- package/src/sql-filters/events.ts +51 -0
- package/src/sql-filters/members.ts +38 -2
- package/src/sql-filters/receivable-balances.ts +3 -3
- package/src/sql-filters/users.ts +10 -0
- package/src/sql-sorters/balance-items.ts +36 -0
- package/src/sql-sorters/document-templates.ts +2 -2
- package/src/sql-sorters/documents.ts +2 -2
- package/src/sql-sorters/event-notifications.ts +1 -1
- package/src/sql-sorters/members.ts +2 -2
- package/src/sql-sorters/orders.ts +2 -2
- package/src/sql-sorters/tickets.ts +2 -2
- package/tests/actions/patchOrganizationMember.ts +3 -3
- package/tests/actions/patchPaymentStatus.ts +3 -3
- package/tests/actions/patchUserMember.ts +2 -2
- package/tests/assertions/assertBalances.ts +1 -1
- package/tests/e2e/api-rate-limits.test.ts +3 -3
- package/tests/e2e/charge-members.test.ts +14 -14
- package/tests/e2e/documents.test.ts +8 -8
- package/tests/e2e/private-files.test.ts +4 -4
- package/tests/e2e/register.test.ts +10 -10
- package/tests/e2e/stock.test.ts +4 -4
- package/tests/e2e/tickets.test.ts +4 -4
- package/tests/helpers/TestServer.ts +2 -2
- package/tests/init/index.ts +7 -7
- package/tests/init/initAdmin.ts +1 -1
- package/src/endpoints/global/registration/GetPaymentRegistrations.ts +0 -67
|
@@ -2,8 +2,8 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
2
2
|
import { Group } from '@stamhoofd/models';
|
|
3
3
|
import { Group as GroupStruct } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
6
|
-
import { Context } from '../../../../helpers/Context';
|
|
5
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
6
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
7
7
|
type Params = Record<string, never>;
|
|
8
8
|
type Query = undefined;
|
|
9
9
|
type Body = undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
|
|
2
2
|
import { UitpasGetClientIdResponse } from '@stamhoofd/structures';
|
|
3
3
|
|
|
4
|
-
import { Context } from '../../../../helpers/Context';
|
|
5
|
-
import { UitpasService } from '../../../../services/uitpas/UitpasService';
|
|
4
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
5
|
+
import { UitpasService } from '../../../../services/uitpas/UitpasService.js';
|
|
6
6
|
|
|
7
7
|
type Params = Record<string, never>;
|
|
8
8
|
type Query = undefined;
|
|
@@ -4,8 +4,8 @@ import { AccessRight, MemberResponsibility, OrganizationPrivateMetaData, Organiz
|
|
|
4
4
|
|
|
5
5
|
import { AutoEncoderPatchType, PatchableArray, PatchableArrayAutoEncoder, PatchMap } from '@simonbackx/simple-encoding';
|
|
6
6
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
7
|
-
import { testServer } from '../../../../../tests/helpers/TestServer';
|
|
8
|
-
import { PatchOrganizationEndpoint } from './PatchOrganizationEndpoint';
|
|
7
|
+
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
8
|
+
import { PatchOrganizationEndpoint } from './PatchOrganizationEndpoint.js';
|
|
9
9
|
|
|
10
10
|
describe('Endpoint.PatchOrganization', () => {
|
|
11
11
|
// Test endpoint
|
|
@@ -71,7 +71,18 @@ export class PatchOrganizationEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
71
71
|
let updateTags = false;
|
|
72
72
|
|
|
73
73
|
if (await Context.auth.hasFullAccess(organization.id)) {
|
|
74
|
-
|
|
74
|
+
if (request.body.name) {
|
|
75
|
+
if (request.body.name.length < 2) {
|
|
76
|
+
throw new SimpleError({
|
|
77
|
+
code: 'invalid_field',
|
|
78
|
+
message: 'Name is too short',
|
|
79
|
+
field: 'name',
|
|
80
|
+
human: $t('50b198a4-af37-4514-8d82-b9e4c41d9e91'),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
organization.name = request.body.name ?? organization.name;
|
|
84
|
+
}
|
|
85
|
+
|
|
75
86
|
if (request.body.website !== undefined) {
|
|
76
87
|
organization.website = request.body.website;
|
|
77
88
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
|
|
2
|
-
import { UitpasService } from '../../../../services/uitpas/UitpasService';
|
|
2
|
+
import { UitpasService } from '../../../../services/uitpas/UitpasService.js';
|
|
3
3
|
import { UitpasOrganizersResponse } from '@stamhoofd/structures';
|
|
4
4
|
import { AutoEncoder, Decoder, field, StringDecoder } from '@simonbackx/simple-encoding';
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
6
|
|
|
7
7
|
type Params = Record<string, never>;
|
|
8
8
|
class Query extends AutoEncoder {
|
|
@@ -4,8 +4,8 @@ import { SimpleError, SimpleErrors } from '@simonbackx/simple-errors';
|
|
|
4
4
|
import { DNSRecord, DNSRecordType, Organization as OrganizationStruct, OrganizationDomains } from '@stamhoofd/structures';
|
|
5
5
|
import NodeRSA from 'node-rsa';
|
|
6
6
|
|
|
7
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
8
|
-
import { Context } from '../../../../helpers/Context';
|
|
7
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
8
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
9
9
|
import { Formatter } from '@stamhoofd/utility';
|
|
10
10
|
|
|
11
11
|
type Params = Record<string, never>;
|
package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { AutoEncoderPatchType, Decoder } from '@simonbackx/simple-encoding';
|
|
|
2
2
|
import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
|
|
3
3
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
4
|
import { UitpasClientCredentialsStatus, UitpasClientIdAndSecret, UitpasSetClientCredentialsResponse } from '@stamhoofd/structures';
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
-
import { UitpasService } from '../../../../services/uitpas/UitpasService';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
|
+
import { UitpasService } from '../../../../services/uitpas/UitpasService.js';
|
|
7
7
|
|
|
8
8
|
type Params = Record<string, never>;
|
|
9
9
|
type Query = undefined;
|
|
@@ -2,8 +2,8 @@ import { Decoder } from '@simonbackx/simple-encoding';
|
|
|
2
2
|
import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
|
|
3
3
|
import { CountFilteredRequest, CountResponse } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
-
import { GetPaymentsEndpoint } from './GetPaymentsEndpoint';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
|
+
import { GetPaymentsEndpoint } from './GetPaymentsEndpoint.js';
|
|
7
7
|
|
|
8
8
|
type Params = Record<string, never>;
|
|
9
9
|
type Query = CountFilteredRequest;
|
|
@@ -6,10 +6,10 @@ import { SQL, applySQLSorter, compileToSQLFilter } from '@stamhoofd/sql';
|
|
|
6
6
|
import { CountFilteredRequest, LimitedFilteredRequest, PaginatedResponse, PaymentGeneral, StamhoofdFilter, TransferSettings, assertSort, getSortFilter } from '@stamhoofd/structures';
|
|
7
7
|
|
|
8
8
|
import { SQLResultNamespacedRow } from '@simonbackx/simple-database';
|
|
9
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
10
|
-
import { Context } from '../../../../helpers/Context';
|
|
11
|
-
import { paymentFilterCompilers } from '../../../../sql-filters/payments';
|
|
12
|
-
import { paymentSorters } from '../../../../sql-sorters/payments';
|
|
9
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
10
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
11
|
+
import { paymentFilterCompilers } from '../../../../sql-filters/payments.js';
|
|
12
|
+
import { paymentSorters } from '../../../../sql-sorters/payments.js';
|
|
13
13
|
|
|
14
14
|
type Params = Record<string, never>;
|
|
15
15
|
type Query = LimitedFilteredRequest;
|
package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalanceEndpoint.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
2
2
|
import { DetailedReceivableBalance, PaymentStatus, ReceivableBalanceType } from '@stamhoofd/structures';
|
|
3
3
|
|
|
4
4
|
import { BalanceItem, BalanceItemPayment, CachedBalance, MemberUser, Payment } from '@stamhoofd/models';
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
7
7
|
import { SQL } from '@stamhoofd/sql';
|
|
8
|
-
import { BalanceItemService } from '../../../../services/BalanceItemService';
|
|
8
|
+
import { BalanceItemService } from '../../../../services/BalanceItemService.js';
|
|
9
9
|
import { Formatter } from '@stamhoofd/utility';
|
|
10
10
|
|
|
11
11
|
type Params = { id: string; type: ReceivableBalanceType };
|
|
@@ -44,7 +44,7 @@ export class GetReceivableBalanceEndpoint extends Endpoint<Params, Query, Body,
|
|
|
44
44
|
switch (request.params.type) {
|
|
45
45
|
case ReceivableBalanceType.organization: {
|
|
46
46
|
// Force cache updates, because sometimes the cache could be out of date
|
|
47
|
-
BalanceItemService.scheduleOrganizationUpdate(organization.id, request.params.id);
|
|
47
|
+
// BalanceItemService.scheduleOrganizationUpdate(organization.id, request.params.id);
|
|
48
48
|
|
|
49
49
|
paymentModels = await Payment.select()
|
|
50
50
|
.where('organizationId', organization.id)
|
|
@@ -67,7 +67,7 @@ export class GetReceivableBalanceEndpoint extends Endpoint<Params, Query, Body,
|
|
|
67
67
|
|
|
68
68
|
case ReceivableBalanceType.member: {
|
|
69
69
|
// Force cache updates, because sometimes the cache could be out of date
|
|
70
|
-
BalanceItemService.scheduleMemberUpdate(organization.id, request.params.id);
|
|
70
|
+
// BalanceItemService.scheduleMemberUpdate(organization.id, request.params.id);
|
|
71
71
|
|
|
72
72
|
paymentModels = await Payment.select()
|
|
73
73
|
.where('organizationId', organization.id)
|
|
@@ -93,11 +93,11 @@ export class GetReceivableBalanceEndpoint extends Endpoint<Params, Query, Body,
|
|
|
93
93
|
const memberIds = Formatter.uniqueArray(memberUsers.map(mu => mu.membersId));
|
|
94
94
|
|
|
95
95
|
// Force cache updates, because sometimes the cache could be out of date
|
|
96
|
-
BalanceItemService.scheduleUserUpdate(organization.id, request.params.id);
|
|
97
|
-
|
|
98
|
-
for (const memberId of memberIds) {
|
|
99
|
-
|
|
100
|
-
}
|
|
96
|
+
// BalanceItemService.scheduleUserUpdate(organization.id, request.params.id);
|
|
97
|
+
//
|
|
98
|
+
// for (const memberId of memberIds) {
|
|
99
|
+
// BalanceItemService.scheduleMemberUpdate(organization.id, memberId);
|
|
100
|
+
// }
|
|
101
101
|
|
|
102
102
|
const q = Payment.select()
|
|
103
103
|
.where('organizationId', organization.id)
|
|
@@ -131,7 +131,7 @@ export class GetReceivableBalanceEndpoint extends Endpoint<Params, Query, Body,
|
|
|
131
131
|
|
|
132
132
|
case ReceivableBalanceType.userWithoutMembers: {
|
|
133
133
|
// Force cache updates, because sometimes the cache could be out of date
|
|
134
|
-
BalanceItemService.scheduleUserUpdate(organization.id, request.params.id);
|
|
134
|
+
// BalanceItemService.scheduleUserUpdate(organization.id, request.params.id);
|
|
135
135
|
|
|
136
136
|
const q = Payment.select()
|
|
137
137
|
.where('organizationId', organization.id)
|
|
@@ -176,7 +176,7 @@ export class GetReceivableBalanceEndpoint extends Endpoint<Params, Query, Body,
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
// Flush caches (this makes sure that we do a reload in the frontend after a registration or change, we get the newest balances)
|
|
179
|
-
await BalanceItemService.flushCaches(organization.id);
|
|
179
|
+
// await BalanceItemService.flushCaches(organization.id);
|
|
180
180
|
const balanceItemModels = await CachedBalance.balanceForObjects(organization.id, [request.params.id], request.params.type);
|
|
181
181
|
const balanceItems = await BalanceItem.getStructureWithPayments(balanceItemModels);
|
|
182
182
|
const payments = await AuthenticatedStructures.paymentsGeneral(paymentModels, false);
|
|
@@ -2,8 +2,8 @@ import { Decoder } from '@simonbackx/simple-encoding';
|
|
|
2
2
|
import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
|
|
3
3
|
import { CountFilteredRequest, CountResponse } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
-
import { GetReceivableBalancesEndpoint } from './GetReceivableBalancesEndpoint';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
|
+
import { GetReceivableBalancesEndpoint } from './GetReceivableBalancesEndpoint.js';
|
|
7
7
|
|
|
8
8
|
type Params = Record<string, never>;
|
|
9
9
|
type Query = CountFilteredRequest;
|
package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesEndpoint.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { CachedBalance } from '@stamhoofd/models';
|
|
|
5
5
|
import { applySQLSorter, compileToSQLFilter } from '@stamhoofd/sql';
|
|
6
6
|
import { assertSort, CountFilteredRequest, DetailedReceivableBalance, getSortFilter, LimitedFilteredRequest, PaginatedResponse, ReceivableBalance as ReceivableBalanceStruct, StamhoofdFilter } from '@stamhoofd/structures';
|
|
7
7
|
|
|
8
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
9
|
-
import { Context } from '../../../../helpers/Context';
|
|
10
|
-
import { receivableBalanceFilterCompilers } from '../../../../sql-filters/receivable-balances';
|
|
11
|
-
import { receivableBalanceSorters } from '../../../../sql-sorters/receivable-balances';
|
|
8
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
9
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
10
|
+
import { receivableBalanceFilterCompilers } from '../../../../sql-filters/receivable-balances.js';
|
|
11
|
+
import { receivableBalanceSorters } from '../../../../sql-sorters/receivable-balances.js';
|
|
12
12
|
|
|
13
13
|
type Params = Record<string, never>;
|
|
14
14
|
type Query = LimitedFilteredRequest;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
2
|
import { GroupFactory, Organization, OrganizationFactory, OrganizationRegistrationPeriodFactory, RegistrationPeriod, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
3
3
|
import { GroupType, LimitedFilteredRequest, PermissionLevel, Permissions } from '@stamhoofd/structures';
|
|
4
|
-
import { testServer } from '../../../../../tests/helpers/TestServer';
|
|
5
|
-
import { GetOrganizationRegistrationPeriodsEndpoint } from './GetOrganizationRegistrationPeriodsEndpoint';
|
|
4
|
+
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
5
|
+
import { GetOrganizationRegistrationPeriodsEndpoint } from './GetOrganizationRegistrationPeriodsEndpoint.js';
|
|
6
6
|
|
|
7
7
|
const baseUrl = `/organization/registration-periods`;
|
|
8
8
|
|
|
@@ -5,10 +5,10 @@ import { Decoder } from '@simonbackx/simple-encoding';
|
|
|
5
5
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
6
6
|
import { OrganizationRegistrationPeriod } from '@stamhoofd/models';
|
|
7
7
|
import { applySQLSorter, compileToSQLFilter, SQLFilterDefinitions, SQLSortDefinitions } from '@stamhoofd/sql';
|
|
8
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
9
|
-
import { Context } from '../../../../helpers/Context';
|
|
10
|
-
import { organizationRegistrationPeriodFilterCompilers } from '../../../../sql-filters/organization-registration-periods';
|
|
11
|
-
import { organizationRegistrationPeriodSorters } from '../../../../sql-sorters/organization-registration-periods';
|
|
8
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
9
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
10
|
+
import { organizationRegistrationPeriodFilterCompilers } from '../../../../sql-filters/organization-registration-periods.js';
|
|
11
|
+
import { organizationRegistrationPeriodSorters } from '../../../../sql-sorters/organization-registration-periods.js';
|
|
12
12
|
|
|
13
13
|
type Params = Record<string, never>;
|
|
14
14
|
type Query = LimitedFilteredRequest;
|
package/src/endpoints/organization/dashboard/registration-periods/MoveRegistrationPeriods.test.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
2
|
import { GroupFactory, MemberFactory, Organization, OrganizationFactory, OrganizationRegistrationPeriod, OrganizationRegistrationPeriodFactory, Registration, RegistrationFactory, RegistrationPeriod, RegistrationPeriodFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
3
3
|
import { Group, GroupType, OrganizationRegistrationPeriod as OrganizationRegistrationPeriodStruct, PermissionLevel, Permissions, PermissionsResourceType, ResourcePermissions, Version } from '@stamhoofd/structures';
|
|
4
|
-
import { PatchOrganizationRegistrationPeriodsEndpoint } from './PatchOrganizationRegistrationPeriodsEndpoint';
|
|
4
|
+
import { PatchOrganizationRegistrationPeriodsEndpoint } from './PatchOrganizationRegistrationPeriodsEndpoint.js';
|
|
5
5
|
|
|
6
6
|
import { PatchableArray, PatchableArrayAutoEncoder } from '@simonbackx/simple-encoding';
|
|
7
7
|
|
|
8
|
-
import { testServer } from '../../../../../tests/helpers/TestServer';
|
|
8
|
+
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
9
9
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
10
10
|
|
|
11
11
|
const endpoint = new PatchOrganizationRegistrationPeriodsEndpoint();
|
|
@@ -4,8 +4,8 @@ import { GroupSettings, Group as GroupStruct, OrganizationRegistrationPeriod as
|
|
|
4
4
|
|
|
5
5
|
import { PatchableArray, PatchableArrayAutoEncoder } from '@simonbackx/simple-encoding';
|
|
6
6
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
7
|
-
import { testServer } from '../../../../../tests/helpers/TestServer';
|
|
8
|
-
import { PatchOrganizationRegistrationPeriodsEndpoint } from './PatchOrganizationRegistrationPeriodsEndpoint';
|
|
7
|
+
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
8
|
+
import { PatchOrganizationRegistrationPeriodsEndpoint } from './PatchOrganizationRegistrationPeriodsEndpoint.js';
|
|
9
9
|
|
|
10
10
|
describe('Endpoint.PatchOrganizationRegistrationPeriods', () => {
|
|
11
11
|
// Test endpoint
|
|
@@ -5,9 +5,9 @@ import { AutoEncoderPatchType, Decoder, PatchableArrayAutoEncoder, PatchableArra
|
|
|
5
5
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
6
6
|
import { Event, Group, Organization, OrganizationRegistrationPeriod, Platform, Registration, RegistrationPeriod } from '@stamhoofd/models';
|
|
7
7
|
import { SQL } from '@stamhoofd/sql';
|
|
8
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
9
|
-
import { Context } from '../../../../helpers/Context';
|
|
10
|
-
import { SetupStepUpdater } from '../../../../helpers/SetupStepUpdater';
|
|
8
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
9
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
10
|
+
import { SetupStepUpdater } from '../../../../helpers/SetupStepUpdater.js';
|
|
11
11
|
|
|
12
12
|
type Params = Record<string, never>;
|
|
13
13
|
type Query = undefined;
|
package/src/endpoints/organization/dashboard/registration-periods/SetupStepReviewEndpoint.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { OrganizationRegistrationPeriod as OrganizationRegistrationPeriodStruct,
|
|
|
4
4
|
import { AutoEncoder, BooleanDecoder, Decoder, EnumDecoder, field } from '@simonbackx/simple-encoding';
|
|
5
5
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
6
6
|
import { OrganizationRegistrationPeriod } from '@stamhoofd/models';
|
|
7
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
8
|
-
import { Context } from '../../../../helpers/Context';
|
|
7
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
8
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
9
9
|
|
|
10
10
|
type Params = { readonly id: string };
|
|
11
11
|
type Query = undefined;
|
|
@@ -4,9 +4,9 @@ import { StripeAccount } from '@stamhoofd/models';
|
|
|
4
4
|
import { AuditLogType, PermissionLevel, StripeAccount as StripeAccountStruct } from '@stamhoofd/structures';
|
|
5
5
|
import Stripe from 'stripe';
|
|
6
6
|
|
|
7
|
-
import { Context } from '../../../../helpers/Context';
|
|
8
|
-
import { StripeHelper } from '../../../../helpers/StripeHelper';
|
|
9
|
-
import { AuditLogService } from '../../../../services/AuditLogService';
|
|
7
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
8
|
+
import { StripeHelper } from '../../../../helpers/StripeHelper.js';
|
|
9
|
+
import { AuditLogService } from '../../../../services/AuditLogService.js';
|
|
10
10
|
type Params = Record<string, never>;
|
|
11
11
|
type Body = undefined;
|
|
12
12
|
type Query = undefined;
|
|
@@ -2,10 +2,10 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
2
2
|
import { StripeAccount } from '@stamhoofd/models';
|
|
3
3
|
import { AuditLogType, PermissionLevel } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
-
import { StripeHelper } from '../../../../helpers/StripeHelper';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
|
+
import { StripeHelper } from '../../../../helpers/StripeHelper.js';
|
|
7
7
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
8
|
-
import { AuditLogService } from '../../../../services/AuditLogService';
|
|
8
|
+
import { AuditLogService } from '../../../../services/AuditLogService.js';
|
|
9
9
|
|
|
10
10
|
type Params = { id: string };
|
|
11
11
|
type Body = undefined;
|
|
@@ -4,8 +4,8 @@ import { SimpleError } from '@simonbackx/simple-errors';
|
|
|
4
4
|
import { StripeAccount } from '@stamhoofd/models';
|
|
5
5
|
import { PermissionLevel } from '@stamhoofd/structures';
|
|
6
6
|
|
|
7
|
-
import { Context } from '../../../../helpers/Context';
|
|
8
|
-
import { StripeHelper } from '../../../../helpers/StripeHelper';
|
|
7
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
8
|
+
import { StripeHelper } from '../../../../helpers/StripeHelper.js';
|
|
9
9
|
|
|
10
10
|
type Params = Record<string, never>;
|
|
11
11
|
class Body extends AutoEncoder {
|
|
@@ -2,7 +2,7 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
2
2
|
import { StripeAccount } from '@stamhoofd/models';
|
|
3
3
|
import { PermissionLevel, StripeAccount as StripeAccountStruct } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
6
|
|
|
7
7
|
type Params = Record<string, never>;
|
|
8
8
|
type Body = undefined;
|
|
@@ -4,8 +4,8 @@ import { SimpleError } from '@simonbackx/simple-errors';
|
|
|
4
4
|
import { StripeAccount, Token } from '@stamhoofd/models';
|
|
5
5
|
import { PermissionLevel } from '@stamhoofd/structures';
|
|
6
6
|
|
|
7
|
-
import { Context } from '../../../../helpers/Context';
|
|
8
|
-
import { StripeHelper } from '../../../../helpers/StripeHelper';
|
|
7
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
8
|
+
import { StripeHelper } from '../../../../helpers/StripeHelper.js';
|
|
9
9
|
|
|
10
10
|
type Params = Record<string, never>;
|
|
11
11
|
class Body extends AutoEncoder {
|
|
@@ -2,9 +2,9 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
2
2
|
import { StripeAccount } from '@stamhoofd/models';
|
|
3
3
|
import { AuditLogSource, PermissionLevel, StripeAccount as StripeAccountStruct } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
-
import { StripeHelper } from '../../../../helpers/StripeHelper';
|
|
7
|
-
import { AuditLogService } from '../../../../services/AuditLogService';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
|
+
import { StripeHelper } from '../../../../helpers/StripeHelper.js';
|
|
7
|
+
import { AuditLogService } from '../../../../services/AuditLogService.js';
|
|
8
8
|
|
|
9
9
|
type Params = { id: string };
|
|
10
10
|
type Body = undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
2
|
import { OrganizationFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
3
3
|
|
|
4
|
-
import { testServer } from '../../../../../tests/helpers/TestServer';
|
|
5
|
-
import { PatchApiUserEndpoint } from './PatchApiUserEndpoint';
|
|
4
|
+
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
5
|
+
import { PatchApiUserEndpoint } from './PatchApiUserEndpoint.js';
|
|
6
6
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
7
7
|
import { ApiUser, ApiUserRateLimits, PermissionLevel, Permissions, UserMeta, UserPermissions } from '@stamhoofd/structures';
|
|
8
|
-
import { CreateApiUserEndpoint } from './CreateApiUserEndpoint';
|
|
8
|
+
import { CreateApiUserEndpoint } from './CreateApiUserEndpoint.js';
|
|
9
9
|
|
|
10
10
|
describe('Endpoint.CreateApiUserEndpoint', () => {
|
|
11
11
|
// Test endpoint
|
|
@@ -4,7 +4,7 @@ import { SimpleError } from '@simonbackx/simple-errors';
|
|
|
4
4
|
import { Token, User } from '@stamhoofd/models';
|
|
5
5
|
import { ApiUser, ApiUserWithToken, UserMeta, UserPermissions } from '@stamhoofd/structures';
|
|
6
6
|
|
|
7
|
-
import { Context } from '../../../../helpers/Context';
|
|
7
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
8
8
|
type Params = Record<string, never>;
|
|
9
9
|
type Query = undefined;
|
|
10
10
|
type Body = ApiUser;
|
|
@@ -2,7 +2,7 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
2
2
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
3
3
|
import { User } from '@stamhoofd/models';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
6
|
type Params = { id: string };
|
|
7
7
|
type Query = undefined;
|
|
8
8
|
type Body = undefined;
|
|
@@ -3,7 +3,7 @@ import { SimpleError } from '@simonbackx/simple-errors';
|
|
|
3
3
|
import { Token, User } from '@stamhoofd/models';
|
|
4
4
|
import { ApiUser } from '@stamhoofd/structures';
|
|
5
5
|
|
|
6
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
7
7
|
type Params = Record<string, never>;
|
|
8
8
|
type Query = undefined;
|
|
9
9
|
type Body = undefined;
|
|
@@ -2,7 +2,7 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
2
2
|
import { User } from '@stamhoofd/models';
|
|
3
3
|
import { OrganizationAdmins } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
6
|
type Params = Record<string, never>;
|
|
7
7
|
type Query = undefined;
|
|
8
8
|
type Body = undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Request } from '@simonbackx/simple-endpoints';
|
|
2
2
|
import { OrganizationFactory, Token, UserFactory } from '@stamhoofd/models';
|
|
3
3
|
|
|
4
|
-
import { testServer } from '../../../../../tests/helpers/TestServer';
|
|
5
|
-
import { PatchApiUserEndpoint } from './PatchApiUserEndpoint';
|
|
4
|
+
import { testServer } from '../../../../../tests/helpers/TestServer.js';
|
|
5
|
+
import { PatchApiUserEndpoint } from './PatchApiUserEndpoint.js';
|
|
6
6
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
7
7
|
import { ApiUser, ApiUserRateLimits, PermissionLevel, Permissions, PermissionsResourceType, ResourcePermissions, UserMeta, UserPermissions } from '@stamhoofd/structures';
|
|
8
|
-
import { CreateApiUserEndpoint } from './CreateApiUserEndpoint';
|
|
8
|
+
import { CreateApiUserEndpoint } from './CreateApiUserEndpoint.js';
|
|
9
9
|
import { PatchMap } from '@simonbackx/simple-encoding';
|
|
10
10
|
|
|
11
11
|
describe('Endpoint.PatchApiUserEndpoint', () => {
|
|
@@ -3,7 +3,7 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
3
3
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
4
|
import { Token, User } from '@stamhoofd/models';
|
|
5
5
|
import { ApiUser, PermissionLevel, UserMeta, UserPermissions } from '@stamhoofd/structures';
|
|
6
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
7
7
|
|
|
8
8
|
type Params = { id: string };
|
|
9
9
|
type Query = undefined;
|
|
@@ -5,7 +5,7 @@ import { Webshop } from '@stamhoofd/models';
|
|
|
5
5
|
import { PermissionLevel, PermissionsResourceType, PrivateWebshop, ResourcePermissions, Version, WebshopPrivateMetaData } from '@stamhoofd/structures';
|
|
6
6
|
import { Formatter } from '@stamhoofd/utility';
|
|
7
7
|
|
|
8
|
-
import { Context } from '../../../../helpers/Context';
|
|
8
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
9
9
|
|
|
10
10
|
type Params = Record<string, never>;
|
|
11
11
|
type Query = undefined;
|
|
@@ -2,8 +2,8 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
2
2
|
import { BalanceItem, Order, Webshop } from '@stamhoofd/models';
|
|
3
3
|
import { PermissionLevel } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
-
import { UitpasService } from '../../../../services/uitpas/UitpasService';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
|
+
import { UitpasService } from '../../../../services/uitpas/UitpasService.js';
|
|
7
7
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
8
8
|
|
|
9
9
|
type Params = { id: string };
|
|
@@ -3,7 +3,7 @@ import { SimpleError } from '@simonbackx/simple-errors';
|
|
|
3
3
|
import { Webshop, WebshopDiscountCode } from '@stamhoofd/models';
|
|
4
4
|
import { DiscountCode, PermissionLevel } from '@stamhoofd/structures';
|
|
5
5
|
|
|
6
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
7
7
|
|
|
8
8
|
type Params = { id: string };
|
|
9
9
|
type Query = undefined;
|
|
@@ -2,8 +2,8 @@ import { Decoder } from '@simonbackx/simple-encoding';
|
|
|
2
2
|
import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
|
|
3
3
|
import { CountFilteredRequest, CountResponse } from '@stamhoofd/structures';
|
|
4
4
|
|
|
5
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
-
import { GetWebshopOrdersEndpoint } from './GetWebshopOrdersEndpoint';
|
|
5
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
6
|
+
import { GetWebshopOrdersEndpoint } from './GetWebshopOrdersEndpoint.js';
|
|
7
7
|
|
|
8
8
|
type Params = Record<string, never>;
|
|
9
9
|
type Query = CountFilteredRequest;
|
|
@@ -6,11 +6,11 @@ import { applySQLSorter, compileToSQLFilter, SQL, SQLFilterDefinitions, SQLSortD
|
|
|
6
6
|
|
|
7
7
|
import { Decoder } from '@simonbackx/simple-encoding';
|
|
8
8
|
import { parsePhoneNumber } from 'libphonenumber-js/max';
|
|
9
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
10
|
-
import { Context } from '../../../../helpers/Context';
|
|
11
|
-
import { LimitedFilteredRequestHelper } from '../../../../helpers/LimitedFilteredRequestHelper';
|
|
12
|
-
import { orderFilterCompilers } from '../../../../sql-filters/orders';
|
|
13
|
-
import { orderSorters } from '../../../../sql-sorters/orders';
|
|
9
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
10
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
11
|
+
import { LimitedFilteredRequestHelper } from '../../../../helpers/LimitedFilteredRequestHelper.js';
|
|
12
|
+
import { orderFilterCompilers } from '../../../../sql-filters/orders.js';
|
|
13
|
+
import { orderSorters } from '../../../../sql-sorters/orders.js';
|
|
14
14
|
|
|
15
15
|
type Params = Record<string, never>;
|
|
16
16
|
type Query = LimitedFilteredRequest;
|
|
@@ -4,11 +4,11 @@ import { Ticket } from '@stamhoofd/models';
|
|
|
4
4
|
import { assertSort, CountFilteredRequest, getSortFilter, LimitedFilteredRequest, PaginatedResponse, TicketPrivate } from '@stamhoofd/structures';
|
|
5
5
|
|
|
6
6
|
import { applySQLSorter, compileToSQLFilter, SQL, SQLFilterDefinitions, SQLSortDefinitions } from '@stamhoofd/sql';
|
|
7
|
-
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures';
|
|
8
|
-
import { Context } from '../../../../helpers/Context';
|
|
9
|
-
import { LimitedFilteredRequestHelper } from '../../../../helpers/LimitedFilteredRequestHelper';
|
|
10
|
-
import { ticketFilterCompilers } from '../../../../sql-filters/tickets';
|
|
11
|
-
import { ticketSorters } from '../../../../sql-sorters/tickets';
|
|
7
|
+
import { AuthenticatedStructures } from '../../../../helpers/AuthenticatedStructures.js';
|
|
8
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
9
|
+
import { LimitedFilteredRequestHelper } from '../../../../helpers/LimitedFilteredRequestHelper.js';
|
|
10
|
+
import { ticketFilterCompilers } from '../../../../sql-filters/tickets.js';
|
|
11
|
+
import { ticketSorters } from '../../../../sql-sorters/tickets.js';
|
|
12
12
|
|
|
13
13
|
type Params = Record<string, never>;
|
|
14
14
|
type Query = LimitedFilteredRequest;
|
|
@@ -3,7 +3,7 @@ import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-
|
|
|
3
3
|
import { Webshop } from '@stamhoofd/models';
|
|
4
4
|
import { PermissionLevel, WebshopUriAvailabilityResponse } from '@stamhoofd/structures';
|
|
5
5
|
|
|
6
|
-
import { Context } from '../../../../helpers/Context';
|
|
6
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
7
7
|
|
|
8
8
|
type Params = { id: string };
|
|
9
9
|
type Body = undefined;
|
|
@@ -5,7 +5,7 @@ import { Webshop, WebshopDiscountCode } from '@stamhoofd/models';
|
|
|
5
5
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
6
6
|
import { DiscountCode, PermissionLevel } from '@stamhoofd/structures';
|
|
7
7
|
|
|
8
|
-
import { Context } from '../../../../helpers/Context';
|
|
8
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
9
9
|
|
|
10
10
|
type Params = { id: string };
|
|
11
11
|
type Query = undefined;
|
|
@@ -6,7 +6,7 @@ import { QueueHandler } from '@stamhoofd/queues';
|
|
|
6
6
|
import { PermissionLevel, PrivateWebshop, WebshopPrivateMetaData } from '@stamhoofd/structures';
|
|
7
7
|
import { Formatter } from '@stamhoofd/utility';
|
|
8
8
|
|
|
9
|
-
import { Context } from '../../../../helpers/Context';
|
|
9
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
10
10
|
|
|
11
11
|
type Params = { id: string };
|
|
12
12
|
type Query = undefined;
|
|
@@ -336,7 +336,7 @@ export class PatchWebshopOrdersEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
336
336
|
});
|
|
337
337
|
|
|
338
338
|
if (clearNumbers) {
|
|
339
|
-
WebshopCounter.resetNumbers(request.params.id);
|
|
339
|
+
await WebshopCounter.resetNumbers(request.params.id);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
return new Response(
|
|
@@ -4,7 +4,7 @@ import { SimpleError, SimpleErrors } from '@simonbackx/simple-errors';
|
|
|
4
4
|
import { Ticket, Token, Webshop } from '@stamhoofd/models';
|
|
5
5
|
import { PermissionLevel, TicketPrivate } from '@stamhoofd/structures';
|
|
6
6
|
|
|
7
|
-
import { Context } from '../../../../helpers/Context';
|
|
7
|
+
import { Context } from '../../../../helpers/Context.js';
|
|
8
8
|
|
|
9
9
|
type Params = { id: string };
|
|
10
10
|
type Query = undefined;
|