@coffer-org/plugin-documents 3.1.2 → 5.0.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/dist/person_identity/index.js +20 -10
- package/dist/personal_document/index.js +59 -30
- package/dist/runtime/index.js +10 -3
- package/dist/schema.js +4762 -1735
- package/locales/en.json +1 -2
- package/locales/ru.json +1 -2
- package/locales/uk.json +1 -2
- package/package.json +5 -4
|
@@ -7,17 +7,27 @@ export default defineExtend({
|
|
|
7
7
|
attachTo: [{ library: 'people', shelf: 'person' }],
|
|
8
8
|
claude: `Canonical person identity (not tied to a physical document).
|
|
9
9
|
nationality — ISO alpha-2. variants — given/family name per language (field.keyed by lang: name+surname).`,
|
|
10
|
-
fields:
|
|
11
|
-
field.
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
fields: {
|
|
11
|
+
nationality: field.string({
|
|
12
|
+
label: 'documents.person_identity.fields.nationality',
|
|
13
|
+
options: 'countries',
|
|
14
|
+
strict: true,
|
|
15
|
+
noSearch: true,
|
|
16
|
+
}),
|
|
17
|
+
variants: field.keyed({
|
|
14
18
|
label: 'documents.person_identity.fields.variants',
|
|
15
19
|
icon: 'lucide:languages',
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
fields: {
|
|
21
|
+
lang: field.string({
|
|
22
|
+
label: 'documents.person_identity.variants.lang',
|
|
23
|
+
options: 'languages',
|
|
24
|
+
strict: true,
|
|
25
|
+
noSearch: true,
|
|
26
|
+
}),
|
|
27
|
+
name: field.string({ label: 'documents.person_identity.variants.name' }),
|
|
28
|
+
surname: field.string({ label: 'documents.person_identity.variants.surname' }),
|
|
29
|
+
},
|
|
30
|
+
by: 'lang',
|
|
21
31
|
}),
|
|
22
|
-
|
|
32
|
+
},
|
|
23
33
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineShelf } from '@coffer-org/sdk/shelf';
|
|
2
|
-
import { field } from '@coffer-org/sdk/fields';
|
|
2
|
+
import { field, fromShelf } from '@coffer-org/sdk/fields';
|
|
3
3
|
export default defineShelf({
|
|
4
4
|
shelf: 'personal_document',
|
|
5
5
|
library: 'documents',
|
|
@@ -8,43 +8,72 @@ export default defineShelf({
|
|
|
8
8
|
views: {
|
|
9
9
|
list: ['owner', 'type', 'surname', 'expires'],
|
|
10
10
|
},
|
|
11
|
-
fields:
|
|
12
|
-
field.title({
|
|
13
|
-
field.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
field.
|
|
18
|
-
|
|
11
|
+
fields: {
|
|
12
|
+
name: field.title({ label: 'core.fields.name' }),
|
|
13
|
+
about: field.illustrated({
|
|
14
|
+
label: 'documents.personal_document.fields.about',
|
|
15
|
+
fields: { image: field.avatar({ ui: { role: 'avatar' } }), text: field.text({ rules: { max: 1000 } }) },
|
|
16
|
+
}),
|
|
17
|
+
idcard: field.idcard({
|
|
18
|
+
number: { number: field.string({ label: 'documents.personal_document.fields.number', rules: { max: 50 } }) },
|
|
19
|
+
meta: {
|
|
20
|
+
issued: field.date({ label: 'documents.personal_document.fields.issued' }),
|
|
21
|
+
authority: field.string({ label: 'documents.personal_document.fields.authority', rules: { max: 200 } }),
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
countdown: field.countdown({
|
|
25
|
+
source: { expires: field.reminder({ label: 'documents.personal_document.fields.expires', rules: { lead: 60 } }) },
|
|
26
|
+
}),
|
|
27
|
+
surname: field.string({
|
|
28
|
+
label: 'documents.personal_document.fields.surname',
|
|
29
|
+
rules: { max: 100 },
|
|
30
|
+
ui: { span: 6 },
|
|
31
|
+
}),
|
|
32
|
+
given_names: field.string({
|
|
33
|
+
label: 'documents.personal_document.fields.given_names',
|
|
34
|
+
rules: { max: 200 },
|
|
35
|
+
ui: { span: 6 },
|
|
36
|
+
}),
|
|
37
|
+
birth_date: field.date({ label: 'documents.personal_document.fields.birth_date', ui: { span: 4 } }),
|
|
38
|
+
sex: field.string({
|
|
19
39
|
label: 'documents.personal_document.fields.sex',
|
|
40
|
+
strict: true,
|
|
41
|
+
noSearch: true,
|
|
20
42
|
options: [
|
|
21
43
|
{ value: 'M', title: 'documents.personal_document.options.sex.M' },
|
|
22
44
|
{ value: 'F', title: 'documents.personal_document.options.sex.F' },
|
|
23
45
|
],
|
|
46
|
+
ui: { span: 4 },
|
|
24
47
|
}),
|
|
25
|
-
field.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
field.string({ key: 'authority', label: 'documents.personal_document.fields.authority', rules: { max: 200 } }),
|
|
32
|
-
field.relation({
|
|
33
|
-
key: 'storage',
|
|
34
|
-
label: 'documents.personal_document.fields.storage',
|
|
35
|
-
options: { library: 'things', shelf: 'storage_location' },
|
|
48
|
+
nationality: field.string({
|
|
49
|
+
label: 'documents.personal_document.fields.nationality',
|
|
50
|
+
options: 'countries',
|
|
51
|
+
strict: true,
|
|
52
|
+
noSearch: true,
|
|
53
|
+
ui: { span: 4 },
|
|
36
54
|
}),
|
|
37
|
-
field.
|
|
38
|
-
field.relation({
|
|
39
|
-
key: 'owner',
|
|
55
|
+
owner: field.relation({
|
|
40
56
|
label: 'documents.personal_document.fields.owner',
|
|
41
|
-
options: { library: 'people', shelf: 'person' },
|
|
57
|
+
options: fromShelf({ library: 'people', shelf: 'person' }),
|
|
58
|
+
ui: { span: 6 },
|
|
59
|
+
}),
|
|
60
|
+
storage: field.relation({
|
|
61
|
+
label: 'documents.personal_document.fields.storage',
|
|
62
|
+
options: fromShelf({ library: 'things', shelf: 'storage_location' }),
|
|
63
|
+
ui: { span: 6 },
|
|
42
64
|
}),
|
|
43
|
-
field.
|
|
44
|
-
|
|
45
|
-
|
|
65
|
+
record_no: field.string({
|
|
66
|
+
label: 'documents.personal_document.fields.record_no',
|
|
67
|
+
rules: { max: 50 },
|
|
68
|
+
ui: { span: 6 },
|
|
69
|
+
}),
|
|
70
|
+
mrz: field.string({ label: 'documents.personal_document.fields.mrz', rules: { max: 200 }, ui: { span: 6 } }),
|
|
71
|
+
photos: field.image({ label: 'documents.personal_document.fields.photos', multiple: true }),
|
|
72
|
+
type: field.string({
|
|
46
73
|
label: 'core.fields.type',
|
|
47
74
|
required: true,
|
|
75
|
+
strict: true,
|
|
76
|
+
noSearch: true,
|
|
48
77
|
options: [
|
|
49
78
|
{ value: 'P', title: 'documents.personal_document.options.type.P' },
|
|
50
79
|
{ value: 'PA', title: 'documents.personal_document.options.type.PA' },
|
|
@@ -56,7 +85,7 @@ export default defineShelf({
|
|
|
56
85
|
{ value: 'OT', title: 'documents.personal_document.options.type.OT' },
|
|
57
86
|
],
|
|
58
87
|
}),
|
|
59
|
-
field.tags({
|
|
60
|
-
field.text({
|
|
61
|
-
|
|
88
|
+
tags: field.tags({ label: 'documents.personal_document.fields.tags' }),
|
|
89
|
+
notes: field.text({ label: 'documents.personal_document.fields.notes', rules: { max: 1000 } }),
|
|
90
|
+
},
|
|
62
91
|
});
|
package/dist/runtime/index.js
CHANGED
|
@@ -17,6 +17,13 @@ export const serverHooks = {
|
|
|
17
17
|
});
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
version: 2,
|
|
22
|
+
up: async ({ table }) => {
|
|
23
|
+
await table('documents__personal_document').renameColumn('logo', 'about__image');
|
|
24
|
+
await table('documents__personal_document').renameColumn('description', 'about__text');
|
|
25
|
+
},
|
|
26
|
+
},
|
|
20
27
|
],
|
|
21
28
|
seed: [
|
|
22
29
|
{
|
|
@@ -26,7 +33,7 @@ export const serverHooks = {
|
|
|
26
33
|
await localPost('documents', 'personal_document', {
|
|
27
34
|
name: 'Passport',
|
|
28
35
|
type: 'P',
|
|
29
|
-
logo,
|
|
36
|
+
about: { image: logo },
|
|
30
37
|
surname: 'Johnson',
|
|
31
38
|
given_names: 'Emma',
|
|
32
39
|
sex: 'F',
|
|
@@ -45,7 +52,7 @@ export const serverHooks = {
|
|
|
45
52
|
await localPost('documents', 'personal_document', {
|
|
46
53
|
name: 'ID card',
|
|
47
54
|
type: 'ID',
|
|
48
|
-
logo,
|
|
55
|
+
about: { image: logo },
|
|
49
56
|
surname: 'Miller',
|
|
50
57
|
given_names: 'James',
|
|
51
58
|
sex: 'M',
|
|
@@ -64,7 +71,7 @@ export const serverHooks = {
|
|
|
64
71
|
await localPost('documents', 'personal_document', {
|
|
65
72
|
name: "Driver's license",
|
|
66
73
|
type: 'DL',
|
|
67
|
-
logo,
|
|
74
|
+
about: { image: logo },
|
|
68
75
|
surname: 'Davis',
|
|
69
76
|
given_names: 'Olivia',
|
|
70
77
|
sex: 'F',
|