@carthooks/arcubase-cli 0.1.2 → 0.1.3
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/bundle/arcubase-admin.mjs +907 -10
- package/bundle/arcubase.mjs +907 -10
- package/dist/runtime/command_registry.d.ts +8 -0
- package/dist/runtime/command_registry.d.ts.map +1 -1
- package/dist/runtime/command_registry.js +35 -0
- package/dist/runtime/entity_save_schema.d.ts +15 -0
- package/dist/runtime/entity_save_schema.d.ts.map +1 -0
- package/dist/runtime/entity_save_schema.js +641 -0
- package/dist/runtime/errors.d.ts +10 -0
- package/dist/runtime/errors.d.ts.map +1 -1
- package/dist/runtime/execute.d.ts.map +1 -1
- package/dist/runtime/execute.js +89 -10
- package/dist/runtime/zod_registry.d.ts +6 -0
- package/dist/runtime/zod_registry.d.ts.map +1 -1
- package/dist/runtime/zod_registry.js +133 -0
- package/dist/tests/command_registry.test.js +5 -0
- package/dist/tests/entity_save_schema.test.d.ts +2 -0
- package/dist/tests/entity_save_schema.test.d.ts.map +1 -0
- package/dist/tests/entity_save_schema.test.js +221 -0
- package/dist/tests/execute_validation.test.js +450 -0
- package/dist/tests/help.test.js +33 -0
- package/package.json +1 -1
- package/sdk-dist/docs/runtime-reference/README.md +177 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/README.md +120 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/address.md +34 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/boolean.md +37 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/button.md +47 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/checkbox.md +61 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/datasets.md +35 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/datetime.md +40 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/department.md +33 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/departments.md +34 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/divider.md +39 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/file.md +44 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/formula.md +44 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/image.md +43 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/linkto.md +67 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/location.md +32 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/lookup.md +41 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/member.md +37 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/members.md +31 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/number.md +70 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/query.md +50 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/radio.md +53 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/relation.md +55 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/relationfield.md +38 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/rollup.md +54 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/select.md +63 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/selects.md +51 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/serialnumber.md +48 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/signature.md +31 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/status.md +70 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/subform.md +74 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/tags.md +19 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/text.md +76 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/textarea.md +47 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/workflow_status.md +17 -0
- package/sdk-dist/docs/runtime-reference/entity-schema.md +197 -0
- package/sdk-dist/docs/runtime-reference/examples/README.md +51 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/README.md +20 -0
- package/sdk-dist/docs/runtime-reference/examples/mes-01/README.md +21 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/README.md +164 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/app-overview.md +79 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/create-app.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/goods-receipt.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/goods-receipt.schema.json +159 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/item-master.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/item-master.schema.json +179 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/picking-list.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/picking-list.schema.json +168 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/purchase-order.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/purchase-order.schema.json +417 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.bulk-update.json +22 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.query.json +10 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.row.insert.json +28 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.schema.json +398 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.selection.condition.json +13 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.selection.ids.json +7 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/stock-issue.create-entity.json +3 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/stock-issue.schema.json +137 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/README.md +21 -0
- package/sdk-dist/docs/runtime-reference/row-crud.md +186 -0
- package/sdk-dist/docs/runtime-reference/search-and-bulk-actions.md +494 -0
- package/sdk-dist/docs/runtime-reference/table-lifecycle.md +123 -0
- package/sdk-dist/docs/runtime-reference/workflow/README.md +19 -0
- package/src/runtime/command_registry.ts +47 -0
- package/src/runtime/entity_save_schema.ts +708 -0
- package/src/runtime/errors.ts +11 -0
- package/src/runtime/execute.ts +123 -10
- package/src/runtime/zod_registry.ts +154 -0
- package/src/tests/command_registry.test.ts +6 -0
- package/src/tests/entity_save_schema.test.ts +236 -0
- package/src/tests/execute_validation.test.ts +598 -0
- package/src/tests/help.test.ts +39 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# selects
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Multi-select dropdown field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: normal`
|
|
10
|
+
- `useFormula: true`
|
|
11
|
+
- `useRelation: true`
|
|
12
|
+
- `inlineEdtiable: true`
|
|
13
|
+
- `events: ['change']`
|
|
14
|
+
|
|
15
|
+
## Minimal shape
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "selects",
|
|
20
|
+
"options": {
|
|
21
|
+
"placeholder": "",
|
|
22
|
+
"lengthLimit": false,
|
|
23
|
+
"lengthMin": 0,
|
|
24
|
+
"lengthMax": 10,
|
|
25
|
+
"options": {
|
|
26
|
+
"mode": "custom",
|
|
27
|
+
"colorful": false,
|
|
28
|
+
"items": [
|
|
29
|
+
{ "key": 1, "value": "Option 1" }
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Common options
|
|
37
|
+
|
|
38
|
+
- `placeholder`
|
|
39
|
+
- `lengthLimit`
|
|
40
|
+
- `lengthMin`
|
|
41
|
+
- `lengthMax`
|
|
42
|
+
- `options.items`
|
|
43
|
+
- `options.mode`
|
|
44
|
+
- `options.colorful`
|
|
45
|
+
- `options.relation`
|
|
46
|
+
- `options.relation_filter`
|
|
47
|
+
- `options.international`
|
|
48
|
+
|
|
49
|
+
## Constraints
|
|
50
|
+
|
|
51
|
+
- `options.items` at least one item
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# serialnumber
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Serial number field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: advanced`
|
|
10
|
+
- `operator: text`
|
|
11
|
+
- `switchgroup: text`
|
|
12
|
+
- `inlineEdtiable: true`
|
|
13
|
+
- `oncopy` clears the copied value
|
|
14
|
+
|
|
15
|
+
## Minimal shape
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "serialnumber",
|
|
20
|
+
"options": {
|
|
21
|
+
"parts": [
|
|
22
|
+
{
|
|
23
|
+
"mode": "buildin",
|
|
24
|
+
"type": "serial",
|
|
25
|
+
"options": {
|
|
26
|
+
"length": 6,
|
|
27
|
+
"lenfixed": true,
|
|
28
|
+
"random": false,
|
|
29
|
+
"reset": "no"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Common parts
|
|
38
|
+
|
|
39
|
+
- `buildin/string`
|
|
40
|
+
- `buildin/date`
|
|
41
|
+
- `buildin/serial`
|
|
42
|
+
- `field`
|
|
43
|
+
|
|
44
|
+
## Constraints
|
|
45
|
+
|
|
46
|
+
- `parts` at least one item
|
|
47
|
+
- `buildin/date` requires `format` or `perdefinedFormat`
|
|
48
|
+
- `buildin/serial` requires `length`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# signature
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Signature field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `notImportAble: true`
|
|
10
|
+
- `notExportAble: true`
|
|
11
|
+
- `events: ['change']`
|
|
12
|
+
|
|
13
|
+
## Minimal shape
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"type": "signature",
|
|
18
|
+
"options": {
|
|
19
|
+
"placeholder": ""
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Common options
|
|
25
|
+
|
|
26
|
+
- `placeholder`
|
|
27
|
+
|
|
28
|
+
## Constraints
|
|
29
|
+
|
|
30
|
+
- `required` is controlled by generic field flags
|
|
31
|
+
- In the current direct-write pathyou may keep only an empty `placeholder`
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# status
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Status field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `group: normal`
|
|
10
|
+
- `operator: enum`
|
|
11
|
+
- `switchgroup: enum`
|
|
12
|
+
- `useFormula: true`
|
|
13
|
+
- `useRelation: true`
|
|
14
|
+
- `inlineEdtiable: true`
|
|
15
|
+
- `events: ['change']`
|
|
16
|
+
|
|
17
|
+
## Minimal shape
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"type": "status",
|
|
22
|
+
"options": {
|
|
23
|
+
"horizontal": false,
|
|
24
|
+
"numberMax": "",
|
|
25
|
+
"numberMin": "",
|
|
26
|
+
"numberRange": false,
|
|
27
|
+
"repeatRemind": "This value already exists and duplicate submission is not allowed",
|
|
28
|
+
"options": {
|
|
29
|
+
"mode": "custom",
|
|
30
|
+
"colorful": false,
|
|
31
|
+
"items": [
|
|
32
|
+
{ "key": 1, "code": 1, "value": "Pending" }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Common options
|
|
40
|
+
|
|
41
|
+
- `horizontal`
|
|
42
|
+
- `numberMax`
|
|
43
|
+
- `numberMin`
|
|
44
|
+
- `numberRange`
|
|
45
|
+
- `repeatRemind`
|
|
46
|
+
- `hideInList`
|
|
47
|
+
- `options.items`
|
|
48
|
+
- `options.mode`
|
|
49
|
+
- `options.colorful`
|
|
50
|
+
|
|
51
|
+
## Constraints
|
|
52
|
+
|
|
53
|
+
- each item must contain at least `code` and `value`
|
|
54
|
+
- keep `code` stable once the field is live
|
|
55
|
+
- row values should use the status `code`
|
|
56
|
+
|
|
57
|
+
## Save-ready reminder
|
|
58
|
+
|
|
59
|
+
For `arcubase-admin entity admin-save-entity`, keep the full base `FieldVO`.
|
|
60
|
+
|
|
61
|
+
The field-specific part only covers `options`. The saved field still needs:
|
|
62
|
+
|
|
63
|
+
- `id`
|
|
64
|
+
- `label`
|
|
65
|
+
- `required`
|
|
66
|
+
- `editable`
|
|
67
|
+
- `visible`
|
|
68
|
+
- `number_decimal`
|
|
69
|
+
- `key`
|
|
70
|
+
- `children: null`
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# subform
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Subform field.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Frontend capability flags
|
|
10
|
+
|
|
11
|
+
- `group: advanced`
|
|
12
|
+
- `useFormula: true`
|
|
13
|
+
- `useRelation: true`
|
|
14
|
+
|
|
15
|
+
## Minimal shape
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "subform",
|
|
20
|
+
"options": {},
|
|
21
|
+
"children": []
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Available options
|
|
26
|
+
|
|
27
|
+
- `lengthLimit`
|
|
28
|
+
- `lengthMin`
|
|
29
|
+
- `lengthMax`
|
|
30
|
+
- `new_record_btn`
|
|
31
|
+
- `hideInList`
|
|
32
|
+
|
|
33
|
+
## Constraints
|
|
34
|
+
|
|
35
|
+
- `children: FieldVO[]`
|
|
36
|
+
- Child ids also consume the global field-id space
|
|
37
|
+
- Do not write `layout` separately in the current saved payload
|
|
38
|
+
- The display order of child fields is the order of `children[]`
|
|
39
|
+
- when `new_record_btn` is not configured, prefer `0`
|
|
40
|
+
- when `lengthLimit=true`, it is recommended to provide both `lengthMin` and `lengthMax`
|
|
41
|
+
|
|
42
|
+
## Row payload
|
|
43
|
+
|
|
44
|
+
For row commands such as:
|
|
45
|
+
|
|
46
|
+
- `arcubase workflow insert-entity`
|
|
47
|
+
- `arcubase workflow update-entity-row`
|
|
48
|
+
|
|
49
|
+
the current writable row shape is:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
"id": 0,
|
|
55
|
+
"fields": {
|
|
56
|
+
"1007": "SKU-001",
|
|
57
|
+
"1008": 2
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Use `id: 0` for a new child row.
|
|
64
|
+
|
|
65
|
+
Do not use this incorrect shape:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
[
|
|
69
|
+
{
|
|
70
|
+
"1007": "SKU-001",
|
|
71
|
+
"1008": 2
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# tags
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
System tags field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `operator: $in`
|
|
10
|
+
- `useFormula: false`
|
|
11
|
+
- `useRelation: false`
|
|
12
|
+
- `notImportAble: true`
|
|
13
|
+
- `notExportAble: true`
|
|
14
|
+
- `readonly: true`
|
|
15
|
+
|
|
16
|
+
## Usage rules
|
|
17
|
+
|
|
18
|
+
- Do not manually add `tags` when creating a normal business schema
|
|
19
|
+
- This is a system-managed field and is not part of normal manual schema modeling
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# text
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Single-line text field.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Frontend capability flags
|
|
10
|
+
|
|
11
|
+
- `group: normal`
|
|
12
|
+
- `uniqueAble: true`
|
|
13
|
+
- `useFormula: true`
|
|
14
|
+
- `useRelation: true`
|
|
15
|
+
- `switchgroup: text`
|
|
16
|
+
- `inlineEdtiable: true`
|
|
17
|
+
- `events: ['change']`
|
|
18
|
+
|
|
19
|
+
## Minimal shape
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"type": "text",
|
|
24
|
+
"options": {
|
|
25
|
+
"placeholder": "",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"lengthLimit": false,
|
|
28
|
+
"lengthMin": 0,
|
|
29
|
+
"lengthMax": 255
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Available options
|
|
35
|
+
|
|
36
|
+
- `placeholder`
|
|
37
|
+
- `type`
|
|
38
|
+
- `lengthLimit`
|
|
39
|
+
- `lengthMin`
|
|
40
|
+
- `lengthMax`
|
|
41
|
+
- `link`
|
|
42
|
+
|
|
43
|
+
## Constraints
|
|
44
|
+
|
|
45
|
+
- it can participate in formula and relation conditions
|
|
46
|
+
- it may be marked `unique`
|
|
47
|
+
- when `lengthLimit=true`, it is recommended to provide both `lengthMin` and `lengthMax`
|
|
48
|
+
- in the current direct-write path, prefer the default `"text"` type
|
|
49
|
+
|
|
50
|
+
## Save-ready reminder
|
|
51
|
+
|
|
52
|
+
For `arcubase-admin entity admin-save-entity`, do not send only `type + options`.
|
|
53
|
+
|
|
54
|
+
Wrap this field-specific shape in the full base `FieldVO` described in `entity-schema.md`, including:
|
|
55
|
+
|
|
56
|
+
- `id`
|
|
57
|
+
- `label`
|
|
58
|
+
- `required`
|
|
59
|
+
- `unique`
|
|
60
|
+
- `editable`
|
|
61
|
+
- `visible`
|
|
62
|
+
- `show_label`
|
|
63
|
+
- `scannable`
|
|
64
|
+
- `default_value_mode`
|
|
65
|
+
- `description`
|
|
66
|
+
- `value`
|
|
67
|
+
- `number_decimal`
|
|
68
|
+
- `depends`
|
|
69
|
+
- `key`
|
|
70
|
+
- `code_index`
|
|
71
|
+
- `transfers`
|
|
72
|
+
- `children`
|
|
73
|
+
|
|
74
|
+
## Common mistakes
|
|
75
|
+
|
|
76
|
+
- `lengthLimit=true` but `lengthMax` is missing
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# textarea
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Multi-line text field.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Frontend capability flags
|
|
10
|
+
|
|
11
|
+
- `group: normal`
|
|
12
|
+
- `useFormula: true`
|
|
13
|
+
- `useRelation: true`
|
|
14
|
+
- `hideInList: true`
|
|
15
|
+
- `inlineEdtiable: false`
|
|
16
|
+
- `events: ['change']`
|
|
17
|
+
|
|
18
|
+
## Minimal shape
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"type": "textarea",
|
|
23
|
+
"options": {
|
|
24
|
+
"placeholder": "",
|
|
25
|
+
"html": false,
|
|
26
|
+
"size": "default",
|
|
27
|
+
"lengthLimit": false,
|
|
28
|
+
"lengthMin": 0,
|
|
29
|
+
"lengthMax": 2000
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Available options
|
|
35
|
+
|
|
36
|
+
- `placeholder`
|
|
37
|
+
- `html`
|
|
38
|
+
- `size`
|
|
39
|
+
- `lengthLimit`
|
|
40
|
+
- `lengthMin`
|
|
41
|
+
- `lengthMax`
|
|
42
|
+
|
|
43
|
+
## Constraints
|
|
44
|
+
|
|
45
|
+
- `placeholder` matters only when `html=false`
|
|
46
|
+
- when `lengthLimit=true`, it is recommended to provide both `lengthMin` and `lengthMax`
|
|
47
|
+
- keep `size` within the values returned by the current editor; do not invent extra enum values
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# workflow_status
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Workflow system status field.
|
|
6
|
+
|
|
7
|
+
## Frontend capability flags
|
|
8
|
+
|
|
9
|
+
- `useFormula: false`
|
|
10
|
+
- `useRelation: false`
|
|
11
|
+
- `notImportAble: true`
|
|
12
|
+
- `notExportAble: true`
|
|
13
|
+
|
|
14
|
+
## Usage rules
|
|
15
|
+
|
|
16
|
+
- Do not manually add `workflow_status` when creating a normal business schema
|
|
17
|
+
- This is a system-managed field and is not part of normal manual schema modeling
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Entity Schema
|
|
2
|
+
|
|
3
|
+
Use this page when writing the full table schema with `arcubase-admin`.
|
|
4
|
+
|
|
5
|
+
Primary command:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
arcubase-admin entity admin-save-entity \
|
|
9
|
+
--app-id <app_id> \
|
|
10
|
+
--entity-id <entity_id> \
|
|
11
|
+
--body-file save-entity.json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Before writing `save-entity.json`, always fetch the current shell:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
arcubase-admin entity admin-get-entity-info \
|
|
18
|
+
--app-id <app_id> \
|
|
19
|
+
--entity-id <entity_id>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If you already know the field type you want, go to:
|
|
23
|
+
|
|
24
|
+
- `entity-schema/README.md`
|
|
25
|
+
|
|
26
|
+
## One successful path
|
|
27
|
+
|
|
28
|
+
The current direct-write path is:
|
|
29
|
+
|
|
30
|
+
1. create the entity shell
|
|
31
|
+
2. fetch the current shell
|
|
32
|
+
3. save the full schema
|
|
33
|
+
4. probe rows with `arcubase workflow query-entity`
|
|
34
|
+
|
|
35
|
+
Do not treat shell creation as “table created”.
|
|
36
|
+
|
|
37
|
+
## Top-level save payload
|
|
38
|
+
|
|
39
|
+
The practical save-ready shape is:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"id": 2188889845,
|
|
44
|
+
"app_id": 2188889844,
|
|
45
|
+
"name": "Order",
|
|
46
|
+
"workflow_enabled": false,
|
|
47
|
+
"fields": [],
|
|
48
|
+
"layout": [],
|
|
49
|
+
"options": {},
|
|
50
|
+
"schema_version": 0,
|
|
51
|
+
"field_id_seq": 1001,
|
|
52
|
+
"current_serial": null
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Rules:
|
|
57
|
+
|
|
58
|
+
- start from the current shell
|
|
59
|
+
- reuse `schema_version` from the shell
|
|
60
|
+
- keep `id`, `app_id`, `name`, and `workflow_enabled`
|
|
61
|
+
- do not rebuild top-level `options` unless you really need to
|
|
62
|
+
|
|
63
|
+
## Shell placeholder normalization
|
|
64
|
+
|
|
65
|
+
The fetched shell may contain placeholder `null` values such as:
|
|
66
|
+
|
|
67
|
+
- `layout: null`
|
|
68
|
+
- `current_serial: null`
|
|
69
|
+
- `options.Buttons: null`
|
|
70
|
+
- `options.CustomActions: null`
|
|
71
|
+
- `options.FrontendEvents: null`
|
|
72
|
+
- `options.TitleFormat.Fields: null`
|
|
73
|
+
- `options.TitleFormat.Parts: null`
|
|
74
|
+
- `options.misc: null`
|
|
75
|
+
|
|
76
|
+
Normalize them before saving:
|
|
77
|
+
|
|
78
|
+
- `layout -> []`
|
|
79
|
+
- remove `current_serial` when it is `null`
|
|
80
|
+
- `Buttons/CustomActions/FrontendEvents -> []`
|
|
81
|
+
- `TitleFormat.Fields/Parts -> []`
|
|
82
|
+
- `misc -> {}`
|
|
83
|
+
|
|
84
|
+
The CLI already performs this normalization on the direct save path. Your `save-entity.json` should follow the same shape.
|
|
85
|
+
|
|
86
|
+
## Global invariants
|
|
87
|
+
|
|
88
|
+
- `fields` must be `FieldVO[]`
|
|
89
|
+
- field ids should start from `1001`
|
|
90
|
+
- field ids must be positive and non-zero
|
|
91
|
+
- `field_id_seq > max(field.id)`
|
|
92
|
+
- `layout` is `number[][]`
|
|
93
|
+
- top-level `layout` may only reference top-level field ids
|
|
94
|
+
- for non-`subform` fields, `children` should be `null`
|
|
95
|
+
- saved `subform` payload keeps `children` only
|
|
96
|
+
- do not write `subform.layout`
|
|
97
|
+
- `lookup.options.relation.local_linkto_field_id` must point to a `linkto` field
|
|
98
|
+
- `rollup.options.relation.local_linkto_field_id` must point to a `linkto` field
|
|
99
|
+
- formula references must point to real field ids
|
|
100
|
+
- do not manually add `tags`
|
|
101
|
+
- do not manually add `workflow_status`
|
|
102
|
+
|
|
103
|
+
## Generic field shape
|
|
104
|
+
|
|
105
|
+
Each field in `fields[]` keeps the full base `FieldVO` shape:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"id": 1001,
|
|
110
|
+
"label": "Order No.",
|
|
111
|
+
"type": "text",
|
|
112
|
+
"required": true,
|
|
113
|
+
"unique": false,
|
|
114
|
+
"editable": true,
|
|
115
|
+
"visible": true,
|
|
116
|
+
"show_label": true,
|
|
117
|
+
"scannable": false,
|
|
118
|
+
"default_value_mode": 0,
|
|
119
|
+
"description": "",
|
|
120
|
+
"value": null,
|
|
121
|
+
"number_decimal": 0,
|
|
122
|
+
"depends": [],
|
|
123
|
+
"key": "order_no",
|
|
124
|
+
"code_index": false,
|
|
125
|
+
"options": {},
|
|
126
|
+
"transfers": null,
|
|
127
|
+
"children": null
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Field pages focus on field-specific `options`, but your real `save-entity.json` still needs the full base shape around them.
|
|
132
|
+
|
|
133
|
+
## Layout shape
|
|
134
|
+
|
|
135
|
+
`layout` is not a flat array. Use `number[][]`.
|
|
136
|
+
|
|
137
|
+
Example:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
[
|
|
141
|
+
[1001, 1002],
|
|
142
|
+
[1003],
|
|
143
|
+
[1004]
|
|
144
|
+
]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Each inner array is one layout row. Only reference top-level field ids here.
|
|
148
|
+
|
|
149
|
+
## Entity-level options boundary
|
|
150
|
+
|
|
151
|
+
This document is for `admin-save-entity`.
|
|
152
|
+
|
|
153
|
+
Keep that command focused on:
|
|
154
|
+
|
|
155
|
+
- `name`
|
|
156
|
+
- `workflow_enabled`
|
|
157
|
+
- `fields`
|
|
158
|
+
- `layout`
|
|
159
|
+
- `field_id_seq`
|
|
160
|
+
|
|
161
|
+
Do not overload this save file with unrelated UI payloads just because the shell contains them.
|
|
162
|
+
|
|
163
|
+
## Fast-fail rules
|
|
164
|
+
|
|
165
|
+
The CLI should stop immediately when:
|
|
166
|
+
|
|
167
|
+
- `fields` is an object instead of an array
|
|
168
|
+
- `field_id_seq` is too small
|
|
169
|
+
- `layout` references a missing field id
|
|
170
|
+
- saved payload includes `subform.layout`
|
|
171
|
+
- `local_linkto_field_id` points to a non-`linkto` field
|
|
172
|
+
- formula references a missing field id
|
|
173
|
+
|
|
174
|
+
Also:
|
|
175
|
+
|
|
176
|
+
- if the JSON response contains a top-level `error`, treat the command as failed even when the HTTP status is `200`
|
|
177
|
+
|
|
178
|
+
## Minimal success criteria
|
|
179
|
+
|
|
180
|
+
Do not call schema creation successful until:
|
|
181
|
+
|
|
182
|
+
1. `arcubase-admin entity admin-save-entity ...` succeeds without top-level `error`
|
|
183
|
+
2. `arcubase workflow query-entity ...` succeeds against the saved table
|
|
184
|
+
|
|
185
|
+
If row probing still fails, the table is not ready.
|
|
186
|
+
|
|
187
|
+
## Row payload reminder
|
|
188
|
+
|
|
189
|
+
This document is only for schema save.
|
|
190
|
+
|
|
191
|
+
If you need row payloads after the schema is ready:
|
|
192
|
+
|
|
193
|
+
- read `row-crud.md`
|
|
194
|
+
|
|
195
|
+
If you need field-specific save fragments:
|
|
196
|
+
|
|
197
|
+
- read `entity-schema/README.md`
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Runtime Examples
|
|
2
|
+
|
|
3
|
+
Use this directory when the field-level reference is not enough and you need a business-shaped example.
|
|
4
|
+
|
|
5
|
+
These examples are:
|
|
6
|
+
|
|
7
|
+
- genericized from real production structures
|
|
8
|
+
- written in English
|
|
9
|
+
- stripped of tenant-specific branding
|
|
10
|
+
- stripped of market-specific vocabulary
|
|
11
|
+
- intended as copy-and-adapt templates for CLI usage
|
|
12
|
+
|
|
13
|
+
These examples are not raw tenant exports.
|
|
14
|
+
|
|
15
|
+
## Rules
|
|
16
|
+
|
|
17
|
+
- Keep table names and field names in English.
|
|
18
|
+
- Remove company-specific words.
|
|
19
|
+
- Remove region-specific words when they are not essential to the workflow.
|
|
20
|
+
- Prefer neutral names such as `sku_code`, `sales_order`, `goods_receipt`, and `stock_issue`.
|
|
21
|
+
- When a save payload needs shell values, replace placeholder tokens such as `__APP_ID__`, `__ENTITY_ID__`, and `__SCHEMA_VERSION__` from the current shell returned by:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
arcubase-admin entity admin-get-entity-info \
|
|
25
|
+
--app-id <app_id> \
|
|
26
|
+
--entity-id <entity_id>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Available example sets
|
|
30
|
+
|
|
31
|
+
- `oms-01/`
|
|
32
|
+
- order management
|
|
33
|
+
- item master
|
|
34
|
+
- goods receipt
|
|
35
|
+
- stock issue
|
|
36
|
+
- picking list
|
|
37
|
+
- purchase order
|
|
38
|
+
- sales order
|
|
39
|
+
- `mes-01/`
|
|
40
|
+
- manufacturing execution examples
|
|
41
|
+
- `wms-01/`
|
|
42
|
+
- warehouse and inventory examples
|
|
43
|
+
- `crm-01/`
|
|
44
|
+
- customer, quote, and invoice examples
|
|
45
|
+
|
|
46
|
+
## Recommended reading order
|
|
47
|
+
|
|
48
|
+
1. `../table-lifecycle.md`
|
|
49
|
+
2. `../entity-schema.md`
|
|
50
|
+
3. `oms-01/README.md`
|
|
51
|
+
4. the exact `*.schema.json` and `*.json` example you need
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# CRM Example 01
|
|
2
|
+
|
|
3
|
+
This directory is reserved for a generic CRM and quote example set.
|
|
4
|
+
|
|
5
|
+
Planned tables:
|
|
6
|
+
|
|
7
|
+
- `Customer`
|
|
8
|
+
- `Contact`
|
|
9
|
+
- `Quote`
|
|
10
|
+
- `Invoice`
|
|
11
|
+
|
|
12
|
+
Planned field patterns:
|
|
13
|
+
|
|
14
|
+
- `text`
|
|
15
|
+
- `select`
|
|
16
|
+
- `status`
|
|
17
|
+
- `member`
|
|
18
|
+
- `textarea`
|
|
19
|
+
|
|
20
|
+
All names will remain generic and English-only.
|