@stamhoofd/models 2.107.1 → 2.107.2
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/src/factories/BalanceItemFactory.d.ts +1 -1
- package/dist/src/factories/BalanceItemFactory.d.ts.map +1 -1
- package/dist/src/factories/BalanceItemFactory.js +2 -2
- package/dist/src/factories/BalanceItemFactory.js.map +1 -1
- package/dist/src/factories/DocumentTemplateFactory.d.ts +1 -1
- package/dist/src/factories/DocumentTemplateFactory.d.ts.map +1 -1
- package/dist/src/factories/DocumentTemplateFactory.js +2 -2
- package/dist/src/factories/DocumentTemplateFactory.js.map +1 -1
- package/dist/src/factories/EmailTemplateFactory.d.ts +2 -2
- package/dist/src/factories/EmailTemplateFactory.d.ts.map +1 -1
- package/dist/src/factories/EmailTemplateFactory.js +2 -2
- package/dist/src/factories/EmailTemplateFactory.js.map +1 -1
- package/dist/src/factories/EmergencyContactFactory.js.map +1 -1
- package/dist/src/factories/EventFactory.d.ts +3 -3
- package/dist/src/factories/EventFactory.d.ts.map +1 -1
- package/dist/src/factories/EventFactory.js +4 -4
- package/dist/src/factories/EventFactory.js.map +1 -1
- package/dist/src/factories/EventNotificationFactory.d.ts +3 -3
- package/dist/src/factories/EventNotificationFactory.d.ts.map +1 -1
- package/dist/src/factories/EventNotificationFactory.js +7 -7
- package/dist/src/factories/EventNotificationFactory.js.map +1 -1
- package/dist/src/factories/EventNotificationTypeFactory.js +2 -2
- package/dist/src/factories/EventNotificationTypeFactory.js.map +1 -1
- package/dist/src/factories/GroupFactory.d.ts +3 -3
- package/dist/src/factories/GroupFactory.d.ts.map +1 -1
- package/dist/src/factories/GroupFactory.js +4 -4
- package/dist/src/factories/GroupFactory.js.map +1 -1
- package/dist/src/factories/MemberFactory.d.ts +3 -3
- package/dist/src/factories/MemberFactory.d.ts.map +1 -1
- package/dist/src/factories/MemberFactory.js +12 -12
- package/dist/src/factories/MemberFactory.js.map +1 -1
- package/dist/src/factories/MemberResponsibilityRecordFactory.d.ts +1 -1
- package/dist/src/factories/MemberResponsibilityRecordFactory.d.ts.map +1 -1
- package/dist/src/factories/MemberResponsibilityRecordFactory.js +4 -4
- package/dist/src/factories/MemberResponsibilityRecordFactory.js.map +1 -1
- package/dist/src/factories/OrganizationFactory.d.ts +2 -2
- package/dist/src/factories/OrganizationFactory.d.ts.map +1 -1
- package/dist/src/factories/OrganizationFactory.js +4 -4
- package/dist/src/factories/OrganizationFactory.js.map +1 -1
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.d.ts +3 -3
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.d.ts.map +1 -1
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.js +2 -2
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.js.map +1 -1
- package/dist/src/factories/OrganizationTagFactory.js +2 -2
- package/dist/src/factories/OrganizationTagFactory.js.map +1 -1
- package/dist/src/factories/ParentFactory.js +2 -2
- package/dist/src/factories/ParentFactory.js.map +1 -1
- package/dist/src/factories/PlatformEventTypeFactory.js +2 -2
- package/dist/src/factories/PlatformEventTypeFactory.js.map +1 -1
- package/dist/src/factories/PlatformResponsibilityFactory.js +2 -2
- package/dist/src/factories/PlatformResponsibilityFactory.js.map +1 -1
- package/dist/src/factories/RecordAnswerFactory.js +2 -2
- package/dist/src/factories/RecordAnswerFactory.js.map +1 -1
- package/dist/src/factories/RecordCategoryFactory.d.ts +1 -1
- package/dist/src/factories/RecordCategoryFactory.d.ts.map +1 -1
- package/dist/src/factories/RecordCategoryFactory.js +2 -2
- package/dist/src/factories/RecordCategoryFactory.js.map +1 -1
- package/dist/src/factories/RegisterCodeFactory.d.ts +1 -1
- package/dist/src/factories/RegisterCodeFactory.d.ts.map +1 -1
- package/dist/src/factories/RegisterCodeFactory.js +2 -2
- package/dist/src/factories/RegisterCodeFactory.js.map +1 -1
- package/dist/src/factories/RegistrationFactory.d.ts +4 -4
- package/dist/src/factories/RegistrationFactory.d.ts.map +1 -1
- package/dist/src/factories/RegistrationFactory.js +4 -4
- package/dist/src/factories/RegistrationFactory.js.map +1 -1
- package/dist/src/factories/RegistrationPeriodFactory.d.ts +1 -1
- package/dist/src/factories/RegistrationPeriodFactory.d.ts.map +1 -1
- package/dist/src/factories/RegistrationPeriodFactory.js +2 -2
- package/dist/src/factories/RegistrationPeriodFactory.js.map +1 -1
- package/dist/src/factories/STPackageFactory.d.ts +2 -2
- package/dist/src/factories/STPackageFactory.d.ts.map +1 -1
- package/dist/src/factories/STPackageFactory.js +2 -2
- package/dist/src/factories/STPackageFactory.js.map +1 -1
- package/dist/src/factories/UserFactory.d.ts +2 -2
- package/dist/src/factories/UserFactory.d.ts.map +1 -1
- package/dist/src/factories/UserFactory.js +4 -4
- package/dist/src/factories/UserFactory.js.map +1 -1
- package/dist/src/factories/WebshopFactory.d.ts +1 -1
- package/dist/src/factories/WebshopFactory.d.ts.map +1 -1
- package/dist/src/factories/WebshopFactory.js +4 -4
- package/dist/src/factories/WebshopFactory.js.map +1 -1
- package/dist/src/factories/index.d.ts +26 -26
- package/dist/src/factories/index.d.ts.map +1 -1
- package/dist/src/factories/index.js +26 -26
- package/dist/src/factories/index.js.map +1 -1
- package/dist/src/helpers/EmailBuilder.d.ts +1 -1
- package/dist/src/helpers/EmailBuilder.d.ts.map +1 -1
- package/dist/src/helpers/EmailBuilder.js +12 -12
- package/dist/src/helpers/EmailBuilder.js.map +1 -1
- package/dist/src/helpers/GroupBuilder.d.ts +1 -1
- package/dist/src/helpers/GroupBuilder.d.ts.map +1 -1
- package/dist/src/helpers/GroupBuilder.js +26 -26
- package/dist/src/helpers/GroupBuilder.js.map +1 -1
- package/dist/src/helpers/MemberMerger.d.ts +1 -1
- package/dist/src/helpers/MemberMerger.d.ts.map +1 -1
- package/dist/src/helpers/MemberMerger.js +10 -10
- package/dist/src/helpers/MemberMerger.js.map +1 -1
- package/dist/src/helpers/MemberMerger.test.js +18 -18
- package/dist/src/helpers/MemberMerger.test.js.map +1 -1
- package/dist/src/helpers/WebshopCounter.d.ts +1 -1
- package/dist/src/helpers/WebshopCounter.d.ts.map +1 -1
- package/dist/src/index.d.ts +8 -8
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -8
- package/dist/src/index.js.map +1 -1
- package/dist/src/migrations/1605262045-import-postcodes.d.ts +1 -1
- package/dist/src/migrations/1605262045-import-postcodes.js +9 -9
- package/dist/src/migrations/1605262046-import-postcodes-nl.js +7 -7
- package/dist/src/models/BalanceItem.d.ts +3 -3
- package/dist/src/models/BalanceItem.d.ts.map +1 -1
- package/dist/src/models/BalanceItem.js +3 -3
- package/dist/src/models/BalanceItem.js.map +1 -1
- package/dist/src/models/BalanceItemPayment.d.ts +1 -1
- package/dist/src/models/BalanceItemPayment.d.ts.map +1 -1
- package/dist/src/models/BalanceItemPayment.js +3 -3
- package/dist/src/models/BalanceItemPayment.js.map +1 -1
- package/dist/src/models/CachedBalance.d.ts +1 -1
- package/dist/src/models/CachedBalance.d.ts.map +1 -1
- package/dist/src/models/CachedBalance.js +13 -13
- package/dist/src/models/CachedBalance.js.map +1 -1
- package/dist/src/models/Document.d.ts +3 -3
- package/dist/src/models/Document.d.ts.map +1 -1
- package/dist/src/models/Document.js +11 -11
- package/dist/src/models/Document.js.map +1 -1
- package/dist/src/models/DocumentTemplate.d.ts +4 -4
- package/dist/src/models/DocumentTemplate.d.ts.map +1 -1
- package/dist/src/models/DocumentTemplate.js +17 -17
- package/dist/src/models/DocumentTemplate.js.map +1 -1
- package/dist/src/models/Email.d.ts +2 -2
- package/dist/src/models/Email.d.ts.map +1 -1
- package/dist/src/models/Email.js +33 -33
- package/dist/src/models/Email.js.map +1 -1
- package/dist/src/models/Email.test.js +38 -38
- package/dist/src/models/Email.test.js.map +1 -1
- package/dist/src/models/EmailRecipient.js +2 -2
- package/dist/src/models/EmailRecipient.js.map +1 -1
- package/dist/src/models/EmailVerificationCode.js +6 -6
- package/dist/src/models/EmailVerificationCode.js.map +1 -1
- package/dist/src/models/Event.d.ts +1 -1
- package/dist/src/models/Event.d.ts.map +1 -1
- package/dist/src/models/Event.js +2 -2
- package/dist/src/models/Event.js.map +1 -1
- package/dist/src/models/EventNotification.d.ts +1 -1
- package/dist/src/models/EventNotification.d.ts.map +1 -1
- package/dist/src/models/EventNotification.js +2 -2
- package/dist/src/models/EventNotification.js.map +1 -1
- package/dist/src/models/Group.d.ts +1 -1
- package/dist/src/models/Group.d.ts.map +1 -1
- package/dist/src/models/Group.js +19 -19
- package/dist/src/models/Group.js.map +1 -1
- package/dist/src/models/Member.d.ts +1 -1
- package/dist/src/models/Member.d.ts.map +1 -1
- package/dist/src/models/Member.js +28 -28
- package/dist/src/models/Member.js.map +1 -1
- package/dist/src/models/MemberPlatformMembership.d.ts +2 -2
- package/dist/src/models/MemberPlatformMembership.d.ts.map +1 -1
- package/dist/src/models/MemberPlatformMembership.js +14 -14
- package/dist/src/models/MemberPlatformMembership.js.map +1 -1
- package/dist/src/models/MergedMember.d.ts +1 -1
- package/dist/src/models/MergedMember.d.ts.map +1 -1
- package/dist/src/models/MollieToken.d.ts +1 -1
- package/dist/src/models/MollieToken.d.ts.map +1 -1
- package/dist/src/models/OneTimeToken.d.ts +1 -1
- package/dist/src/models/OneTimeToken.d.ts.map +1 -1
- package/dist/src/models/Order.d.ts +1 -1
- package/dist/src/models/Order.d.ts.map +1 -1
- package/dist/src/models/Order.js +28 -27
- package/dist/src/models/Order.js.map +1 -1
- package/dist/src/models/Organization.d.ts +4 -4
- package/dist/src/models/Organization.d.ts.map +1 -1
- package/dist/src/models/Organization.js +14 -14
- package/dist/src/models/Organization.js.map +1 -1
- package/dist/src/models/OrganizationRegistrationPeriod.d.ts +2 -1
- package/dist/src/models/OrganizationRegistrationPeriod.d.ts.map +1 -1
- package/dist/src/models/PasswordToken.d.ts +1 -1
- package/dist/src/models/PasswordToken.d.ts.map +1 -1
- package/dist/src/models/PasswordToken.js +4 -4
- package/dist/src/models/PasswordToken.js.map +1 -1
- package/dist/src/models/PayconiqPayment.d.ts +1 -1
- package/dist/src/models/PayconiqPayment.d.ts.map +1 -1
- package/dist/src/models/Payment.d.ts +3 -3
- package/dist/src/models/Payment.d.ts.map +1 -1
- package/dist/src/models/Payment.js +6 -6
- package/dist/src/models/Payment.js.map +1 -1
- package/dist/src/models/Platform.js +5 -5
- package/dist/src/models/Platform.js.map +1 -1
- package/dist/src/models/Platform.test.js +23 -23
- package/dist/src/models/Platform.test.js.map +1 -1
- package/dist/src/models/Registration.d.ts +1 -1
- package/dist/src/models/Registration.d.ts.map +1 -1
- package/dist/src/models/Registration.js +8 -8
- package/dist/src/models/Registration.js.map +1 -1
- package/dist/src/models/STInvoice.d.ts +1 -1
- package/dist/src/models/STInvoice.d.ts.map +1 -1
- package/dist/src/models/STPackage.js +7 -7
- package/dist/src/models/STPackage.js.map +1 -1
- package/dist/src/models/STPendingInvoice.d.ts +1 -1
- package/dist/src/models/STPendingInvoice.d.ts.map +1 -1
- package/dist/src/models/STPendingInvoice.js +2 -2
- package/dist/src/models/STPendingInvoice.js.map +1 -1
- package/dist/src/models/Ticket.d.ts +1 -1
- package/dist/src/models/Ticket.d.ts.map +1 -1
- package/dist/src/models/Ticket.js +4 -4
- package/dist/src/models/Ticket.js.map +1 -1
- package/dist/src/models/Token.d.ts +1 -1
- package/dist/src/models/Token.d.ts.map +1 -1
- package/dist/src/models/Token.js +5 -5
- package/dist/src/models/Token.js.map +1 -1
- package/dist/src/models/Token.test.js +11 -11
- package/dist/src/models/Token.test.js.map +1 -1
- package/dist/src/models/User.d.ts +1 -1
- package/dist/src/models/User.d.ts.map +1 -1
- package/dist/src/models/User.js +3 -3
- package/dist/src/models/User.js.map +1 -1
- package/dist/src/models/UserPermissions.d.ts +1 -1
- package/dist/src/models/UserPermissions.d.ts.map +1 -1
- package/dist/src/models/UserPermissions.js +3 -3
- package/dist/src/models/UserPermissions.js.map +1 -1
- package/dist/src/models/Webshop.d.ts +1 -1
- package/dist/src/models/Webshop.d.ts.map +1 -1
- package/dist/src/models/Webshop.js +4 -4
- package/dist/src/models/Webshop.js.map +1 -1
- package/dist/src/models/addresses/City.d.ts +1 -1
- package/dist/src/models/addresses/City.d.ts.map +1 -1
- package/dist/src/models/addresses/City.js +2 -2
- package/dist/src/models/addresses/City.js.map +1 -1
- package/dist/src/models/addresses/PostalCode.d.ts +1 -1
- package/dist/src/models/addresses/PostalCode.d.ts.map +1 -1
- package/dist/src/models/addresses/PostalCode.js +10 -10
- package/dist/src/models/addresses/PostalCode.js.map +1 -1
- package/dist/src/models/addresses/PostalCode.test.js +19 -19
- package/dist/src/models/addresses/PostalCode.test.js.map +1 -1
- package/dist/src/models/addresses/Street.d.ts +1 -1
- package/dist/src/models/addresses/Street.d.ts.map +1 -1
- package/dist/src/models/addresses/Street.js +2 -2
- package/dist/src/models/addresses/Street.js.map +1 -1
- package/dist/src/models/index.d.ts +51 -51
- package/dist/src/models/index.d.ts.map +1 -1
- package/dist/src/models/index.js +62 -62
- package/dist/src/models/index.js.map +1 -1
- package/package.json +2 -2
- package/src/factories/BalanceItemFactory.ts +1 -1
- package/src/factories/DocumentTemplateFactory.ts +1 -1
- package/src/factories/EmailTemplateFactory.ts +2 -2
- package/src/factories/EmergencyContactFactory.ts +10 -10
- package/src/factories/EventFactory.ts +4 -4
- package/src/factories/EventNotificationFactory.ts +5 -5
- package/src/factories/EventNotificationTypeFactory.ts +1 -1
- package/src/factories/GroupFactory.ts +4 -4
- package/src/factories/MemberFactory.ts +16 -16
- package/src/factories/MemberResponsibilityRecordFactory.ts +2 -2
- package/src/factories/OrganizationFactory.ts +3 -3
- package/src/factories/OrganizationRegistrationPeriodFactory.ts +3 -3
- package/src/factories/OrganizationTagFactory.ts +1 -1
- package/src/factories/ParentFactory.ts +11 -11
- package/src/factories/PlatformEventTypeFactory.ts +1 -1
- package/src/factories/PlatformResponsibilityFactory.ts +1 -1
- package/src/factories/RecordAnswerFactory.ts +1 -1
- package/src/factories/RecordCategoryFactory.ts +1 -1
- package/src/factories/RegisterCodeFactory.ts +1 -1
- package/src/factories/RegistrationFactory.ts +5 -5
- package/src/factories/RegistrationPeriodFactory.ts +1 -1
- package/src/factories/STPackageFactory.ts +2 -2
- package/src/factories/UserFactory.ts +3 -3
- package/src/factories/WebshopFactory.ts +2 -2
- package/src/factories/index.ts +26 -26
- package/src/helpers/EmailBuilder.ts +2 -2
- package/src/helpers/GroupBuilder.ts +1 -1
- package/src/helpers/MemberMerger.test.ts +2 -2
- package/src/helpers/MemberMerger.ts +1 -1
- package/src/helpers/WebshopCounter.ts +1 -1
- package/src/index.ts +8 -8
- package/src/migrations/1605262045-import-postcodes.ts +3 -3
- package/src/migrations/1605262046-import-postcodes-nl.ts +3 -3
- package/src/models/BalanceItem.ts +4 -4
- package/src/models/BalanceItemPayment.ts +1 -1
- package/src/models/CachedBalance.ts +2 -2
- package/src/models/Document.ts +13 -13
- package/src/models/DocumentTemplate.ts +8 -8
- package/src/models/Email.test.ts +6 -6
- package/src/models/Email.ts +6 -6
- package/src/models/EmailRecipient.ts +1 -1
- package/src/models/EmailVerificationCode.ts +3 -3
- package/src/models/Event.ts +1 -1
- package/src/models/EventNotification.ts +1 -1
- package/src/models/Group.ts +1 -1
- package/src/models/Member.ts +2 -2
- package/src/models/MemberPlatformMembership.ts +6 -6
- package/src/models/MergedMember.ts +1 -1
- package/src/models/MollieToken.ts +1 -1
- package/src/models/OneTimeToken.ts +1 -1
- package/src/models/Order.ts +4 -3
- package/src/models/Organization.ts +5 -5
- package/src/models/OrganizationRegistrationPeriod.ts +2 -2
- package/src/models/PasswordToken.ts +1 -1
- package/src/models/PayconiqPayment.ts +1 -1
- package/src/models/Payment.ts +5 -5
- package/src/models/Platform.test.ts +1 -1
- package/src/models/Platform.ts +1 -1
- package/src/models/Registration.ts +5 -5
- package/src/models/STInvoice.ts +1 -1
- package/src/models/STPackage.ts +3 -3
- package/src/models/STPendingInvoice.ts +1 -1
- package/src/models/Ticket.ts +1 -1
- package/src/models/Token.test.ts +5 -5
- package/src/models/Token.ts +2 -2
- package/src/models/User.ts +2 -2
- package/src/models/UserPermissions.ts +1 -1
- package/src/models/Webshop.ts +2 -2
- package/src/models/addresses/City.ts +1 -1
- package/src/models/addresses/PostalCode.test.ts +3 -3
- package/src/models/addresses/PostalCode.ts +1 -1
- package/src/models/addresses/Street.ts +1 -1
- package/src/models/index.ts +60 -60
package/src/models/Document.ts
CHANGED
|
@@ -4,10 +4,10 @@ import { Formatter } from '@stamhoofd/utility';
|
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
|
|
6
6
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
7
|
-
import { render } from '../helpers/Handlebars';
|
|
8
|
-
import { RegistrationWithMember } from './Member';
|
|
9
|
-
import { Organization } from './Organization';
|
|
10
|
-
import { Registration } from './Registration';
|
|
7
|
+
import { render } from '../helpers/Handlebars.js';
|
|
8
|
+
import { RegistrationWithMember } from './Member.js';
|
|
9
|
+
import { Organization } from './Organization.js';
|
|
10
|
+
import { Registration } from './Registration.js';
|
|
11
11
|
|
|
12
12
|
export class Document extends QueryableModel {
|
|
13
13
|
static table = 'documents';
|
|
@@ -121,7 +121,7 @@ export class Document extends QueryableModel {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
async updateData(): Promise<void> {
|
|
124
|
-
const DocumentTemplate = (await import('./DocumentTemplate')).DocumentTemplate;
|
|
124
|
+
const DocumentTemplate = (await import('./DocumentTemplate.js')).DocumentTemplate;
|
|
125
125
|
const template = await DocumentTemplate.getByID(this.templateId);
|
|
126
126
|
if (!template) {
|
|
127
127
|
console.log('No template, skipping update');
|
|
@@ -141,7 +141,7 @@ export class Document extends QueryableModel {
|
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
const Member = (await import('./Member')).Member;
|
|
144
|
+
const Member = (await import('./Member.js')).Member;
|
|
145
145
|
const [registration] = await Member.getRegistrationWithMembersByIDs([this.registrationId]);
|
|
146
146
|
if (!registration) {
|
|
147
147
|
console.log('No registration when updating document', this.id);
|
|
@@ -155,7 +155,7 @@ export class Document extends QueryableModel {
|
|
|
155
155
|
static async updateForMember(memberId: string) {
|
|
156
156
|
try {
|
|
157
157
|
console.log('Updating documents for member', memberId);
|
|
158
|
-
const Member = (await import('./Member')).Member;
|
|
158
|
+
const Member = (await import('./Member.js')).Member;
|
|
159
159
|
const member = await Member.getWithRegistrations(memberId);
|
|
160
160
|
if (member) {
|
|
161
161
|
const organizationIds = Formatter.uniqueArray(member.registrations.map(r => r.organizationId));
|
|
@@ -173,7 +173,7 @@ export class Document extends QueryableModel {
|
|
|
173
173
|
try {
|
|
174
174
|
console.log('Updating documents for registration', registration.id);
|
|
175
175
|
|
|
176
|
-
const DocumentTemplate = (await import('./DocumentTemplate')).DocumentTemplate;
|
|
176
|
+
const DocumentTemplate = (await import('./DocumentTemplate.js')).DocumentTemplate;
|
|
177
177
|
const templates = await DocumentTemplate.where({ updatesEnabled: 1, organizationId: registration.organizationId });
|
|
178
178
|
|
|
179
179
|
for (const template of templates) {
|
|
@@ -205,11 +205,11 @@ export class Document extends QueryableModel {
|
|
|
205
205
|
try {
|
|
206
206
|
console.log('Updating documents for updateForRegistrations', registrationIds, organizationId);
|
|
207
207
|
|
|
208
|
-
const DocumentTemplate = (await import('./DocumentTemplate')).DocumentTemplate;
|
|
208
|
+
const DocumentTemplate = (await import('./DocumentTemplate.js')).DocumentTemplate;
|
|
209
209
|
const templates = await DocumentTemplate.where({ updatesEnabled: 1, organizationId });
|
|
210
210
|
|
|
211
211
|
if (templates.length) {
|
|
212
|
-
const Member = (await import('./Member')).Member;
|
|
212
|
+
const Member = (await import('./Member.js')).Member;
|
|
213
213
|
const registrations = await Member.getRegistrationWithMembersByIDs(registrationIds);
|
|
214
214
|
|
|
215
215
|
for (const template of templates) {
|
|
@@ -226,11 +226,11 @@ export class Document extends QueryableModel {
|
|
|
226
226
|
try {
|
|
227
227
|
console.log('Updating documents for group', groupId);
|
|
228
228
|
|
|
229
|
-
const DocumentTemplate = (await import('./DocumentTemplate')).DocumentTemplate;
|
|
229
|
+
const DocumentTemplate = (await import('./DocumentTemplate.js')).DocumentTemplate;
|
|
230
230
|
const templates = await DocumentTemplate.where({ updatesEnabled: 1, organizationId });
|
|
231
231
|
|
|
232
232
|
if (templates.length) {
|
|
233
|
-
const Member = (await import('./Member')).Member;
|
|
233
|
+
const Member = (await import('./Member.js')).Member;
|
|
234
234
|
const registrations = await Member.getRegistrationWithMembersForGroup(groupId);
|
|
235
235
|
|
|
236
236
|
for (const template of templates) {
|
|
@@ -245,7 +245,7 @@ export class Document extends QueryableModel {
|
|
|
245
245
|
|
|
246
246
|
// Rander handlebars template
|
|
247
247
|
async getRenderedHtml(organization: Organization): Promise<string | null> {
|
|
248
|
-
const DocumentTemplate = (await import('./DocumentTemplate')).DocumentTemplate;
|
|
248
|
+
const DocumentTemplate = (await import('./DocumentTemplate.js')).DocumentTemplate;
|
|
249
249
|
const template = await DocumentTemplate.getByID(this.templateId);
|
|
250
250
|
if (!template) {
|
|
251
251
|
return null;
|
|
@@ -6,14 +6,14 @@ import { Sorter } from '@stamhoofd/utility';
|
|
|
6
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
7
|
|
|
8
8
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
9
|
-
import { render } from '../helpers/Handlebars';
|
|
10
|
-
import { BalanceItem } from './BalanceItem';
|
|
11
|
-
import { Document } from './Document';
|
|
12
|
-
import { Group } from './Group';
|
|
13
|
-
import { Member, RegistrationWithMember } from './Member';
|
|
14
|
-
import { Organization } from './Organization';
|
|
15
|
-
import { Registration } from './Registration';
|
|
16
|
-
import { User } from './User';
|
|
9
|
+
import { render } from '../helpers/Handlebars.js';
|
|
10
|
+
import { BalanceItem } from './BalanceItem.js';
|
|
11
|
+
import { Document } from './Document.js';
|
|
12
|
+
import { Group } from './Group.js';
|
|
13
|
+
import { Member, RegistrationWithMember } from './Member.js';
|
|
14
|
+
import { Organization } from './Organization.js';
|
|
15
|
+
import { Registration } from './Registration.js';
|
|
16
|
+
import { User } from './User.js';
|
|
17
17
|
|
|
18
18
|
export class DocumentTemplate extends QueryableModel {
|
|
19
19
|
static table = 'document_templates';
|
package/src/models/Email.test.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BalanceItemType, EmailRecipientFilter, EmailRecipientFilterType, EmailRecipientsStatus, EmailRecipient as EmailRecipientStruct, EmailRecipientSubfilter, EmailStatus, LimitedFilteredRequest, OrganizationMetaData, PaginatedResponse } from '@stamhoofd/structures';
|
|
2
|
-
import { Email } from './Email';
|
|
3
|
-
import { EmailRecipient } from './EmailRecipient';
|
|
2
|
+
import { Email } from './Email.js';
|
|
3
|
+
import { EmailRecipient } from './EmailRecipient.js';
|
|
4
4
|
import { EmailMocker } from '@stamhoofd/email';
|
|
5
5
|
import { STExpect, TestUtils } from '@stamhoofd/test-utils';
|
|
6
|
-
import { OrganizationFactory } from '../factories/OrganizationFactory';
|
|
7
|
-
import { Platform } from './Platform';
|
|
8
|
-
import { BalanceItemFactory, MemberFactory, UserFactory } from '../factories';
|
|
9
|
-
import { CachedBalance } from './CachedBalance';
|
|
6
|
+
import { OrganizationFactory } from '../factories/OrganizationFactory.js';
|
|
7
|
+
import { Platform } from './Platform.js';
|
|
8
|
+
import { BalanceItemFactory, MemberFactory, UserFactory } from '../factories/index.js';
|
|
9
|
+
import { CachedBalance } from './CachedBalance.js';
|
|
10
10
|
import { Formatter } from '@stamhoofd/utility';
|
|
11
11
|
|
|
12
12
|
async function buildEmail(data: {
|
package/src/models/Email.ts
CHANGED
|
@@ -8,12 +8,12 @@ import { I18n } from '@stamhoofd/backend-i18n';
|
|
|
8
8
|
import { Email as EmailClass, EmailInterfaceRecipient } from '@stamhoofd/email';
|
|
9
9
|
import { isAbortedError, QueueHandler, QueueHandlerOptions } from '@stamhoofd/queues';
|
|
10
10
|
import { QueryableModel, readDynamicSQLExpression, SQL, SQLAlias, SQLCalculation, SQLCount, SQLPlusSign, SQLSelectAs, SQLWhereSign } from '@stamhoofd/sql';
|
|
11
|
-
import { canSendFromEmail, fillRecipientReplacements, getEmailBuilder, mergeReplacementsIfEqual, removeUnusedReplacements, stripRecipientReplacementsForWebDisplay, stripSensitiveRecipientReplacements } from '../helpers/EmailBuilder';
|
|
12
|
-
import { EmailRecipient } from './EmailRecipient';
|
|
13
|
-
import { EmailTemplate } from './EmailTemplate';
|
|
14
|
-
import { Organization } from './Organization';
|
|
15
|
-
import { User } from './User';
|
|
16
|
-
import { Platform } from './Platform';
|
|
11
|
+
import { canSendFromEmail, fillRecipientReplacements, getEmailBuilder, mergeReplacementsIfEqual, removeUnusedReplacements, stripRecipientReplacementsForWebDisplay, stripSensitiveRecipientReplacements } from '../helpers/EmailBuilder.js';
|
|
12
|
+
import { EmailRecipient } from './EmailRecipient.js';
|
|
13
|
+
import { EmailTemplate } from './EmailTemplate.js';
|
|
14
|
+
import { Organization } from './Organization.js';
|
|
15
|
+
import { User } from './User.js';
|
|
16
|
+
import { Platform } from './Platform.js';
|
|
17
17
|
|
|
18
18
|
type Attachment = { filename: string; path?: string; href?: string; content?: string | Buffer; contentType?: string; encoding?: string };
|
|
19
19
|
|
|
@@ -6,7 +6,7 @@ import { ArrayDecoder } from '@simonbackx/simple-encoding';
|
|
|
6
6
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
7
7
|
import { SimpleErrors } from '@simonbackx/simple-errors';
|
|
8
8
|
import { Formatter } from '@stamhoofd/utility';
|
|
9
|
-
import { Member } from './Member';
|
|
9
|
+
import { Member } from './Member.js';
|
|
10
10
|
|
|
11
11
|
export class EmailRecipient extends QueryableModel {
|
|
12
12
|
static table = 'email_recipients';
|
|
@@ -6,8 +6,8 @@ import { EmailTemplateType, Recipient, Replacement } from '@stamhoofd/structures
|
|
|
6
6
|
import basex from 'base-x';
|
|
7
7
|
import crypto from 'crypto';
|
|
8
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
-
import { sendEmailTemplate } from '../helpers/EmailBuilder';
|
|
10
|
-
import { Platform } from './Platform';
|
|
9
|
+
import { sendEmailTemplate } from '../helpers/EmailBuilder.js';
|
|
10
|
+
import { Platform } from './Platform.js';
|
|
11
11
|
|
|
12
12
|
const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
13
13
|
const bs58 = basex(ALPHABET);
|
|
@@ -323,7 +323,7 @@ export class EmailVerificationCode extends QueryableModel {
|
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
const { User } = await import('./User');
|
|
326
|
+
const { User } = await import('./User.js');
|
|
327
327
|
const user = await User.getByID(verificationCode.userId);
|
|
328
328
|
if (!user) {
|
|
329
329
|
return;
|
package/src/models/Event.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { column } from '@simonbackx/simple-database';
|
|
|
2
2
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
3
3
|
import { EventMeta, Event as EventStruct, GroupType, TranslatedString } from '@stamhoofd/structures';
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
|
-
import { Group } from './Group';
|
|
5
|
+
import { Group } from './Group.js';
|
|
6
6
|
|
|
7
7
|
export class Event extends QueryableModel {
|
|
8
8
|
static table = 'events';
|
|
@@ -3,7 +3,7 @@ import { MapDecoder, StringDecoder } from '@simonbackx/simple-encoding';
|
|
|
3
3
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
4
4
|
import { EventNotificationStatus, RecordAnswer, RecordAnswerDecoder } from '@stamhoofd/structures';
|
|
5
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
-
import { Event } from './Event';
|
|
6
|
+
import { Event } from './Event.js';
|
|
7
7
|
|
|
8
8
|
export class EventNotification extends QueryableModel {
|
|
9
9
|
static table = 'event_notifications';
|
package/src/models/Group.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { ArrayDecoder } from '@simonbackx/simple-encoding';
|
|
|
6
6
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
7
7
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
8
8
|
import { Formatter } from '@stamhoofd/utility';
|
|
9
|
-
import { Member, MemberWithRegistrations, OrganizationRegistrationPeriod, Payment, Registration, User } from './';
|
|
9
|
+
import { Member, MemberWithRegistrations, OrganizationRegistrationPeriod, Payment, Registration, User } from './index.js';
|
|
10
10
|
|
|
11
11
|
if (Member === undefined) {
|
|
12
12
|
throw new Error('Import Member is undefined');
|
package/src/models/Member.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { MemberDetails, NationalRegisterNumberOptOut, RegistrationWithTinyMember
|
|
|
4
4
|
import { Formatter } from '@stamhoofd/utility';
|
|
5
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
6
|
|
|
7
|
-
import { Group, MemberResponsibilityRecord, Payment, Registration, User } from './';
|
|
7
|
+
import { Group, MemberResponsibilityRecord, Payment, Registration, User } from './index.js';
|
|
8
8
|
export type MemberWithUsers = Member & {
|
|
9
9
|
users: User[];
|
|
10
10
|
};
|
|
@@ -185,7 +185,7 @@ export class Member extends QueryableModel {
|
|
|
185
185
|
* Fetch all registrations with members with their corresponding (valid) registrations and payment
|
|
186
186
|
*/
|
|
187
187
|
static async getRegistrationWithMembersForPayment(paymentId: string): Promise<RegistrationWithMember[]> {
|
|
188
|
-
const { BalanceItem, BalanceItemPayment } = await import('./');
|
|
188
|
+
const { BalanceItem, BalanceItemPayment } = await import('./index.js');
|
|
189
189
|
|
|
190
190
|
let query = `SELECT ${Member.getDefaultSelect()}, ${Registration.getDefaultSelect()} from \`${Member.table}\`\n`;
|
|
191
191
|
|
|
@@ -4,12 +4,12 @@ import { QueryableModel, SQL, SQLWhereSign } from '@stamhoofd/sql';
|
|
|
4
4
|
import { PlatformMembershipTypeBehaviour } from '@stamhoofd/structures';
|
|
5
5
|
import { Formatter } from '@stamhoofd/utility';
|
|
6
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
|
-
import { BalanceItem } from './BalanceItem';
|
|
8
|
-
import { Member } from './Member';
|
|
9
|
-
import { Organization } from './Organization';
|
|
10
|
-
import { Platform } from './Platform';
|
|
11
|
-
import { Registration } from './Registration';
|
|
12
|
-
import { RegistrationPeriod } from './RegistrationPeriod';
|
|
7
|
+
import { BalanceItem } from './BalanceItem.js';
|
|
8
|
+
import { Member } from './Member.js';
|
|
9
|
+
import { Organization } from './Organization.js';
|
|
10
|
+
import { Platform } from './Platform.js';
|
|
11
|
+
import { Registration } from './Registration.js';
|
|
12
|
+
import { RegistrationPeriod } from './RegistrationPeriod.js';
|
|
13
13
|
|
|
14
14
|
export class MemberPlatformMembership extends QueryableModel {
|
|
15
15
|
static table = 'member_platform_memberships';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { column } from '@simonbackx/simple-database';
|
|
2
2
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
3
3
|
import { MemberDetails } from '@stamhoofd/structures';
|
|
4
|
-
import { Member } from './';
|
|
4
|
+
import { Member } from './index.js';
|
|
5
5
|
|
|
6
6
|
export class MergedMember extends QueryableModel {
|
|
7
7
|
static override table = 'merged_members';
|
|
@@ -6,7 +6,7 @@ import { MollieOnboarding, MollieProfile, MollieStatus } from '@stamhoofd/struct
|
|
|
6
6
|
import { IncomingMessage } from 'http';
|
|
7
7
|
import https from 'https';
|
|
8
8
|
|
|
9
|
-
import { Organization } from './Organization';
|
|
9
|
+
import { Organization } from './Organization.js';
|
|
10
10
|
|
|
11
11
|
function sleep(ms: number) {
|
|
12
12
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
@@ -4,7 +4,7 @@ import { QueryableModel } from '@stamhoofd/sql';
|
|
|
4
4
|
import basex from 'base-x';
|
|
5
5
|
import crypto from 'crypto';
|
|
6
6
|
|
|
7
|
-
import { Organization } from './Organization';
|
|
7
|
+
import { Organization } from './Organization.js';
|
|
8
8
|
|
|
9
9
|
const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
10
10
|
const bs58 = basex(ALPHABET);
|
package/src/models/Order.ts
CHANGED
|
@@ -6,9 +6,9 @@ import { BalanceItemPaymentWithPayment, BalanceItemPaymentWithPrivatePayment, Ba
|
|
|
6
6
|
import { Formatter } from '@stamhoofd/utility';
|
|
7
7
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
8
|
|
|
9
|
-
import { sendEmailTemplate } from '../helpers/EmailBuilder';
|
|
10
|
-
import { WebshopCounter } from '../helpers/WebshopCounter';
|
|
11
|
-
import { BalanceItem, BalanceItemPayment, Organization, Payment, Ticket, Webshop, WebshopDiscountCode } from './';
|
|
9
|
+
import { sendEmailTemplate } from '../helpers/EmailBuilder.js';
|
|
10
|
+
import { WebshopCounter } from '../helpers/WebshopCounter.js';
|
|
11
|
+
import { BalanceItem, BalanceItemPayment, Organization, Payment, Ticket, Webshop, WebshopDiscountCode } from './index.js';
|
|
12
12
|
|
|
13
13
|
export class Order extends QueryableModel {
|
|
14
14
|
static table = 'webshop_orders';
|
|
@@ -111,6 +111,7 @@ export class Order extends QueryableModel {
|
|
|
111
111
|
getUrl(this: Order & { webshop: Webshop & { organization: Organization } }) {
|
|
112
112
|
// 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
|
|
113
113
|
let locale = '';
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
114
115
|
if (this.data.consumerLanguage !== this.webshop.organization.i18n.language) {
|
|
115
116
|
locale = '/' + this.data.consumerLanguage;
|
|
116
117
|
}
|
|
@@ -11,10 +11,10 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
11
11
|
|
|
12
12
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
13
13
|
import { Formatter } from '@stamhoofd/utility';
|
|
14
|
-
import { validateDNSRecords } from '../helpers/DNSValidator';
|
|
15
|
-
import { sendEmailTemplate } from '../helpers/EmailBuilder';
|
|
16
|
-
import { OrganizationServerMetaData } from '../structures/OrganizationServerMetaData';
|
|
17
|
-
import { OrganizationRegistrationPeriod, StripeAccount } from './';
|
|
14
|
+
import { validateDNSRecords } from '../helpers/DNSValidator.js';
|
|
15
|
+
import { sendEmailTemplate } from '../helpers/EmailBuilder.js';
|
|
16
|
+
import { OrganizationServerMetaData } from '../structures/OrganizationServerMetaData.js';
|
|
17
|
+
import { OrganizationRegistrationPeriod, StripeAccount } from './index.js';
|
|
18
18
|
|
|
19
19
|
export class Organization extends QueryableModel {
|
|
20
20
|
static table = 'organizations';
|
|
@@ -815,7 +815,7 @@ export class Organization extends QueryableModel {
|
|
|
815
815
|
|
|
816
816
|
async getAdmins() {
|
|
817
817
|
// Circular reference fix
|
|
818
|
-
const User = (await import('./User')).User;
|
|
818
|
+
const User = (await import('./User.js')).User;
|
|
819
819
|
return await User.getAdmins(this.id, { verified: true });
|
|
820
820
|
}
|
|
821
821
|
|
|
@@ -3,8 +3,8 @@ import { QueryableModel } from '@stamhoofd/sql';
|
|
|
3
3
|
import { Group as GroupStruct, OrganizationRegistrationPeriodSettings, OrganizationRegistrationPeriod as OrganizationRegistrationPeriodStruct, SetupSteps } from '@stamhoofd/structures';
|
|
4
4
|
import { Formatter } from '@stamhoofd/utility';
|
|
5
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
-
import { Group
|
|
7
|
-
|
|
6
|
+
import { Group } from './Group.js';
|
|
7
|
+
import { RegistrationPeriod } from './RegistrationPeriod.js';
|
|
8
8
|
export class OrganizationRegistrationPeriod extends QueryableModel {
|
|
9
9
|
static table = 'organization_registration_periods';
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import { QueryableModel } from '@stamhoofd/sql';
|
|
|
4
4
|
import basex from 'base-x';
|
|
5
5
|
import crypto from 'crypto';
|
|
6
6
|
|
|
7
|
-
import { Organization, User } from './';
|
|
7
|
+
import { Organization, User } from './index.js';
|
|
8
8
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
9
9
|
const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
10
10
|
const bs58 = basex(ALPHABET);
|
|
@@ -6,7 +6,7 @@ import { IncomingMessage } from 'http';
|
|
|
6
6
|
import https from 'https';
|
|
7
7
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
8
|
|
|
9
|
-
import { Organization, Payment } from './';
|
|
9
|
+
import { Organization, Payment } from './index.js';
|
|
10
10
|
import { Formatter } from '@stamhoofd/utility';
|
|
11
11
|
|
|
12
12
|
export class PayconiqPayment extends QueryableModel {
|
package/src/models/Payment.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BalanceItemDetailed, BalanceItemPaymentDetailed, PaymentCustomer, Payme
|
|
|
3
3
|
import { Formatter } from '@stamhoofd/utility';
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
|
|
6
|
-
import { BalanceItem, Organization } from './';
|
|
6
|
+
import { BalanceItem, Organization } from './index.js';
|
|
7
7
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
8
8
|
|
|
9
9
|
export class Payment extends QueryableModel {
|
|
@@ -233,8 +233,8 @@ export class Payment extends QueryableModel {
|
|
|
233
233
|
if (payments.length === 0) {
|
|
234
234
|
return { balanceItemPayments: [], balanceItems: [] };
|
|
235
235
|
}
|
|
236
|
-
const { BalanceItemPayment } = await import('./BalanceItemPayment');
|
|
237
|
-
const { BalanceItem } = await import('./BalanceItem');
|
|
236
|
+
const { BalanceItemPayment } = await import('./BalanceItemPayment.js');
|
|
237
|
+
const { BalanceItem } = await import('./BalanceItem.js');
|
|
238
238
|
|
|
239
239
|
// Load all the related models from the database so we can build the structures
|
|
240
240
|
const balanceItemPayments = await BalanceItemPayment.where({
|
|
@@ -261,8 +261,8 @@ export class Payment extends QueryableModel {
|
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
static async loadBalanceItemRelations(balanceItems: import('./BalanceItem').BalanceItem[]) {
|
|
264
|
-
const { Order } = await import('./Order');
|
|
265
|
-
const { Member } = await import('./Member');
|
|
264
|
+
const { Order } = await import('./Order.js');
|
|
265
|
+
const { Member } = await import('./Member.js');
|
|
266
266
|
|
|
267
267
|
// Load members and orders
|
|
268
268
|
const registrationIds = Formatter.uniqueArray(balanceItems.flatMap(b => b.registrationId ? [b.registrationId] : []));
|
package/src/models/Platform.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { QueryableModel } from '@stamhoofd/sql';
|
|
|
5
5
|
import { PlatformConfig, PlatformPrivateConfig, PlatformServerConfig, Platform as PlatformStruct } from '@stamhoofd/structures';
|
|
6
6
|
import { deepFreeze } from '@stamhoofd/utility';
|
|
7
7
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
|
-
import { RegistrationPeriod } from './RegistrationPeriod';
|
|
8
|
+
import { RegistrationPeriod } from './RegistrationPeriod.js';
|
|
9
9
|
|
|
10
10
|
export class Platform extends QueryableModel {
|
|
11
11
|
static table = 'platform';
|
|
@@ -5,8 +5,8 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
5
5
|
|
|
6
6
|
import { ArrayDecoder, MapDecoder, StringDecoder } from '@simonbackx/simple-encoding';
|
|
7
7
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
8
|
-
import { sendEmailTemplate } from '../helpers/EmailBuilder';
|
|
9
|
-
import { Group, Organization, OrganizationRegistrationPeriod, User } from './';
|
|
8
|
+
import { sendEmailTemplate } from '../helpers/EmailBuilder.js';
|
|
9
|
+
import { Group, Organization, OrganizationRegistrationPeriod, User } from './index.js';
|
|
10
10
|
|
|
11
11
|
export class Registration extends QueryableModel {
|
|
12
12
|
static table = 'registrations';
|
|
@@ -181,7 +181,7 @@ export class Registration extends QueryableModel {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
async getRecipients(organization: Organization, group: import('./').Group) {
|
|
184
|
-
const { Member } = await import('./Member');
|
|
184
|
+
const { Member } = await import('./Member.js');
|
|
185
185
|
|
|
186
186
|
const member = await Member.getWithRegistrations(this.memberId);
|
|
187
187
|
|
|
@@ -220,7 +220,7 @@ export class Registration extends QueryableModel {
|
|
|
220
220
|
async sendEmailTemplate(data: {
|
|
221
221
|
type: EmailTemplateType;
|
|
222
222
|
}) {
|
|
223
|
-
const Group = (await import('./')).Group;
|
|
223
|
+
const Group = (await import('./index.js')).Group;
|
|
224
224
|
const group = await Group.getByID(this.groupId);
|
|
225
225
|
|
|
226
226
|
if (!group) {
|
|
@@ -309,7 +309,7 @@ export class Registration extends QueryableModel {
|
|
|
309
309
|
let group: Group | undefined | null = null;
|
|
310
310
|
|
|
311
311
|
if (groupIds.length == 1) {
|
|
312
|
-
const Group = (await import('./')).Group;
|
|
312
|
+
const Group = (await import('./index.js')).Group;
|
|
313
313
|
group = await Group.getByID(groupIds[0]);
|
|
314
314
|
}
|
|
315
315
|
|
package/src/models/STInvoice.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { SimpleError } from '@simonbackx/simple-errors';
|
|
|
4
4
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
5
5
|
import { OrganizationPaymentMandate, OrganizationPaymentMandateDetails, STInvoiceMeta } from '@stamhoofd/structures';
|
|
6
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
|
-
import { Organization } from './';
|
|
7
|
+
import { Organization } from './index.js';
|
|
8
8
|
|
|
9
9
|
export class STInvoice extends QueryableModel {
|
|
10
10
|
static table = 'stamhoofd_invoices';
|
package/src/models/STPackage.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { Formatter } from '@stamhoofd/utility';
|
|
|
5
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
6
|
|
|
7
7
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
8
|
-
import { sendEmailTemplate } from '../helpers/EmailBuilder';
|
|
9
|
-
import { GroupBuilder } from '../helpers/GroupBuilder';
|
|
10
|
-
import { Organization } from './';
|
|
8
|
+
import { sendEmailTemplate } from '../helpers/EmailBuilder.js';
|
|
9
|
+
import { GroupBuilder } from '../helpers/GroupBuilder.js';
|
|
10
|
+
import { Organization } from './index.js';
|
|
11
11
|
|
|
12
12
|
export class STPackage extends QueryableModel {
|
|
13
13
|
static table = 'stamhoofd_packages';
|
|
@@ -3,7 +3,7 @@ import { QueryableModel } from '@stamhoofd/sql';
|
|
|
3
3
|
import { STInvoiceMeta } from '@stamhoofd/structures';
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
|
|
6
|
-
import { Organization } from './';
|
|
6
|
+
import { Organization } from './index.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Things that should get paid, but are not yet invoiced yet because:
|
package/src/models/Ticket.ts
CHANGED
|
@@ -5,7 +5,7 @@ import basex from 'base-x';
|
|
|
5
5
|
import crypto from 'crypto';
|
|
6
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
7
|
|
|
8
|
-
import { Order, Organization, Webshop } from './';
|
|
8
|
+
import { Order, Organization, Webshop } from './index.js';
|
|
9
9
|
|
|
10
10
|
// Note: 0 and O is removed to prevent typing it in wrong
|
|
11
11
|
const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZ';
|
package/src/models/Token.test.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Database } from '@simonbackx/simple-database';
|
|
2
2
|
|
|
3
|
-
import { OrganizationFactory } from '../factories/OrganizationFactory';
|
|
4
|
-
import { UserFactory } from '../factories/UserFactory';
|
|
5
|
-
import { Organization } from './Organization';
|
|
6
|
-
import { Token } from './Token';
|
|
7
|
-
import { User } from './User';
|
|
3
|
+
import { OrganizationFactory } from '../factories/OrganizationFactory.js';
|
|
4
|
+
import { UserFactory } from '../factories/UserFactory.js';
|
|
5
|
+
import { Organization } from './Organization.js';
|
|
6
|
+
import { Token } from './Token.js';
|
|
7
|
+
import { User } from './User.js';
|
|
8
8
|
|
|
9
9
|
describe('Model.Token', () => {
|
|
10
10
|
const existingToken = 'ABCDEFG';
|
package/src/models/Token.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { QueryableModel } from '@stamhoofd/sql';
|
|
|
3
3
|
import { ApiUser, ApiUserRateLimits } from '@stamhoofd/structures';
|
|
4
4
|
import crypto from 'crypto';
|
|
5
5
|
|
|
6
|
-
import { RateLimiter } from '../helpers/RateLimiter';
|
|
7
|
-
import { User } from './';
|
|
6
|
+
import { RateLimiter } from '../helpers/RateLimiter.js';
|
|
7
|
+
import { User } from './index.js';
|
|
8
8
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
9
9
|
|
|
10
10
|
export type TokenWithUser = Token & { user: User };
|
package/src/models/User.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
7
7
|
|
|
8
8
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
9
9
|
import { QueueHandler } from '@stamhoofd/queues';
|
|
10
|
-
import { Organization } from './';
|
|
10
|
+
import { Organization } from './index.js';
|
|
11
11
|
|
|
12
12
|
export class User extends QueryableModel {
|
|
13
13
|
static table = 'users';
|
|
@@ -213,7 +213,7 @@ export class User extends QueryableModel {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
const Member = (await import('./Member')).Member;
|
|
216
|
+
const Member = (await import('./Member.js')).Member;
|
|
217
217
|
|
|
218
218
|
// Delete placeholder account, but migrate members first
|
|
219
219
|
const members = await Member.getMembersWithRegistrationForUser(other);
|
|
@@ -3,7 +3,7 @@ import { QueryableModel } from '@stamhoofd/sql';
|
|
|
3
3
|
import { Permissions } from '@stamhoofd/structures';
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
|
|
6
|
-
import { Organization, User } from './';
|
|
6
|
+
import { Organization, User } from './index.js';
|
|
7
7
|
|
|
8
8
|
export class UserPermissions extends QueryableModel {
|
|
9
9
|
static table = 'user_permissions';
|
package/src/models/Webshop.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { ArrayDecoder } from '@simonbackx/simple-encoding';
|
|
|
3
3
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
4
4
|
import { Category, DNSRecordStatus, Product, WebshopMetaData, WebshopPrivateMetaData, WebshopServerMetaData } from '@stamhoofd/structures';
|
|
5
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
-
import { validateDNSRecords } from '../helpers/DNSValidator';
|
|
6
|
+
import { validateDNSRecords } from '../helpers/DNSValidator.js';
|
|
7
7
|
|
|
8
|
-
import { Organization } from './';
|
|
8
|
+
import { Organization } from './index.js';
|
|
9
9
|
|
|
10
10
|
export class Webshop extends QueryableModel {
|
|
11
11
|
static table = 'webshops';
|
|
@@ -3,7 +3,7 @@ import { Country } from '@stamhoofd/structures';
|
|
|
3
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
4
4
|
|
|
5
5
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
6
|
-
import { Province } from './Province';
|
|
6
|
+
import { Province } from './Province.js';
|
|
7
7
|
|
|
8
8
|
export class City extends QueryableModel {
|
|
9
9
|
static table = 'cities';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Country } from '@stamhoofd/structures';
|
|
2
2
|
|
|
3
|
-
import { City } from './City';
|
|
4
|
-
import { PostalCode } from './PostalCode';
|
|
5
|
-
import { Province } from './Province';
|
|
3
|
+
import { City } from './City.js';
|
|
4
|
+
import { PostalCode } from './PostalCode.js';
|
|
5
|
+
import { Province } from './Province.js';
|
|
6
6
|
|
|
7
7
|
describe('Model.PostalCode', () => {
|
|
8
8
|
let oostVlaanderen!: Province;
|
|
@@ -5,7 +5,7 @@ import { Country } from '@stamhoofd/structures';
|
|
|
5
5
|
import { Formatter, StringCompare } from '@stamhoofd/utility';
|
|
6
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
7
|
|
|
8
|
-
import { City } from './City';
|
|
8
|
+
import { City } from './City.js';
|
|
9
9
|
|
|
10
10
|
export class PostalCode extends QueryableModel {
|
|
11
11
|
static table = 'postal_codes';
|
|
@@ -2,7 +2,7 @@ import { column, ManyToOneRelation } from '@simonbackx/simple-database';
|
|
|
2
2
|
import { QueryableModel } from '@stamhoofd/sql';
|
|
3
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
4
4
|
|
|
5
|
-
import { City } from './City';
|
|
5
|
+
import { City } from './City.js';
|
|
6
6
|
|
|
7
7
|
export class Street extends QueryableModel {
|
|
8
8
|
static table = 'streets';
|