@stamhoofd/backend 2.122.6 → 2.122.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamhoofd/backend",
3
- "version": "2.122.6",
3
+ "version": "2.122.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -57,20 +57,20 @@
57
57
  "@simonbackx/simple-endpoints": "1.21.1",
58
58
  "@simonbackx/simple-errors": "1.5.0",
59
59
  "@simonbackx/simple-logging": "1.0.1",
60
- "@stamhoofd/backend-env": "2.122.6",
61
- "@stamhoofd/backend-i18n": "2.122.6",
62
- "@stamhoofd/backend-middleware": "2.122.6",
63
- "@stamhoofd/crons": "2.122.6",
64
- "@stamhoofd/email": "2.122.6",
65
- "@stamhoofd/excel-writer": "2.122.6",
66
- "@stamhoofd/logging": "2.122.6",
67
- "@stamhoofd/models": "2.122.6",
68
- "@stamhoofd/object-differ": "2.122.6",
69
- "@stamhoofd/queues": "2.122.6",
70
- "@stamhoofd/sql": "2.122.6",
71
- "@stamhoofd/structures": "2.122.6",
72
- "@stamhoofd/types": "2.122.6",
73
- "@stamhoofd/utility": "2.122.6",
60
+ "@stamhoofd/backend-env": "2.122.7",
61
+ "@stamhoofd/backend-i18n": "2.122.7",
62
+ "@stamhoofd/backend-middleware": "2.122.7",
63
+ "@stamhoofd/crons": "2.122.7",
64
+ "@stamhoofd/email": "2.122.7",
65
+ "@stamhoofd/excel-writer": "2.122.7",
66
+ "@stamhoofd/logging": "2.122.7",
67
+ "@stamhoofd/models": "2.122.7",
68
+ "@stamhoofd/object-differ": "2.122.7",
69
+ "@stamhoofd/queues": "2.122.7",
70
+ "@stamhoofd/sql": "2.122.7",
71
+ "@stamhoofd/structures": "2.122.7",
72
+ "@stamhoofd/types": "2.122.7",
73
+ "@stamhoofd/utility": "2.122.7",
74
74
  "archiver": "7.0.1",
75
75
  "axios": "1.16.0",
76
76
  "base-x": "3.0.11",
@@ -91,7 +91,7 @@
91
91
  "stripe": "16.12.0"
92
92
  },
93
93
  "devDependencies": {
94
- "@stamhoofd/test-utils": "2.122.6",
94
+ "@stamhoofd/test-utils": "2.122.7",
95
95
  "@types/cookie": "0.6.0",
96
96
  "@types/luxon": "3.7.1",
97
97
  "@types/mailparser": "3.4.6",
@@ -107,5 +107,5 @@
107
107
  "publishConfig": {
108
108
  "access": "public"
109
109
  },
110
- "gitHead": "7a9fd6be1074753301ef8e3dad8f79164522567f"
110
+ "gitHead": "2fcad274db9243e6eea1ab70a63046b949608e2a"
111
111
  }
@@ -3,6 +3,8 @@ import { Group, Organization, OrganizationRegistrationPeriod, Registration, Regi
3
3
  import { GroupPrivateSettings, GroupSettings, GroupStatus, GroupType, TranslatedString } from '@stamhoofd/structures';
4
4
  import { SeedTools } from '../helpers/SeedTools.js';
5
5
 
6
+ const CUTOFF = new Date(1782172800000); // Jun 23 2026 02:00:00 GMT+0200
7
+
6
8
  export default new Migration(async () => {
7
9
  if (STAMHOOFD.environment === 'test') {
8
10
  console.log('skipped in tests');
@@ -68,6 +70,7 @@ async function getCurrentCycle(group: Group) {
68
70
  async function fixRegistrations(organization: Organization, group: Group, dryRun: boolean) {
69
71
  const registrations = await Registration.select()
70
72
  .where('groupId', group.id)
73
+ .andWhere('createdAt', '<', CUTOFF)
71
74
  .fetch();
72
75
 
73
76
  const currentCycle = await getCurrentCycle(group);
@@ -102,6 +105,7 @@ async function fixRegistrations(organization: Organization, group: Group, dryRun
102
105
 
103
106
  const registrationCount = await Registration.select()
104
107
  .where('groupId', group.id)
108
+ .andWhere('createdAt', '<', CUTOFF)
105
109
  .andWhere('cycle', cycle)
106
110
  .count();
107
111
 
@@ -149,6 +153,10 @@ async function fixRegistrations(organization: Organization, group: Group, dryRun
149
153
  await cleanupGroup(newGroup, dryRun);
150
154
  }
151
155
 
156
+ if (!parentCategory) {
157
+ console.error('Could not find parent category to place new groups', allNewGroups.map(i => i.id), 'in');
158
+ }
159
+
152
160
  if (!dryRun) {
153
161
  await archiveOrganizationPeriod.save();
154
162
  await group.updateOccupancy();
@@ -244,6 +252,7 @@ async function migrateRegistrations({ organization, period, originalGroup, newGr
244
252
  const registrations = await Registration.select()
245
253
  .where('groupId', originalGroup.id)
246
254
  .andWhere('cycle', cycle)
255
+ .andWhere('createdAt', '<', CUTOFF)
247
256
  .fetch();
248
257
 
249
258
  for (const registration of registrations) {