@stamhoofd/models 2.119.0 → 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/dist/factories/AddressFactory.d.ts.map +1 -0
- package/dist/factories/AddressFactory.js +38 -0
- package/dist/factories/AddressFactory.js.map +1 -0
- package/dist/factories/BalanceItemFactory.d.ts +29 -0
- package/dist/factories/BalanceItemFactory.d.ts.map +1 -0
- package/dist/factories/BalanceItemFactory.js +56 -0
- package/dist/factories/BalanceItemFactory.js.map +1 -0
- package/dist/factories/DocumentTemplateFactory.d.ts +22 -0
- package/dist/factories/DocumentTemplateFactory.d.ts.map +1 -0
- package/dist/factories/DocumentTemplateFactory.js +145 -0
- package/dist/factories/DocumentTemplateFactory.js.map +1 -0
- package/dist/factories/EmailTemplateFactory.d.ts +18 -0
- package/dist/factories/EmailTemplateFactory.d.ts.map +1 -0
- package/dist/factories/EmailTemplateFactory.js +39 -0
- package/dist/factories/EmailTemplateFactory.js.map +1 -0
- package/dist/factories/EmergencyContactFactory.d.ts.map +1 -0
- package/dist/factories/EmergencyContactFactory.js +38 -0
- package/dist/factories/EmergencyContactFactory.js.map +1 -0
- package/dist/factories/EventFactory.d.ts +19 -0
- package/dist/factories/EventFactory.d.ts.map +1 -0
- package/dist/factories/EventFactory.js +31 -0
- package/dist/factories/EventFactory.js.map +1 -0
- package/dist/factories/EventNotificationFactory.d.ts +23 -0
- package/dist/factories/EventNotificationFactory.d.ts.map +1 -0
- package/dist/factories/EventNotificationFactory.js +40 -0
- package/dist/factories/EventNotificationFactory.js.map +1 -0
- package/dist/factories/EventNotificationTypeFactory.d.ts +12 -0
- package/dist/factories/EventNotificationTypeFactory.d.ts.map +1 -0
- package/dist/factories/EventNotificationTypeFactory.js +21 -0
- package/dist/factories/EventNotificationTypeFactory.js.map +1 -0
- package/dist/factories/GroupFactory.d.ts +27 -0
- package/dist/factories/GroupFactory.d.ts.map +1 -0
- package/dist/factories/GroupFactory.js +88 -0
- package/dist/factories/GroupFactory.js.map +1 -0
- package/dist/factories/MemberFactory.d.ts +26 -0
- package/dist/factories/MemberFactory.d.ts.map +1 -0
- package/dist/factories/MemberFactory.js +131 -0
- package/dist/factories/MemberFactory.js.map +1 -0
- package/dist/factories/MemberResponsibilityRecordFactory.d.ts +15 -0
- package/dist/factories/MemberResponsibilityRecordFactory.d.ts.map +1 -0
- package/dist/factories/MemberResponsibilityRecordFactory.js +30 -0
- package/dist/factories/MemberResponsibilityRecordFactory.js.map +1 -0
- package/dist/factories/OrganizationFactory.d.ts +20 -0
- package/dist/factories/OrganizationFactory.d.ts.map +1 -0
- package/dist/factories/OrganizationFactory.js +61 -0
- package/dist/factories/OrganizationFactory.js.map +1 -0
- package/dist/factories/OrganizationRegistrationPeriodFactory.d.ts +13 -0
- package/dist/factories/OrganizationRegistrationPeriodFactory.d.ts.map +1 -0
- package/dist/factories/OrganizationRegistrationPeriodFactory.js +16 -0
- package/dist/factories/OrganizationRegistrationPeriodFactory.js.map +1 -0
- package/dist/factories/OrganizationTagFactory.d.ts.map +1 -0
- package/dist/factories/OrganizationTagFactory.js +19 -0
- package/dist/factories/OrganizationTagFactory.js.map +1 -0
- package/dist/factories/ParentFactory.d.ts.map +1 -0
- package/dist/factories/ParentFactory.js +39 -0
- package/dist/factories/ParentFactory.js.map +1 -0
- package/dist/factories/PlatformEventTypeFactory.d.ts.map +1 -0
- package/dist/factories/PlatformEventTypeFactory.js +23 -0
- package/dist/factories/PlatformEventTypeFactory.js.map +1 -0
- package/dist/factories/PlatformResponsibilityFactory.d.ts.map +1 -0
- package/dist/factories/PlatformResponsibilityFactory.js +21 -0
- package/dist/factories/PlatformResponsibilityFactory.js.map +1 -0
- package/dist/factories/RecordAnswerFactory.d.ts +18 -0
- package/dist/factories/RecordAnswerFactory.d.ts.map +1 -0
- package/dist/factories/RecordAnswerFactory.js +91 -0
- package/dist/factories/RecordAnswerFactory.js.map +1 -0
- package/dist/factories/RecordCategoryFactory.d.ts +11 -0
- package/dist/factories/RecordCategoryFactory.d.ts.map +1 -0
- package/dist/factories/RecordCategoryFactory.js +19 -0
- package/dist/factories/RecordCategoryFactory.js.map +1 -0
- package/dist/factories/RecordFactory.d.ts.map +1 -0
- package/dist/factories/RecordFactory.js +16 -0
- package/dist/factories/RecordFactory.js.map +1 -0
- package/dist/factories/RegisterCodeFactory.d.ts.map +1 -0
- package/dist/factories/RegisterCodeFactory.js +14 -0
- package/dist/factories/RegisterCodeFactory.js.map +1 -0
- package/dist/factories/RegistrationFactory.d.ts +21 -0
- package/dist/factories/RegistrationFactory.d.ts.map +1 -0
- package/dist/factories/RegistrationFactory.js +21 -0
- package/dist/factories/RegistrationFactory.js.map +1 -0
- package/dist/factories/RegistrationPeriodFactory.d.ts +16 -0
- package/dist/factories/RegistrationPeriodFactory.d.ts.map +1 -0
- package/dist/factories/RegistrationPeriodFactory.js +30 -0
- package/dist/factories/RegistrationPeriodFactory.js.map +1 -0
- package/dist/factories/STPackageFactory.d.ts +15 -0
- package/dist/factories/STPackageFactory.d.ts.map +1 -0
- package/dist/factories/STPackageFactory.js +34 -0
- package/dist/factories/STPackageFactory.js.map +1 -0
- package/dist/factories/UserFactory.d.ts +22 -0
- package/dist/factories/UserFactory.d.ts.map +1 -0
- package/dist/factories/UserFactory.js +63 -0
- package/dist/factories/UserFactory.js.map +1 -0
- package/dist/factories/WebshopFactory.d.ts +17 -0
- package/dist/factories/WebshopFactory.d.ts.map +1 -0
- package/dist/factories/WebshopFactory.js +35 -0
- package/dist/factories/WebshopFactory.js.map +1 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/index.js +27 -0
- package/dist/factories/index.js.map +1 -0
- package/dist/helpers/DNSValidator.d.ts +6 -0
- package/dist/helpers/DNSValidator.d.ts.map +1 -0
- package/dist/helpers/DNSValidator.js +142 -0
- package/dist/helpers/DNSValidator.js.map +1 -0
- package/dist/helpers/EmailBuilder.d.ts +88 -0
- package/dist/helpers/EmailBuilder.d.ts.map +1 -0
- package/dist/helpers/EmailBuilder.js +603 -0
- package/dist/helpers/EmailBuilder.js.map +1 -0
- package/dist/helpers/Handlebars.d.ts.map +1 -0
- package/dist/helpers/Handlebars.js +244 -0
- package/dist/helpers/Handlebars.js.map +1 -0
- package/dist/helpers/MemberMerger.d.ts.map +1 -0
- package/dist/helpers/MemberMerger.js +364 -0
- package/dist/helpers/MemberMerger.js.map +1 -0
- package/dist/helpers/RateLimiter.d.ts.map +1 -0
- package/dist/helpers/RateLimiter.js +64 -0
- package/dist/helpers/RateLimiter.js.map +1 -0
- package/dist/helpers/WebshopCounter.d.ts +8 -0
- package/dist/helpers/WebshopCounter.d.ts.map +1 -0
- package/dist/helpers/WebshopCounter.js +46 -0
- package/dist/helpers/WebshopCounter.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/1605262045-import-postcodes.d.ts.map +1 -0
- package/dist/migrations/1605262045-import-postcodes.js +117 -0
- package/dist/migrations/1605262045-import-postcodes.js.map +1 -0
- package/dist/migrations/1605262046-import-postcodes-nl.d.ts.map +1 -0
- package/dist/migrations/1605262046-import-postcodes-nl.js +80 -0
- package/dist/migrations/1605262046-import-postcodes-nl.js.map +1 -0
- package/dist/migrations/1720080976-convert-charset-leads.d.ts +10 -0
- package/dist/migrations/1720080976-convert-charset-leads.d.ts.map +1 -0
- package/dist/migrations/1720080976-convert-charset-leads.js +41 -0
- package/dist/migrations/1720080976-convert-charset-leads.js.map +1 -0
- package/dist/models/AuditLog.d.ts.map +1 -0
- package/dist/models/AuditLog.js +94 -0
- package/dist/models/AuditLog.js.map +1 -0
- package/dist/models/BalanceItem.d.ts +218 -0
- package/dist/models/BalanceItem.d.ts.map +1 -0
- package/dist/models/BalanceItem.js +626 -0
- package/dist/models/BalanceItem.js.map +1 -0
- package/dist/models/BalanceItemPayment.d.ts +24 -0
- package/dist/models/BalanceItemPayment.d.ts.map +1 -0
- package/dist/models/BalanceItemPayment.js +65 -0
- package/dist/models/BalanceItemPayment.js.map +1 -0
- package/dist/models/BuckarooPayment.d.ts.map +1 -0
- package/dist/models/BuckarooPayment.js +24 -0
- package/dist/models/BuckarooPayment.js.map +1 -0
- package/dist/models/CachedBalance.d.ts +51 -0
- package/dist/models/CachedBalance.d.ts.map +1 -0
- package/dist/models/CachedBalance.js +390 -0
- package/dist/models/CachedBalance.js.map +1 -0
- package/dist/models/Document.d.ts +41 -0
- package/dist/models/Document.d.ts.map +1 -0
- package/dist/models/Document.js +251 -0
- package/dist/models/Document.js.map +1 -0
- package/dist/models/DocumentTemplate.d.ts +56 -0
- package/dist/models/DocumentTemplate.d.ts.map +1 -0
- package/dist/models/DocumentTemplate.js +719 -0
- package/dist/models/DocumentTemplate.js.map +1 -0
- package/dist/models/Email.d.ts +141 -0
- package/dist/models/Email.d.ts.map +1 -0
- package/dist/models/Email.js +1341 -0
- package/dist/models/Email.js.map +1 -0
- package/dist/models/EmailRecipient.d.ts.map +1 -0
- package/dist/models/EmailRecipient.js +194 -0
- package/dist/models/EmailRecipient.js.map +1 -0
- package/dist/models/EmailTemplate.d.ts +24 -0
- package/dist/models/EmailTemplate.d.ts.map +1 -0
- package/dist/models/EmailTemplate.js +79 -0
- package/dist/models/EmailTemplate.js.map +1 -0
- package/dist/models/EmailVerificationCode.d.ts +61 -0
- package/dist/models/EmailVerificationCode.d.ts.map +1 -0
- package/dist/models/EmailVerificationCode.js +339 -0
- package/dist/models/EmailVerificationCode.js.map +1 -0
- package/dist/models/Event.d.ts.map +1 -0
- package/dist/models/Event.js +132 -0
- package/dist/models/Event.js.map +1 -0
- package/dist/models/EventNotification.d.ts +32 -0
- package/dist/models/EventNotification.d.ts.map +1 -0
- package/dist/models/EventNotification.js +98 -0
- package/dist/models/EventNotification.js.map +1 -0
- package/dist/models/Group.d.ts +46 -0
- package/dist/models/Group.d.ts.map +1 -0
- package/dist/models/Group.js +213 -0
- package/dist/models/Group.js.map +1 -0
- package/dist/models/Image.d.ts +17 -0
- package/dist/models/Image.d.ts.map +1 -0
- package/dist/models/Image.js +169 -0
- package/dist/models/Image.js.map +1 -0
- package/dist/models/Invoice.d.ts.map +1 -0
- package/dist/models/Invoice.js +186 -0
- package/dist/models/Invoice.js.map +1 -0
- package/dist/models/InvoicedBalanceItem.d.ts +66 -0
- package/dist/models/InvoicedBalanceItem.d.ts.map +1 -0
- package/dist/models/InvoicedBalanceItem.js +130 -0
- package/dist/models/InvoicedBalanceItem.js.map +1 -0
- package/dist/models/Member.d.ts +114 -0
- package/dist/models/Member.d.ts.map +1 -0
- package/dist/models/Member.js +415 -0
- package/dist/models/Member.js.map +1 -0
- package/dist/models/MemberPlatformMembership.d.ts +48 -0
- package/dist/models/MemberPlatformMembership.d.ts.map +1 -0
- package/dist/models/MemberPlatformMembership.js +377 -0
- package/dist/models/MemberPlatformMembership.js.map +1 -0
- package/dist/models/MemberResponsibilityRecord.d.ts +17 -0
- package/dist/models/MemberResponsibilityRecord.d.ts.map +1 -0
- package/dist/models/MemberResponsibilityRecord.js +65 -0
- package/dist/models/MemberResponsibilityRecord.js.map +1 -0
- package/dist/models/MemberUser.d.ts.map +1 -0
- package/dist/models/MemberUser.js +22 -0
- package/dist/models/MemberUser.js.map +1 -0
- package/dist/models/MergedMember.d.ts +23 -0
- package/dist/models/MergedMember.d.ts.map +1 -0
- package/dist/models/MergedMember.js +123 -0
- package/dist/models/MergedMember.js.map +1 -0
- package/dist/models/MolliePayment.d.ts.map +1 -0
- package/dist/models/MolliePayment.js +24 -0
- package/dist/models/MolliePayment.js.map +1 -0
- package/dist/models/MollieToken.d.ts +45 -0
- package/dist/models/MollieToken.d.ts.map +1 -0
- package/dist/models/MollieToken.js +330 -0
- package/dist/models/MollieToken.js.map +1 -0
- package/dist/models/OneTimeToken.d.ts +38 -0
- package/dist/models/OneTimeToken.d.ts.map +1 -0
- package/dist/models/OneTimeToken.js +125 -0
- package/dist/models/OneTimeToken.js.map +1 -0
- package/dist/models/Order.d.ts +115 -0
- package/dist/models/Order.d.ts.map +1 -0
- package/dist/models/Order.js +908 -0
- package/dist/models/Order.js.map +1 -0
- package/dist/models/Organization.d.ts +128 -0
- package/dist/models/Organization.d.ts.map +1 -0
- package/dist/models/Organization.js +846 -0
- package/dist/models/Organization.js.map +1 -0
- package/dist/models/OrganizationRegistrationPeriod.d.ts +22 -0
- package/dist/models/OrganizationRegistrationPeriod.d.ts.map +1 -0
- package/dist/models/OrganizationRegistrationPeriod.js +129 -0
- package/dist/models/OrganizationRegistrationPeriod.js.map +1 -0
- package/dist/models/PasswordToken.d.ts +31 -0
- package/dist/models/PasswordToken.d.ts.map +1 -0
- package/dist/models/PasswordToken.js +129 -0
- package/dist/models/PasswordToken.js.map +1 -0
- package/dist/models/PayconiqPayment.d.ts +24 -0
- package/dist/models/PayconiqPayment.d.ts.map +1 -0
- package/dist/models/PayconiqPayment.js +272 -0
- package/dist/models/PayconiqPayment.js.map +1 -0
- package/dist/models/Payment.d.ts +120 -0
- package/dist/models/Payment.d.ts.map +1 -0
- package/dist/models/Payment.js +289 -0
- package/dist/models/Payment.js.map +1 -0
- package/dist/models/Platform.d.ts.map +1 -0
- package/dist/models/Platform.js +178 -0
- package/dist/models/Platform.js.map +1 -0
- package/dist/models/RegisterCode.d.ts.map +1 -0
- package/dist/models/RegisterCode.js +76 -0
- package/dist/models/RegisterCode.js.map +1 -0
- package/dist/models/Registration.d.ts +85 -0
- package/dist/models/Registration.d.ts.map +1 -0
- package/dist/models/Registration.js +190 -0
- package/dist/models/Registration.js.map +1 -0
- package/dist/models/RegistrationPeriod.d.ts.map +1 -0
- package/dist/models/RegistrationPeriod.js +140 -0
- package/dist/models/RegistrationPeriod.js.map +1 -0
- package/dist/models/STCredit.d.ts.map +1 -0
- package/dist/models/STCredit.js +61 -0
- package/dist/models/STCredit.js.map +1 -0
- package/dist/models/STInvoice.d.ts +37 -0
- package/dist/models/STInvoice.d.ts.map +1 -0
- package/dist/models/STInvoice.js +139 -0
- package/dist/models/STInvoice.js.map +1 -0
- package/dist/models/STPackage.d.ts.map +1 -0
- package/dist/models/STPackage.js +276 -0
- package/dist/models/STPackage.js.map +1 -0
- package/dist/models/STPendingInvoice.d.ts +26 -0
- package/dist/models/STPendingInvoice.d.ts.map +1 -0
- package/dist/models/STPendingInvoice.js +68 -0
- package/dist/models/STPendingInvoice.js.map +1 -0
- package/dist/models/StripeAccount.d.ts.map +1 -0
- package/dist/models/StripeAccount.js +81 -0
- package/dist/models/StripeAccount.js.map +1 -0
- package/dist/models/StripeCheckoutSession.d.ts.map +1 -0
- package/dist/models/StripeCheckoutSession.js +35 -0
- package/dist/models/StripeCheckoutSession.js.map +1 -0
- package/dist/models/StripePaymentIntent.d.ts.map +1 -0
- package/dist/models/StripePaymentIntent.js +35 -0
- package/dist/models/StripePaymentIntent.js.map +1 -0
- package/dist/models/Ticket.d.ts +65 -0
- package/dist/models/Ticket.d.ts.map +1 -0
- package/dist/models/Ticket.js +157 -0
- package/dist/models/Ticket.js.map +1 -0
- package/dist/models/Token.d.ts +48 -0
- package/dist/models/Token.d.ts.map +1 -0
- package/dist/models/Token.js +208 -0
- package/dist/models/Token.js.map +1 -0
- package/dist/models/UitpasClientCredential.d.ts.map +1 -0
- package/dist/models/UitpasClientCredential.js +62 -0
- package/dist/models/UitpasClientCredential.js.map +1 -0
- package/dist/models/UsedRegisterCode.d.ts.map +1 -0
- package/dist/models/UsedRegisterCode.js +58 -0
- package/dist/models/UsedRegisterCode.js.map +1 -0
- package/dist/models/User.d.ts +76 -0
- package/dist/models/User.d.ts.map +1 -0
- package/dist/models/User.js +484 -0
- package/dist/models/User.js.map +1 -0
- package/dist/models/UserPermissions.d.ts +16 -0
- package/dist/models/UserPermissions.d.ts.map +1 -0
- package/dist/models/UserPermissions.js +56 -0
- package/dist/models/UserPermissions.js.map +1 -0
- package/dist/models/Webshop.d.ts +45 -0
- package/dist/models/Webshop.d.ts.map +1 -0
- package/dist/models/Webshop.js +187 -0
- package/dist/models/Webshop.js.map +1 -0
- package/dist/models/WebshopDiscountCode.d.ts.map +1 -0
- package/dist/models/WebshopDiscountCode.js +89 -0
- package/dist/models/WebshopDiscountCode.js.map +1 -0
- package/dist/models/WebshopUitpasNumber.d.ts.map +1 -0
- package/dist/models/WebshopUitpasNumber.js +91 -0
- package/dist/models/WebshopUitpasNumber.js.map +1 -0
- package/dist/models/_relations.d.ts +8 -0
- package/dist/models/_relations.d.ts.map +1 -0
- package/dist/models/_relations.js +110 -0
- package/dist/models/_relations.js.map +1 -0
- package/dist/models/addresses/City.d.ts +15 -0
- package/dist/models/addresses/City.d.ts.map +1 -0
- package/dist/models/addresses/City.js +35 -0
- package/dist/models/addresses/City.js.map +1 -0
- package/dist/models/addresses/PostalCode.d.ts +21 -0
- package/dist/models/addresses/PostalCode.d.ts.map +1 -0
- package/dist/models/addresses/PostalCode.js +139 -0
- package/dist/models/addresses/PostalCode.js.map +1 -0
- package/dist/models/addresses/Province.d.ts +9 -0
- package/dist/models/addresses/Province.d.ts.map +1 -0
- package/dist/models/addresses/Province.js +24 -0
- package/dist/models/addresses/Province.js.map +1 -0
- package/dist/models/addresses/Street.d.ts.map +1 -0
- package/dist/models/addresses/Street.js +26 -0
- package/dist/models/addresses/Street.js.map +1 -0
- package/dist/models/index.d.ts +55 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +55 -0
- package/dist/models/index.js.map +1 -0
- package/dist/structures/OrganizationServerMetaData.d.ts.map +1 -0
- package/dist/structures/OrganizationServerMetaData.js +130 -0
- package/dist/structures/OrganizationServerMetaData.js.map +1 -0
- package/package.json +13 -10
- package/src/factories/AddressFactory.ts +3 -2
- package/src/factories/BalanceItemFactory.ts +2 -1
- package/src/factories/DocumentTemplateFactory.ts +2 -1
- package/src/factories/EmailTemplateFactory.ts +3 -2
- package/src/factories/EmergencyContactFactory.ts +1 -1
- package/src/factories/EventFactory.ts +2 -2
- package/src/factories/EventNotificationFactory.ts +6 -4
- package/src/factories/EventNotificationTypeFactory.ts +2 -1
- package/src/factories/GroupFactory.ts +4 -3
- package/src/factories/MemberFactory.ts +6 -5
- package/src/factories/MemberResponsibilityRecordFactory.ts +3 -2
- package/src/factories/OrganizationFactory.ts +4 -2
- package/src/factories/OrganizationRegistrationPeriodFactory.ts +2 -2
- package/src/factories/ParentFactory.ts +1 -1
- package/src/factories/RecordAnswerFactory.ts +2 -1
- package/src/factories/RecordCategoryFactory.ts +4 -2
- package/src/factories/RegistrationFactory.ts +5 -4
- package/src/factories/RegistrationPeriodFactory.ts +2 -1
- package/src/factories/STPackageFactory.ts +1 -1
- package/src/factories/UserFactory.ts +3 -2
- package/src/factories/WebshopFactory.ts +3 -2
- package/src/helpers/DNSValidator.ts +2 -1
- package/src/helpers/EmailBuilder.ts +13 -4
- package/src/helpers/Handlebars.ts +3 -3
- package/src/helpers/MemberMerger.test.ts +1 -1
- package/src/helpers/MemberMerger.ts +5 -4
- package/src/helpers/WebshopCounter.ts +1 -1
- package/src/migrations/1605262045-import-postcodes.ts +1 -1
- package/src/migrations/1605262046-import-postcodes-nl.ts +2 -2
- package/src/migrations/1720080976-convert-charset-leads.ts +53 -0
- package/src/models/AuditLog.ts +2 -1
- package/src/models/BalanceItem.ts +4 -3
- package/src/models/BalanceItemPayment.ts +9 -6
- package/src/models/CachedBalance.test.ts +331 -0
- package/src/models/CachedBalance.ts +3 -2
- package/src/models/Document.ts +2 -2
- package/src/models/DocumentTemplate.ts +5 -3
- package/src/models/Email.test.ts +32 -31
- package/src/models/Email.ts +7 -4
- package/src/models/EmailTemplate.ts +2 -1
- package/src/models/EmailVerificationCode.ts +7 -5
- package/src/models/EventNotification.ts +3 -2
- package/src/models/Group.ts +5 -15
- package/src/models/Image.ts +2 -1
- package/src/models/InvoicedBalanceItem.ts +9 -8
- package/src/models/Member.ts +8 -4
- package/src/models/MemberPlatformMembership.ts +1 -1
- package/src/models/MemberResponsibilityRecord.ts +2 -1
- package/src/models/MergedMember.ts +1 -1
- package/src/models/MollieToken.ts +3 -3
- package/src/models/OneTimeToken.ts +1 -1
- package/src/models/Order.ts +17 -9
- package/src/models/Organization.ts +39 -11
- package/src/models/OrganizationRegistrationPeriod.ts +2 -2
- package/src/models/PasswordToken.ts +7 -5
- package/src/models/PayconiqPayment.ts +6 -3
- package/src/models/Payment.ts +8 -5
- package/src/models/Registration.ts +9 -97
- package/src/models/STInvoice.ts +1 -4
- package/src/models/STPackage.ts +1 -1
- package/src/models/STPendingInvoice.ts +5 -4
- package/src/models/Ticket.ts +11 -9
- package/src/models/Token.test.ts +2 -2
- package/src/models/Token.ts +6 -6
- package/src/models/User.ts +7 -8
- package/src/models/UserPermissions.ts +7 -6
- package/src/models/Webshop.ts +5 -5
- package/src/models/_relations.ts +133 -0
- package/src/models/addresses/City.ts +1 -1
- package/src/models/addresses/PostalCode.test.ts +1 -1
- package/src/models/addresses/PostalCode.ts +1 -1
- package/src/models/addresses/Province.ts +1 -1
- package/src/models/index.ts +22 -20
- package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/dist/src/factories/AddressFactory.d.ts.map +0 -1
- package/dist/src/factories/AddressFactory.js +0 -42
- package/dist/src/factories/AddressFactory.js.map +0 -1
- package/dist/src/factories/BalanceItemFactory.d.ts +0 -28
- package/dist/src/factories/BalanceItemFactory.d.ts.map +0 -1
- package/dist/src/factories/BalanceItemFactory.js +0 -60
- package/dist/src/factories/BalanceItemFactory.js.map +0 -1
- package/dist/src/factories/DocumentTemplateFactory.d.ts +0 -21
- package/dist/src/factories/DocumentTemplateFactory.d.ts.map +0 -1
- package/dist/src/factories/DocumentTemplateFactory.js +0 -149
- package/dist/src/factories/DocumentTemplateFactory.js.map +0 -1
- package/dist/src/factories/EmailTemplateFactory.d.ts +0 -18
- package/dist/src/factories/EmailTemplateFactory.d.ts.map +0 -1
- package/dist/src/factories/EmailTemplateFactory.js +0 -43
- package/dist/src/factories/EmailTemplateFactory.js.map +0 -1
- package/dist/src/factories/EmergencyContactFactory.d.ts.map +0 -1
- package/dist/src/factories/EmergencyContactFactory.js +0 -42
- package/dist/src/factories/EmergencyContactFactory.js.map +0 -1
- package/dist/src/factories/EventFactory.d.ts +0 -19
- package/dist/src/factories/EventFactory.d.ts.map +0 -1
- package/dist/src/factories/EventFactory.js +0 -35
- package/dist/src/factories/EventFactory.js.map +0 -1
- package/dist/src/factories/EventNotificationFactory.d.ts +0 -21
- package/dist/src/factories/EventNotificationFactory.d.ts.map +0 -1
- package/dist/src/factories/EventNotificationFactory.js +0 -44
- package/dist/src/factories/EventNotificationFactory.js.map +0 -1
- package/dist/src/factories/EventNotificationTypeFactory.d.ts +0 -11
- package/dist/src/factories/EventNotificationTypeFactory.d.ts.map +0 -1
- package/dist/src/factories/EventNotificationTypeFactory.js +0 -25
- package/dist/src/factories/EventNotificationTypeFactory.js.map +0 -1
- package/dist/src/factories/GroupFactory.d.ts +0 -26
- package/dist/src/factories/GroupFactory.d.ts.map +0 -1
- package/dist/src/factories/GroupFactory.js +0 -92
- package/dist/src/factories/GroupFactory.js.map +0 -1
- package/dist/src/factories/MemberFactory.d.ts +0 -26
- package/dist/src/factories/MemberFactory.d.ts.map +0 -1
- package/dist/src/factories/MemberFactory.js +0 -135
- package/dist/src/factories/MemberFactory.js.map +0 -1
- package/dist/src/factories/MemberResponsibilityRecordFactory.d.ts +0 -14
- package/dist/src/factories/MemberResponsibilityRecordFactory.d.ts.map +0 -1
- package/dist/src/factories/MemberResponsibilityRecordFactory.js +0 -34
- package/dist/src/factories/MemberResponsibilityRecordFactory.js.map +0 -1
- package/dist/src/factories/OrganizationFactory.d.ts +0 -19
- package/dist/src/factories/OrganizationFactory.d.ts.map +0 -1
- package/dist/src/factories/OrganizationFactory.js +0 -64
- package/dist/src/factories/OrganizationFactory.js.map +0 -1
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.d.ts +0 -13
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.d.ts.map +0 -1
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.js +0 -20
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.js.map +0 -1
- package/dist/src/factories/OrganizationTagFactory.d.ts.map +0 -1
- package/dist/src/factories/OrganizationTagFactory.js +0 -23
- package/dist/src/factories/OrganizationTagFactory.js.map +0 -1
- package/dist/src/factories/ParentFactory.d.ts.map +0 -1
- package/dist/src/factories/ParentFactory.js +0 -43
- package/dist/src/factories/ParentFactory.js.map +0 -1
- package/dist/src/factories/PlatformEventTypeFactory.d.ts.map +0 -1
- package/dist/src/factories/PlatformEventTypeFactory.js +0 -27
- package/dist/src/factories/PlatformEventTypeFactory.js.map +0 -1
- package/dist/src/factories/PlatformResponsibilityFactory.d.ts.map +0 -1
- package/dist/src/factories/PlatformResponsibilityFactory.js +0 -25
- package/dist/src/factories/PlatformResponsibilityFactory.js.map +0 -1
- package/dist/src/factories/RecordAnswerFactory.d.ts +0 -17
- package/dist/src/factories/RecordAnswerFactory.d.ts.map +0 -1
- package/dist/src/factories/RecordAnswerFactory.js +0 -95
- package/dist/src/factories/RecordAnswerFactory.js.map +0 -1
- package/dist/src/factories/RecordCategoryFactory.d.ts +0 -11
- package/dist/src/factories/RecordCategoryFactory.d.ts.map +0 -1
- package/dist/src/factories/RecordCategoryFactory.js +0 -23
- package/dist/src/factories/RecordCategoryFactory.js.map +0 -1
- package/dist/src/factories/RecordFactory.d.ts.map +0 -1
- package/dist/src/factories/RecordFactory.js +0 -21
- package/dist/src/factories/RecordFactory.js.map +0 -1
- package/dist/src/factories/RegisterCodeFactory.d.ts.map +0 -1
- package/dist/src/factories/RegisterCodeFactory.js +0 -18
- package/dist/src/factories/RegisterCodeFactory.js.map +0 -1
- package/dist/src/factories/RegistrationFactory.d.ts +0 -21
- package/dist/src/factories/RegistrationFactory.d.ts.map +0 -1
- package/dist/src/factories/RegistrationFactory.js +0 -25
- package/dist/src/factories/RegistrationFactory.js.map +0 -1
- package/dist/src/factories/RegistrationPeriodFactory.d.ts +0 -15
- package/dist/src/factories/RegistrationPeriodFactory.d.ts.map +0 -1
- package/dist/src/factories/RegistrationPeriodFactory.js +0 -34
- package/dist/src/factories/RegistrationPeriodFactory.js.map +0 -1
- package/dist/src/factories/STPackageFactory.d.ts +0 -15
- package/dist/src/factories/STPackageFactory.d.ts.map +0 -1
- package/dist/src/factories/STPackageFactory.js +0 -38
- package/dist/src/factories/STPackageFactory.js.map +0 -1
- package/dist/src/factories/UserFactory.d.ts +0 -22
- package/dist/src/factories/UserFactory.d.ts.map +0 -1
- package/dist/src/factories/UserFactory.js +0 -67
- package/dist/src/factories/UserFactory.js.map +0 -1
- package/dist/src/factories/WebshopFactory.d.ts +0 -16
- package/dist/src/factories/WebshopFactory.d.ts.map +0 -1
- package/dist/src/factories/WebshopFactory.js +0 -39
- package/dist/src/factories/WebshopFactory.js.map +0 -1
- package/dist/src/factories/index.d.ts.map +0 -1
- package/dist/src/factories/index.js +0 -30
- package/dist/src/factories/index.js.map +0 -1
- package/dist/src/helpers/DNSValidator.d.ts +0 -6
- package/dist/src/helpers/DNSValidator.d.ts.map +0 -1
- package/dist/src/helpers/DNSValidator.js +0 -145
- package/dist/src/helpers/DNSValidator.js.map +0 -1
- package/dist/src/helpers/EmailBuilder.d.ts +0 -83
- package/dist/src/helpers/EmailBuilder.d.ts.map +0 -1
- package/dist/src/helpers/EmailBuilder.js +0 -646
- package/dist/src/helpers/EmailBuilder.js.map +0 -1
- package/dist/src/helpers/Handlebars.d.ts.map +0 -1
- package/dist/src/helpers/Handlebars.js +0 -248
- package/dist/src/helpers/Handlebars.js.map +0 -1
- package/dist/src/helpers/MemberMerger.d.ts.map +0 -1
- package/dist/src/helpers/MemberMerger.js +0 -371
- package/dist/src/helpers/MemberMerger.js.map +0 -1
- package/dist/src/helpers/MemberMerger.test.d.ts +0 -2
- package/dist/src/helpers/MemberMerger.test.d.ts.map +0 -1
- package/dist/src/helpers/MemberMerger.test.js +0 -644
- package/dist/src/helpers/MemberMerger.test.js.map +0 -1
- package/dist/src/helpers/RateLimiter.d.ts.map +0 -1
- package/dist/src/helpers/RateLimiter.js +0 -69
- package/dist/src/helpers/RateLimiter.js.map +0 -1
- package/dist/src/helpers/WebshopCounter.d.ts +0 -8
- package/dist/src/helpers/WebshopCounter.d.ts.map +0 -1
- package/dist/src/helpers/WebshopCounter.js +0 -50
- package/dist/src/helpers/WebshopCounter.js.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -14
- package/dist/src/index.js.map +0 -1
- package/dist/src/migrations/1605262045-import-postcodes.js +0 -121
- package/dist/src/migrations/1605262046-import-postcodes-nl.js +0 -83
- package/dist/src/models/AuditLog.d.ts.map +0 -1
- package/dist/src/models/AuditLog.js +0 -98
- package/dist/src/models/AuditLog.js.map +0 -1
- package/dist/src/models/BalanceItem.d.ts +0 -217
- package/dist/src/models/BalanceItem.d.ts.map +0 -1
- package/dist/src/models/BalanceItem.js +0 -630
- package/dist/src/models/BalanceItem.js.map +0 -1
- package/dist/src/models/BalanceItemPayment.d.ts +0 -23
- package/dist/src/models/BalanceItemPayment.d.ts.map +0 -1
- package/dist/src/models/BalanceItemPayment.js +0 -70
- package/dist/src/models/BalanceItemPayment.js.map +0 -1
- package/dist/src/models/BuckarooPayment.d.ts.map +0 -1
- package/dist/src/models/BuckarooPayment.js +0 -28
- package/dist/src/models/BuckarooPayment.js.map +0 -1
- package/dist/src/models/CachedBalance.d.ts +0 -50
- package/dist/src/models/CachedBalance.d.ts.map +0 -1
- package/dist/src/models/CachedBalance.js +0 -394
- package/dist/src/models/CachedBalance.js.map +0 -1
- package/dist/src/models/Document.d.ts +0 -41
- package/dist/src/models/Document.d.ts.map +0 -1
- package/dist/src/models/Document.js +0 -255
- package/dist/src/models/Document.js.map +0 -1
- package/dist/src/models/DocumentTemplate.d.ts +0 -55
- package/dist/src/models/DocumentTemplate.d.ts.map +0 -1
- package/dist/src/models/DocumentTemplate.js +0 -723
- package/dist/src/models/DocumentTemplate.js.map +0 -1
- package/dist/src/models/DocumentTemplate.test.d.ts +0 -2
- package/dist/src/models/DocumentTemplate.test.d.ts.map +0 -1
- package/dist/src/models/DocumentTemplate.test.js +0 -57
- package/dist/src/models/DocumentTemplate.test.js.map +0 -1
- package/dist/src/models/Email.d.ts +0 -140
- package/dist/src/models/Email.d.ts.map +0 -1
- package/dist/src/models/Email.js +0 -1345
- package/dist/src/models/Email.js.map +0 -1
- package/dist/src/models/Email.test.d.ts +0 -2
- package/dist/src/models/Email.test.d.ts.map +0 -1
- package/dist/src/models/Email.test.js +0 -1036
- package/dist/src/models/Email.test.js.map +0 -1
- package/dist/src/models/EmailRecipient.d.ts.map +0 -1
- package/dist/src/models/EmailRecipient.js +0 -198
- package/dist/src/models/EmailRecipient.js.map +0 -1
- package/dist/src/models/EmailTemplate.d.ts +0 -23
- package/dist/src/models/EmailTemplate.d.ts.map +0 -1
- package/dist/src/models/EmailTemplate.js +0 -83
- package/dist/src/models/EmailTemplate.js.map +0 -1
- package/dist/src/models/EmailVerificationCode.d.ts +0 -59
- package/dist/src/models/EmailVerificationCode.d.ts.map +0 -1
- package/dist/src/models/EmailVerificationCode.js +0 -343
- package/dist/src/models/EmailVerificationCode.js.map +0 -1
- package/dist/src/models/Event.d.ts.map +0 -1
- package/dist/src/models/Event.js +0 -136
- package/dist/src/models/Event.js.map +0 -1
- package/dist/src/models/EventNotification.d.ts +0 -31
- package/dist/src/models/EventNotification.d.ts.map +0 -1
- package/dist/src/models/EventNotification.js +0 -102
- package/dist/src/models/EventNotification.js.map +0 -1
- package/dist/src/models/Group.d.ts +0 -45
- package/dist/src/models/Group.d.ts.map +0 -1
- package/dist/src/models/Group.js +0 -228
- package/dist/src/models/Group.js.map +0 -1
- package/dist/src/models/Image.d.ts +0 -16
- package/dist/src/models/Image.d.ts.map +0 -1
- package/dist/src/models/Image.js +0 -173
- package/dist/src/models/Image.js.map +0 -1
- package/dist/src/models/Invoice.d.ts.map +0 -1
- package/dist/src/models/Invoice.js +0 -190
- package/dist/src/models/Invoice.js.map +0 -1
- package/dist/src/models/InvoicedBalanceItem.d.ts +0 -66
- package/dist/src/models/InvoicedBalanceItem.d.ts.map +0 -1
- package/dist/src/models/InvoicedBalanceItem.js +0 -136
- package/dist/src/models/InvoicedBalanceItem.js.map +0 -1
- package/dist/src/models/Member.d.ts +0 -112
- package/dist/src/models/Member.d.ts.map +0 -1
- package/dist/src/models/Member.js +0 -415
- package/dist/src/models/Member.js.map +0 -1
- package/dist/src/models/MemberPlatformMembership.d.ts +0 -48
- package/dist/src/models/MemberPlatformMembership.d.ts.map +0 -1
- package/dist/src/models/MemberPlatformMembership.js +0 -381
- package/dist/src/models/MemberPlatformMembership.js.map +0 -1
- package/dist/src/models/MemberResponsibilityRecord.d.ts +0 -16
- package/dist/src/models/MemberResponsibilityRecord.d.ts.map +0 -1
- package/dist/src/models/MemberResponsibilityRecord.js +0 -69
- package/dist/src/models/MemberResponsibilityRecord.js.map +0 -1
- package/dist/src/models/MemberUser.d.ts.map +0 -1
- package/dist/src/models/MemberUser.js +0 -26
- package/dist/src/models/MemberUser.js.map +0 -1
- package/dist/src/models/MergedMember.d.ts +0 -23
- package/dist/src/models/MergedMember.d.ts.map +0 -1
- package/dist/src/models/MergedMember.js +0 -127
- package/dist/src/models/MergedMember.js.map +0 -1
- package/dist/src/models/MolliePayment.d.ts.map +0 -1
- package/dist/src/models/MolliePayment.js +0 -28
- package/dist/src/models/MolliePayment.js.map +0 -1
- package/dist/src/models/MollieToken.d.ts +0 -45
- package/dist/src/models/MollieToken.d.ts.map +0 -1
- package/dist/src/models/MollieToken.js +0 -334
- package/dist/src/models/MollieToken.js.map +0 -1
- package/dist/src/models/OneTimeToken.d.ts +0 -38
- package/dist/src/models/OneTimeToken.d.ts.map +0 -1
- package/dist/src/models/OneTimeToken.js +0 -129
- package/dist/src/models/OneTimeToken.js.map +0 -1
- package/dist/src/models/Order.d.ts +0 -112
- package/dist/src/models/Order.d.ts.map +0 -1
- package/dist/src/models/Order.js +0 -906
- package/dist/src/models/Order.js.map +0 -1
- package/dist/src/models/Organization.d.ts +0 -120
- package/dist/src/models/Organization.d.ts.map +0 -1
- package/dist/src/models/Organization.js +0 -828
- package/dist/src/models/Organization.js.map +0 -1
- package/dist/src/models/OrganizationRegistrationPeriod.d.ts +0 -22
- package/dist/src/models/OrganizationRegistrationPeriod.d.ts.map +0 -1
- package/dist/src/models/OrganizationRegistrationPeriod.js +0 -133
- package/dist/src/models/OrganizationRegistrationPeriod.js.map +0 -1
- package/dist/src/models/PasswordToken.d.ts +0 -30
- package/dist/src/models/PasswordToken.d.ts.map +0 -1
- package/dist/src/models/PasswordToken.js +0 -133
- package/dist/src/models/PasswordToken.js.map +0 -1
- package/dist/src/models/PayconiqPayment.d.ts +0 -22
- package/dist/src/models/PayconiqPayment.d.ts.map +0 -1
- package/dist/src/models/PayconiqPayment.js +0 -276
- package/dist/src/models/PayconiqPayment.js.map +0 -1
- package/dist/src/models/Payment.d.ts +0 -117
- package/dist/src/models/Payment.d.ts.map +0 -1
- package/dist/src/models/Payment.js +0 -293
- package/dist/src/models/Payment.js.map +0 -1
- package/dist/src/models/Platform.d.ts.map +0 -1
- package/dist/src/models/Platform.js +0 -182
- package/dist/src/models/Platform.js.map +0 -1
- package/dist/src/models/Platform.test.d.ts +0 -2
- package/dist/src/models/Platform.test.d.ts.map +0 -1
- package/dist/src/models/Platform.test.js +0 -90
- package/dist/src/models/Platform.test.js.map +0 -1
- package/dist/src/models/RegisterCode.d.ts.map +0 -1
- package/dist/src/models/RegisterCode.js +0 -80
- package/dist/src/models/RegisterCode.js.map +0 -1
- package/dist/src/models/Registration.d.ts +0 -93
- package/dist/src/models/Registration.d.ts.map +0 -1
- package/dist/src/models/Registration.js +0 -267
- package/dist/src/models/Registration.js.map +0 -1
- package/dist/src/models/RegistrationPeriod.d.ts.map +0 -1
- package/dist/src/models/RegistrationPeriod.js +0 -144
- package/dist/src/models/RegistrationPeriod.js.map +0 -1
- package/dist/src/models/STCredit.d.ts.map +0 -1
- package/dist/src/models/STCredit.js +0 -65
- package/dist/src/models/STCredit.js.map +0 -1
- package/dist/src/models/STInvoice.d.ts +0 -37
- package/dist/src/models/STInvoice.d.ts.map +0 -1
- package/dist/src/models/STInvoice.js +0 -145
- package/dist/src/models/STInvoice.js.map +0 -1
- package/dist/src/models/STPackage.d.ts.map +0 -1
- package/dist/src/models/STPackage.js +0 -280
- package/dist/src/models/STPackage.js.map +0 -1
- package/dist/src/models/STPendingInvoice.d.ts +0 -26
- package/dist/src/models/STPendingInvoice.d.ts.map +0 -1
- package/dist/src/models/STPendingInvoice.js +0 -73
- package/dist/src/models/STPendingInvoice.js.map +0 -1
- package/dist/src/models/StripeAccount.d.ts.map +0 -1
- package/dist/src/models/StripeAccount.js +0 -85
- package/dist/src/models/StripeAccount.js.map +0 -1
- package/dist/src/models/StripeCheckoutSession.d.ts.map +0 -1
- package/dist/src/models/StripeCheckoutSession.js +0 -39
- package/dist/src/models/StripeCheckoutSession.js.map +0 -1
- package/dist/src/models/StripePaymentIntent.d.ts.map +0 -1
- package/dist/src/models/StripePaymentIntent.js +0 -39
- package/dist/src/models/StripePaymentIntent.js.map +0 -1
- package/dist/src/models/Ticket.d.ts +0 -63
- package/dist/src/models/Ticket.d.ts.map +0 -1
- package/dist/src/models/Ticket.js +0 -162
- package/dist/src/models/Ticket.js.map +0 -1
- package/dist/src/models/Token.d.ts +0 -48
- package/dist/src/models/Token.d.ts.map +0 -1
- package/dist/src/models/Token.js +0 -212
- package/dist/src/models/Token.js.map +0 -1
- package/dist/src/models/Token.test.d.ts +0 -2
- package/dist/src/models/Token.test.d.ts.map +0 -1
- package/dist/src/models/Token.test.js +0 -60
- package/dist/src/models/Token.test.js.map +0 -1
- package/dist/src/models/UitpasClientCredential.d.ts.map +0 -1
- package/dist/src/models/UitpasClientCredential.js +0 -66
- package/dist/src/models/UitpasClientCredential.js.map +0 -1
- package/dist/src/models/UsedRegisterCode.d.ts.map +0 -1
- package/dist/src/models/UsedRegisterCode.js +0 -62
- package/dist/src/models/UsedRegisterCode.js.map +0 -1
- package/dist/src/models/User.d.ts +0 -77
- package/dist/src/models/User.d.ts.map +0 -1
- package/dist/src/models/User.js +0 -490
- package/dist/src/models/User.js.map +0 -1
- package/dist/src/models/UserPermissions.d.ts +0 -16
- package/dist/src/models/UserPermissions.d.ts.map +0 -1
- package/dist/src/models/UserPermissions.js +0 -61
- package/dist/src/models/UserPermissions.js.map +0 -1
- package/dist/src/models/Webshop.d.ts +0 -45
- package/dist/src/models/Webshop.d.ts.map +0 -1
- package/dist/src/models/Webshop.js +0 -192
- package/dist/src/models/Webshop.js.map +0 -1
- package/dist/src/models/WebshopDiscountCode.d.ts.map +0 -1
- package/dist/src/models/WebshopDiscountCode.js +0 -93
- package/dist/src/models/WebshopDiscountCode.js.map +0 -1
- package/dist/src/models/WebshopUitpasNumber.d.ts.map +0 -1
- package/dist/src/models/WebshopUitpasNumber.js +0 -95
- package/dist/src/models/WebshopUitpasNumber.js.map +0 -1
- package/dist/src/models/addresses/City.d.ts +0 -15
- package/dist/src/models/addresses/City.d.ts.map +0 -1
- package/dist/src/models/addresses/City.js +0 -39
- package/dist/src/models/addresses/City.js.map +0 -1
- package/dist/src/models/addresses/PostalCode.d.ts +0 -21
- package/dist/src/models/addresses/PostalCode.d.ts.map +0 -1
- package/dist/src/models/addresses/PostalCode.js +0 -143
- package/dist/src/models/addresses/PostalCode.js.map +0 -1
- package/dist/src/models/addresses/PostalCode.test.d.ts +0 -2
- package/dist/src/models/addresses/PostalCode.test.d.ts.map +0 -1
- package/dist/src/models/addresses/PostalCode.test.js +0 -98
- package/dist/src/models/addresses/PostalCode.test.js.map +0 -1
- package/dist/src/models/addresses/Province.d.ts +0 -9
- package/dist/src/models/addresses/Province.d.ts.map +0 -1
- package/dist/src/models/addresses/Province.js +0 -28
- package/dist/src/models/addresses/Province.js.map +0 -1
- package/dist/src/models/addresses/Street.d.ts.map +0 -1
- package/dist/src/models/addresses/Street.js +0 -30
- package/dist/src/models/addresses/Street.js.map +0 -1
- package/dist/src/models/index.d.ts +0 -54
- package/dist/src/models/index.d.ts.map +0 -1
- package/dist/src/models/index.js +0 -69
- package/dist/src/models/index.js.map +0 -1
- package/dist/src/structures/OrganizationServerMetaData.d.ts.map +0 -1
- package/dist/src/structures/OrganizationServerMetaData.js +0 -135
- package/dist/src/structures/OrganizationServerMetaData.js.map +0 -1
- package/dist/tests/jest.global.setup.d.ts +0 -3
- package/dist/tests/jest.global.setup.d.ts.map +0 -1
- package/dist/tests/jest.global.setup.js +0 -33
- package/dist/tests/jest.global.setup.js.map +0 -1
- package/dist/tests/jest.setup.d.ts +0 -2
- package/dist/tests/jest.setup.d.ts.map +0 -1
- package/dist/tests/jest.setup.js +0 -32
- package/dist/tests/jest.setup.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/dist/{src/assets → assets}/Metropolis-Black.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-BlackItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Bold.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-BoldItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ExtraBold.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ExtraBoldItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ExtraLight.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ExtraLightItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Light.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-LightItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Medium.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-MediumItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Regular.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-RegularItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-SemiBold.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-SemiBoldItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Thin.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ThinItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/logo.png +0 -0
- /package/dist/{src/factories → factories}/AddressFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/EmergencyContactFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/OrganizationTagFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/ParentFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/PlatformEventTypeFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/PlatformResponsibilityFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/RecordFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/RegisterCodeFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/index.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/Handlebars.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/MemberMerger.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/RateLimiter.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/migrations → migrations}/1593773929-create-initial-tables.sql +0 -0
- /package/dist/{src/migrations → migrations}/1605261999-gemeenten-tmp.sql +0 -0
- /package/dist/{src/migrations → migrations}/1605262045-import-postcodes.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/1605262046-import-postcodes-nl.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/1605279038-drop-gemeenten-tmp.sql +0 -0
- /package/dist/{src/migrations → migrations}/1708607340-tickets-deleted-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1710459176-register-code-invoices.sql +0 -0
- /package/dist/{src/migrations → migrations}/1712158247-discount-codes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178665-drop-invites.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178666-drop-keychain.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178667-drop-challenges.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178668-drop-user-keys.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178669-drop-organization-key.sql +0 -0
- /package/dist/{src/migrations → migrations}/1714985451-user-nullable-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1714985452-email-verification-code-nullable-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1714985453-user-organization-permissions.sql +0 -0
- /package/dist/{src/migrations → migrations}/1714985454-user-organization-permissions.sql +0 -0
- /package/dist/{src/migrations → migrations}/1715079362-platform.sql +0 -0
- /package/dist/{src/migrations → migrations}/1715181649-registrations-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1715181650-registrations-organization-id-fill.sql +0 -0
- /package/dist/{src/migrations → migrations}/1715181651-registrations-organization-id-drop-null.sql +0 -0
- /package/dist/{src/migrations → migrations}/1716117067-members-nullable-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567581-registration-periods.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567582-organization-registration-periods.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567881-organization-periodId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567882-groups-periodId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567883-platform-periodId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719568079-default-period.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719568080-set-default-period-platform.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719568081-set-default-period-organizations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719568082-set-default-period-groups.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719580828-registrations-periodId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719580829-set-default-period-registrations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719931362-groups-default-age-group-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720080975-convert-charset.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720080976-responsibilities.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720088136-member-membership-types.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720088137-member-membership-types-expire-date.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720444931-organization-active.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721050380-email-table.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721050381-email-recipients-table.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721342679-responsibility-groupId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721342680-responsibility-groupId-foreign-key.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721400546-users-memberId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721639159-membership-deleted-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721639160-membership-generated.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721841819-group-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722090482-events.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722269236-group-waitinglist-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722525785-balance-item-paying-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722525787-depending-balance-item.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722845608-registration-stock-reservations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722845609-group-stock-reservations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722852362-stripe-intents-account-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722852363-stripe-checkout-sessions-account-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722959111-allow-multiple-registrations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722963554-registration-group-price-and-options.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723202125-member-number.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723202126-member-number-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218160-balance-item-unit-price.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218161-balance-item-amount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218162-balance-item-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218163-balance-item-type-defaults.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218164-balance-item-relations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723652795-payments-paying-user-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723652796-payments-paying-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723652797-payments-paying-organization-id-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723652798-payments-customer.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723736282-merged-members.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724076162-setup-steps.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724156666-member-indexes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724156667-organization-tag-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724256125-membership-balance-item-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724256126-membership-balance-item-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724258844-membershipOrganizationId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724258845-membershipOrganizationId-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726054851-balance-item-price-pending.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726054852-cached-outstanding-balances.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726668114-maximum-free-amount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726668115-free-amount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726668116-price-without-discount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1727947041-registration-record-answers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1729251385-order-extra-filter-columns.sql +0 -0
- /package/dist/{src/migrations → migrations}/1732285080-audit-logs.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733129611-clear-audit-logs.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733129612-audit-logs-source.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733317908-added-missing-organization-fk-on-registrations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733317909-paying-organization-id-registrations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733317910-paying-organization-id-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733410641-audit-log-external-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733418667-desc-audit-log-primary-key.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733909398-balance-items-due-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733909399-recalculate-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733994454-balance-item-price-open.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734084689-payment-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734084690-move-payment-column-order.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734084691-fill-payment-type-refunds.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734084692-fill-payment-type-reallocations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734429094-registration-trial-until.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734429095-membership-trial-until.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734535120-registration-period-previous-period-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734535121-platform-previous-period-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734626607-cached-balance-amount-open.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734698906-cached-balance-amount-paid.sql +0 -0
- /package/dist/{src/migrations → migrations}/1735573520-emails-email-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1735573521-email-recipients-email-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1735573522-emails-indexes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1735982691-cached-balance-email-reminder-counts.sql +0 -0
- /package/dist/{src/migrations → migrations}/1736850097-audit-logs-meta.sql +0 -0
- /package/dist/{src/migrations → migrations}/1736947931-platform-server-config.sql +0 -0
- /package/dist/{src/migrations → migrations}/1738922428-membership-locked.sql +0 -0
- /package/dist/{src/migrations → migrations}/1739017508-event-notifications.sql +0 -0
- /package/dist/{src/migrations → migrations}/1739017509-event-notifications-link.sql +0 -0
- /package/dist/{src/migrations → migrations}/1739282590-event-notifications-submitted-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1741954610-event-notifications-accepted-record-answers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1742579832-audit-log-longer-object-size.sql +0 -0
- /package/dist/{src/migrations → migrations}/1747913433-registration-discounts.sql +0 -0
- /package/dist/{src/migrations → migrations}/1747996262-balance-items-paid-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1747996263-balance-items-paid-at-fill.sql +0 -0
- /package/dist/{src/migrations → migrations}/1751633220-create-uitpas-client-credentials.sql +0 -0
- /package/dist/{src/migrations → migrations}/1751970372-create-webshop-uitpas-numbers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1752655335-events-webshop-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1752678047-confirmation-email.sql +0 -0
- /package/dist/{src/migrations → migrations}/1753363434-service-fees.sql +0 -0
- /package/dist/{src/migrations → migrations}/1753430415-update-webshop-uitpasnumbers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1755529026-email-sender-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1755789797-email-counts-errors.sql +0 -0
- /package/dist/{src/migrations → migrations}/1755789798-email-recipient-errors.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115313-email-recipient-ids-and-errors.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115314-email-recipient-email-optional.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115315-email-recipients-count.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115316-email-cached-counts.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115317-email-deleted-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756293494-registration-period-next-period-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756293495-platform-next-period-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756387016-registration-period-custom-name.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756391212-email-recipients-duplicate.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756821154-email-send-as-email.sql +0 -0
- /package/dist/{src/migrations → migrations}/1758034021-email-recipient-previous-error.sql +0 -0
- /package/dist/{src/migrations → migrations}/1760535508-update-cached-balances-object-id-unique-constraint.sql +0 -0
- /package/dist/{src/migrations → migrations}/1761750780-renamed-invoice-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1761750781-rename-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1761750782-invoices-add-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1761750783-invoices-organization-id-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1762521336-did-send-peppol.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216321-multiply-balance-item-payments.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216322-multiply-balance-items.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216323-bigint-cached-balances.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216324-multiply-cached-balances.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216325-multiply-member-platform-memberships.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216326-multiply-payments.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216327-multiply-register-codes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216328-multiply-credits.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216329-multiply-orders.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216330-multiply-uitpas-numbers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216331-balance-item-vat-percentages.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216332-balance-item-price-total.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216333-balance-item-price-total-fill.sql +0 -0
- /package/dist/{src/migrations → migrations}/1765895470-document-year.sql +0 -0
- /package/dist/{src/migrations → migrations}/1766150401-document-published-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1766410598-registration-end-date.sql +0 -0
- /package/dist/{src/migrations → migrations}/1769087807-invoices-table.sql +0 -0
- /package/dist/{src/migrations → migrations}/1769087808-invoiced-balance-items-table.sql +0 -0
- /package/dist/{src/migrations → migrations}/1769087809-payments-invoice-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1769621227-payments-rounding-amount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917406-create-cached-balances-global-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917407-create-member-name-ordering-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917408-create-member-name-ordering-index-desc.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917409-create-member-age-ordering-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917410-create-member-age-ordering-index-desc.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917411-drop-duplicate-member-indexes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1771510518-events-index-organization-id-start-date.sql +0 -0
- /package/dist/{src/migrations → migrations}/1771918307-membership-active-filter-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1772033555-balance-item-package-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1772033715-balance-item-start-end-date.sql +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Drenthe +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Flevoland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Friesland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Gelderland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Groningen +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Limburg +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Noord-Brabant +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Noord-Holland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Overrijsel +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Utrecht +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Zeeland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Zuid-Holland +0 -0
- /package/dist/{src/models → models}/AuditLog.d.ts +0 -0
- /package/dist/{src/models → models}/BuckarooPayment.d.ts +0 -0
- /package/dist/{src/models → models}/EmailRecipient.d.ts +0 -0
- /package/dist/{src/models → models}/Event.d.ts +0 -0
- /package/dist/{src/models → models}/Invoice.d.ts +0 -0
- /package/dist/{src/models → models}/MemberUser.d.ts +0 -0
- /package/dist/{src/models → models}/MolliePayment.d.ts +0 -0
- /package/dist/{src/models → models}/Platform.d.ts +0 -0
- /package/dist/{src/models → models}/RegisterCode.d.ts +0 -0
- /package/dist/{src/models → models}/RegistrationPeriod.d.ts +0 -0
- /package/dist/{src/models → models}/STCredit.d.ts +0 -0
- /package/dist/{src/models → models}/STPackage.d.ts +0 -0
- /package/dist/{src/models → models}/StripeAccount.d.ts +0 -0
- /package/dist/{src/models → models}/StripeCheckoutSession.d.ts +0 -0
- /package/dist/{src/models → models}/StripePaymentIntent.d.ts +0 -0
- /package/dist/{src/models → models}/UitpasClientCredential.d.ts +0 -0
- /package/dist/{src/models → models}/UsedRegisterCode.d.ts +0 -0
- /package/dist/{src/models → models}/WebshopDiscountCode.d.ts +0 -0
- /package/dist/{src/models → models}/WebshopUitpasNumber.d.ts +0 -0
- /package/dist/{src/models → models}/addresses/Street.d.ts +0 -0
- /package/dist/{src/structures → structures}/OrganizationServerMetaData.d.ts +0 -0
|
@@ -0,0 +1,908 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { column } from '@simonbackx/simple-database';
|
|
3
|
+
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
|
+
import { QueueHandler } from '@stamhoofd/queues';
|
|
5
|
+
import { QueryableModel, SQL } from '@stamhoofd/sql';
|
|
6
|
+
import { BalanceItemPaymentWithPayment, BalanceItemPaymentWithPrivatePayment, BalanceItemWithPayments, BalanceItemWithPrivatePayments, EmailTemplateType, OrderData, OrderStatus, Order as OrderStruct, PaymentMethod, PaymentStatus, Payment as PaymentStruct, PrivateOrder, PrivatePayment, ProductType, Recipient, Replacement, WebshopPreview, WebshopStatus, WebshopTicketType } from '@stamhoofd/structures';
|
|
7
|
+
import { Formatter } from '@stamhoofd/utility';
|
|
8
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
+
import { sendEmailTemplate } from '../helpers/EmailBuilder.js';
|
|
10
|
+
import { WebshopCounter } from '../helpers/WebshopCounter.js';
|
|
11
|
+
import { BalanceItem } from './BalanceItem.js';
|
|
12
|
+
import { BalanceItemPayment } from './BalanceItemPayment.js';
|
|
13
|
+
import { Payment } from './Payment.js';
|
|
14
|
+
import { Ticket } from './Ticket.js';
|
|
15
|
+
import { Webshop } from './Webshop.js';
|
|
16
|
+
import { WebshopDiscountCode } from './WebshopDiscountCode.js';
|
|
17
|
+
export class Order extends QueryableModel {
|
|
18
|
+
static table = 'webshop_orders';
|
|
19
|
+
// Columns
|
|
20
|
+
id;
|
|
21
|
+
organizationId;
|
|
22
|
+
webshopId;
|
|
23
|
+
paymentId = null;
|
|
24
|
+
userId = null;
|
|
25
|
+
data;
|
|
26
|
+
number = null;
|
|
27
|
+
createdAt;
|
|
28
|
+
updatedAt;
|
|
29
|
+
validAt = null;
|
|
30
|
+
status = OrderStatus.Created;
|
|
31
|
+
/**
|
|
32
|
+
* Cached value for faster in database filtering
|
|
33
|
+
*/
|
|
34
|
+
totalPrice = 0;
|
|
35
|
+
/**
|
|
36
|
+
* Cached value for faster in database filtering
|
|
37
|
+
*/
|
|
38
|
+
amount = 0;
|
|
39
|
+
timeSlotTime = null;
|
|
40
|
+
static webshop;
|
|
41
|
+
static payment;
|
|
42
|
+
;
|
|
43
|
+
static organization;
|
|
44
|
+
getTransferReplacements() {
|
|
45
|
+
const base = {
|
|
46
|
+
nr: this.number?.toString() ?? '',
|
|
47
|
+
email: this.data.customer.email ?? '',
|
|
48
|
+
phone: this.data.customer.phone ?? '',
|
|
49
|
+
name: this.data.customer.name ?? '',
|
|
50
|
+
naam: this.data.customer.name ?? '',
|
|
51
|
+
};
|
|
52
|
+
for (const answer of this.data.recordAnswers.values()) {
|
|
53
|
+
base[Formatter.slug(answer.settings.name)] = answer.stringValue;
|
|
54
|
+
}
|
|
55
|
+
return base;
|
|
56
|
+
}
|
|
57
|
+
getUrl() {
|
|
58
|
+
// Country locales are disabled on webshops (always the same country). But we need to add the language if it isn't the same as the organization default language
|
|
59
|
+
let locale = '';
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
61
|
+
if (this.data.consumerLanguage !== this.webshop.organization.i18n.language) {
|
|
62
|
+
locale = '/' + this.data.consumerLanguage;
|
|
63
|
+
}
|
|
64
|
+
return 'https://' + this.webshop.getHost() + locale + '/order/' + this.id;
|
|
65
|
+
}
|
|
66
|
+
generateBalanceDescription(webshop) {
|
|
67
|
+
if (!this.number) {
|
|
68
|
+
return $t(`%x2`) + ' ' + webshop.meta.name;
|
|
69
|
+
}
|
|
70
|
+
return $t(`%x3`) + this.number.toString() + ' - ' + webshop.meta.name;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Fetch an order
|
|
74
|
+
*/
|
|
75
|
+
static async getForPayment(organizationId, paymentId) {
|
|
76
|
+
const order = (await this.where({ paymentId }, { limit: 1 }))[0];
|
|
77
|
+
if (!order) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (organizationId !== null && order.organizationId !== organizationId) {
|
|
81
|
+
// Security check
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
return order;
|
|
85
|
+
}
|
|
86
|
+
shouldIncludeStock() {
|
|
87
|
+
return this.status !== OrderStatus.Canceled && this.status !== OrderStatus.Deleted;
|
|
88
|
+
}
|
|
89
|
+
async shouldCreateTickets(options) {
|
|
90
|
+
if (this.status === OrderStatus.Canceled || this.status === OrderStatus.Deleted || this.id === undefined || this.id === null) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (this.data.paymentMethod === PaymentMethod.PointOfSale || this.data.paymentMethod === PaymentMethod.Unknown || this.data.totalPrice === 0) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
if (options?.hasPaidPayment) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
// Check we paid at least 1 cent
|
|
100
|
+
// note: do not use cached values such as pricePaid here, because their value could be delayed.
|
|
101
|
+
console.log('Checking payments for order ' + this.id);
|
|
102
|
+
const payments = await Payment.select(SQL.wildcard(Payment.table))
|
|
103
|
+
.join(SQL.join(BalanceItemPayment.table).where('paymentId', SQL.parentColumn('id')))
|
|
104
|
+
.join(SQL.join(BalanceItem.table).where('id', SQL.column(BalanceItemPayment.table, 'balanceItemId')))
|
|
105
|
+
.where(SQL.column(BalanceItem.table, 'orderId'), this.id)
|
|
106
|
+
.groupBy(SQL.column(Payment.table, 'id'))
|
|
107
|
+
.fetch();
|
|
108
|
+
if (payments.find(p => p.status === PaymentStatus.Succeeded && p.price > 0)) {
|
|
109
|
+
console.log('Order ' + this.id + ' has a succeeded payment with price > 0');
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
console.log('Order ' + this.id + ' has no succeeded payments with price > 0');
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
get isDue() {
|
|
116
|
+
if (this.status === OrderStatus.Canceled || this.status === OrderStatus.Deleted) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
get totalToPay() {
|
|
122
|
+
if (this.status === OrderStatus.Canceled || this.status === OrderStatus.Deleted) {
|
|
123
|
+
return 0;
|
|
124
|
+
}
|
|
125
|
+
return this.data.totalPrice;
|
|
126
|
+
}
|
|
127
|
+
async undoPaymentFailed(_payment, _organization) {
|
|
128
|
+
if (this.status !== OrderStatus.Deleted && this.status !== OrderStatus.Canceled) {
|
|
129
|
+
this.markUpdated();
|
|
130
|
+
await this.save();
|
|
131
|
+
const webshop = await Webshop.getByID(this.webshopId);
|
|
132
|
+
if (webshop) {
|
|
133
|
+
await this.setRelation(Order.webshop, webshop).updateTickets();
|
|
134
|
+
}
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
console.log('Undoing payment failed for order ' + this.id);
|
|
138
|
+
this.markUpdated();
|
|
139
|
+
this.status = OrderStatus.Created;
|
|
140
|
+
const webshop = await QueueHandler.schedule('webshop-stock/' + this.webshopId, async () => {
|
|
141
|
+
// Fetch webshop inside queue to make sure the stock is up to date
|
|
142
|
+
const webshop = await Webshop.getByID(this.webshopId);
|
|
143
|
+
if (!webshop) {
|
|
144
|
+
// ignore for now
|
|
145
|
+
console.error('Missing webshop with id ' + this.webshopId + ' in webshop stock queue for order ' + this.id);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
await this.setRelation(Order.webshop, webshop).updateStock(null, true); // readd reserved stock
|
|
149
|
+
return webshop;
|
|
150
|
+
});
|
|
151
|
+
await this.save();
|
|
152
|
+
if (webshop) {
|
|
153
|
+
await this.setRelation(Order.webshop, webshop).updateTickets();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async deleteOrderBecauseOfCreationError() {
|
|
157
|
+
this.status = OrderStatus.Deleted;
|
|
158
|
+
await this.save();
|
|
159
|
+
const webshop = await QueueHandler.schedule('webshop-stock/' + this.webshopId, async () => {
|
|
160
|
+
// Fetch webshop inside queue to make sure the stock is up to date
|
|
161
|
+
const webshop = await Webshop.getByID(this.webshopId);
|
|
162
|
+
if (!webshop) {
|
|
163
|
+
// ignore for now
|
|
164
|
+
console.error('Missing webshop with id ' + this.webshopId + ' in webshop stock queue for order ' + this.id);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
await this.setRelation(Order.webshop, webshop).updateStock(); // readd reserved stock
|
|
168
|
+
return webshop;
|
|
169
|
+
});
|
|
170
|
+
if (webshop) {
|
|
171
|
+
await this.setRelation(Order.webshop, webshop).updateTickets();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async onPaymentFailed(payment, organization) {
|
|
175
|
+
if (this.shouldIncludeStock()) {
|
|
176
|
+
this.markUpdated();
|
|
177
|
+
if (this.number === null) {
|
|
178
|
+
this.status = OrderStatus.Deleted;
|
|
179
|
+
}
|
|
180
|
+
await this.save();
|
|
181
|
+
const webshop = await QueueHandler.schedule('webshop-stock/' + this.webshopId, async () => {
|
|
182
|
+
// Fetch webshop inside queue to make sure the stock is up to date
|
|
183
|
+
const webshop = await Webshop.getByID(this.webshopId);
|
|
184
|
+
if (!webshop) {
|
|
185
|
+
// ignore for now
|
|
186
|
+
console.error('Missing webshop with id ' + this.webshopId + ' in webshop stock queue for order ' + this.id);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
await this.setRelation(Order.webshop, webshop).updateStock(); // remove reserved stock
|
|
190
|
+
return webshop;
|
|
191
|
+
});
|
|
192
|
+
if (webshop) {
|
|
193
|
+
await this.setRelation(Order.webshop, webshop).updateTickets();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
this.markUpdated();
|
|
198
|
+
await this.save();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Adds or removes the order to the stock of the webshop (if it wasn't already included). If amounts were changed, only those
|
|
203
|
+
* changes will get added
|
|
204
|
+
* Should always happen in the webshop-stock queue to prevent multiple webshop writes at the same time
|
|
205
|
+
* + in combination with validation and reading the webshop
|
|
206
|
+
*/
|
|
207
|
+
async updateStock(previousData = null, skipOrderSave = false) {
|
|
208
|
+
// Previous data?
|
|
209
|
+
// Add or delete this order from the stock?
|
|
210
|
+
const add = this.shouldIncludeStock();
|
|
211
|
+
let changed = false;
|
|
212
|
+
const discountCodeUsageMap = new Map();
|
|
213
|
+
if (previousData !== null) {
|
|
214
|
+
// Remove stock from old items without modifying old data
|
|
215
|
+
for (const item of previousData.cart.items) {
|
|
216
|
+
const product = this.webshop.products.find(p => p.id === item.product.id);
|
|
217
|
+
if (product) {
|
|
218
|
+
if (item.reservedAmount > 0) {
|
|
219
|
+
product.usedStock -= item.reservedAmount;
|
|
220
|
+
if (product.usedStock < 0) {
|
|
221
|
+
product.usedStock = 0;
|
|
222
|
+
}
|
|
223
|
+
changed = true;
|
|
224
|
+
}
|
|
225
|
+
// Product price
|
|
226
|
+
for (const [priceId, amount] of item.reservedPrices) {
|
|
227
|
+
const productPrice = product.prices.find(p => p.id === priceId);
|
|
228
|
+
if (productPrice) {
|
|
229
|
+
productPrice.usedStock -= amount;
|
|
230
|
+
if (productPrice.usedStock < 0) {
|
|
231
|
+
productPrice.usedStock = 0;
|
|
232
|
+
}
|
|
233
|
+
changed = true;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// Options
|
|
237
|
+
for (const [optionId, amount] of item.reservedOptions) {
|
|
238
|
+
const option = product.optionMenus.flatMap(om => om.options).find(o => o.id === optionId);
|
|
239
|
+
if (option) {
|
|
240
|
+
option.usedStock -= amount;
|
|
241
|
+
if (option.usedStock < 0) {
|
|
242
|
+
option.usedStock = 0;
|
|
243
|
+
}
|
|
244
|
+
changed = true;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// Seats
|
|
248
|
+
if (item.reservedSeats.length > 0) {
|
|
249
|
+
for (const seat of item.reservedSeats) {
|
|
250
|
+
// Only remove each seat once
|
|
251
|
+
const reservedIndex = product.reservedSeats.findIndex(s => s.equals(seat));
|
|
252
|
+
if (reservedIndex !== -1) {
|
|
253
|
+
product.reservedSeats.splice(reservedIndex, 1);
|
|
254
|
+
changed = true;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
item.reservedSeats = [];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
for (const code of previousData.discountCodes) {
|
|
262
|
+
if (code.reserved) {
|
|
263
|
+
// Remove usage
|
|
264
|
+
code.reserved = false;
|
|
265
|
+
discountCodeUsageMap.set(code.id, (discountCodeUsageMap.get(code.id) ?? 0) - 1);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
for (const item of this.data.cart.items) {
|
|
270
|
+
if (previousData !== null) {
|
|
271
|
+
// If we have previousData, we already removed the stock from the old items, so reservedAmount is always zero
|
|
272
|
+
item.reservedAmount = 0;
|
|
273
|
+
item.reservedPrices = new Map();
|
|
274
|
+
item.reservedOptions = new Map();
|
|
275
|
+
changed = true;
|
|
276
|
+
}
|
|
277
|
+
const difference = add ? (item.amount - item.reservedAmount) : -item.reservedAmount;
|
|
278
|
+
if (difference !== 0) {
|
|
279
|
+
const product = this.webshop.products.find(p => p.id === item.product.id);
|
|
280
|
+
if (product) {
|
|
281
|
+
product.usedStock += difference;
|
|
282
|
+
if (product.usedStock < 0) {
|
|
283
|
+
product.usedStock = 0;
|
|
284
|
+
}
|
|
285
|
+
// Keep track that we included this order in the stock already
|
|
286
|
+
item.reservedAmount += difference;
|
|
287
|
+
changed = true;
|
|
288
|
+
const productPrice = product.prices.find(p => p.id === item.productPrice.id);
|
|
289
|
+
if (productPrice) {
|
|
290
|
+
productPrice.usedStock += difference;
|
|
291
|
+
if (productPrice.usedStock < 0) {
|
|
292
|
+
productPrice.usedStock = 0;
|
|
293
|
+
}
|
|
294
|
+
// Keep track that we included this order in the stock already
|
|
295
|
+
item.reservedPrices.set(productPrice.id, (item.reservedPrices.get(productPrice.id) ?? 0) + difference);
|
|
296
|
+
}
|
|
297
|
+
// Options
|
|
298
|
+
for (const cartItemOption of item.options) {
|
|
299
|
+
const option = product.optionMenus.find(om => om.id === cartItemOption.optionMenu.id)?.options.find(o => o.id === cartItemOption.option.id);
|
|
300
|
+
if (option) {
|
|
301
|
+
option.usedStock += difference;
|
|
302
|
+
if (option.usedStock < 0) {
|
|
303
|
+
option.usedStock = 0;
|
|
304
|
+
}
|
|
305
|
+
// Keep track that we included this order in the stock already
|
|
306
|
+
item.reservedOptions.set(option.id, (item.reservedOptions.get(option.id) ?? 0) + difference);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (previousData !== null && previousData.timeSlot) {
|
|
313
|
+
// Changed timeslot. Remove all reserved ones
|
|
314
|
+
const ps = previousData.timeSlot;
|
|
315
|
+
const timeSlot = this.webshop.meta.checkoutMethods.flatMap(m => m.timeSlots).flatMap(t => t.timeSlots).find(t => t.id === ps.id);
|
|
316
|
+
if (timeSlot) {
|
|
317
|
+
// Remove any reserved stock
|
|
318
|
+
const updated = Order.updateTimeSlotStock(timeSlot, this.data, false);
|
|
319
|
+
changed = changed || updated;
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
this.data.reservedOrder = false;
|
|
323
|
+
this.data.reservedPersons = 0;
|
|
324
|
+
changed = true;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (this.data.timeSlot !== null) {
|
|
328
|
+
const s = this.data.timeSlot;
|
|
329
|
+
const timeSlot = this.webshop.meta.checkoutMethods.flatMap(m => m.timeSlots).flatMap(t => t.timeSlots).find(t => t.id === s.id);
|
|
330
|
+
if (timeSlot) {
|
|
331
|
+
const updated = Order.updateTimeSlotStock(timeSlot, this.data, add);
|
|
332
|
+
changed = changed || updated;
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
console.error('Missing timeslot ' + s.id + ' in webshop ' + this.webshopId);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
// Seats
|
|
339
|
+
for (const item of this.data.cart.items) {
|
|
340
|
+
if (item.seats.length > 0) {
|
|
341
|
+
const product = this.webshop.products.find(p => p.id === item.product.id);
|
|
342
|
+
if (product) {
|
|
343
|
+
if (previousData !== null) {
|
|
344
|
+
// Already removed
|
|
345
|
+
item.reservedSeats = [];
|
|
346
|
+
changed = true;
|
|
347
|
+
}
|
|
348
|
+
// First remove all (but only once!), to avoid duplicates
|
|
349
|
+
for (const seat of item.reservedSeats) {
|
|
350
|
+
const reservedIndex = product.reservedSeats.findIndex(s => s.equals(seat));
|
|
351
|
+
if (reservedIndex !== -1) {
|
|
352
|
+
product.reservedSeats.splice(reservedIndex, 1);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
// First remove all (but only once!), to avoid duplicates
|
|
356
|
+
if (add) {
|
|
357
|
+
for (const seat of item.seats) {
|
|
358
|
+
product.reservedSeats.push(seat);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
changed = true;
|
|
362
|
+
item.reservedSeats = add ? item.seats : [];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
// Discount codes
|
|
367
|
+
for (const code of this.data.discountCodes) {
|
|
368
|
+
if (previousData !== null) {
|
|
369
|
+
code.reserved = false;
|
|
370
|
+
changed = true;
|
|
371
|
+
}
|
|
372
|
+
if (code.reserved && !add) {
|
|
373
|
+
// Remove usage
|
|
374
|
+
code.reserved = false;
|
|
375
|
+
discountCodeUsageMap.set(code.id, (discountCodeUsageMap.get(code.id) ?? 0) - 1);
|
|
376
|
+
changed = true;
|
|
377
|
+
}
|
|
378
|
+
else if (!code.reserved && add) {
|
|
379
|
+
code.reserved = true;
|
|
380
|
+
discountCodeUsageMap.set(code.id, (discountCodeUsageMap.get(code.id) ?? 0) + 1);
|
|
381
|
+
changed = true;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
for (const [id, amount] of discountCodeUsageMap) {
|
|
385
|
+
if (amount !== 0) {
|
|
386
|
+
const code = await WebshopDiscountCode.getByID(id);
|
|
387
|
+
if (code) {
|
|
388
|
+
code.usageCount += amount;
|
|
389
|
+
await code.save();
|
|
390
|
+
changed = true;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (changed) {
|
|
395
|
+
// Do not log the webshop stock changes - but do log the order changes
|
|
396
|
+
await this.webshop.save();
|
|
397
|
+
if (!skipOrderSave) {
|
|
398
|
+
await this.save();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return changed;
|
|
402
|
+
}
|
|
403
|
+
static updateTimeSlotStock(timeSlot, data, add) {
|
|
404
|
+
let changed = false;
|
|
405
|
+
if (data.reservedOrder !== add) {
|
|
406
|
+
data.reservedOrder = add;
|
|
407
|
+
timeSlot.usedOrders += add ? 1 : -1;
|
|
408
|
+
if (timeSlot.usedOrders < 0) {
|
|
409
|
+
timeSlot.usedOrders = 0;
|
|
410
|
+
}
|
|
411
|
+
changed = true;
|
|
412
|
+
}
|
|
413
|
+
const personDifference = (add ? data.cart.persons : 0) - data.reservedPersons;
|
|
414
|
+
if (personDifference !== 0) {
|
|
415
|
+
timeSlot.usedPersons += personDifference;
|
|
416
|
+
if (timeSlot.usedPersons < 0) {
|
|
417
|
+
timeSlot.usedPersons = 0;
|
|
418
|
+
}
|
|
419
|
+
data.reservedPersons += personDifference;
|
|
420
|
+
changed = true;
|
|
421
|
+
}
|
|
422
|
+
return changed;
|
|
423
|
+
}
|
|
424
|
+
async updateTickets(options) {
|
|
425
|
+
const webshop = this.webshop;
|
|
426
|
+
if (webshop.meta.ticketType !== WebshopTicketType.Tickets && webshop.meta.ticketType !== WebshopTicketType.SingleTicket) {
|
|
427
|
+
return { tickets: [], didCreateTickets: false };
|
|
428
|
+
}
|
|
429
|
+
const existingTickets = !this.id ? [] : await Ticket.select().where('orderId', this.id).fetch();
|
|
430
|
+
if (!(await this.shouldCreateTickets(options))) {
|
|
431
|
+
// Delete all existing tickets
|
|
432
|
+
for (const ticket of existingTickets) {
|
|
433
|
+
if (ticket.isDeleted) {
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
console.log('Deleting ticket for order ' + this.id + ', ticket id = ' + ticket.id);
|
|
437
|
+
await ticket.softDelete();
|
|
438
|
+
}
|
|
439
|
+
return { tickets: [], didCreateTickets: false };
|
|
440
|
+
}
|
|
441
|
+
// Create tickets if needed (we might already be valid in case of transfer payments)
|
|
442
|
+
let tickets = [];
|
|
443
|
+
if (webshop.meta.ticketType === WebshopTicketType.Tickets) {
|
|
444
|
+
const ticketMap = new Map();
|
|
445
|
+
for (const item of this.data.cart.items) {
|
|
446
|
+
if (item.product.type === ProductType.Ticket || item.product.type === ProductType.Voucher) {
|
|
447
|
+
const offset = ticketMap.get(item.product.id) ?? 0;
|
|
448
|
+
// Separate ticket if multiple amounts
|
|
449
|
+
for (let index = 0; index < item.amount; index++) {
|
|
450
|
+
const ticket = new Ticket();
|
|
451
|
+
ticket.orderId = this.id;
|
|
452
|
+
ticket.itemId = item.id;
|
|
453
|
+
ticket.organizationId = this.organizationId;
|
|
454
|
+
ticket.webshopId = this.webshopId;
|
|
455
|
+
// Relative index for items with same properties
|
|
456
|
+
ticket.index = offset + index + 1;
|
|
457
|
+
ticket.total = item.getTotalAmount(this.data.cart);
|
|
458
|
+
// Seat
|
|
459
|
+
ticket.seat = item.seats.length > 0 ? item.seats[index] : null;
|
|
460
|
+
ticket.originalSeat = ticket.seat;
|
|
461
|
+
// Do not save yet
|
|
462
|
+
tickets.push(ticket);
|
|
463
|
+
}
|
|
464
|
+
ticketMap.set(item.product.id, offset + item.amount);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
// Create a shared ticket for the whole order
|
|
470
|
+
const ticket = new Ticket();
|
|
471
|
+
ticket.orderId = this.id;
|
|
472
|
+
ticket.itemId = null;
|
|
473
|
+
ticket.organizationId = this.organizationId;
|
|
474
|
+
ticket.webshopId = this.webshopId;
|
|
475
|
+
// Relative index for items with same properties
|
|
476
|
+
ticket.index = 1;
|
|
477
|
+
ticket.total = 1;
|
|
478
|
+
// Do not save yet
|
|
479
|
+
tickets.push(ticket);
|
|
480
|
+
}
|
|
481
|
+
let didCreateTickets = false;
|
|
482
|
+
if (!this.id) {
|
|
483
|
+
await this.save();
|
|
484
|
+
for (const ticket of tickets) {
|
|
485
|
+
ticket.orderId = this.id;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
// First check if we already have tickets
|
|
489
|
+
const mergedTickets = [];
|
|
490
|
+
// First try to keep existing tickets
|
|
491
|
+
for (const existing of existingTickets) {
|
|
492
|
+
if (existing.originalSeat) {
|
|
493
|
+
const index = tickets.findIndex(t => t.seat && t.seat.equals(existing.originalSeat));
|
|
494
|
+
if (index !== -1) {
|
|
495
|
+
const ticket = tickets[index];
|
|
496
|
+
tickets.splice(index, 1);
|
|
497
|
+
existing.itemId = ticket.itemId;
|
|
498
|
+
existing.index = ticket.index;
|
|
499
|
+
existing.total = ticket.total;
|
|
500
|
+
existing.seat = ticket.seat;
|
|
501
|
+
existing.deletedAt = null;
|
|
502
|
+
mergedTickets.push(existing);
|
|
503
|
+
}
|
|
504
|
+
continue;
|
|
505
|
+
}
|
|
506
|
+
const index = tickets.findIndex(ticket => existing.itemId === ticket.itemId && ticket.index === existing.index);
|
|
507
|
+
if (index !== -1) {
|
|
508
|
+
const ticket = tickets[index];
|
|
509
|
+
tickets.splice(index, 1);
|
|
510
|
+
existing.itemId = ticket.itemId;
|
|
511
|
+
existing.index = ticket.index;
|
|
512
|
+
existing.total = ticket.total;
|
|
513
|
+
existing.seat = ticket.seat;
|
|
514
|
+
existing.deletedAt = null;
|
|
515
|
+
mergedTickets.push(existing);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
// Try to reuse tickets instead of recreating if no match is found
|
|
519
|
+
for (const existing of existingTickets) {
|
|
520
|
+
if (mergedTickets.find(m => m.id === existing.id)) {
|
|
521
|
+
// Already mapped
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
const index = tickets.findIndex(ticket => existing.itemId === ticket.itemId);
|
|
525
|
+
if (index !== -1) {
|
|
526
|
+
const ticket = tickets[index];
|
|
527
|
+
tickets.splice(index, 1);
|
|
528
|
+
existing.itemId = ticket.itemId;
|
|
529
|
+
existing.index = ticket.index;
|
|
530
|
+
existing.total = ticket.total;
|
|
531
|
+
existing.seat = ticket.seat;
|
|
532
|
+
existing.deletedAt = null;
|
|
533
|
+
mergedTickets.push(existing);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
// Remaining tickets that were not reused
|
|
537
|
+
for (const ticket of tickets) {
|
|
538
|
+
didCreateTickets = true;
|
|
539
|
+
mergedTickets.push(ticket);
|
|
540
|
+
}
|
|
541
|
+
tickets = mergedTickets;
|
|
542
|
+
// Wait to save them all
|
|
543
|
+
console.log('Saving merged tickets for order ' + this.id);
|
|
544
|
+
await Promise.all(tickets.map(ticket => ticket.save()));
|
|
545
|
+
// Delete others
|
|
546
|
+
for (const existing of existingTickets) {
|
|
547
|
+
if (!mergedTickets.find(m => m.id === existing.id)) {
|
|
548
|
+
if (existing.isDeleted) {
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
console.log('Deleting ticket for order ' + this.id + ', ticket id = ' + existing.id);
|
|
552
|
+
await existing.softDelete();
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return { tickets, didCreateTickets };
|
|
556
|
+
}
|
|
557
|
+
markUpdated() {
|
|
558
|
+
this.updatedAt = new Date();
|
|
559
|
+
// Also save if this is the only saved property
|
|
560
|
+
this.forceSaveProperty('updatedAt');
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* A payment changed the total paid amount
|
|
564
|
+
*/
|
|
565
|
+
async paymentChanged(payment, organization, knownWebshop) {
|
|
566
|
+
this.markUpdated();
|
|
567
|
+
await this.save();
|
|
568
|
+
}
|
|
569
|
+
async undoPaid(payment, organization, knownWebshop) {
|
|
570
|
+
this.markUpdated();
|
|
571
|
+
await this.save();
|
|
572
|
+
const webshop = (knownWebshop ?? (await Webshop.getByID(this.webshopId)))?.setRelation(Webshop.organization, organization);
|
|
573
|
+
if (!webshop) {
|
|
574
|
+
console.error('Missing webshop for order ' + this.id);
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
await this.setRelation(Order.webshop, webshop).updateTickets();
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Only call this once! Make sure you use the queues correctly
|
|
581
|
+
*/
|
|
582
|
+
async markPaid(payment, organization, knownWebshop) {
|
|
583
|
+
console.log('Marking order ' + this.id + ' as paid');
|
|
584
|
+
const webshop = (knownWebshop ?? (await Webshop.getByID(this.webshopId)))?.setRelation(Webshop.organization, organization);
|
|
585
|
+
if (!webshop) {
|
|
586
|
+
console.error('Missing webshop for order ' + this.id);
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
if (this.status === OrderStatus.Deleted) {
|
|
590
|
+
await this.undoPaymentFailed(payment, organization);
|
|
591
|
+
}
|
|
592
|
+
const { tickets, didCreateTickets } = await this.setRelation(Order.webshop, webshop).updateTickets({ hasPaidPayment: true });
|
|
593
|
+
// Needs to happen before validation, because we can include the tickets in the validation that way
|
|
594
|
+
if (this.validAt === null) {
|
|
595
|
+
await this.setRelation(Order.webshop, webshop).markValid(payment, tickets);
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
this.markUpdated();
|
|
599
|
+
await this.save();
|
|
600
|
+
if (!this.data.shouldSendPaymentUpdates) {
|
|
601
|
+
console.log('Skip sending paid email for order ' + this.id);
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
if (this.data.customer.email.length > 0) {
|
|
605
|
+
if (didCreateTickets) {
|
|
606
|
+
await this.setRelation(Order.webshop, webshop).sendTickets();
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
if (payment && payment.method === PaymentMethod.Transfer) {
|
|
610
|
+
await this.setRelation(Order.webshop, webshop).sendPaidMail();
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
async sendPaidMail() {
|
|
617
|
+
// For a tickets webshop, where the order was marked as paid / non-paid, we should still send the tickets email
|
|
618
|
+
// - because the normal email is not editable
|
|
619
|
+
const hasTickets = this.webshop.meta.hasTickets;
|
|
620
|
+
await this.sendEmailTemplate({
|
|
621
|
+
type: hasTickets ? EmailTemplateType.TicketsReceivedTransfer : EmailTemplateType.OrderReceivedTransfer,
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
async sendTickets() {
|
|
625
|
+
await this.sendEmailTemplate({
|
|
626
|
+
type: EmailTemplateType.TicketsReceivedTransfer,
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
getStructureWithoutPayment() {
|
|
630
|
+
return OrderStruct.create({
|
|
631
|
+
id: this.id,
|
|
632
|
+
webshopId: this.webshopId,
|
|
633
|
+
number: this.number,
|
|
634
|
+
data: this.data,
|
|
635
|
+
status: this.status,
|
|
636
|
+
balanceItems: [],
|
|
637
|
+
createdAt: this.createdAt,
|
|
638
|
+
updatedAt: this.updatedAt,
|
|
639
|
+
validAt: this.validAt,
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
static async getStructures(orders) {
|
|
643
|
+
if (orders.length === 0) {
|
|
644
|
+
return [];
|
|
645
|
+
}
|
|
646
|
+
// Balance items
|
|
647
|
+
const allBalanceItems = await BalanceItem.where({ orderId: {
|
|
648
|
+
sign: 'IN',
|
|
649
|
+
value: orders.map(o => o.id),
|
|
650
|
+
} });
|
|
651
|
+
const { payments, balanceItemPayments } = await BalanceItem.loadPayments(allBalanceItems);
|
|
652
|
+
const structures = [];
|
|
653
|
+
for (const order of orders) {
|
|
654
|
+
const balanceItems = allBalanceItems.filter(b => b.orderId === order.id);
|
|
655
|
+
const balanceItemStructures = balanceItems.map((balanceItem) => {
|
|
656
|
+
return BalanceItemWithPayments.create({
|
|
657
|
+
...balanceItem,
|
|
658
|
+
payments: balanceItemPayments.filter(b => b.balanceItemId === balanceItem.id).map((balanceItemPayment) => {
|
|
659
|
+
const payment = payments.find(pp => pp.id === balanceItemPayment.paymentId);
|
|
660
|
+
return BalanceItemPaymentWithPayment.create({
|
|
661
|
+
...balanceItemPayment,
|
|
662
|
+
payment: PaymentStruct.create(payment),
|
|
663
|
+
});
|
|
664
|
+
}),
|
|
665
|
+
});
|
|
666
|
+
});
|
|
667
|
+
structures.push(OrderStruct.create({
|
|
668
|
+
...order,
|
|
669
|
+
balanceItems: balanceItemStructures,
|
|
670
|
+
// Compatibility
|
|
671
|
+
payment: balanceItemStructures[0]?.payments[0]?.payment ?? null,
|
|
672
|
+
}));
|
|
673
|
+
}
|
|
674
|
+
return structures;
|
|
675
|
+
}
|
|
676
|
+
static async getPrivateStructures(orders) {
|
|
677
|
+
if (orders.length === 0) {
|
|
678
|
+
return [];
|
|
679
|
+
}
|
|
680
|
+
// Balance items
|
|
681
|
+
const allBalanceItems = await BalanceItem.where({ orderId: {
|
|
682
|
+
sign: 'IN',
|
|
683
|
+
value: orders.map(o => o.id),
|
|
684
|
+
} });
|
|
685
|
+
const { payments, balanceItemPayments } = await BalanceItem.loadPayments(allBalanceItems);
|
|
686
|
+
const structures = [];
|
|
687
|
+
for (const order of orders) {
|
|
688
|
+
const balanceItems = allBalanceItems.filter(b => b.orderId === order.id);
|
|
689
|
+
const balanceItemStructures = balanceItems.map((balanceItem) => {
|
|
690
|
+
return BalanceItemWithPrivatePayments.create({
|
|
691
|
+
...balanceItem,
|
|
692
|
+
payments: balanceItemPayments.filter(b => b.balanceItemId === balanceItem.id).map((balanceItemPayment) => {
|
|
693
|
+
const payment = payments.find(pp => pp.id === balanceItemPayment.paymentId);
|
|
694
|
+
return BalanceItemPaymentWithPrivatePayment.create({
|
|
695
|
+
...balanceItemPayment,
|
|
696
|
+
payment: PrivatePayment.create(payment),
|
|
697
|
+
});
|
|
698
|
+
}),
|
|
699
|
+
});
|
|
700
|
+
});
|
|
701
|
+
structures.push(PrivateOrder.create({
|
|
702
|
+
...order,
|
|
703
|
+
balanceItems: balanceItemStructures,
|
|
704
|
+
// Compatibility
|
|
705
|
+
payment: balanceItemStructures[0]?.payments[0]?.payment ?? null,
|
|
706
|
+
}));
|
|
707
|
+
}
|
|
708
|
+
return structures;
|
|
709
|
+
}
|
|
710
|
+
async getStructure() {
|
|
711
|
+
return (await Order.getStructures([this]))[0];
|
|
712
|
+
}
|
|
713
|
+
async sendEmailTemplate(data) {
|
|
714
|
+
// Never send an email for archived webshops
|
|
715
|
+
if (this.webshop.meta.status === WebshopStatus.Archived) {
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
let recipient = (await this.getStructure()).getRecipient(this.webshop.organization.getBaseStructure(), WebshopPreview.create(this.webshop));
|
|
719
|
+
if (data.to) {
|
|
720
|
+
// Clear first and last name
|
|
721
|
+
recipient.firstName = null;
|
|
722
|
+
recipient.lastName = null;
|
|
723
|
+
recipient.replacements = recipient.replacements.filter(r => !['firstName', 'lastName'].includes(r.token));
|
|
724
|
+
data.to.merge(recipient);
|
|
725
|
+
recipient = data.to;
|
|
726
|
+
}
|
|
727
|
+
// Create e-mail builder
|
|
728
|
+
await sendEmailTemplate(this.webshop.organization, {
|
|
729
|
+
recipients: [recipient],
|
|
730
|
+
template: {
|
|
731
|
+
type: data.type,
|
|
732
|
+
webshop: this.webshop,
|
|
733
|
+
},
|
|
734
|
+
type: 'transactional',
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* WARNING: this should always run inside a queue so it only runs once for the same orde
|
|
739
|
+
* Include any tickets that are generated and should be included in the e-mail
|
|
740
|
+
*/
|
|
741
|
+
async markValid(payment, tickets) {
|
|
742
|
+
const webshop = this.webshop;
|
|
743
|
+
const organization = webshop.organization;
|
|
744
|
+
console.log('Marking as valid: order ' + this.id);
|
|
745
|
+
const wasValid = this.validAt !== null;
|
|
746
|
+
if (wasValid) {
|
|
747
|
+
console.warn('Warning: already validated an order');
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
this.validAt = new Date(); // will get flattened AFTER calculations
|
|
751
|
+
this.validAt.setMilliseconds(0);
|
|
752
|
+
this.number = await WebshopCounter.getNextNumber(this.webshop);
|
|
753
|
+
if (payment && !Order.payment.isLoaded(this)) {
|
|
754
|
+
this.setRelation(Order.payment, payment);
|
|
755
|
+
}
|
|
756
|
+
// Now we have a number, update the payment
|
|
757
|
+
if (payment && payment.method === PaymentMethod.Transfer) {
|
|
758
|
+
// Only now we can update the transfer description, since we need the order number as a reference
|
|
759
|
+
payment.transferSettings = webshop.meta.transferSettings.fillMissing(organization.mappedTransferSettings);
|
|
760
|
+
if (!payment.transferSettings.iban) {
|
|
761
|
+
throw new SimpleError({
|
|
762
|
+
code: 'missing_iban',
|
|
763
|
+
message: 'Missing IBAN',
|
|
764
|
+
human: $t(`%w2`),
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
payment.generateDescription(organization, this.number.toString(), this.getTransferReplacements());
|
|
768
|
+
await payment.save();
|
|
769
|
+
}
|
|
770
|
+
await this.save();
|
|
771
|
+
if (this.data.customer.email.length > 0) {
|
|
772
|
+
if (tickets.length > 0) {
|
|
773
|
+
// Also send a copy
|
|
774
|
+
if (payment && payment.method === PaymentMethod.PointOfSale) {
|
|
775
|
+
await this.sendEmailTemplate({
|
|
776
|
+
type: EmailTemplateType.TicketsConfirmationPOS,
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
else {
|
|
780
|
+
await this.sendEmailTemplate({
|
|
781
|
+
type: EmailTemplateType.TicketsConfirmation,
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
if (this.webshop.meta.ticketType === WebshopTicketType.None) {
|
|
787
|
+
if (payment && payment.method === PaymentMethod.Transfer) {
|
|
788
|
+
// Also send a copy
|
|
789
|
+
await this.sendEmailTemplate({
|
|
790
|
+
type: EmailTemplateType.OrderConfirmationTransfer,
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
else if (payment && payment.method === PaymentMethod.PointOfSale) {
|
|
794
|
+
await this.sendEmailTemplate({
|
|
795
|
+
type: EmailTemplateType.OrderConfirmationPOS,
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
else {
|
|
799
|
+
// Also send a copy
|
|
800
|
+
await this.sendEmailTemplate({
|
|
801
|
+
type: EmailTemplateType.OrderConfirmationOnline,
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
else {
|
|
806
|
+
if (payment && payment.method === PaymentMethod.Transfer) {
|
|
807
|
+
await this.sendEmailTemplate({
|
|
808
|
+
type: EmailTemplateType.TicketsConfirmationTransfer,
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
else {
|
|
812
|
+
console.error('Unexpected missing tickets for order where tickets are expected');
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
if (this.webshop.privateMeta.notificationEmails) {
|
|
818
|
+
const webshop = this.webshop;
|
|
819
|
+
const organization = webshop.organization;
|
|
820
|
+
const i18n = organization.i18n;
|
|
821
|
+
const webshopDashboardUrl = 'https://' + (STAMHOOFD.domains.dashboard ?? 'stamhoofd.app') + '/' + i18n.locale + '/webshops/' + Formatter.slug(webshop.meta.name) + '/orders';
|
|
822
|
+
// Send an email to all these notification emails
|
|
823
|
+
for (const email of this.webshop.privateMeta.notificationEmails) {
|
|
824
|
+
await this.sendEmailTemplate({
|
|
825
|
+
type: EmailTemplateType.OrderNotification,
|
|
826
|
+
to: Recipient.create({
|
|
827
|
+
email,
|
|
828
|
+
replacements: [
|
|
829
|
+
Replacement.create({
|
|
830
|
+
token: 'orderUrl',
|
|
831
|
+
value: webshopDashboardUrl,
|
|
832
|
+
}),
|
|
833
|
+
],
|
|
834
|
+
}),
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
__decorate([
|
|
841
|
+
column({
|
|
842
|
+
primary: true, type: 'string', beforeSave(value) {
|
|
843
|
+
return value ?? uuidv4();
|
|
844
|
+
},
|
|
845
|
+
})
|
|
846
|
+
], Order.prototype, "id", void 0);
|
|
847
|
+
__decorate([
|
|
848
|
+
column({ type: 'string' })
|
|
849
|
+
], Order.prototype, "organizationId", void 0);
|
|
850
|
+
__decorate([
|
|
851
|
+
column({ type: 'string' })
|
|
852
|
+
], Order.prototype, "webshopId", void 0);
|
|
853
|
+
__decorate([
|
|
854
|
+
column({ type: 'string', nullable: true })
|
|
855
|
+
], Order.prototype, "paymentId", void 0);
|
|
856
|
+
__decorate([
|
|
857
|
+
column({ type: 'string', nullable: true })
|
|
858
|
+
], Order.prototype, "userId", void 0);
|
|
859
|
+
__decorate([
|
|
860
|
+
column({ type: 'json', decoder: OrderData })
|
|
861
|
+
], Order.prototype, "data", void 0);
|
|
862
|
+
__decorate([
|
|
863
|
+
column({ type: 'integer', nullable: true })
|
|
864
|
+
], Order.prototype, "number", void 0);
|
|
865
|
+
__decorate([
|
|
866
|
+
column({
|
|
867
|
+
type: 'datetime', beforeSave(old) {
|
|
868
|
+
if (old !== undefined) {
|
|
869
|
+
return old;
|
|
870
|
+
}
|
|
871
|
+
const date = new Date();
|
|
872
|
+
date.setMilliseconds(0);
|
|
873
|
+
return date;
|
|
874
|
+
},
|
|
875
|
+
})
|
|
876
|
+
], Order.prototype, "createdAt", void 0);
|
|
877
|
+
__decorate([
|
|
878
|
+
column({
|
|
879
|
+
type: 'datetime', beforeSave() {
|
|
880
|
+
const date = new Date();
|
|
881
|
+
date.setMilliseconds(0);
|
|
882
|
+
return date;
|
|
883
|
+
},
|
|
884
|
+
skipUpdate: true,
|
|
885
|
+
})
|
|
886
|
+
], Order.prototype, "updatedAt", void 0);
|
|
887
|
+
__decorate([
|
|
888
|
+
column({ type: 'datetime', nullable: true })
|
|
889
|
+
], Order.prototype, "validAt", void 0);
|
|
890
|
+
__decorate([
|
|
891
|
+
column({ type: 'string' })
|
|
892
|
+
], Order.prototype, "status", void 0);
|
|
893
|
+
__decorate([
|
|
894
|
+
column({ type: 'integer', nullable: true, beforeSave() {
|
|
895
|
+
return this.data.totalPrice;
|
|
896
|
+
} })
|
|
897
|
+
], Order.prototype, "totalPrice", void 0);
|
|
898
|
+
__decorate([
|
|
899
|
+
column({ type: 'integer', nullable: true, beforeSave() {
|
|
900
|
+
return this.data.amount;
|
|
901
|
+
} })
|
|
902
|
+
], Order.prototype, "amount", void 0);
|
|
903
|
+
__decorate([
|
|
904
|
+
column({ type: 'string', nullable: true, beforeSave() {
|
|
905
|
+
return this.data.timeSlot?.timeIndex ?? null;
|
|
906
|
+
} })
|
|
907
|
+
], Order.prototype, "timeSlotTime", void 0);
|
|
908
|
+
//# sourceMappingURL=Order.js.map
|