@lotics/cli 0.321.73 → 0.321.75

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/docs/examples.md CHANGED
@@ -8,7 +8,8 @@ Left out, for the page's size: a Section or page that carries nothing of the tre
8
8
  `pair`, how a computed field computes, the `tables` and `templates` maps an App adds (ids from the
9
9
  `set_tables` answer), and template contents — a call states each table's and field's `label`. Choosing
10
10
  among them: the `design` reference. Every key: `reference`, at the pages each section names under
11
- **Keys**.
11
+ **Keys**. How a record's status draws is a choice of its own, made by what the work is (`design`, Stages):
12
+ each section says which its record takes under **Its stages**, so the form is copied with its reason.
12
13
 
13
14
  ## Calendar
14
15
 
@@ -20,6 +21,8 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
20
21
 
21
22
  **Not when.** Rows booked on a resource that two may not share at once — that is `lanes`. Rows with a date nobody plans by (an invoice's date) stay a table.
22
23
 
24
+ **Its stages.** `service_visit` states Sections at its stages: its path reads down the page, each stage's Section under its step.
25
+
23
26
  ```json
24
27
  {
25
28
  "tables": [
@@ -103,82 +106,87 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
103
106
  "entity": "service_visit",
104
107
  "children": [
105
108
  {
106
- "type": "Section",
107
- "key": "visit",
108
- "title": "Visit",
109
- "at": ["booked_on", "parts_ready_on"],
109
+ "type": "Steps",
110
110
  "children": [
111
- "job",
112
- "booked_on",
113
- "parts_ready_on",
114
- {
115
- "type": "Act",
116
- "key": "reschedule",
117
- "label": "Reschedule",
118
- "asks": ["scheduled_for", "ends_at"],
119
- "when": {"stage": ["booked_on", "parts_ready_on"]}
120
- },
121
111
  {
122
- "type": "Act",
123
- "key": "to_booked_on",
124
- "label": "Booked",
125
- "when": {"stage": {"empty": true}},
126
- "asks": [{"field": "booked_on", "starts": "today"}],
127
- "set": {"stage": "booked_on"}
128
- },
129
- {
130
- "type": "Act",
131
- "key": "to_parts_ready_on",
132
- "label": "Parts ready",
133
- "when": {"stage": ["booked_on"], "job": ["repair"]},
134
- "asks": [{"field": "parts_ready_on", "starts": "today"}],
135
- "set": {"stage": "parts_ready_on"}
136
- },
137
- {
138
- "type": "Act",
139
- "key": "to_arrived_on",
140
- "label": "On site",
141
- "when": {"stage": ["booked_on"], "job": ["inspection"]},
142
- "asks": [{"field": "arrived_on", "starts": "today"}],
143
- "set": {"stage": "arrived_on"}
144
- },
145
- {
146
- "type": "Act",
147
- "key": "to_arrived_on_2",
148
- "label": "On site",
149
- "when": {"stage": ["parts_ready_on"]},
150
- "asks": [{"field": "arrived_on", "starts": "today"}],
151
- "set": {"stage": "arrived_on"}
152
- }
153
- ]
154
- },
155
- {
156
- "type": "Section",
157
- "key": "report",
158
- "title": "Report",
159
- "at": ["arrived_on"],
160
- "children": [
161
- "engineer",
162
- "arrived_on",
163
- {"field": "report", "block": false},
164
- {
165
- "type": "Act",
166
- "key": "complete",
167
- "label": "Complete visit",
168
- "requires": ["engineer"],
169
- "asks": [
170
- "hours",
171
- {"input": "summary", "label": "What was done", "type": "long_text", "required": true}
172
- ],
173
- "set": {"report": {"input": "summary"}, "stage": "completed_on"},
174
- "when": {"stage": ["arrived_on"]}
112
+ "type": "Section",
113
+ "key": "visit",
114
+ "title": "Visit",
115
+ "at": ["booked_on", "parts_ready_on"],
116
+ "children": [
117
+ "job",
118
+ "booked_on",
119
+ "parts_ready_on",
120
+ {
121
+ "type": "Act",
122
+ "key": "reschedule",
123
+ "label": "Reschedule",
124
+ "asks": ["scheduled_for", "ends_at"],
125
+ "when": {"stage": ["booked_on", "parts_ready_on"]}
126
+ },
127
+ {
128
+ "type": "Act",
129
+ "key": "to_booked_on",
130
+ "label": "Booked",
131
+ "when": {"stage": {"empty": true}},
132
+ "asks": [{"field": "booked_on", "starts": "today"}],
133
+ "set": {"stage": "booked_on"}
134
+ },
135
+ {
136
+ "type": "Act",
137
+ "key": "to_parts_ready_on",
138
+ "label": "Parts ready",
139
+ "when": {"stage": ["booked_on"], "job": ["repair"]},
140
+ "asks": [{"field": "parts_ready_on", "starts": "today"}],
141
+ "set": {"stage": "parts_ready_on"}
142
+ },
143
+ {
144
+ "type": "Act",
145
+ "key": "to_arrived_on",
146
+ "label": "On site",
147
+ "when": {"stage": ["booked_on"], "job": ["inspection"]},
148
+ "asks": [{"field": "arrived_on", "starts": "today"}],
149
+ "set": {"stage": "arrived_on"}
150
+ },
151
+ {
152
+ "type": "Act",
153
+ "key": "to_arrived_on_2",
154
+ "label": "On site",
155
+ "when": {"stage": ["parts_ready_on"]},
156
+ "asks": [{"field": "arrived_on", "starts": "today"}],
157
+ "set": {"stage": "arrived_on"}
158
+ }
159
+ ]
175
160
  },
176
161
  {
177
- "type": "Act",
178
- "key": "clear_visit_hours",
179
- "label": "Clear hours",
180
- "set": {"hours": null},
181
- "confirm": true
162
+ "type": "Section",
163
+ "key": "report",
164
+ "title": "Report",
165
+ "at": ["arrived_on"],
166
+ "children": [
167
+ "engineer",
168
+ "arrived_on",
169
+ {"field": "report", "block": false},
170
+ {
171
+ "type": "Act",
172
+ "key": "complete",
173
+ "label": "Complete visit",
174
+ "requires": ["engineer"],
175
+ "asks": [
176
+ "hours",
177
+ {"input": "summary", "label": "What was done", "type": "long_text", "required": true}
178
+ ],
179
+ "set": {"report": {"input": "summary"}, "stage": "completed_on"},
180
+ "when": {"stage": ["arrived_on"]}
181
+ },
182
+ {
183
+ "type": "Act",
184
+ "key": "clear_visit_hours",
185
+ "label": "Clear hours",
186
+ "set": {"hours": null},
187
+ "confirm": true
188
+ }
189
+ ]
182
190
  }
183
191
  ]
184
192
  }
@@ -202,6 +210,8 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
202
210
 
203
211
  **Not when.** The resource is not a row of the model (a free-text room name), or rows never compete for one — a `calendar` reads them by day.
204
212
 
213
+ **Its stages.** `service_visit` states no Section at a stage and its Acts move it: its path draws as a line of steps across the page.
214
+
205
215
  ```json
206
216
  {
207
217
  "tables": [
@@ -362,6 +372,8 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
362
372
 
363
373
  **Not when.** Rows that last a day or less (a visit, a shift) — `calendar` or `lanes`; a plan with no dates set yet.
364
374
 
375
+ **Its stages.** `phieu_thue` states Sections at its stages: its path reads down the page, each stage's Section under its step.
376
+
365
377
  ```json
366
378
  {
367
379
  "tables": [
@@ -432,29 +444,34 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
432
444
  "children": ["ngay_giao", "han_tra"]
433
445
  },
434
446
  {
435
- "type": "Section",
436
- "key": "dang_thue",
437
- "title": "Đang thuê",
438
- "at": ["dang_thue"],
447
+ "type": "Steps",
439
448
  "children": [
440
- "so_ngay",
441
- {"field": "ngay_tra", "edit": false},
442
- {
443
- "type": "Act",
444
- "key": "nhan_tra",
445
- "label": "Nhận máy trả",
446
- "when": {"trang_thai": ["dang_thue"]},
447
- "asks": ["tinh_trang_tra"],
448
- "set": {"trang_thai": "da_tra"},
449
- "confirm": true
450
- },
451
449
  {
452
- "type": "Act",
453
- "key": "mo_lai",
454
- "label": "Mở lại",
455
- "when": {"trang_thai": ["da_tra"]},
456
- "set": {"trang_thai": "dang_thue"},
457
- "confirm": true
450
+ "type": "Section",
451
+ "key": "dang_thue",
452
+ "title": "Đang thuê",
453
+ "at": ["dang_thue"],
454
+ "children": [
455
+ "so_ngay",
456
+ {"field": "ngay_tra", "edit": false},
457
+ {
458
+ "type": "Act",
459
+ "key": "nhan_tra",
460
+ "label": "Nhận máy trả",
461
+ "when": {"trang_thai": ["dang_thue"]},
462
+ "asks": ["tinh_trang_tra"],
463
+ "set": {"trang_thai": "da_tra"},
464
+ "confirm": true
465
+ },
466
+ {
467
+ "type": "Act",
468
+ "key": "mo_lai",
469
+ "label": "Mở lại",
470
+ "when": {"trang_thai": ["da_tra"]},
471
+ "set": {"trang_thai": "dang_thue"},
472
+ "confirm": true
473
+ }
474
+ ]
458
475
  }
459
476
  ]
460
477
  }
@@ -742,6 +759,8 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
742
759
 
743
760
  **Not when.** A list of customers is not a job by itself: the customer is a link on the desk whose rows name it, unless the job is the account itself.
744
761
 
762
+ **Its stages.** `order` states no Section at a stage and its Acts move it: its path draws as a line of steps across the page.
763
+
745
764
  ```json
746
765
  {
747
766
  "tables": [
@@ -1052,6 +1071,8 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
1052
1071
 
1053
1072
  **Not when.** A record that needs no papers, or one paper made once — a single `template` act.
1054
1073
 
1074
+ **Its stages.** `ho_so` states Sections at its stages: its path reads down the page, each stage's Section under its step.
1075
+
1055
1076
  ```json
1056
1077
  {
1057
1078
  "tables": [
@@ -1370,58 +1391,63 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
1370
1391
  ]
1371
1392
  },
1372
1393
  {
1373
- "type": "Section",
1374
- "key": "bo_ho_so",
1375
- "title": "Bộ hồ sơ",
1376
- "at": ["ngay_nhan_giay_to", "ngay_lap_ho_so"],
1394
+ "type": "Steps",
1377
1395
  "children": [
1378
- "ngay_nhan_giay_to",
1379
- "ngay_lap_ho_so",
1380
- {
1381
- "type": "Act",
1382
- "key": "tao_giay_to",
1383
- "label": "Tạo giấy tờ",
1384
- "templates": [
1385
- {"template": "don_dang_ky"},
1386
- {"template": "mau_02_chua_co_nha", "when": {"tinh_trang_nha_o": ["chua_co_nha"]}},
1387
- {"template": "mau_03_nha_chat", "when": {"tinh_trang_nha_o": ["nha_chat"]}}
1388
- ],
1389
- "into": "bo_ho_so",
1390
- "when": {"giai_doan": ["ngay_nhan_giay_to", "ngay_lap_ho_so"]}
1391
- },
1392
- {
1393
- "type": "Act",
1394
- "key": "nop_cdt",
1395
- "label": "Nộp chủ đầu tư",
1396
- "when": {"dich_vu": ["tron_goi"], "giai_doan": ["ngay_lap_ho_so"]},
1397
- "requires": ["bo_ho_so", "loai_can"],
1398
- "asks": ["loai_can"],
1399
- "set": {"giai_doan": "ngay_nop_cdt"},
1400
- "confirm": true
1401
- },
1402
- {
1403
- "type": "Act",
1404
- "key": "to_ngay_nhan_giay_to",
1405
- "label": "Đã nhận giấy tờ",
1406
- "when": {"giai_doan": {"empty": true}, "dich_vu": ["tron_goi"]},
1407
- "asks": [{"field": "ngay_nhan_giay_to", "starts": "today"}],
1408
- "set": {"giai_doan": "ngay_nhan_giay_to"}
1409
- },
1410
- {
1411
- "type": "Act",
1412
- "key": "to_ngay_lap_ho_so",
1413
- "label": "Đã lập hồ sơ",
1414
- "when": {"giai_doan": ["ngay_nhan_giay_to"], "dich_vu": ["tron_goi"]},
1415
- "asks": [{"field": "ngay_lap_ho_so", "starts": "today"}],
1416
- "set": {"giai_doan": "ngay_lap_ho_so"}
1417
- },
1418
1396
  {
1419
- "type": "Act",
1420
- "key": "to_ngay_ban_giao",
1421
- "label": "Đã bàn giao hồ sơ",
1422
- "when": {"giai_doan": ["ngay_nhan_giay_to"], "dich_vu": ["lam_ho_so"]},
1423
- "asks": [{"field": "ngay_ban_giao", "starts": "today"}],
1424
- "set": {"giai_doan": "ngay_ban_giao"}
1397
+ "type": "Section",
1398
+ "key": "bo_ho_so",
1399
+ "title": "Bộ hồ sơ",
1400
+ "at": ["ngay_nhan_giay_to", "ngay_lap_ho_so"],
1401
+ "children": [
1402
+ "ngay_nhan_giay_to",
1403
+ "ngay_lap_ho_so",
1404
+ {
1405
+ "type": "Act",
1406
+ "key": "tao_giay_to",
1407
+ "label": "Tạo giấy tờ",
1408
+ "templates": [
1409
+ {"template": "don_dang_ky"},
1410
+ {"template": "mau_02_chua_co_nha", "when": {"tinh_trang_nha_o": ["chua_co_nha"]}},
1411
+ {"template": "mau_03_nha_chat", "when": {"tinh_trang_nha_o": ["nha_chat"]}}
1412
+ ],
1413
+ "into": "bo_ho_so",
1414
+ "when": {"giai_doan": ["ngay_nhan_giay_to", "ngay_lap_ho_so"]}
1415
+ },
1416
+ {
1417
+ "type": "Act",
1418
+ "key": "nop_cdt",
1419
+ "label": "Nộp chủ đầu tư",
1420
+ "when": {"dich_vu": ["tron_goi"], "giai_doan": ["ngay_lap_ho_so"]},
1421
+ "requires": ["bo_ho_so", "loai_can"],
1422
+ "asks": ["loai_can"],
1423
+ "set": {"giai_doan": "ngay_nop_cdt"},
1424
+ "confirm": true
1425
+ },
1426
+ {
1427
+ "type": "Act",
1428
+ "key": "to_ngay_nhan_giay_to",
1429
+ "label": "Đã nhận giấy tờ",
1430
+ "when": {"giai_doan": {"empty": true}, "dich_vu": ["tron_goi"]},
1431
+ "asks": [{"field": "ngay_nhan_giay_to", "starts": "today"}],
1432
+ "set": {"giai_doan": "ngay_nhan_giay_to"}
1433
+ },
1434
+ {
1435
+ "type": "Act",
1436
+ "key": "to_ngay_lap_ho_so",
1437
+ "label": "Đã lập hồ sơ",
1438
+ "when": {"giai_doan": ["ngay_nhan_giay_to"], "dich_vu": ["tron_goi"]},
1439
+ "asks": [{"field": "ngay_lap_ho_so", "starts": "today"}],
1440
+ "set": {"giai_doan": "ngay_lap_ho_so"}
1441
+ },
1442
+ {
1443
+ "type": "Act",
1444
+ "key": "to_ngay_ban_giao",
1445
+ "label": "Đã bàn giao hồ sơ",
1446
+ "when": {"giai_doan": ["ngay_nhan_giay_to"], "dich_vu": ["lam_ho_so"]},
1447
+ "asks": [{"field": "ngay_ban_giao", "starts": "today"}],
1448
+ "set": {"giai_doan": "ngay_ban_giao"}
1449
+ }
1450
+ ]
1425
1451
  }
1426
1452
  ]
1427
1453
  },
@@ -1454,6 +1480,8 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
1454
1480
 
1455
1481
  **Not when.** Calls made and logged elsewhere — a `timeline` with its own add keeps the note.
1456
1482
 
1483
+ **Its stages.** `khach_tiem_nang` states Sections at its stages: its path reads down the page, each stage's Section under its step. `buoc_tiep` states no Section at a stage and its Acts move it: its path draws as a line of steps across the page.
1484
+
1457
1485
  ```json
1458
1486
  {
1459
1487
  "tables": [
@@ -1679,121 +1707,126 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
1679
1707
  "entity": "khach_tiem_nang",
1680
1708
  "children": [
1681
1709
  {
1682
- "type": "Section",
1683
- "key": "danh_gia",
1684
- "title": "Đánh giá",
1685
- "at": ["moi"],
1686
- "children": [
1687
- "vai_tro",
1688
- "loai_hinh",
1689
- "quy_mo",
1690
- "vi_sao_du_dieu_kien",
1691
- "do_nong",
1692
- {
1693
- "type": "List",
1694
- "entity": "tin_hieu",
1695
- "columns": ["loai", "noi_dung"],
1696
- "create": ["tom_tat", "anh_chup", "loai", "noi_dung", "kenh", "lien_ket", "ngay_dang"]
1697
- },
1698
- {
1699
- "type": "Act",
1700
- "key": "danh_gia_dat",
1701
- "label": "Đủ điều kiện",
1702
- "when": {"trang_thai": ["moi"]},
1703
- "requires": ["vi_sao_du_dieu_kien"],
1704
- "set": {"trang_thai": "du_dieu_kien"}
1705
- }
1706
- ]
1707
- },
1708
- {
1709
- "type": "Section",
1710
- "key": "lien_he",
1711
- "title": "Liên hệ",
1712
- "at": ["du_dieu_kien"],
1710
+ "type": "Steps",
1713
1711
  "children": [
1714
- "so_dien_thoai",
1715
- "phu_trach",
1716
- "trang_ca_nhan",
1717
- "zalo",
1718
- "email",
1719
- {"field": "ghi_chu", "block": false},
1720
1712
  {
1721
- "type": "List",
1722
- "entity": "buoc_tiep",
1723
- "columns": ["ban_nhap"],
1724
- "create": ["vi_sao_luc_nay", "viec", "han", "ban_nhap"]
1725
- },
1726
- {
1727
- "type": "List",
1728
- "entity": "tuong_tac",
1729
- "layout": "timeline",
1730
- "create": ["tom_tat", "qua", "phan_hoi", "thoi_diem", "hen_lai"]
1713
+ "type": "Section",
1714
+ "key": "danh_gia",
1715
+ "title": "Đánh giá",
1716
+ "at": ["moi"],
1717
+ "children": [
1718
+ "vai_tro",
1719
+ "loai_hinh",
1720
+ "quy_mo",
1721
+ "vi_sao_du_dieu_kien",
1722
+ "do_nong",
1723
+ {
1724
+ "type": "List",
1725
+ "entity": "tin_hieu",
1726
+ "columns": ["loai", "noi_dung"],
1727
+ "create": ["tom_tat", "anh_chup", "loai", "noi_dung", "kenh", "lien_ket", "ngay_dang"]
1728
+ },
1729
+ {
1730
+ "type": "Act",
1731
+ "key": "danh_gia_dat",
1732
+ "label": "Đủ điều kiện",
1733
+ "when": {"trang_thai": ["moi"]},
1734
+ "requires": ["vi_sao_du_dieu_kien"],
1735
+ "set": {"trang_thai": "du_dieu_kien"}
1736
+ }
1737
+ ]
1731
1738
  },
1732
1739
  {
1733
- "type": "Act",
1734
- "key": "ghi_cuoc_goi",
1735
- "label": "Ghi âm cuộc gọi",
1736
- "when": {"trang_thai": ["du_dieu_kien"]},
1737
- "fills": ["tom_tat", "phan_hoi"],
1738
- "record": {
1739
- "into": "tuong_tac",
1740
- "audio": "ghi_am",
1741
- "transcript": "nguyen_van",
1742
- "at": "thoi_diem",
1743
- "by": "nguoi_thuc_hien",
1744
- "video": "man_hinh"
1745
- }
1740
+ "type": "Section",
1741
+ "key": "lien_he",
1742
+ "title": "Liên hệ",
1743
+ "at": ["du_dieu_kien"],
1744
+ "children": [
1745
+ "so_dien_thoai",
1746
+ "phu_trach",
1747
+ "trang_ca_nhan",
1748
+ "zalo",
1749
+ "email",
1750
+ {"field": "ghi_chu", "block": false},
1751
+ {
1752
+ "type": "List",
1753
+ "entity": "buoc_tiep",
1754
+ "columns": ["ban_nhap"],
1755
+ "create": ["vi_sao_luc_nay", "viec", "han", "ban_nhap"]
1756
+ },
1757
+ {
1758
+ "type": "List",
1759
+ "entity": "tuong_tac",
1760
+ "layout": "timeline",
1761
+ "create": ["tom_tat", "qua", "phan_hoi", "thoi_diem", "hen_lai"]
1762
+ },
1763
+ {
1764
+ "type": "Act",
1765
+ "key": "ghi_cuoc_goi",
1766
+ "label": "Ghi âm cuộc gọi",
1767
+ "when": {"trang_thai": ["du_dieu_kien"]},
1768
+ "fills": ["tom_tat", "phan_hoi"],
1769
+ "record": {
1770
+ "into": "tuong_tac",
1771
+ "audio": "ghi_am",
1772
+ "transcript": "nguyen_van",
1773
+ "at": "thoi_diem",
1774
+ "by": "nguoi_thuc_hien",
1775
+ "video": "man_hinh"
1776
+ }
1777
+ },
1778
+ {
1779
+ "type": "Act",
1780
+ "key": "da_lien_he",
1781
+ "label": "Đánh dấu đã liên hệ",
1782
+ "when": {"trang_thai": ["du_dieu_kien"]},
1783
+ "set": {"trang_thai": "da_lien_he"}
1784
+ }
1785
+ ]
1746
1786
  },
1747
1787
  {
1748
- "type": "Act",
1749
- "key": "da_lien_he",
1750
- "label": "Đánh dấu đã liên hệ",
1751
- "when": {"trang_thai": ["du_dieu_kien"]},
1752
- "set": {"trang_thai": "da_lien_he"}
1753
- }
1754
- ]
1755
- },
1756
- {
1757
- "type": "Section",
1758
- "key": "chuyen_doi",
1759
- "title": "Chuyển đổi",
1760
- "at": ["da_lien_he"],
1761
- "children": [
1762
- "nguon",
1763
- {"field": "lien_he", "edit": false},
1764
- {"field": "cong_ty", "edit": false},
1765
- {
1766
- "type": "Act",
1788
+ "type": "Section",
1767
1789
  "key": "chuyen_doi",
1768
- "label": "Chuyển đổi",
1769
- "when": {"trang_thai": ["da_lien_he"]},
1770
- "workflow": "chuyen_doi_khach",
1771
- "confirm": true
1772
- }
1773
- ]
1774
- },
1775
- {
1776
- "type": "Section",
1777
- "key": "loai",
1778
- "title": "Loại",
1779
- "at": ["loai"],
1780
- "children": [
1781
- "ly_do_loai",
1782
- {
1783
- "type": "Act",
1784
- "key": "loai",
1785
- "label": "Loại",
1786
- "when": {"trang_thai": ["moi", "du_dieu_kien", "da_lien_he"]},
1787
- "asks": ["ly_do_loai"],
1788
- "set": {"trang_thai": "loai"},
1789
- "danger": true
1790
+ "title": "Chuyển đổi",
1791
+ "at": ["da_lien_he"],
1792
+ "children": [
1793
+ "nguon",
1794
+ {"field": "lien_he", "edit": false},
1795
+ {"field": "cong_ty", "edit": false},
1796
+ {
1797
+ "type": "Act",
1798
+ "key": "chuyen_doi",
1799
+ "label": "Chuyển đổi",
1800
+ "when": {"trang_thai": ["da_lien_he"]},
1801
+ "workflow": "chuyen_doi_khach",
1802
+ "confirm": true
1803
+ }
1804
+ ]
1790
1805
  },
1791
1806
  {
1792
- "type": "Act",
1793
- "key": "mo_lai",
1794
- "label": "Mở lại",
1795
- "when": {"trang_thai": ["loai"]},
1796
- "set": {"trang_thai": "moi"}
1807
+ "type": "Section",
1808
+ "key": "loai",
1809
+ "title": "Loại",
1810
+ "at": ["loai"],
1811
+ "children": [
1812
+ "ly_do_loai",
1813
+ {
1814
+ "type": "Act",
1815
+ "key": "loai",
1816
+ "label": "Loại",
1817
+ "when": {"trang_thai": ["moi", "du_dieu_kien", "da_lien_he"]},
1818
+ "asks": ["ly_do_loai"],
1819
+ "set": {"trang_thai": "loai"},
1820
+ "danger": true
1821
+ },
1822
+ {
1823
+ "type": "Act",
1824
+ "key": "mo_lai",
1825
+ "label": "Mở lại",
1826
+ "when": {"trang_thai": ["loai"]},
1827
+ "set": {"trang_thai": "moi"}
1828
+ }
1829
+ ]
1797
1830
  }
1798
1831
  ]
1799
1832
  },
@@ -1829,6 +1862,8 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
1829
1862
 
1830
1863
  **Not when.** Rows that never move — a reference list (a price list, a catalog) has no status and no headline number.
1831
1864
 
1865
+ **Its stages.** `de_nghi` states Sections at its stages: its path reads down the page, each stage's Section under its step.
1866
+
1832
1867
  ```json
1833
1868
  {
1834
1869
  "tables": [
@@ -1940,53 +1975,58 @@ among them: the `design` reference. Every key: `reference`, at the pages each se
1940
1975
  "door": "drawer",
1941
1976
  "children": [
1942
1977
  {
1943
- "type": "Section",
1944
- "key": "de_nghi",
1945
- "title": "Đề nghị",
1946
- "at": ["nhap"],
1978
+ "type": "Steps",
1947
1979
  "children": [
1948
- "so_de_nghi",
1949
- "loai",
1950
- "nha_cung_cap",
1951
- "han_thanh_toan",
1952
- "nguoi_de_nghi",
1953
- {"field": "chung_tu"},
1954
1980
  {
1955
- "type": "Act",
1956
- "key": "gui_duyet",
1957
- "label": "Gửi duyệt",
1958
- "when": {"trang_thai": ["nhap"]},
1959
- "requires": ["chung_tu", "nguoi_de_nghi"],
1960
- "set": {"trang_thai": "cho_duyet"}
1961
- }
1962
- ]
1963
- },
1964
- {
1965
- "type": "Section",
1966
- "key": "duyet",
1967
- "title": "Duyệt",
1968
- "at": ["cho_duyet", "cho_chu_tich"],
1969
- "children": [
1970
- {"field": "nguoi_duyet", "edit": false},
1971
- {"field": "duyet_luc", "edit": false},
1972
- {"field": "ly_do_tu_choi", "edit": false},
1981
+ "type": "Section",
1982
+ "key": "de_nghi",
1983
+ "title": "Đề nghị",
1984
+ "at": ["nhap"],
1985
+ "children": [
1986
+ "so_de_nghi",
1987
+ "loai",
1988
+ "nha_cung_cap",
1989
+ "han_thanh_toan",
1990
+ "nguoi_de_nghi",
1991
+ {"field": "chung_tu"},
1992
+ {
1993
+ "type": "Act",
1994
+ "key": "gui_duyet",
1995
+ "label": "Gửi duyệt",
1996
+ "when": {"trang_thai": ["nhap"]},
1997
+ "requires": ["chung_tu", "nguoi_de_nghi"],
1998
+ "set": {"trang_thai": "cho_duyet"}
1999
+ }
2000
+ ]
2001
+ },
1973
2002
  {
1974
- "type": "Act",
1975
- "key": "rut_lai",
1976
- "label": "Rút lại",
1977
- "when": {"trang_thai": ["cho_duyet", "cho_chu_tich"]},
1978
- "set": {"trang_thai": "nhap"},
1979
- "confirm": true
2003
+ "type": "Section",
2004
+ "key": "duyet",
2005
+ "title": "Duyệt",
2006
+ "at": ["cho_duyet", "cho_chu_tich"],
2007
+ "children": [
2008
+ {"field": "nguoi_duyet", "edit": false},
2009
+ {"field": "duyet_luc", "edit": false},
2010
+ {"field": "ly_do_tu_choi", "edit": false},
2011
+ {
2012
+ "type": "Act",
2013
+ "key": "rut_lai",
2014
+ "label": "Rút lại",
2015
+ "when": {"trang_thai": ["cho_duyet", "cho_chu_tich"]},
2016
+ "set": {"trang_thai": "nhap"},
2017
+ "confirm": true
2018
+ }
2019
+ ]
2020
+ },
2021
+ {
2022
+ "type": "Section",
2023
+ "key": "da_chi",
2024
+ "title": "Đã chi",
2025
+ "at": ["da_chi"],
2026
+ "children": [{"field": "phieu_chi", "edit": false}]
1980
2027
  }
1981
2028
  ]
1982
2029
  },
1983
- {
1984
- "type": "Section",
1985
- "key": "da_chi",
1986
- "title": "Đã chi",
1987
- "at": ["da_chi"],
1988
- "children": [{"field": "phieu_chi", "edit": false}]
1989
- },
1990
2030
  {"type": "Check", "field": "da_gui", "on": ["update"]}
1991
2031
  ]
1992
2032
  },