@opengis/surveyor 0.0.10 → 0.0.12
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/dist/chunks/{AppIcon-Di5F4Bu_.js → AppIcon-CO70tpMX.js} +1 -1
- package/dist/chunks/{AppealDetailField-DNpsGpPY.js → AppealDetailField-DNRGpnyD.js} +2 -2
- package/dist/chunks/{AppealStatusBadge-z77wwkFD.js → AppealStatusBadge-BlAaNUSK.js} +2 -2
- package/dist/chunks/{AppealStatusBadge-MP1qD952.js → AppealStatusBadge-Ct3EcB4_.js} +15 -1
- package/dist/chunks/{ApplicationHistorySection-DIoFZwH6.js → ApplicationHistorySection-D7KPV2cX.js} +155 -141
- package/dist/chunks/{BaseModal-DP_ilBdg.js → BaseModal-SjP521X9.js} +2 -2
- package/dist/chunks/{FormFilePicker-D5fAUE0Z.js → FormFilePicker-DxPQlxgy.js} +2 -2
- package/dist/chunks/{MapLayerMenu-CI5cbLEC.js → MapLayerMenu-AUeTqgEp.js} +1 -1
- package/dist/chunks/{RegistryForm-DbCxZsr0.js → RegistryForm-BlK1lExt.js} +2 -2
- package/dist/chunks/{RegistryFormModal-D_KLGj2d.js → RegistryFormModal-DhzEpxys.js} +3 -3
- package/dist/chunks/{RegistryToolbar-DvbrASlj.js → RegistryToolbar-DXOEcD84.js} +45 -154
- package/dist/chunks/{SurveyorTeleport-D6-KXe_5.js → SurveyorTeleport-CnSF0Ptl.js} +1 -1
- package/dist/chunks/TablePagination-CUtnDQQ_.js +116 -0
- package/dist/chunks/{UserAccessBadge-B5Q1LvNv.js → UserAccessBadge-DyZDv7Oo.js} +1 -1
- package/dist/chunks/{UserTypeBadge-CuAMctTK.js → UserTypeBadge-LvnMuKGo.js} +1 -1
- package/dist/chunks/{VerifiedBadge-D6L7mCdp.js → VerifiedBadge-bk0n-rlC.js} +2 -2
- package/dist/chunks/{buildSchema-CccjX9TJ.js → buildSchema-DEfhZEM8.js} +1 -1
- package/dist/chunks/{card-ylC5NYbz.js → card-BBx1zR0E.js} +316 -306
- package/dist/chunks/{card-BsTSF6aL.js → card-Bj4zFzbe.js} +47 -44
- package/dist/chunks/{card-CI7ntIHf.js → card-C-ohjNkC.js} +5 -5
- package/dist/chunks/{card--XUb1kFK.js → card-DEJs9IIP.js} +6 -6
- package/dist/chunks/card-VnUCFC7v.js +609 -0
- package/dist/chunks/{card-BrjnXf1N.js → card-_YyJbLNI.js} +13 -10
- package/dist/chunks/{certificates-BnseQylH.js → certificates-Be6u7Cix.js} +1 -1
- package/dist/chunks/{certificates-aJ-hvaP-.js → certificates-DtfZTFN9.js} +13 -12
- package/dist/chunks/{create-Bi7-j9Ri.js → create-Cgeu7aKO.js} +348 -293
- package/dist/chunks/{filterQuery-CvfZrkTC.js → filterQuery-Dka-mIso.js} +7 -3
- package/dist/chunks/{forgot-DnixBqdc.js → forgot-DoG6vXhq.js} +2 -2
- package/dist/chunks/{form-DDjELqZ9.js → form-CEfc_shb.js} +1 -1
- package/dist/chunks/{form-Bh6i5n1U.js → form-DZ3CbtkT.js} +1 -1
- package/dist/chunks/{login-BWCQdEkv.js → login-BWGylcSU.js} +2 -2
- package/dist/chunks/{map-CwsVIW79.js → map-DkKsEnCM.js} +1126 -831
- package/dist/chunks/{map-layers-BLiEYC4C.js → map-layers-BmuIMLHa.js} +13 -12
- package/dist/chunks/{organizations-mc6FlSwe.js → organizations-BO1dIl7v.js} +15 -14
- package/dist/chunks/{profile-F7mr0poI.js → profile-CkwMFh82.js} +3 -3
- package/dist/chunks/{registration-BRF4985_.js → registration-3GLgq-ae.js} +2 -2
- package/dist/chunks/{requests-7pD2ckdx.js → requests-BZ2jrt5J.js} +12 -11
- package/dist/chunks/{requests-BCJN-CNx.js → requests-rWq8ok3C.js} +5 -5
- package/dist/chunks/{resendSurveyorRegistration-BHTTVIw1.js → resendSurveyorRegistration-BQjL9IgM.js} +1 -1
- package/dist/chunks/{reset-OZCgLi6f.js → reset-CP9LsLkC.js} +2 -2
- package/dist/chunks/{resources-2e8RFqWR.js → resources-Cj8BzrBX.js} +18 -13
- package/dist/chunks/{surveyorAccount-C7UiiIYg.js → surveyorAccount-Cfba7ZVZ.js} +1 -1
- package/dist/chunks/{useEntityPath-8s0Y1tjA.js → useEntityPath-C5Owtidc.js} +1 -1
- package/dist/chunks/{users-CAEjpaI1.js → users-DOiQeVwn.js} +15 -14
- package/dist/index.css +1 -1
- package/dist/index.js +40 -40
- package/migrations/20261016120000_map_layers.sql +156 -156
- package/migrations/20261016150000_password_reset.sql +15 -15
- package/migrations/20261016180000_settlement_lookup.sql +16 -16
- package/package.json +1 -1
- package/server/dictionaries/index.ts +17 -17
- package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
- package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
- package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
- package/server/modules/surveyor/services/mapLayers.ts +61 -61
- package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -52
- package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -53
- package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -79
- package/server/plugins/convertVector.ts +1 -1
- package/server/resources/helpers/settlement_lookup.ts +7 -7
- package/server/resources/surveyor-admin/map_layers.ts +69 -69
- package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
- package/server/resources/surveyor-admin/organizations.ts +61 -61
- package/dist/chunks/card-Cu8QOSIw.js +0 -539
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// The view prefixes the settlement name with its type for lookup labels.
|
|
2
|
-
export const settlementLookup = {
|
|
3
|
-
table: "surveyor.settlement_lookup",
|
|
4
|
-
value: "katottg",
|
|
5
|
-
text: "settlement_text",
|
|
6
|
-
filterFields: ["level"],
|
|
7
|
-
};
|
|
1
|
+
// The view prefixes the settlement name with its type for lookup labels.
|
|
2
|
+
export const settlementLookup = {
|
|
3
|
+
table: "surveyor.settlement_lookup",
|
|
4
|
+
value: "katottg",
|
|
5
|
+
text: "settlement_text",
|
|
6
|
+
filterFields: ["level"],
|
|
7
|
+
};
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import type { ResourceContract } from "@opengis/fcore";
|
|
2
|
-
import mapLayerComponents from "../../dictionaries/surveyor/map_layer_components.js";
|
|
3
|
-
import mapLayerGroups from "../../dictionaries/surveyor/map_layer_groups.js";
|
|
4
|
-
import mapLayerTypes from "../../dictionaries/surveyor/map_layer_types.js";
|
|
5
|
-
import { userLookup } from "../helpers/user_lookup.js";
|
|
6
|
-
|
|
7
|
-
// Panel order is sort_order inside each group; the cabinet reads the list via /api/surveyor/map/layers.
|
|
8
|
-
export default {
|
|
9
|
-
version: 1,
|
|
10
|
-
name: "map_layers",
|
|
11
|
-
module: "surveyor",
|
|
12
|
-
title: "Шари карти",
|
|
13
|
-
table: "surveyor.map_layers",
|
|
14
|
-
key: "layer_id",
|
|
15
|
-
display: ["name"],
|
|
16
|
-
displayFields: ["code", "layer_group", "layer_type"],
|
|
17
|
-
access: "admin",
|
|
18
|
-
operations: ["read", "create", "update", "delete"],
|
|
19
|
-
searchable: ["name", "code"],
|
|
20
|
-
fields: {
|
|
21
|
-
layer_id: { type: "text", write: false, filterable: true },
|
|
22
|
-
code: { type: "string", write: true, required: true, searchable: true, sortable: true, pattern: "^[a-z0-9_-]+$" },
|
|
23
|
-
name: { type: "string", write: true, required: true, searchable: true, sortable: true },
|
|
24
|
-
layer_group: {
|
|
25
|
-
type: "string",
|
|
26
|
-
write: true,
|
|
27
|
-
required: true,
|
|
28
|
-
filterable: true,
|
|
29
|
-
sortable: true,
|
|
30
|
-
dictionary: mapLayerGroups.code,
|
|
31
|
-
enum: mapLayerGroups.items.map(({ code }) => code),
|
|
32
|
-
},
|
|
33
|
-
layer_type: {
|
|
34
|
-
type: "string",
|
|
35
|
-
write: true,
|
|
36
|
-
required: true,
|
|
37
|
-
filterable: true,
|
|
38
|
-
dictionary: mapLayerTypes.code,
|
|
39
|
-
enum: mapLayerTypes.items.map(({ code }) => code),
|
|
40
|
-
},
|
|
41
|
-
tiles: { type: "string", array: true, write: true },
|
|
42
|
-
scheme: { type: "string", write: true, enum: ["xyz", "tms"] },
|
|
43
|
-
source_layer: { type: "string", write: true },
|
|
44
|
-
attribution: { type: "string", write: true },
|
|
45
|
-
minzoom: { type: "integer", write: true, minimum: 0, maximum: 24 },
|
|
46
|
-
maxzoom: { type: "integer", write: true, minimum: 0, maximum: 24 },
|
|
47
|
-
opacity: { type: "number", write: true, minimum: 0, maximum: 1 },
|
|
48
|
-
style: { type: "json", write: true },
|
|
49
|
-
legend: { type: "json", write: true },
|
|
50
|
-
preview: { type: "string", write: true },
|
|
51
|
-
// No `enum`: FCore checks it against the whole value, so arrays never pass.
|
|
52
|
-
// Allowed values are enforced by map_layers_components_check.
|
|
53
|
-
components: {
|
|
54
|
-
type: "string",
|
|
55
|
-
array: true,
|
|
56
|
-
write: true,
|
|
57
|
-
filterable: true,
|
|
58
|
-
dictionary: mapLayerComponents.code,
|
|
59
|
-
},
|
|
60
|
-
sort_order: { type: "integer", write: true, sortable: true },
|
|
61
|
-
is_default: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
|
|
62
|
-
has_filters: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
|
|
63
|
-
enabled: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
|
|
64
|
-
created_by: { type: "string", write: false, lookup: userLookup },
|
|
65
|
-
created_at: { type: "timestamp", write: false, sortable: true },
|
|
66
|
-
updated_by: { type: "string", write: false, lookup: userLookup },
|
|
67
|
-
updated_at: { type: "timestamp", write: false, sortable: true },
|
|
68
|
-
},
|
|
69
|
-
} satisfies ResourceContract;
|
|
1
|
+
import type { ResourceContract } from "@opengis/fcore";
|
|
2
|
+
import mapLayerComponents from "../../dictionaries/surveyor/map_layer_components.js";
|
|
3
|
+
import mapLayerGroups from "../../dictionaries/surveyor/map_layer_groups.js";
|
|
4
|
+
import mapLayerTypes from "../../dictionaries/surveyor/map_layer_types.js";
|
|
5
|
+
import { userLookup } from "../helpers/user_lookup.js";
|
|
6
|
+
|
|
7
|
+
// Panel order is sort_order inside each group; the cabinet reads the list via /api/surveyor/map/layers.
|
|
8
|
+
export default {
|
|
9
|
+
version: 1,
|
|
10
|
+
name: "map_layers",
|
|
11
|
+
module: "surveyor",
|
|
12
|
+
title: "Шари карти",
|
|
13
|
+
table: "surveyor.map_layers",
|
|
14
|
+
key: "layer_id",
|
|
15
|
+
display: ["name"],
|
|
16
|
+
displayFields: ["code", "layer_group", "layer_type"],
|
|
17
|
+
access: "admin",
|
|
18
|
+
operations: ["read", "create", "update", "delete"],
|
|
19
|
+
searchable: ["name", "code"],
|
|
20
|
+
fields: {
|
|
21
|
+
layer_id: { type: "text", write: false, filterable: true },
|
|
22
|
+
code: { type: "string", write: true, required: true, searchable: true, sortable: true, pattern: "^[a-z0-9_-]+$" },
|
|
23
|
+
name: { type: "string", write: true, required: true, searchable: true, sortable: true },
|
|
24
|
+
layer_group: {
|
|
25
|
+
type: "string",
|
|
26
|
+
write: true,
|
|
27
|
+
required: true,
|
|
28
|
+
filterable: true,
|
|
29
|
+
sortable: true,
|
|
30
|
+
dictionary: mapLayerGroups.code,
|
|
31
|
+
enum: mapLayerGroups.items.map(({ code }) => code),
|
|
32
|
+
},
|
|
33
|
+
layer_type: {
|
|
34
|
+
type: "string",
|
|
35
|
+
write: true,
|
|
36
|
+
required: true,
|
|
37
|
+
filterable: true,
|
|
38
|
+
dictionary: mapLayerTypes.code,
|
|
39
|
+
enum: mapLayerTypes.items.map(({ code }) => code),
|
|
40
|
+
},
|
|
41
|
+
tiles: { type: "string", array: true, write: true },
|
|
42
|
+
scheme: { type: "string", write: true, enum: ["xyz", "tms"] },
|
|
43
|
+
source_layer: { type: "string", write: true },
|
|
44
|
+
attribution: { type: "string", write: true },
|
|
45
|
+
minzoom: { type: "integer", write: true, minimum: 0, maximum: 24 },
|
|
46
|
+
maxzoom: { type: "integer", write: true, minimum: 0, maximum: 24 },
|
|
47
|
+
opacity: { type: "number", write: true, minimum: 0, maximum: 1 },
|
|
48
|
+
style: { type: "json", write: true },
|
|
49
|
+
legend: { type: "json", write: true },
|
|
50
|
+
preview: { type: "string", write: true },
|
|
51
|
+
// No `enum`: FCore checks it against the whole value, so arrays never pass.
|
|
52
|
+
// Allowed values are enforced by map_layers_components_check.
|
|
53
|
+
components: {
|
|
54
|
+
type: "string",
|
|
55
|
+
array: true,
|
|
56
|
+
write: true,
|
|
57
|
+
filterable: true,
|
|
58
|
+
dictionary: mapLayerComponents.code,
|
|
59
|
+
},
|
|
60
|
+
sort_order: { type: "integer", write: true, sortable: true },
|
|
61
|
+
is_default: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
|
|
62
|
+
has_filters: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
|
|
63
|
+
enabled: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
|
|
64
|
+
created_by: { type: "string", write: false, lookup: userLookup },
|
|
65
|
+
created_at: { type: "timestamp", write: false, sortable: true },
|
|
66
|
+
updated_by: { type: "string", write: false, lookup: userLookup },
|
|
67
|
+
updated_at: { type: "timestamp", write: false, sortable: true },
|
|
68
|
+
},
|
|
69
|
+
} satisfies ResourceContract;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import type { ResourceContract } from '@opengis/fcore';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
name: 'organization_surveyors',
|
|
5
|
-
version: 1,
|
|
6
|
-
table: 'surveyor.organization_surveyors',
|
|
7
|
-
key: 'org_id',
|
|
8
|
-
module: 'surveyor',
|
|
9
|
-
operations: ["read"],
|
|
10
|
-
fields: {
|
|
11
|
-
org_id: { type: 'text', read: true, },
|
|
12
|
-
surveyor_id: { type: 'text', read: true },
|
|
13
|
-
first_name: { type: 'text', read: true },
|
|
14
|
-
last_name: { type: 'text', read: true },
|
|
15
|
-
middle_name: { type: 'text', read: true },
|
|
16
|
-
enabled: { type: 'boolean', read: true },
|
|
17
|
-
created_by: { type: 'text', read: true },
|
|
18
|
-
created_at: { type: 'timestamp', read: true },
|
|
19
|
-
registered_at: { type: 'timestamp', read: true },
|
|
20
|
-
email: { type: 'text', read: true },
|
|
21
|
-
phone: { type: 'text', read: true },
|
|
22
|
-
certificate_id: {
|
|
23
|
-
type: 'text',
|
|
24
|
-
read: true,
|
|
25
|
-
lookup: { table: 'surveyor.certificates', value: 'certificate_id', text: 'number_certificate' },
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
joins: [{
|
|
29
|
-
sql: `LEFT JOIN LATERAL (select first_name, last_name, middle_name, registered_at, email, phone, certificate_id, enabled AS surveyor_enabled from surveyor.surveyors s where s.surveyor_id = t.surveyor_id) as s on true`
|
|
30
|
-
}]
|
|
31
|
-
|
|
1
|
+
import type { ResourceContract } from '@opengis/fcore';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'organization_surveyors',
|
|
5
|
+
version: 1,
|
|
6
|
+
table: 'surveyor.organization_surveyors',
|
|
7
|
+
key: 'org_id',
|
|
8
|
+
module: 'surveyor',
|
|
9
|
+
operations: ["read"],
|
|
10
|
+
fields: {
|
|
11
|
+
org_id: { type: 'text', read: true, },
|
|
12
|
+
surveyor_id: { type: 'text', read: true },
|
|
13
|
+
first_name: { type: 'text', read: true },
|
|
14
|
+
last_name: { type: 'text', read: true },
|
|
15
|
+
middle_name: { type: 'text', read: true },
|
|
16
|
+
enabled: { type: 'boolean', read: true },
|
|
17
|
+
created_by: { type: 'text', read: true },
|
|
18
|
+
created_at: { type: 'timestamp', read: true },
|
|
19
|
+
registered_at: { type: 'timestamp', read: true },
|
|
20
|
+
email: { type: 'text', read: true },
|
|
21
|
+
phone: { type: 'text', read: true },
|
|
22
|
+
certificate_id: {
|
|
23
|
+
type: 'text',
|
|
24
|
+
read: true,
|
|
25
|
+
lookup: { table: 'surveyor.certificates', value: 'certificate_id', text: 'number_certificate' },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
joins: [{
|
|
29
|
+
sql: `LEFT JOIN LATERAL (select first_name, last_name, middle_name, registered_at, email, phone, certificate_id, enabled AS surveyor_enabled from surveyor.surveyors s where s.surveyor_id = t.surveyor_id) as s on true`
|
|
30
|
+
}]
|
|
31
|
+
|
|
32
32
|
} satisfies ResourceContract;
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import type { ResourceContract } from "@opengis/fcore";
|
|
2
|
-
import { userLookup } from "../helpers/user_lookup.js";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
version: 1,
|
|
6
|
-
name: "organizations",
|
|
7
|
-
module: "surveyor",
|
|
8
|
-
title: "Організації",
|
|
9
|
-
table: "surveyor.organizations",
|
|
10
|
-
key: "org_id",
|
|
11
|
-
display: ["name"],
|
|
12
|
-
access: "admin",
|
|
13
|
-
operations: ["read", "create", "update", "delete"],
|
|
14
|
-
searchable: ["name", "email", "phone"],
|
|
15
|
-
capabilities: ["notes", "files"],
|
|
16
|
-
fields: {
|
|
17
|
-
org_id: {
|
|
18
|
-
type: "text",
|
|
19
|
-
write: false,
|
|
20
|
-
filterable: true,
|
|
21
|
-
lookup: {
|
|
22
|
-
table: "surveyor.organizations",
|
|
23
|
-
value: "org_id",
|
|
24
|
-
text: "name",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
name: { type: "string", write: true, required: true, searchable: true, sortable: true },
|
|
28
|
-
legal_address: { type: "text", write: true },
|
|
29
|
-
phone: { type: "string", write: true, required: true, searchable: true },
|
|
30
|
-
email: { type: "string", write: true, required: true, searchable: true },
|
|
31
|
-
scan_path: { type: "file", write: true },
|
|
32
|
-
created_by: { type: "string", write: false, lookup: userLookup },
|
|
33
|
-
updated_by: { type: "string", write: false, lookup: userLookup },
|
|
34
|
-
created_at: { type: "timestamp", write: false, filterable: true, sortable: true },
|
|
35
|
-
updated_at: { type: "timestamp", write: false, sortable: true },
|
|
36
|
-
verified: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
|
|
37
|
-
},
|
|
38
|
-
relations: {
|
|
39
|
-
surveyors: {
|
|
40
|
-
resource: "organization_surveyors",
|
|
41
|
-
localKey: "org_id",
|
|
42
|
-
// `enabled` is the surveyor account flag; the membership flag is exposed separately.
|
|
43
|
-
fields: [
|
|
44
|
-
't."org_id"',
|
|
45
|
-
't."surveyor_id"',
|
|
46
|
-
's."first_name"',
|
|
47
|
-
's."last_name"',
|
|
48
|
-
's."middle_name"',
|
|
49
|
-
's."email"',
|
|
50
|
-
's."phone"',
|
|
51
|
-
's."registered_at"',
|
|
52
|
-
's."certificate_id"',
|
|
53
|
-
's."surveyor_enabled" AS "enabled"',
|
|
54
|
-
't."enabled" AS "membership_enabled"',
|
|
55
|
-
't."created_by"',
|
|
56
|
-
't."created_at"',
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
applications: { resource: "applications", localKey: "org_id", foreignKey: "org_id" },
|
|
60
|
-
},
|
|
61
|
-
} satisfies ResourceContract;
|
|
1
|
+
import type { ResourceContract } from "@opengis/fcore";
|
|
2
|
+
import { userLookup } from "../helpers/user_lookup.js";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
version: 1,
|
|
6
|
+
name: "organizations",
|
|
7
|
+
module: "surveyor",
|
|
8
|
+
title: "Організації",
|
|
9
|
+
table: "surveyor.organizations",
|
|
10
|
+
key: "org_id",
|
|
11
|
+
display: ["name"],
|
|
12
|
+
access: "admin",
|
|
13
|
+
operations: ["read", "create", "update", "delete"],
|
|
14
|
+
searchable: ["name", "email", "phone"],
|
|
15
|
+
capabilities: ["notes", "files"],
|
|
16
|
+
fields: {
|
|
17
|
+
org_id: {
|
|
18
|
+
type: "text",
|
|
19
|
+
write: false,
|
|
20
|
+
filterable: true,
|
|
21
|
+
lookup: {
|
|
22
|
+
table: "surveyor.organizations",
|
|
23
|
+
value: "org_id",
|
|
24
|
+
text: "name",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
name: { type: "string", write: true, required: true, searchable: true, sortable: true },
|
|
28
|
+
legal_address: { type: "text", write: true },
|
|
29
|
+
phone: { type: "string", write: true, required: true, searchable: true },
|
|
30
|
+
email: { type: "string", write: true, required: true, searchable: true },
|
|
31
|
+
scan_path: { type: "file", write: true },
|
|
32
|
+
created_by: { type: "string", write: false, lookup: userLookup },
|
|
33
|
+
updated_by: { type: "string", write: false, lookup: userLookup },
|
|
34
|
+
created_at: { type: "timestamp", write: false, filterable: true, sortable: true },
|
|
35
|
+
updated_at: { type: "timestamp", write: false, sortable: true },
|
|
36
|
+
verified: { type: "boolean", write: true, filterable: true, dictionary: "yes-no" },
|
|
37
|
+
},
|
|
38
|
+
relations: {
|
|
39
|
+
surveyors: {
|
|
40
|
+
resource: "organization_surveyors",
|
|
41
|
+
localKey: "org_id",
|
|
42
|
+
// `enabled` is the surveyor account flag; the membership flag is exposed separately.
|
|
43
|
+
fields: [
|
|
44
|
+
't."org_id"',
|
|
45
|
+
't."surveyor_id"',
|
|
46
|
+
's."first_name"',
|
|
47
|
+
's."last_name"',
|
|
48
|
+
's."middle_name"',
|
|
49
|
+
's."email"',
|
|
50
|
+
's."phone"',
|
|
51
|
+
's."registered_at"',
|
|
52
|
+
's."certificate_id"',
|
|
53
|
+
's."surveyor_enabled" AS "enabled"',
|
|
54
|
+
't."enabled" AS "membership_enabled"',
|
|
55
|
+
't."created_by"',
|
|
56
|
+
't."created_at"',
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
applications: { resource: "applications", localKey: "org_id", foreignKey: "org_id" },
|
|
60
|
+
},
|
|
61
|
+
} satisfies ResourceContract;
|