@stamhoofd/backend 2.89.1 → 2.90.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 +12 -11
- package/src/boot.ts +2 -0
- package/src/crons/balance-emails.ts +1 -6
- package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +1 -1
- package/src/endpoints/admin/organizations/SearchUitpasOrganizersEndpoint.ts +42 -0
- package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +4 -4
- package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +3 -3
- package/src/endpoints/global/events/GetEventsEndpoint.ts +2 -2
- package/src/endpoints/global/events/PatchEventsEndpoint.ts +23 -2
- package/src/endpoints/global/groups/GetGroupsEndpoint.ts +6 -6
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.test.ts +8 -6
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +2 -2
- package/src/endpoints/global/platform/GetPlatformEndpoint.ts +1 -0
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.test.ts +10 -8
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +11 -0
- package/src/endpoints/global/registration-periods/GetRegistrationPeriodsEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentsEndpoint.ts +3 -6
- package/src/endpoints/organization/dashboard/organization/GetUitpasClientIdEndpoint.ts +38 -0
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +31 -1
- package/src/endpoints/organization/dashboard/organization/SetUitpasClientCredentialsEndpoint.ts +108 -0
- package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/receivable-balances/GetReceivableBalancesEndpoint.ts +1 -2
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +9 -1
- package/src/endpoints/organization/dashboard/webshops/GetWebshopOrdersEndpoint.ts +3 -2
- package/src/endpoints/organization/dashboard/webshops/GetWebshopTicketsEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.test.ts +2 -9
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +1 -7
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +68 -1
- package/src/endpoints/organization/webshops/RetrieveUitpasSocialTariffPriceEndpoint.ts +27 -20
- package/src/helpers/AdminPermissionChecker.ts +129 -22
- package/src/helpers/AuthenticatedStructures.ts +13 -10
- package/src/helpers/Context.ts +1 -1
- package/src/helpers/UitpasTokenRepository.ts +125 -35
- package/src/helpers/ViesHelper.ts +2 -1
- package/src/seeds/0000000002-clear-stamhoofd-email-templates.ts +13 -0
- package/src/seeds/0000000003-default-email-templates.ts +20 -0
- package/src/seeds/data/default-email-templates.sql +55 -0
- package/src/services/RegistrationService.ts +6 -4
- package/src/services/uitpas/UitpasService.test.ts +23 -0
- package/src/services/uitpas/UitpasService.ts +222 -0
- package/src/services/uitpas/checkPermissionsFor.ts +111 -0
- package/src/services/uitpas/checkUitpasNumbers.ts +180 -0
- package/src/services/uitpas/getSocialTariffForEvent.ts +90 -0
- package/src/services/uitpas/getSocialTariffForUitpasNumbers.ts +181 -0
- package/src/services/uitpas/searchUitpasOrganizers.ts +93 -0
- package/src/sql-filters/audit-logs.ts +26 -6
- package/src/sql-filters/balance-item-payments.ts +23 -8
- package/src/sql-filters/base-registration-filter-compilers.ts +74 -23
- package/src/sql-filters/documents.ts +46 -13
- package/src/sql-filters/event-notifications.ts +48 -12
- package/src/sql-filters/events.ts +62 -26
- package/src/sql-filters/groups.ts +12 -12
- package/src/sql-filters/members.ts +325 -137
- package/src/sql-filters/orders.ts +96 -48
- package/src/sql-filters/organization-registration-periods.ts +16 -4
- package/src/sql-filters/organizations.ts +105 -99
- package/src/sql-filters/payments.ts +97 -47
- package/src/sql-filters/receivable-balances.ts +56 -19
- package/src/sql-filters/registration-periods.ts +16 -4
- package/src/sql-filters/registrations.ts +2 -2
- package/src/sql-filters/shared/EmailRelationFilterCompilers.ts +14 -8
- package/src/sql-filters/tickets.ts +26 -6
- package/tests/e2e/charge-members.test.ts +1 -0
- package/src/helpers/UitpasNumberValidator.test.ts +0 -23
- package/src/helpers/UitpasNumberValidator.ts +0 -185
|
@@ -1,31 +1,63 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { baseSQLFilterCompilers, createColumnFilter, createExistsFilter, SQL, SQLFilterDefinitions, SQLValueType } from '@stamhoofd/sql';
|
|
2
2
|
|
|
3
3
|
export const eventFilterCompilers: SQLFilterDefinitions = {
|
|
4
4
|
...baseSQLFilterCompilers,
|
|
5
|
-
'id':
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
'
|
|
11
|
-
SQL.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
),
|
|
20
|
-
'
|
|
21
|
-
SQL.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
'id': createColumnFilter({
|
|
6
|
+
expression: SQL.column('id'),
|
|
7
|
+
type: SQLValueType.String,
|
|
8
|
+
nullable: false,
|
|
9
|
+
}),
|
|
10
|
+
'name': createColumnFilter({
|
|
11
|
+
expression: SQL.column('name'),
|
|
12
|
+
type: SQLValueType.String,
|
|
13
|
+
nullable: false,
|
|
14
|
+
}),
|
|
15
|
+
'organizationId': createColumnFilter({
|
|
16
|
+
expression: SQL.column('organizationId'),
|
|
17
|
+
type: SQLValueType.String,
|
|
18
|
+
nullable: true,
|
|
19
|
+
}),
|
|
20
|
+
'startDate': createColumnFilter({
|
|
21
|
+
expression: SQL.column('startDate'),
|
|
22
|
+
type: SQLValueType.Datetime,
|
|
23
|
+
nullable: false,
|
|
24
|
+
}),
|
|
25
|
+
'endDate': createColumnFilter({
|
|
26
|
+
expression: SQL.column('endDate'),
|
|
27
|
+
type: SQLValueType.Datetime,
|
|
28
|
+
nullable: false,
|
|
29
|
+
}),
|
|
30
|
+
'groupIds': createColumnFilter({
|
|
31
|
+
expression: SQL.jsonValue(SQL.column('meta'), '$.value.groups[*].id'),
|
|
32
|
+
type: SQLValueType.JSONArray,
|
|
33
|
+
nullable: true,
|
|
34
|
+
}),
|
|
35
|
+
'groupId': createColumnFilter({
|
|
36
|
+
expression: SQL.column('groupId'),
|
|
37
|
+
type: SQLValueType.String,
|
|
38
|
+
nullable: true,
|
|
39
|
+
}),
|
|
40
|
+
'typeId': createColumnFilter({
|
|
41
|
+
expression: SQL.column('typeId'),
|
|
42
|
+
type: SQLValueType.String,
|
|
43
|
+
nullable: false,
|
|
44
|
+
}),
|
|
45
|
+
'defaultAgeGroupIds': createColumnFilter({
|
|
46
|
+
expression: SQL.jsonValue(SQL.column('meta'), '$.value.defaultAgeGroupIds'),
|
|
47
|
+
type: SQLValueType.JSONArray,
|
|
48
|
+
nullable: true,
|
|
49
|
+
}),
|
|
50
|
+
'organizationTagIds': createColumnFilter({
|
|
51
|
+
expression: SQL.jsonValue(SQL.column('meta'), '$.value.organizationTagIds'),
|
|
52
|
+
type: SQLValueType.JSONArray,
|
|
53
|
+
nullable: true,
|
|
54
|
+
}),
|
|
55
|
+
'meta.visible': createColumnFilter({
|
|
56
|
+
expression: SQL.jsonValue(SQL.column('meta'), '$.value.visible'),
|
|
57
|
+
type: SQLValueType.JSONBoolean,
|
|
58
|
+
nullable: false,
|
|
59
|
+
}),
|
|
60
|
+
'group': createExistsFilter(
|
|
29
61
|
SQL.select()
|
|
30
62
|
.from(SQL.table('groups'))
|
|
31
63
|
.where(
|
|
@@ -34,7 +66,11 @@ export const eventFilterCompilers: SQLFilterDefinitions = {
|
|
|
34
66
|
),
|
|
35
67
|
{
|
|
36
68
|
...baseSQLFilterCompilers,
|
|
37
|
-
organizationId:
|
|
69
|
+
organizationId: createColumnFilter({
|
|
70
|
+
expression: SQL.column('organizationId'),
|
|
71
|
+
type: SQLValueType.String,
|
|
72
|
+
nullable: false,
|
|
73
|
+
}),
|
|
38
74
|
},
|
|
39
75
|
),
|
|
40
76
|
};
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { baseSQLFilterCompilers, createColumnFilter, createWildcardColumnFilter, SQL, SQLJsonExtract, SQLFilterDefinitions, SQLValueType } from '@stamhoofd/sql';
|
|
2
2
|
|
|
3
|
-
export const groupFilterCompilers:
|
|
4
|
-
...
|
|
3
|
+
export const groupFilterCompilers: SQLFilterDefinitions = {
|
|
4
|
+
...baseSQLFilterCompilers,
|
|
5
5
|
id: createColumnFilter({
|
|
6
6
|
expression: SQL.column('id'),
|
|
7
|
-
type:
|
|
7
|
+
type: SQLValueType.String,
|
|
8
8
|
nullable: false,
|
|
9
9
|
}),
|
|
10
10
|
organizationId: createColumnFilter({
|
|
11
11
|
expression: SQL.column('organizationId'),
|
|
12
|
-
type:
|
|
12
|
+
type: SQLValueType.String,
|
|
13
13
|
nullable: false,
|
|
14
14
|
}),
|
|
15
15
|
periodId: createColumnFilter({
|
|
16
16
|
expression: SQL.column('periodId'),
|
|
17
|
-
type:
|
|
17
|
+
type: SQLValueType.String,
|
|
18
18
|
nullable: false,
|
|
19
19
|
}),
|
|
20
20
|
name: createColumnFilter({
|
|
21
21
|
expression: SQL.jsonValue(SQL.column('settings'), '$.value.name'),
|
|
22
|
-
type:
|
|
22
|
+
type: SQLValueType.JSONString,
|
|
23
23
|
nullable: false,
|
|
24
24
|
}),
|
|
25
25
|
status: createColumnFilter({
|
|
26
26
|
expression: SQL.column('status'),
|
|
27
|
-
type:
|
|
27
|
+
type: SQLValueType.String,
|
|
28
28
|
nullable: false,
|
|
29
29
|
}),
|
|
30
30
|
defaultAgeGroupId: createColumnFilter({
|
|
31
31
|
expression: SQL.column('defaultAgeGroupId'),
|
|
32
|
-
type:
|
|
32
|
+
type: SQLValueType.String,
|
|
33
33
|
nullable: true,
|
|
34
34
|
}),
|
|
35
35
|
bundleDiscounts: createWildcardColumnFilter(
|
|
36
36
|
(key: string) => ({
|
|
37
37
|
expression: SQL.jsonValue(SQL.column('settings'), `$.value.prices[*].bundleDiscounts.${SQLJsonExtract.escapePathComponent(key)}`, true),
|
|
38
|
-
type:
|
|
38
|
+
type: SQLValueType.JSONArray,
|
|
39
39
|
nullable: true,
|
|
40
40
|
}),
|
|
41
41
|
(key: string) => ({
|
|
42
|
-
...
|
|
42
|
+
...baseSQLFilterCompilers,
|
|
43
43
|
name: createColumnFilter({
|
|
44
44
|
expression: SQL.jsonValue(SQL.column('settings'), `$.value.prices[*].bundleDiscounts.${SQLJsonExtract.escapePathComponent(key)}.name`, true),
|
|
45
|
-
type:
|
|
45
|
+
type: SQLValueType.JSONArray,
|
|
46
46
|
nullable: true,
|
|
47
47
|
}),
|
|
48
48
|
}),
|