@stamhoofd/backend 2.40.1 → 2.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamhoofd/backend",
3
- "version": "2.40.1",
3
+ "version": "2.42.0",
4
4
  "main": "./dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "license": "UNLICENCED",
11
11
  "scripts": {
12
- "dev": "echo 'Waiting for shared backend packages...' && wait-on ../../shared/env/dist/index.js && echo 'Start building backend API' && concurrently -r 'yarn build --watch --preserveWatchOutput' \"wait-on ./dist/index.js && nodemon --quiet --inspect=5858 --watch dist --watch '../../../shared/*/dist/' --watch '../../shared/*/dist/' --ext .ts,.json,.sql,.js --watch .env.json --delay 1000ms --exec 'node --enable-source-maps ./dist/index.js' --signal SIGTERM\"",
12
+ "dev": "echo 'Waiting for shared backend packages...' && wait-on ../../shared/middleware/dist/index.js && echo 'Start building backend API' && concurrently -r 'yarn build --watch --preserveWatchOutput' \"wait-on ./dist/index.js && nodemon --quiet --inspect=5858 --watch dist --watch '../../../shared/*/dist/' --watch '../../shared/*/dist/' --ext .ts,.json,.sql,.js --watch .env.json --delay 1000ms --exec 'node --enable-source-maps ./dist/index.js' --signal SIGTERM\"",
13
13
  "dev:backend": "yarn dev",
14
14
  "build": "rm -rf ./dist/src/migrations && rm -rf ./dist/src/seeds && tsc -b",
15
15
  "build:full": "yarn clear && yarn build",
@@ -36,14 +36,14 @@
36
36
  "@simonbackx/simple-encoding": "2.15.1",
37
37
  "@simonbackx/simple-endpoints": "1.14.0",
38
38
  "@simonbackx/simple-logging": "^1.0.1",
39
- "@stamhoofd/backend-i18n": "2.40.1",
40
- "@stamhoofd/backend-middleware": "2.40.1",
41
- "@stamhoofd/email": "2.40.1",
42
- "@stamhoofd/models": "2.40.1",
43
- "@stamhoofd/queues": "2.40.1",
44
- "@stamhoofd/sql": "2.40.1",
45
- "@stamhoofd/structures": "2.40.1",
46
- "@stamhoofd/utility": "2.40.1",
39
+ "@stamhoofd/backend-i18n": "2.42.0",
40
+ "@stamhoofd/backend-middleware": "2.42.0",
41
+ "@stamhoofd/email": "2.42.0",
42
+ "@stamhoofd/models": "2.42.0",
43
+ "@stamhoofd/queues": "2.42.0",
44
+ "@stamhoofd/sql": "2.42.0",
45
+ "@stamhoofd/structures": "2.42.0",
46
+ "@stamhoofd/utility": "2.42.0",
47
47
  "archiver": "^7.0.1",
48
48
  "aws-sdk": "^2.885.0",
49
49
  "axios": "1.6.8",
@@ -60,5 +60,5 @@
60
60
  "postmark": "^4.0.5",
61
61
  "stripe": "^16.6.0"
62
62
  },
63
- "gitHead": "31eb933097eb608655f755de9df912c21a420963"
63
+ "gitHead": "fa8a47af38cc79eecaf7934cd1b15d5b20fd3e2d"
64
64
  }
@@ -113,6 +113,10 @@ export class PatchPlatformEndpoint extends Endpoint<
113
113
  if (d.defaultMembershipTypeId !== undefined) {
114
114
  shouldUpdateMemberships = true;
115
115
  }
116
+
117
+ if (d.minimumRequiredMembers !== undefined) {
118
+ shouldUpdateSetupSteps = true;
119
+ }
116
120
  }
117
121
  }
118
122
  }
@@ -1,7 +1,6 @@
1
1
  import { Decoder } from '@simonbackx/simple-encoding';
2
2
  import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
3
3
  import { SimpleError } from '@simonbackx/simple-errors';
4
- import { I18n } from '@stamhoofd/backend-i18n';
5
4
  import { Email } from '@stamhoofd/email';
6
5
  import { getEmailBuilder, RateLimiter } from '@stamhoofd/models';
7
6
  import { EmailRequest, Recipient } from '@stamhoofd/structures';
@@ -267,6 +267,11 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
267
267
  throw Context.auth.error('Je hebt geen toegangsrechten om deze groep te wijzigen');
268
268
  }
269
269
 
270
+ const previousProperties = {
271
+ deletedAt: model.deletedAt,
272
+ defaultAgeGroupId: model.defaultAgeGroupId,
273
+ };
274
+
270
275
  if (struct.settings) {
271
276
  struct.settings.period = undefined; // Not allowed to patch manually
272
277
  model.settings.patchOrPut(struct.settings);
@@ -376,7 +381,9 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
376
381
  }
377
382
  }
378
383
 
379
- await model.updateOccupancy();
384
+ await model.updateOccupancy({
385
+ previousProperties,
386
+ });
380
387
  await model.save();
381
388
 
382
389
  if (struct.deletedAt !== undefined || struct.defaultAgeGroupId !== undefined) {
@@ -122,6 +122,14 @@ export const memberFilterCompilers: SQLFilterDefinitions = {
122
122
  SQL.column('member_responsibility_records', 'groupId'),
123
123
  ),
124
124
  )
125
+ .join(
126
+ SQL.leftJoin(
127
+ SQL.table('organizations'),
128
+ ).where(
129
+ SQL.column('organizations', 'id'),
130
+ SQL.column('member_responsibility_records', 'organizationId'),
131
+ ),
132
+ )
125
133
  .where(
126
134
  SQL.column('memberId'),
127
135
  SQL.column('members', 'id'),
@@ -139,6 +147,7 @@ export const memberFilterCompilers: SQLFilterDefinitions = {
139
147
  id: createSQLColumnFilterCompiler(SQL.column('groups', 'id')),
140
148
  defaultAgeGroupId: createSQLColumnFilterCompiler(SQL.column('groups', 'defaultAgeGroupId')),
141
149
  }),
150
+ organization: createSQLFilterNamespace(organizationFilterCompilers),
142
151
  },
143
152
  ),
144
153