@stamhoofd/backend 2.77.5 → 2.78.1

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/.env.ci.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "environment": "test",
3
+ "domains": {
4
+ "dashboard": "dashboard.stamhoofd.dev",
5
+ "registration": {
6
+ "": "stamhoofd.dev",
7
+ "BE": "dev.stamhoofd.be",
8
+ "NL": "dev.stamhoofd.nl"
9
+ },
10
+ "webshop": "shop.stamhoofd.dev",
11
+ "api": "api.stamhoofd.dev"
12
+ },
13
+
14
+ "PORT": 9091,
15
+ "DB_HOST": "127.0.0.1",
16
+ "DB_USER": "root",
17
+ "DB_PASS": "root",
18
+ "DB_DATABASE": "stamhoofd",
19
+
20
+ "SMTP_HOST": "email-smtp.eu-west-1.amazonaws.com",
21
+ "SMTP_USERNAME": "test",
22
+ "SMTP_PASSWORD": "test",
23
+ "SMTP_PORT": 587,
24
+
25
+ "AWS_ACCESS_KEY_ID": "",
26
+ "AWS_SECRET_ACCESS_KEY": "",
27
+ "AWS_REGION": "",
28
+
29
+ "SPACES_ENDPOINT": "ams3.digitaloceanspaces.com",
30
+ "SPACES_BUCKET": "stamhoofd",
31
+ "SPACES_KEY": "",
32
+ "SPACES_SECRET": "",
33
+
34
+ "INTERNAL_SECRET_KEY": "test",
35
+
36
+ "STRIPE_SECRET_KEY": "test",
37
+ "STRIPE_ENDPOINT_SECRET": "test",
38
+ "translationNamespace": "digit",
39
+ "platformName": "ravot",
40
+ "userMode": "organization",
41
+ "WHITELISTED_EMAIL_DESTINATIONS": []
42
+ }
package/index.ts CHANGED
@@ -30,7 +30,7 @@ process.on('unhandledRejection', (error: Error) => {
30
30
  // Set version of saved structures
31
31
  Column.setJSONVersion(Version);
32
32
 
33
- // Set timezone!
33
+ // Set timezone
34
34
  process.env.TZ = 'UTC';
35
35
 
36
36
  // Quick check
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamhoofd/backend",
3
- "version": "2.77.5",
3
+ "version": "2.78.1",
4
4
  "main": "./dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -37,14 +37,14 @@
37
37
  "@simonbackx/simple-encoding": "2.20.0",
38
38
  "@simonbackx/simple-endpoints": "1.19.1",
39
39
  "@simonbackx/simple-logging": "^1.0.1",
40
- "@stamhoofd/backend-i18n": "2.77.5",
41
- "@stamhoofd/backend-middleware": "2.77.5",
42
- "@stamhoofd/email": "2.77.5",
43
- "@stamhoofd/models": "2.77.5",
44
- "@stamhoofd/queues": "2.77.5",
45
- "@stamhoofd/sql": "2.77.5",
46
- "@stamhoofd/structures": "2.77.5",
47
- "@stamhoofd/utility": "2.77.5",
40
+ "@stamhoofd/backend-i18n": "2.78.1",
41
+ "@stamhoofd/backend-middleware": "2.78.1",
42
+ "@stamhoofd/email": "2.78.1",
43
+ "@stamhoofd/models": "2.78.1",
44
+ "@stamhoofd/queues": "2.78.1",
45
+ "@stamhoofd/sql": "2.78.1",
46
+ "@stamhoofd/structures": "2.78.1",
47
+ "@stamhoofd/utility": "2.78.1",
48
48
  "archiver": "^7.0.1",
49
49
  "aws-sdk": "^2.885.0",
50
50
  "axios": "1.6.8",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "0406aa72c5040bf58c903fa27ce31a24c78b370e"
67
+ "gitHead": "3e6f3c8bf1f8ca422b22e53ad0621f7a0cf2f01d"
68
68
  }
@@ -60,11 +60,6 @@ export class GetMembersEndpoint extends Endpoint<Params, Query, Body, ResponseBo
60
60
  },
61
61
  },
62
62
  periodId: platform.periodId,
63
- group: {
64
- defaultAgeGroupId: {
65
- $neq: null,
66
- },
67
- },
68
63
  },
69
64
  },
70
65
  };
@@ -1,6 +1,6 @@
1
1
  import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
2
- import { CachedBalance, Member, Organization } from '@stamhoofd/models';
3
- import { PayableBalanceCollection, PayableBalance } from '@stamhoofd/structures';
2
+ import { CachedBalance, Organization } from '@stamhoofd/models';
3
+ import { PayableBalance, PayableBalanceCollection } from '@stamhoofd/structures';
4
4
 
5
5
  import { Formatter } from '@stamhoofd/utility';
6
6
  import { AuthenticatedStructures } from '../../../helpers/AuthenticatedStructures';
@@ -31,9 +31,7 @@ export class GetUserPayableBalanceEndpoint extends Endpoint<Params, Query, Body,
31
31
  const organization = await Context.setUserOrganizationScope();
32
32
  const { user } = await Context.authenticate();
33
33
 
34
- const memberIds = await Member.getMemberIdsWithRegistrationForUser(user);
35
-
36
- return new Response(await GetUserPayableBalanceEndpoint.getBillingStatusForObjects([user.id, ...memberIds], organization));
34
+ return new Response(await GetUserPayableBalanceEndpoint.getBillingStatusForObjects([user.id], organization));
37
35
  }
38
36
 
39
37
  static async getBillingStatusForObjects(objectIds: string[], organization?: Organization | null) {
@@ -256,6 +256,11 @@ export class AdminPermissionChecker {
256
256
  return true;
257
257
  }
258
258
 
259
+ if (this.getPlatformAccessibleOrganizationTags(permissionLevel) === 'all') {
260
+ // Can access all members: even members without any registration
261
+ return true;
262
+ }
263
+
259
264
  if (member.organizationId && await this.hasFullAccess(member.organizationId, permissionLevel)) {
260
265
  return true;
261
266
  }