@opengis/surveyor 0.0.10 → 0.0.11

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.
Files changed (56) hide show
  1. package/dist/chunks/{AppIcon-Di5F4Bu_.js → AppIcon-CCLzEE-_.js} +1 -1
  2. package/dist/chunks/{AppealDetailField-DNpsGpPY.js → AppealDetailField-CI-1qhs3.js} +2 -2
  3. package/dist/chunks/{AppealStatusBadge-z77wwkFD.js → AppealStatusBadge-CzzI6x8I.js} +2 -2
  4. package/dist/chunks/{AppealStatusBadge-MP1qD952.js → AppealStatusBadge-DYBe9hqP.js} +1 -1
  5. package/dist/chunks/{ApplicationHistorySection-DIoFZwH6.js → ApplicationHistorySection-CPCU_DXH.js} +4 -4
  6. package/dist/chunks/{BaseModal-DP_ilBdg.js → BaseModal-DnwqlJhc.js} +2 -2
  7. package/dist/chunks/{FormFilePicker-D5fAUE0Z.js → FormFilePicker-Dss6pGmO.js} +2 -2
  8. package/dist/chunks/{MapLayerMenu-CI5cbLEC.js → MapLayerMenu-DjYCxEc3.js} +1 -1
  9. package/dist/chunks/{RegistryForm-DbCxZsr0.js → RegistryForm-CEUqFmsF.js} +1 -1
  10. package/dist/chunks/{RegistryFormModal-D_KLGj2d.js → RegistryFormModal-C-Z4MMHi.js} +3 -3
  11. package/dist/chunks/{RegistryToolbar-DvbrASlj.js → RegistryToolbar-CI1MRqzw.js} +6 -6
  12. package/dist/chunks/{SurveyorTeleport-D6-KXe_5.js → SurveyorTeleport-BLEO6we9.js} +1 -1
  13. package/dist/chunks/{UserAccessBadge-B5Q1LvNv.js → UserAccessBadge-D8JfgGfN.js} +1 -1
  14. package/dist/chunks/{UserTypeBadge-CuAMctTK.js → UserTypeBadge-YIwwoCho.js} +1 -1
  15. package/dist/chunks/{VerifiedBadge-D6L7mCdp.js → VerifiedBadge-B__Vs_ce.js} +2 -2
  16. package/dist/chunks/{card-ylC5NYbz.js → card-BElHsAFl.js} +10 -10
  17. package/dist/chunks/{card-Cu8QOSIw.js → card-CU2THiBT.js} +4 -4
  18. package/dist/chunks/{card-BsTSF6aL.js → card-CUDo4kUH.js} +10 -10
  19. package/dist/chunks/{card-CI7ntIHf.js → card-DL7yHB1C.js} +5 -5
  20. package/dist/chunks/{card--XUb1kFK.js → card-UG1mWhcg.js} +4 -4
  21. package/dist/chunks/{card-BrjnXf1N.js → card-sDIYR6YI.js} +6 -6
  22. package/dist/chunks/{certificates-aJ-hvaP-.js → certificates-DKi9CSfc.js} +5 -5
  23. package/dist/chunks/{create-Bi7-j9Ri.js → create-DVZv77Uw.js} +9 -9
  24. package/dist/chunks/{forgot-DnixBqdc.js → forgot-BVzXMKGA.js} +2 -2
  25. package/dist/chunks/{login-BWCQdEkv.js → login-BCib_dtl.js} +2 -2
  26. package/dist/chunks/{map-CwsVIW79.js → map-CNX1_COE.js} +10 -10
  27. package/dist/chunks/{map-layers-BLiEYC4C.js → map-layers-CCJ7G7ZK.js} +5 -5
  28. package/dist/chunks/{organizations-mc6FlSwe.js → organizations-BuMFRKjw.js} +6 -6
  29. package/dist/chunks/{profile-F7mr0poI.js → profile-BI_RIHN1.js} +3 -3
  30. package/dist/chunks/{registration-BRF4985_.js → registration-6nn7GgDS.js} +2 -2
  31. package/dist/chunks/{requests-7pD2ckdx.js → requests-DQRmDemb.js} +4 -4
  32. package/dist/chunks/{requests-BCJN-CNx.js → requests-Dh5jxF06.js} +5 -5
  33. package/dist/chunks/{reset-OZCgLi6f.js → reset-D2uXDfB6.js} +2 -2
  34. package/dist/chunks/{useEntityPath-8s0Y1tjA.js → useEntityPath-n7hCq8zh.js} +1 -1
  35. package/dist/chunks/{users-CAEjpaI1.js → users-LbXn1F2y.js} +6 -6
  36. package/dist/index.css +1 -1
  37. package/dist/index.js +40 -40
  38. package/migrations/20261016120000_map_layers.sql +156 -156
  39. package/migrations/20261016150000_password_reset.sql +15 -15
  40. package/migrations/20261016180000_settlement_lookup.sql +16 -16
  41. package/package.json +1 -1
  42. package/server/dictionaries/index.ts +17 -17
  43. package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
  44. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
  45. package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
  46. package/server/modules/surveyor/services/changeSurveyorPasswordByAdmin.ts +41 -41
  47. package/server/modules/surveyor/services/mapLayers.ts +61 -61
  48. package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -52
  49. package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -53
  50. package/server/modules/surveyor/utils/templates/ds.surveyor_admin_password.pt.hbs +79 -79
  51. package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -79
  52. package/server/plugins/convertVector.ts +1 -1
  53. package/server/resources/helpers/settlement_lookup.ts +7 -7
  54. package/server/resources/surveyor-admin/map_layers.ts +69 -69
  55. package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
  56. package/server/resources/surveyor-admin/organizations.ts +61 -61
@@ -1,79 +1,79 @@
1
- <!DOCTYPE html>
2
- <html lang="uk">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Пароль змінено</title>
8
- <style>
9
- body {
10
- font-family: Arial, sans-serif;
11
- color: #333;
12
- background-color: #f4f4f4;
13
- padding: 20px;
14
- }
15
-
16
- .email-container {
17
- max-width: 600px;
18
- margin: 0 auto;
19
- background-color: #ffffff;
20
- padding: 20px;
21
- border-radius: 5px;
22
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
23
- }
24
-
25
- h1 {
26
- font-size: 20px;
27
- color: #000;
28
- margin-bottom: 20px;
29
- }
30
-
31
- p {
32
- line-height: 1.6;
33
- margin: 10px 0;
34
- }
35
-
36
- .credentials {
37
- font-weight: bold;
38
- margin-top: 10px;
39
- }
40
-
41
- a {
42
- color: #007bff;
43
- text-decoration: none;
44
- }
45
-
46
- a:hover {
47
- text-decoration: underline;
48
- }
49
-
50
- .footer {
51
- font-size: 12px;
52
- color: #777;
53
- margin-top: 20px;
54
- text-align: center;
55
- }
56
- </style>
57
- </head>
58
-
59
- <body>
60
- <div class="email-container">
61
- <h1>Адміністратор порталу змінив Вам пароль до
62
- <a target="_blank" href="{{protocol}}://{{host}}">кабінету геодезиста</a>
63
- </h1>
64
- <p class="credentials">
65
- Логін: <strong>{{login}}</strong><br>
66
- Пароль: <strong>{{password}}</strong>
67
- </p>
68
- <p>
69
- Ви можете увійти на сайт, натиснувши на цьому посиланні або скопіювавши його в адресний рядок вашого
70
- браузера:<br>
71
- <a target="_blank" href="{{protocol}}://{{host}}">{{protocol}}://{{host}}</a>
72
- </p>
73
- <div class="footer">
74
- Це автоматично створений лист, будь ласка, не відповідайте на нього.
75
- </div>
76
- </div>
77
- </body>
78
-
79
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="uk">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Пароль змінено</title>
8
+ <style>
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ color: #333;
12
+ background-color: #f4f4f4;
13
+ padding: 20px;
14
+ }
15
+
16
+ .email-container {
17
+ max-width: 600px;
18
+ margin: 0 auto;
19
+ background-color: #ffffff;
20
+ padding: 20px;
21
+ border-radius: 5px;
22
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 20px;
27
+ color: #000;
28
+ margin-bottom: 20px;
29
+ }
30
+
31
+ p {
32
+ line-height: 1.6;
33
+ margin: 10px 0;
34
+ }
35
+
36
+ .credentials {
37
+ font-weight: bold;
38
+ margin-top: 10px;
39
+ }
40
+
41
+ a {
42
+ color: #007bff;
43
+ text-decoration: none;
44
+ }
45
+
46
+ a:hover {
47
+ text-decoration: underline;
48
+ }
49
+
50
+ .footer {
51
+ font-size: 12px;
52
+ color: #777;
53
+ margin-top: 20px;
54
+ text-align: center;
55
+ }
56
+ </style>
57
+ </head>
58
+
59
+ <body>
60
+ <div class="email-container">
61
+ <h1>Адміністратор порталу змінив Вам пароль до
62
+ <a target="_blank" href="{{protocol}}://{{host}}">кабінету геодезиста</a>
63
+ </h1>
64
+ <p class="credentials">
65
+ Логін: <strong>{{login}}</strong><br>
66
+ Пароль: <strong>{{password}}</strong>
67
+ </p>
68
+ <p>
69
+ Ви можете увійти на сайт, натиснувши на цьому посиланні або скопіювавши його в адресний рядок вашого
70
+ браузера:<br>
71
+ <a target="_blank" href="{{protocol}}://{{host}}">{{protocol}}://{{host}}</a>
72
+ </p>
73
+ <div class="footer">
74
+ Це автоматично створений лист, будь ласка, не відповідайте на нього.
75
+ </div>
76
+ </div>
77
+ </body>
78
+
79
+ </html>
@@ -1,79 +1,79 @@
1
- <!DOCTYPE html>
2
- <html lang="uk">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Відновлення пароля</title>
8
- <style>
9
- body {
10
- font-family: Arial, sans-serif;
11
- color: #333;
12
- background-color: #f4f4f4;
13
- padding: 20px;
14
- }
15
-
16
- .email-container {
17
- max-width: 600px;
18
- margin: 0 auto;
19
- background-color: #ffffff;
20
- padding: 20px;
21
- border-radius: 5px;
22
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
23
- }
24
-
25
- h1 {
26
- font-size: 20px;
27
- color: #000;
28
- margin-bottom: 20px;
29
- }
30
-
31
- p {
32
- line-height: 1.6;
33
- margin: 10px 0;
34
- }
35
-
36
- .credentials {
37
- font-weight: bold;
38
- margin-top: 10px;
39
- }
40
-
41
- a {
42
- color: #007bff;
43
- text-decoration: none;
44
- }
45
-
46
- a:hover {
47
- text-decoration: underline;
48
- }
49
-
50
- .footer {
51
- font-size: 12px;
52
- color: #777;
53
- margin-top: 20px;
54
- text-align: center;
55
- }
56
- </style>
57
- </head>
58
-
59
- <body>
60
- <div class="email-container">
61
- <h1>Відновлення пароля до
62
- <a target="_blank" href="{{protocol}}://{{host}}">кабінету геодезиста</a>
63
- </h1>
64
- <p class="credentials">
65
- Логін: <strong>{{login}}</strong>
66
- </p>
67
- <p>
68
- Щоб встановити новий пароль, відкрийте це посилання або скопіюйте його в адресний рядок вашого браузера:<br>
69
- <a target="_blank" href="{{resetUrl}}">{{resetUrl}}</a>
70
- </p>
71
- <p>Посилання дійсне протягом 1 години і може бути використане лише один раз.</p>
72
- <p>Якщо ви не надсилали запит на відновлення пароля, проігноруйте цей лист — ваш поточний пароль залишиться без змін.</p>
73
- <div class="footer">
74
- Це автоматично створений лист, будь ласка, не відповідайте на нього.
75
- </div>
76
- </div>
77
- </body>
78
-
79
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="uk">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Відновлення пароля</title>
8
+ <style>
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ color: #333;
12
+ background-color: #f4f4f4;
13
+ padding: 20px;
14
+ }
15
+
16
+ .email-container {
17
+ max-width: 600px;
18
+ margin: 0 auto;
19
+ background-color: #ffffff;
20
+ padding: 20px;
21
+ border-radius: 5px;
22
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 20px;
27
+ color: #000;
28
+ margin-bottom: 20px;
29
+ }
30
+
31
+ p {
32
+ line-height: 1.6;
33
+ margin: 10px 0;
34
+ }
35
+
36
+ .credentials {
37
+ font-weight: bold;
38
+ margin-top: 10px;
39
+ }
40
+
41
+ a {
42
+ color: #007bff;
43
+ text-decoration: none;
44
+ }
45
+
46
+ a:hover {
47
+ text-decoration: underline;
48
+ }
49
+
50
+ .footer {
51
+ font-size: 12px;
52
+ color: #777;
53
+ margin-top: 20px;
54
+ text-align: center;
55
+ }
56
+ </style>
57
+ </head>
58
+
59
+ <body>
60
+ <div class="email-container">
61
+ <h1>Відновлення пароля до
62
+ <a target="_blank" href="{{protocol}}://{{host}}">кабінету геодезиста</a>
63
+ </h1>
64
+ <p class="credentials">
65
+ Логін: <strong>{{login}}</strong>
66
+ </p>
67
+ <p>
68
+ Щоб встановити новий пароль, відкрийте це посилання або скопіюйте його в адресний рядок вашого браузера:<br>
69
+ <a target="_blank" href="{{resetUrl}}">{{resetUrl}}</a>
70
+ </p>
71
+ <p>Посилання дійсне протягом 1 години і може бути використане лише один раз.</p>
72
+ <p>Якщо ви не надсилали запит на відновлення пароля, проігноруйте цей лист — ваш поточний пароль залишиться без змін.</p>
73
+ <div class="footer">
74
+ Це автоматично створений лист, будь ласка, не відповідайте на нього.
75
+ </div>
76
+ </div>
77
+ </body>
78
+
79
+ </html>
@@ -28,7 +28,7 @@ const protocol = grpc.loadPackageDefinition(definition) as unknown as {
28
28
  };
29
29
 
30
30
  export async function convertVector(input: ConvertInput): Promise<unknown> {
31
- const address = process.env.MAPNIK_SERVER?.trim();
31
+ const address = process.env.MAPNIK_SERVER?.trim() || process.env?.['mapnik.server'];
32
32
  if (!address) {
33
33
  throw new FCoreError("VECTOR_CONVERTER_UNAVAILABLE", "Не налаштовано MAPNIK_SERVER", 503);
34
34
  }
@@ -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;