spine-framework 0.3.136 → 0.3.137
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.
|
@@ -417,14 +417,43 @@ BEGIN
|
|
|
417
417
|
'account',
|
|
418
418
|
'Account',
|
|
419
419
|
'Organization or tenant account',
|
|
420
|
-
|
|
420
|
+
jsonb_build_object(
|
|
421
|
+
'scope', 'platform',
|
|
422
|
+
'fields', jsonb_build_object(
|
|
423
|
+
'display_name', jsonb_build_object('data_type', 'text', 'label', 'Account Name', 'required', true, 'system', true, 'validation', null),
|
|
424
|
+
'description', jsonb_build_object('data_type', 'textarea', 'label', 'Description', 'required', false, 'system', true, 'validation', null),
|
|
425
|
+
'is_active', jsonb_build_object('data_type', 'boolean', 'label', 'Active', 'required', true, 'system', true, 'validation', null),
|
|
426
|
+
'created_at', jsonb_build_object('data_type', 'datetime', 'label', 'Created', 'required', false, 'system', true, 'readonly', true, 'validation', null),
|
|
427
|
+
'updated_at', jsonb_build_object('data_type', 'datetime', 'label', 'Updated', 'required', false, 'system', true, 'readonly', true, 'validation', null)
|
|
428
|
+
),
|
|
429
|
+
'views', jsonb_build_object(
|
|
430
|
+
'default_list', jsonb_build_object('type', 'list', 'display', 'table', 'label', 'Accounts',
|
|
431
|
+
'fields', jsonb_build_object(
|
|
432
|
+
'display_name', jsonb_build_object('sortable', true, 'display_type', 'text'),
|
|
433
|
+
'is_active', jsonb_build_object('sortable', true, 'display_type', 'badge'),
|
|
434
|
+
'created_at', jsonb_build_object('sortable', true, 'display_type', 'timestamp')
|
|
435
|
+
),
|
|
436
|
+
'default_sort', jsonb_build_object('field', 'created_at', 'direction', 'desc')
|
|
437
|
+
),
|
|
438
|
+
'default_detail', jsonb_build_object('type', 'detail', 'label', 'Account',
|
|
439
|
+
'sections', jsonb_build_array(
|
|
440
|
+
jsonb_build_object('title', 'Details', 'fields', jsonb_build_array('display_name', 'description', 'is_active')),
|
|
441
|
+
jsonb_build_object('title', 'Metadata', 'fields', jsonb_build_array('created_at', 'updated_at'))
|
|
442
|
+
)
|
|
443
|
+
)
|
|
444
|
+
),
|
|
445
|
+
'record_permissions', jsonb_build_object(
|
|
446
|
+
'system_admin', ARRAY['create', 'read', 'update', 'delete']
|
|
447
|
+
),
|
|
448
|
+
'functionality', null
|
|
449
|
+
),
|
|
421
450
|
'{}'::jsonb,
|
|
422
451
|
'pack',
|
|
423
452
|
true
|
|
424
453
|
)
|
|
425
454
|
ON CONFLICT (app_id, kind, slug) DO NOTHING;
|
|
426
455
|
|
|
427
|
-
-- Seed the spine-system master account
|
|
456
|
+
-- Seed the spine-system master account, stamping the account type's design/validation schema
|
|
428
457
|
INSERT INTO public.accounts (id, slug, display_name, description, data, is_active, design_schema, validation_schema, type_id)
|
|
429
458
|
SELECT
|
|
430
459
|
gen_random_uuid(),
|
|
@@ -433,10 +462,12 @@ BEGIN
|
|
|
433
462
|
'Master system account for internal Spine operations',
|
|
434
463
|
'{}'::jsonb,
|
|
435
464
|
true,
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
465
|
+
t.design_schema,
|
|
466
|
+
t.validation_schema,
|
|
467
|
+
t.id
|
|
468
|
+
FROM public.types t
|
|
469
|
+
WHERE t.kind = 'account' AND t.slug = 'account'
|
|
470
|
+
AND NOT EXISTS (SELECT 1 FROM public.accounts a WHERE a.slug = 'spine-system');
|
|
440
471
|
|
|
441
472
|
UPDATE public.accounts
|
|
442
473
|
SET type_id = (SELECT id FROM public.types WHERE slug = 'account' AND app_id = v_spine_core_app_id LIMIT 1)
|
|
@@ -9,14 +9,43 @@ SELECT
|
|
|
9
9
|
'account',
|
|
10
10
|
'Account',
|
|
11
11
|
'Organization or tenant account',
|
|
12
|
-
|
|
12
|
+
jsonb_build_object(
|
|
13
|
+
'scope', 'platform',
|
|
14
|
+
'fields', jsonb_build_object(
|
|
15
|
+
'display_name', jsonb_build_object('data_type', 'text', 'label', 'Account Name', 'required', true, 'system', true, 'validation', null),
|
|
16
|
+
'description', jsonb_build_object('data_type', 'textarea', 'label', 'Description', 'required', false, 'system', true, 'validation', null),
|
|
17
|
+
'is_active', jsonb_build_object('data_type', 'boolean', 'label', 'Active', 'required', true, 'system', true, 'validation', null),
|
|
18
|
+
'created_at', jsonb_build_object('data_type', 'datetime', 'label', 'Created', 'required', false, 'system', true, 'readonly', true, 'validation', null),
|
|
19
|
+
'updated_at', jsonb_build_object('data_type', 'datetime', 'label', 'Updated', 'required', false, 'system', true, 'readonly', true, 'validation', null)
|
|
20
|
+
),
|
|
21
|
+
'views', jsonb_build_object(
|
|
22
|
+
'default_list', jsonb_build_object('type', 'list', 'display', 'table', 'label', 'Accounts',
|
|
23
|
+
'fields', jsonb_build_object(
|
|
24
|
+
'display_name', jsonb_build_object('sortable', true, 'display_type', 'text'),
|
|
25
|
+
'is_active', jsonb_build_object('sortable', true, 'display_type', 'badge'),
|
|
26
|
+
'created_at', jsonb_build_object('sortable', true, 'display_type', 'timestamp')
|
|
27
|
+
),
|
|
28
|
+
'default_sort', jsonb_build_object('field', 'created_at', 'direction', 'desc')
|
|
29
|
+
),
|
|
30
|
+
'default_detail', jsonb_build_object('type', 'detail', 'label', 'Account',
|
|
31
|
+
'sections', jsonb_build_array(
|
|
32
|
+
jsonb_build_object('title', 'Details', 'fields', jsonb_build_array('display_name', 'description', 'is_active')),
|
|
33
|
+
jsonb_build_object('title', 'Metadata', 'fields', jsonb_build_array('created_at', 'updated_at'))
|
|
34
|
+
)
|
|
35
|
+
)
|
|
36
|
+
),
|
|
37
|
+
'record_permissions', jsonb_build_object(
|
|
38
|
+
'system_admin', ARRAY['create', 'read', 'update', 'delete']
|
|
39
|
+
),
|
|
40
|
+
'functionality', null
|
|
41
|
+
),
|
|
13
42
|
'{}'::jsonb,
|
|
14
43
|
'pack',
|
|
15
44
|
true
|
|
16
45
|
WHERE NOT EXISTS (SELECT 1 FROM public.types WHERE kind = 'account' AND slug = 'account')
|
|
17
46
|
ON CONFLICT (app_id, kind, slug) DO NOTHING;
|
|
18
47
|
|
|
19
|
-
-- Ensure the spine-system master account exists
|
|
48
|
+
-- Ensure the spine-system master account exists, stamping the account type's schema
|
|
20
49
|
INSERT INTO public.accounts (id, slug, display_name, description, data, is_active, design_schema, validation_schema, type_id)
|
|
21
50
|
SELECT
|
|
22
51
|
gen_random_uuid(),
|
|
@@ -25,7 +54,9 @@ SELECT
|
|
|
25
54
|
'Master system account for internal Spine operations',
|
|
26
55
|
'{}'::jsonb,
|
|
27
56
|
true,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
57
|
+
t.design_schema,
|
|
58
|
+
t.validation_schema,
|
|
59
|
+
t.id
|
|
60
|
+
FROM public.types t
|
|
61
|
+
WHERE t.kind = 'account' AND t.slug = 'account'
|
|
62
|
+
AND NOT EXISTS (SELECT 1 FROM public.accounts a WHERE a.slug = 'spine-system');
|