@stamhoofd/backend 2.42.1 → 2.42.3
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.42.
|
|
3
|
+
"version": "2.42.3",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -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.42.
|
|
40
|
-
"@stamhoofd/backend-middleware": "2.42.
|
|
41
|
-
"@stamhoofd/email": "2.42.
|
|
42
|
-
"@stamhoofd/models": "2.42.
|
|
43
|
-
"@stamhoofd/queues": "2.42.
|
|
44
|
-
"@stamhoofd/sql": "2.42.
|
|
45
|
-
"@stamhoofd/structures": "2.42.
|
|
46
|
-
"@stamhoofd/utility": "2.42.
|
|
39
|
+
"@stamhoofd/backend-i18n": "2.42.3",
|
|
40
|
+
"@stamhoofd/backend-middleware": "2.42.3",
|
|
41
|
+
"@stamhoofd/email": "2.42.3",
|
|
42
|
+
"@stamhoofd/models": "2.42.3",
|
|
43
|
+
"@stamhoofd/queues": "2.42.3",
|
|
44
|
+
"@stamhoofd/sql": "2.42.3",
|
|
45
|
+
"@stamhoofd/structures": "2.42.3",
|
|
46
|
+
"@stamhoofd/utility": "2.42.3",
|
|
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": "
|
|
63
|
+
"gitHead": "ee0812960b3c22f3c13c15b0b5a84639aeba5ad8"
|
|
64
64
|
}
|
|
@@ -332,21 +332,6 @@ function getSettlementColumns(): XlsxTransformerColumn<PaymentGeneral>[] {
|
|
|
332
332
|
};
|
|
333
333
|
},
|
|
334
334
|
},
|
|
335
|
-
{
|
|
336
|
-
id: 'settlement.fee',
|
|
337
|
-
name: 'Uitbetalingstransactiekosten',
|
|
338
|
-
width: 25,
|
|
339
|
-
getValue: (object: PaymentGeneralWithStripeAccount) => {
|
|
340
|
-
return {
|
|
341
|
-
value: object.settlement?.fee !== undefined ? (object.settlement?.fee / 100) : null,
|
|
342
|
-
style: {
|
|
343
|
-
numberFormat: {
|
|
344
|
-
id: XlsxBuiltInNumberFormat.Currency2DecimalWithRed,
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
|
-
};
|
|
348
|
-
},
|
|
349
|
-
},
|
|
350
335
|
];
|
|
351
336
|
}
|
|
352
337
|
|
|
@@ -482,6 +482,10 @@ export class AdminPermissionChecker {
|
|
|
482
482
|
}
|
|
483
483
|
|
|
484
484
|
const { balanceItems } = await Payment.loadBalanceItems(payments);
|
|
485
|
+
|
|
486
|
+
if (balanceItems.length === 0) {
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
485
489
|
return await this.canAccessBalanceItems(balanceItems, permissionLevel);
|
|
486
490
|
}
|
|
487
491
|
|
|
@@ -501,7 +505,7 @@ export class AdminPermissionChecker {
|
|
|
501
505
|
}
|
|
502
506
|
|
|
503
507
|
if (balanceItems.length === 0) {
|
|
504
|
-
return
|
|
508
|
+
return true;
|
|
505
509
|
}
|
|
506
510
|
|
|
507
511
|
const organizationId = balanceItems[0].organizationId;
|
|
@@ -31,8 +31,8 @@ export class AuthenticatedStructures {
|
|
|
31
31
|
// Note: permission checking is moved here for performacne to avoid loading the data multiple times
|
|
32
32
|
if (!(await Context.auth.canAccessBalanceItems(balanceItems, PermissionLevel.Read, { registrations, orders }))) {
|
|
33
33
|
throw new SimpleError({
|
|
34
|
-
code: '
|
|
35
|
-
message: '
|
|
34
|
+
code: 'permission_denied',
|
|
35
|
+
message: 'Permission denied',
|
|
36
36
|
human: 'Je hebt geen toegang tot deze betaling',
|
|
37
37
|
});
|
|
38
38
|
}
|
package/src/helpers/FileCache.ts
CHANGED
|
@@ -24,7 +24,7 @@ async function randomBytes(size: number): Promise<Buffer> {
|
|
|
24
24
|
export class FileCache {
|
|
25
25
|
static async getWriteStream(extension: '.xlsx'): Promise<{
|
|
26
26
|
file: string;
|
|
27
|
-
stream:
|
|
27
|
+
stream: Writable;
|
|
28
28
|
}> {
|
|
29
29
|
if (!STAMHOOFD.CACHE_PATH) {
|
|
30
30
|
throw new SimpleError({
|
|
@@ -51,7 +51,7 @@ export class FileCache {
|
|
|
51
51
|
|
|
52
52
|
return {
|
|
53
53
|
file: path + '/' + fileName,
|
|
54
|
-
stream:
|
|
54
|
+
stream: s,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|