@simitgroup/simpleapp-generator 1.0.39 → 1.0.41

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/README copy.md CHANGED
@@ -879,4 +879,405 @@ invoice => foreignkey: detail.product=>product
879
879
  order => foreignkey: detail.product=>product
880
880
 
881
881
  cat =[product.category]
882
- product=[invoice.detail.product, order.detail.product]
882
+ product=[invoice.detail.product, order.detail.product]
883
+
884
+
885
+
886
+
887
+ todo:
888
+ ## high priority Job
889
+
890
+ [ ] add special search like isolate by user for autocomplete (add property of)
891
+ choose org then branch
892
+ [ ] create invoice and receipt
893
+ [x] fix error reporting and success reporting at frontend
894
+ [x] define some allow override and some not
895
+ [ ] json schema can set generate what page type, no define = no generate page
896
+ [ ] create tenant/org/branch auto increament
897
+ [ ] focus on functions customer, product, invoice and receipt
898
+ [~] repeat same typscript formula at frontend and backend
899
+ [ ] frontend search
900
+ [ ] new transaction CRUD ui
901
+ [ ] student UI
902
+ [ ] structure of save into another document
903
+
904
+ Permission and Authorization
905
+ [x] hide no permission window
906
+ [ ] hide no permission buttons
907
+ [x] permission user/group (pick hard coded group from some place)
908
+ [ ] figure how to get enum list from permission list for user schema
909
+
910
+
911
+
912
+ 1. copy group-to-role to both frontend and backend
913
+ 2. loop backend role code, and define into user role
914
+ 3. loop frontend role code, and
915
+ 1 update to getMenus,
916
+ 2. existing all menus store as permission list
917
+ 3. crud and etc page need verify existing user can go in this menu or not. if can't will render no permission
918
+ 4. use directive to control show or not show button (new, save, delete)
919
+
920
+
921
+
922
+ Custom Document Status and API
923
+ [ ] document status control
924
+ [ ] document api touch up
925
+ 1. auto add document status column
926
+ 2. change document status when change status
927
+ 3. enum document status, but UI dont show the field
928
+ 4. have document action, then show document button
929
+
930
+
931
+ # Quick start
932
+ ** You need to have mongodb installed **
933
+ 1. git clone from simpleapp-generator
934
+ ```sh
935
+ npm -i @simitgroup/simpleapp-generator@latest
936
+ git clone https://github.com/SIMITGROUP/simpleapp-generator-template myapp
937
+ # edit myapp/config.json to match you mongodb connection string
938
+ cd ~/myapp
939
+ simpleapp-generator -c config.json
940
+ ```
941
+ 2. start backend
942
+ ```sh
943
+ cd ~/myapp/backend
944
+ pnpm start:dev
945
+ ```
946
+ 3. start frontend
947
+ ```sh
948
+ cd ~/myapp/frontend
949
+ pnpm dev
950
+ ```
951
+ 4. try ui:
952
+ * frontend: [http://localhost:8080](http://localhost:8080)
953
+ * backend: [http://localhost:8000/api](http://localhost:8000/api)
954
+ 5. Open project with vscode, explore json schema and the generated forms
955
+ ```sh
956
+ code ~/mydoc
957
+ ```
958
+ you can change your project at:
959
+ * myapp/backend/.env
960
+ * myapp/backend/src/hooks/*
961
+
962
+ * myapp/frontend/.env
963
+ * myapp/frontend/pages/*
964
+
965
+
966
+
967
+ # Special Properties:
968
+ ## Special root level property
969
+ _id:
970
+ tenantId:
971
+ orgId:
972
+ branchId:
973
+ created:
974
+ createdby:
975
+ updated:
976
+ updatedby:
977
+ documentStatus
978
+ _v:
979
+ x-document-status: [optional]array of document satus: such as:
980
+ {
981
+ "":{"readonly":false,"allowApi":["confirm","void"],"description":"new"},
982
+ "D":{"readonly":false,"allowApi":["confirm","void"],"description":"draft"},
983
+ "V":{"readonly":true,"allowApi":[],"description":"v"},
984
+ "CO":{"readonly":true,"allowApi":["void","revert"],"description":"confirmed"},
985
+ "CL":{"readonly":true,"allowApi":[],"description":"closed"}
986
+ }
987
+ x-document-api: [optional]array of custom api (beside default)
988
+
989
+ ```typescript
990
+ [
991
+ {"action":"confirm","method":"put","setDocumentStatus":"CO", "bpmn":"generic-confirm",
992
+ "data":{"document":"document"}},
993
+ {"action":"void",,"method":"put", "setDocumentStatus":"V", "bpmn":"generic-void",
994
+ "data":{"document":"document"}},
995
+ {"action":"revert",,"method":"put", "setDocumentStatus":"D", "bpmn":"generic-revert",
996
+ "data":{"document":"document"}},
997
+ {"action":"duplicate", ,"method":"post","data":{"document":"document"}},
998
+ {"action":"switchStatus",,"method":"put","data":{"statusName":"string","document":"document"}}
999
+ ]
1000
+ ```
1001
+ ## Custom Format
1002
+
1003
+ ## Custom Property
1004
+
1005
+ # Concept of Development
1006
+ Development using simpleapp-generator involve below steps:
1007
+ ## Simple
1008
+ 1. create appropriate jsonschema
1009
+ 2. generate frontend and backend architectures
1010
+ 3. start backend service, obtain and save api definations into openapi.yaml
1011
+ 4. regenerate codes so frontend can obtain openapi clients
1012
+ 5. align frontend UI, add necessary component such as css and ui components
1013
+
1014
+ ## Advance
1015
+ 1. complete simple task
1016
+ 2. add more api/process at backend `controller`,`service`,`schema`. Such as:
1017
+ a. customized search and filters
1018
+ b. customized workflows
1019
+ c. connect external api
1020
+ d. additional data processing and validation which is not supported by jsonschema (AJV)
1021
+ 3. security like sso/jwt, plugins
1022
+ a. keycloak integration at frontends
1023
+ b. backend manage jwt
1024
+ 4. allow additional field formats, validations by modifying ajv
1025
+ a. allow custom jsonschema field property, and do something at backend
1026
+ b. allow custom field format, and do something at backend
1027
+ 5. repeat same typscript formula at frontend and backend
1028
+
1029
+ Special Root Level property
1030
+ [x] x-ignore-autocomplete: optional boolean, define it to allow undefine x-document-no & x-document-label
1031
+ [x] x-isolation-type: optional string, how data isolated, 'none,tenant,org,branch', default 'org'
1032
+
1033
+ Special Field Level property
1034
+
1035
+
1036
+
1037
+ # JSON Schema supported String Format
1038
+ all format recognize by ajv plus below:
1039
+
1040
+ 1. tel: only digit, auto generate input tel
1041
+ 2. documentno : will use documentno generator for auto generate document no
1042
+ 3. text: do nothing, will auto generate textarea
1043
+ 4. html editor: do nothing, will auto generate html editor
1044
+
1045
+
1046
+
1047
+ # Todo
1048
+ ## Update documentation and reference
1049
+ 1. create github simpleapp-generator-template and documentation
1050
+ 2. update documentation for `simpleapp-generator` and `simpleapp-vue-component`
1051
+
1052
+
1053
+ workflow ideal
1054
+ 1. define apiserver at backend .env
1055
+ 2. api-service class can have standardway for
1056
+ a. excute new workflow
1057
+ b. get tasklist belong to me or my group
1058
+ c. trigger task move
1059
+ d. cancel workflow
1060
+ e. can define workflow inputs
1061
+ 3. bind hook to workflow?
1062
+
1063
+
1064
+
1065
+
1066
+
1067
+ 1. try possibility of no backend modifications
1068
+ 3. completely hide all generated codes of frontend and backend, except allow change items
1069
+ 1. define hidden control infra of admin tenant, user api+ui (like need special role system-admin from keycloak)
1070
+ add lodash plugin at both side
1071
+
1072
+
1073
+ autocomplete can have more dependency filter like setting in jsonschema
1074
+ 2. way in jsonschema to use share source code for frontend/backend like
1075
+ calculate tax
1076
+ calculate subtotal
1077
+
1078
+ 5. new transaction crud
1079
+ d. windows
1080
+ new user no tenant record how to do?
1081
+ 8. way to handle :id/api
1082
+ 9. service class which not using source code
1083
+
1084
+
1085
+
1086
+ 1. create follow data
1087
+ a. users
1088
+ b. tenant / users
1089
+ c. org
1090
+ branch/user
1091
+ group
1092
+
1093
+
1094
+ 3. json schema setting can define isolation type
1095
+ 2. page/index first login can pick tenant
1096
+ 3. create all window as xorg/index
1097
+ 4. transaction crud window
1098
+ with x-document-api can have button for api-buttons, control by document status
1099
+ support readonly status
1100
+ 5. simple crud only support crud
1101
+ 6. support document-no
1102
+ 7. add special isolation method by user
1103
+ 8. beautify nuxt page
1104
+ 9. foreign key with different schema
1105
+
1106
+
1107
+ 2. tidy up error at frontend/backend messages
1108
+ fix success msg at frontend
1109
+ 11.add simple and consistent external hook in service class.
1110
+ 13.have way to create more api using different openapi schema but on same object
1111
+ 1. support half schema setting in crud, the rest at background
1112
+
1113
+ no auto logout after session expired, or auto renew token
1114
+ - menulist ** less priority, can customize manually
1115
+ 10.auto bind apiclient methods to compatible with openapi methods
1116
+ a. create backend service method
1117
+ b. create controller handle
1118
+
1119
+ b. add popup dialog for edit table
1120
+ c. separate list table and form table
1121
+ d.
1122
+ 5. tenant setting
1123
+ 6. user management
1124
+ 5. security of string input, block xss
1125
+ 12.add pusher listener in apiclient also
1126
+
1127
+ 18. add transaction screen templates
1128
+
1129
+
1130
+ ## Lower Priority
1131
+ 3. multi-lingual
1132
+ 6. audit trails
1133
+ 7. permissions
1134
+ 7. update record need replace updated,updatedby, line item also need headache
1135
+
1136
+ 11.frontend add parent/child ui for invoices
1137
+
1138
+ [done]
1139
+ x16. support table details in generator
1140
+ x3. settle instancePath in form
1141
+ x17. auto add source code for addarray item
1142
+ a. render autocomplete readonly field
1143
+ xauto index x-document-name
1144
+ x8. jwt
1145
+ ximprove tel control to allow empty string
1146
+ x15. some autocomplete wish to allow additional column like 6% tax, now become additional fields
1147
+ x9. frontend authentication
1148
+ x1. auto pretty backend and frontend
1149
+ x2. fix pages:id issue
1150
+ x3. search at backend
1151
+ 1. remain codes after regenerate (backend)
1152
+ x - service
1153
+ x - schema
1154
+ x - controller
1155
+ x8. block uniquekey
1156
+ 1. remain codes after regenerate (frontend)
1157
+ x - pages
1158
+ x - composable (no need )
1159
+ x6. fill in data for tenant/org/branch created,updated,createdby,updatedby
1160
+ 14. force x-document-no/name is required
1161
+
1162
+
1163
+
1164
+ ## Bug fix
1165
+ 1. Openapi some schema like primarykey/more not generated, cause error in ide
1166
+
1167
+
1168
+ Document Numbering System
1169
+ 1. generate prepare list of document no for generate.
1170
+ x-document-no + document-format
1171
+ 2. if x-document-no, will auto add docformat={}
1172
+ 3. button can pick document-no format
1173
+ 4. have add new function
1174
+ 5. if type manually wont create new
1175
+ 6. preview next no api
1176
+ 7. generate next no api
1177
+ 8. if _id = '', will auto preview next no
1178
+ 9. after change default format, will preview another next no
1179
+ 10. have list to pick format
1180
+ 11. support transactions
1181
+ 12. only list current branch document no options
1182
+ 11. master data
1183
+ a. add list for document type
1184
+ b. click doctype then can available document settings
1185
+ c. document will set by branch
1186
+
1187
+
1188
+ SimpleApp-Vue-Component Fix:
1189
+ 1. table
1190
+ a. column title
1191
+ b. nested column data, like primarykey label
1192
+ c. search and functions like filters, pagination, large datas
1193
+ 1. single/multi select
1194
+ 4. search at frontend
1195
+
1196
+
1197
+ Coding Rules
1198
+ 1. create type and codes in 'shares'
1199
+ 2. service class and doc class
1200
+
1201
+
1202
+
1203
+
1204
+ JSON Properties
1205
+ document level property
1206
+ {
1207
+ "type":"object"
1208
+ "x-simpleapp-config":{
1209
+ //isolation type, none/tenant/org/branch
1210
+ "isolationType":"none",
1211
+
1212
+ //what special allow access it, undefine mean only super admin, and resource+action role can go in
1213
+ "requiredRoles":["SuperAdmin"],
1214
+
1215
+ // page type (example: crud), undefine will not generate page in frontend
1216
+ "pageType":"crud",
1217
+
1218
+ //unique key for document, it build compound index depends on isolationtype
1219
+ "uniqueKey":"invoiceNo",
1220
+
1221
+ //use as display name in autocomplete, also add into textsearch
1222
+ "documentTitle":"InvoiceTitle", //no define this will not have auto complete and text search for this field
1223
+
1224
+
1225
+ //frontend uniqueKey field become special input field which can generate doc number, once activated auto create new field `docNoFormat`
1226
+ "generateDocumentNumber":true,
1227
+
1228
+ //frontend use this field to show current month document, docNumberFormat generator will have monthly document number setting
1229
+ "documentDate":"invoiceDate",
1230
+
1231
+ //manage document status and accessibility, it auto add field `documentStatus` when define
1232
+ "allStatus":[
1233
+ {"status":"CO","readOnly":true,"actions":["revert","void","close"]},
1234
+ {"status":"V","readOnly":true,"actions":["revert"]},
1235
+ ],
1236
+
1237
+ //all custom api, response, paras, operation put here. variable define at entrypoint or querypara
1238
+ "allApi":[{
1239
+ "action":"confirm",
1240
+ "entrypoint":":id/confirm",
1241
+ "requiredrole":["SuperUser"],
1242
+ "method":"post",
1243
+ "execute":"ping",
1244
+ "description":"confirm document and change status to CO"
1245
+ },{
1246
+ "action":"void",
1247
+ "entrypoint":":id/void",
1248
+ "querypara":["reason"],
1249
+ "requiredrole":["SuperUser"],
1250
+ "method":"post",
1251
+ "execute":"ping",
1252
+ "description":"confirm document and change status to CO"
1253
+ }],
1254
+
1255
+ // simple => pure model and service(no page,api),
1256
+ // default => force masterdata property,
1257
+ // transaction => force masterdata property
1258
+ "schemaType": "default",
1259
+
1260
+ //frontend(client) and backend (processor) typescript class auto import this lib, helper for `formula`
1261
+ "libs":[{"lib":"lodash","as":"_"}], // both process class and frontend client class will import same lib
1262
+
1263
+ // frontend apply recalculation everytime current document change
1264
+ // backend auto apply formula during create and update
1265
+ "formula": [ //apply both frontend and backend, it different with concept on change, sequence of formula important
1266
+ {"jsonpath":"$.subtotal","formula":"jslib.getDocumentSubTotal(@F{$.details})"}, //apply formula into single field
1267
+ {"jsonpath":"$.tags","formula":"$F{$.tags}.map(item=>item.toUppeCase())"}, //apply upper case to all item in string array
1268
+ {"jsonpath":"$.details","loop":"jslib.calculateLineTotal(item)"}, //apply multiple calculation of subtotal, tax, amtaftertax and etc, using loop
1269
+ {"jsonpath":"$.total","formula":"@F{$.subtotal} + @F{$.taxamt}"}, //apply simple formula here
1270
+ ],
1271
+
1272
+ // auto generate fields
1273
+ documentType: 'SI',
1274
+ documentName: 'Sales Invoice',
1275
+
1276
+ //auto generated foreign keys catalogue
1277
+ "foreignKeys":{ "customer":["$.customer._id"], "user":[{"$.preparedby._id"},{$.approveby._id"}]}
1278
+ },
1279
+ "properties":{
1280
+ "invoiceDate":{"type":"string"},
1281
+ //and others field
1282
+ }
1283
+ }
package/README.md CHANGED
@@ -1,397 +1,38 @@
1
- todo:
2
- ## high priority Job
3
-
4
- [ ] add special search like isolate by user for autocomplete (add property of)
5
- choose org then branch
6
- [ ] create invoice and receipt
7
- [x] fix error reporting and success reporting at frontend
8
- [x] define some allow override and some not
9
- [ ] json schema can set generate what page type, no define = no generate page
10
- [ ] create tenant/org/branch auto increament
11
- [ ] focus on functions customer, product, invoice and receipt
12
- [~] repeat same typscript formula at frontend and backend
13
- [ ] frontend search
14
- [ ] new transaction CRUD ui
15
- [ ] student UI
16
- [ ] structure of save into another document
17
-
18
- Permission and Authorization
19
- [x] hide no permission window
20
- [ ] hide no permission buttons
21
- [x] permission user/group (pick hard coded group from some place)
22
- [ ] figure how to get enum list from permission list for user schema
23
-
24
-
25
-
26
- 1. copy group-to-role to both frontend and backend
27
- 2. loop backend role code, and define into user role
28
- 3. loop frontend role code, and
29
- 1 update to getMenus,
30
- 2. existing all menus store as permission list
31
- 3. crud and etc page need verify existing user can go in this menu or not. if can't will render no permission
32
- 4. use directive to control show or not show button (new, save, delete)
33
-
34
-
35
-
36
- Custom Document Status and API
37
- [ ] document status control
38
- [ ] document api touch up
39
- 1. auto add document status column
40
- 2. change document status when change status
41
- 3. enum document status, but UI dont show the field
42
- 4. have document action, then show document button
43
-
44
-
45
- # Quick start
46
- ** You need to have mongodb installed **
47
- 1. git clone from simpleapp-generator
1
+ # Quick start
2
+ 1. create project folder
48
3
  ```sh
49
- npm -i @simitgroup/simpleapp-generator@latest
50
- git clone https://github.com/SIMITGROUP/simpleapp-generator-template myapp
51
- # edit myapp/config.json to match you mongodb connection string
52
- cd ~/myapp
53
- simpleapp-generator -c config.json
4
+ mkdir project1
5
+ cd project1
54
6
  ```
55
- 2. start backend
7
+ 2. install simpleapp-generator
56
8
  ```sh
57
- cd ~/myapp/backend
58
- pnpm start:dev
9
+ npm install -g @simitgroup/simpleapp-generator
59
10
  ```
60
- 3. start frontend
11
+ 3. init project folder, it will create some samples too
61
12
  ```sh
62
- cd ~/myapp/frontend
63
- pnpm dev
13
+ simpleapp-generator -g init
64
14
  ```
65
- 4. try ui:
66
- * frontend: [http://localhost:8080](http://localhost:8080)
67
- * backend: [http://localhost:8000/api](http://localhost:8000/api)
68
- 5. Open project with vscode, explore json schema and the generated forms
15
+ 4. prepare backend
69
16
  ```sh
70
- code ~/mydoc
17
+ sh build.sh backend
18
+ cd backend
19
+ pnpm start:dev
71
20
  ```
72
- you can change your project at:
73
- * myapp/backend/.env
74
- * myapp/backend/src/hooks/*
75
-
76
- * myapp/frontend/.env
77
- * myapp/frontend/pages/*
78
-
79
-
80
-
81
- # Special Properties:
82
- ## Special root level property
83
- _id:
84
- tenantId:
85
- orgId:
86
- branchId:
87
- created:
88
- createdby:
89
- updated:
90
- updatedby:
91
- documentStatus
92
- _v:
93
- x-document-status: [optional]array of document satus: such as:
94
- {
95
- "":{"readonly":false,"allowApi":["confirm","void"],"description":"new"},
96
- "D":{"readonly":false,"allowApi":["confirm","void"],"description":"draft"},
97
- "V":{"readonly":true,"allowApi":[],"description":"v"},
98
- "CO":{"readonly":true,"allowApi":["void","revert"],"description":"confirmed"},
99
- "CL":{"readonly":true,"allowApi":[],"description":"closed"}
100
- }
101
- x-document-api: [optional]array of custom api (beside default)
102
-
103
- ```typescript
104
- [
105
- {"action":"confirm","method":"put","setDocumentStatus":"CO", "bpmn":"generic-confirm",
106
- "data":{"document":"document"}},
107
- {"action":"void",,"method":"put", "setDocumentStatus":"V", "bpmn":"generic-void",
108
- "data":{"document":"document"}},
109
- {"action":"revert",,"method":"put", "setDocumentStatus":"D", "bpmn":"generic-revert",
110
- "data":{"document":"document"}},
111
- {"action":"duplicate", ,"method":"post","data":{"document":"document"}},
112
- {"action":"switchStatus",,"method":"put","data":{"statusName":"string","document":"document"}}
113
- ]
21
+ 5. prepare frontend
22
+ ```sh
23
+ sh build.sh frontend
24
+ cd frontend
25
+ pnpm start
114
26
  ```
115
- ## Custom Format
116
-
117
- ## Custom Property
118
-
119
- # Concept of Development
120
- Development using simpleapp-generator involve below steps:
121
- ## Simple
122
- 1. create appropriate jsonschema
123
- 2. generate frontend and backend architectures
124
- 3. start backend service, obtain and save api definations into openapi.yaml
125
- 4. regenerate codes so frontend can obtain openapi clients
126
- 5. align frontend UI, add necessary component such as css and ui components
127
-
128
- ## Advance
129
- 1. complete simple task
130
- 2. add more api/process at backend `controller`,`service`,`schema`. Such as:
131
- a. customized search and filters
132
- b. customized workflows
133
- c. connect external api
134
- d. additional data processing and validation which is not supported by jsonschema (AJV)
135
- 3. security like sso/jwt, plugins
136
- a. keycloak integration at frontends
137
- b. backend manage jwt
138
- 4. allow additional field formats, validations by modifying ajv
139
- a. allow custom jsonschema field property, and do something at backend
140
- b. allow custom field format, and do something at backend
141
- 5. repeat same typscript formula at frontend and backend
142
-
143
- Special Root Level property
144
- [x] x-ignore-autocomplete: optional boolean, define it to allow undefine x-document-no & x-document-label
145
- [x] x-isolation-type: optional string, how data isolated, 'none,tenant,org,branch', default 'org'
146
-
147
- Special Field Level property
148
-
149
-
150
-
151
- # JSON Schema supported String Format
152
- all format recognize by ajv plus below:
153
-
154
- 1. tel: only digit, auto generate input tel
155
- 2. documentno : will use documentno generator for auto generate document no
156
- 3. text: do nothing, will auto generate textarea
157
- 4. html editor: do nothing, will auto generate html editor
158
-
159
-
160
-
161
- # Todo
162
- ## Update documentation and reference
163
- 1. create github simpleapp-generator-template and documentation
164
- 2. update documentation for `simpleapp-generator` and `simpleapp-vue-component`
165
-
166
-
167
- workflow ideal
168
- 1. define apiserver at backend .env
169
- 2. api-service class can have standardway for
170
- a. excute new workflow
171
- b. get tasklist belong to me or my group
172
- c. trigger task move
173
- d. cancel workflow
174
- e. can define workflow inputs
175
- 3. bind hook to workflow?
176
-
177
27
 
28
+ # Perform Development
29
+ 1. add some schemas from project1/schemas
30
+ 2. then run
31
+ ```sh
32
+ sh build.sh updatebackend
33
+ sh build.sh updatefrontend
34
+ ```
35
+ 3. to add different user group permission, you may change `project1/groups`
178
36
 
179
37
 
180
38
 
181
- 1. try possibility of no backend modifications
182
- 3. completely hide all generated codes of frontend and backend, except allow change items
183
- 1. define hidden control infra of admin tenant, user api+ui (like need special role system-admin from keycloak)
184
- add lodash plugin at both side
185
-
186
-
187
- autocomplete can have more dependency filter like setting in jsonschema
188
- 2. way in jsonschema to use share source code for frontend/backend like
189
- calculate tax
190
- calculate subtotal
191
-
192
- 5. new transaction crud
193
- d. windows
194
- new user no tenant record how to do?
195
- 8. way to handle :id/api
196
- 9. service class which not using source code
197
-
198
-
199
-
200
- 1. create follow data
201
- a. users
202
- b. tenant / users
203
- c. org
204
- branch/user
205
- group
206
-
207
-
208
- 3. json schema setting can define isolation type
209
- 2. page/index first login can pick tenant
210
- 3. create all window as xorg/index
211
- 4. transaction crud window
212
- with x-document-api can have button for api-buttons, control by document status
213
- support readonly status
214
- 5. simple crud only support crud
215
- 6. support document-no
216
- 7. add special isolation method by user
217
- 8. beautify nuxt page
218
- 9. foreign key with different schema
219
-
220
-
221
- 2. tidy up error at frontend/backend messages
222
- fix success msg at frontend
223
- 11.add simple and consistent external hook in service class.
224
- 13.have way to create more api using different openapi schema but on same object
225
- 1. support half schema setting in crud, the rest at background
226
-
227
- no auto logout after session expired, or auto renew token
228
- - menulist ** less priority, can customize manually
229
- 10.auto bind apiclient methods to compatible with openapi methods
230
- a. create backend service method
231
- b. create controller handle
232
-
233
- b. add popup dialog for edit table
234
- c. separate list table and form table
235
- d.
236
- 5. tenant setting
237
- 6. user management
238
- 5. security of string input, block xss
239
- 12.add pusher listener in apiclient also
240
-
241
- 18. add transaction screen templates
242
-
243
-
244
- ## Lower Priority
245
- 3. multi-lingual
246
- 6. audit trails
247
- 7. permissions
248
- 7. update record need replace updated,updatedby, line item also need headache
249
-
250
- 11.frontend add parent/child ui for invoices
251
-
252
- [done]
253
- x16. support table details in generator
254
- x3. settle instancePath in form
255
- x17. auto add source code for addarray item
256
- a. render autocomplete readonly field
257
- xauto index x-document-name
258
- x8. jwt
259
- ximprove tel control to allow empty string
260
- x15. some autocomplete wish to allow additional column like 6% tax, now become additional fields
261
- x9. frontend authentication
262
- x1. auto pretty backend and frontend
263
- x2. fix pages:id issue
264
- x3. search at backend
265
- 1. remain codes after regenerate (backend)
266
- x - service
267
- x - schema
268
- x - controller
269
- x8. block uniquekey
270
- 1. remain codes after regenerate (frontend)
271
- x - pages
272
- x - composable (no need )
273
- x6. fill in data for tenant/org/branch created,updated,createdby,updatedby
274
- 14. force x-document-no/name is required
275
-
276
-
277
-
278
- ## Bug fix
279
- 1. Openapi some schema like primarykey/more not generated, cause error in ide
280
-
281
-
282
- Document Numbering System
283
- 1. generate prepare list of document no for generate.
284
- x-document-no + document-format
285
- 2. if x-document-no, will auto add docformat={}
286
- 3. button can pick document-no format
287
- 4. have add new function
288
- 5. if type manually wont create new
289
- 6. preview next no api
290
- 7. generate next no api
291
- 8. if _id = '', will auto preview next no
292
- 9. after change default format, will preview another next no
293
- 10. have list to pick format
294
- 11. support transactions
295
- 12. only list current branch document no options
296
- 11. master data
297
- a. add list for document type
298
- b. click doctype then can available document settings
299
- c. document will set by branch
300
-
301
-
302
- SimpleApp-Vue-Component Fix:
303
- 1. table
304
- a. column title
305
- b. nested column data, like primarykey label
306
- c. search and functions like filters, pagination, large datas
307
- 1. single/multi select
308
- 4. search at frontend
309
-
310
-
311
- Coding Rules
312
- 1. create type and codes in 'shares'
313
- 2. service class and doc class
314
-
315
-
316
-
317
-
318
- JSON Properties
319
- document level property
320
- {
321
- "type":"object"
322
- "x-simpleapp-config":{
323
- //isolation type, none/tenant/org/branch
324
- "isolationType":"none",
325
-
326
- //what special allow access it, undefine mean only super admin, and resource+action role can go in
327
- "requiredRoles":["SuperAdmin"],
328
-
329
- // page type (example: crud), undefine will not generate page in frontend
330
- "pageType":"crud",
331
-
332
- //unique key for document, it build compound index depends on isolationtype
333
- "uniqueKey":"invoiceNo",
334
-
335
- //use as display name in autocomplete, also add into textsearch
336
- "documentTitle":"InvoiceTitle", //no define this will not have auto complete and text search for this field
337
-
338
-
339
- //frontend uniqueKey field become special input field which can generate doc number, once activated auto create new field `docNoFormat`
340
- "generateDocumentNumber":true,
341
-
342
- //frontend use this field to show current month document, docNumberFormat generator will have monthly document number setting
343
- "documentDate":"invoiceDate",
344
-
345
- //manage document status and accessibility, it auto add field `documentStatus` when define
346
- "allStatus":[
347
- {"status":"CO","readOnly":true,"actions":["revert","void","close"]},
348
- {"status":"V","readOnly":true,"actions":["revert"]},
349
- ],
350
-
351
- //all custom api, response, paras, operation put here. variable define at entrypoint or querypara
352
- "allApi":[{
353
- "action":"confirm",
354
- "entrypoint":":id/confirm",
355
- "requiredrole":["SuperUser"],
356
- "method":"post",
357
- "execute":"ping",
358
- "description":"confirm document and change status to CO"
359
- },{
360
- "action":"void",
361
- "entrypoint":":id/void",
362
- "querypara":["reason"],
363
- "requiredrole":["SuperUser"],
364
- "method":"post",
365
- "execute":"ping",
366
- "description":"confirm document and change status to CO"
367
- }],
368
-
369
- // simple => pure model and service(no page,api),
370
- // default => force masterdata property,
371
- // transaction => force masterdata property
372
- "schemaType": "default",
373
-
374
- //frontend(client) and backend (processor) typescript class auto import this lib, helper for `formula`
375
- "libs":[{"lib":"lodash","as":"_"}], // both process class and frontend client class will import same lib
376
-
377
- // frontend apply recalculation everytime current document change
378
- // backend auto apply formula during create and update
379
- "formula": [ //apply both frontend and backend, it different with concept on change, sequence of formula important
380
- {"jsonpath":"$.subtotal","formula":"jslib.getDocumentSubTotal(@F{$.details})"}, //apply formula into single field
381
- {"jsonpath":"$.tags","formula":"$F{$.tags}.map(item=>item.toUppeCase())"}, //apply upper case to all item in string array
382
- {"jsonpath":"$.details","loop":"jslib.calculateLineTotal(item)"}, //apply multiple calculation of subtotal, tax, amtaftertax and etc, using loop
383
- {"jsonpath":"$.total","formula":"@F{$.subtotal} + @F{$.taxamt}"}, //apply simple formula here
384
- ],
385
-
386
- // auto generate fields
387
- documentType: 'SI',
388
- documentName: 'Sales Invoice',
389
-
390
- //auto generated foreign keys catalogue
391
- "foreignKeys":{ "customer":["$.customer._id"], "user":[{"$.preparedby._id"},{$.approveby._id"}]}
392
- },
393
- "properties":{
394
- "invoiceDate":{"type":"string"},
395
- //and others field
396
- }
397
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simitgroup/simpleapp-generator",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "frontend nuxtjs and backend nests code generator using jsonschema",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,40 @@
1
+ {
2
+ "Autoincreament": [
3
+ "create",
4
+ "update",
5
+ "delete",
6
+ "search",
7
+ "genNextNumber"
8
+ ],
9
+ "Branch": [
10
+ "create",
11
+ "update",
12
+ "delete",
13
+ "search"
14
+ ],
15
+ "Organization": [
16
+ "create",
17
+ "update",
18
+ "search",
19
+ "delete"
20
+ ],
21
+ "Permission": [
22
+ "listUser",
23
+ "search",
24
+ "delete",
25
+ "update",
26
+ "create"
27
+ ],
28
+ "Tenant": [
29
+ "create",
30
+ "update",
31
+ "delete",
32
+ "search"
33
+ ],
34
+ "User": [
35
+ "create",
36
+ "update",
37
+ "search",
38
+ "delete"
39
+ ]
40
+ }
@@ -1,4 +1,5 @@
1
- import {SchemaType,RESTMethods,IsolationType} from '/Users/kstan/dev/lowcode/simpleapp-generator/src/type'
1
+ //examples
2
+ import {SchemaType,RESTMethods,IsolationType} from '/usr/local/lib/node_modules/@simitgroup/simpleapp-generator/src/type'
2
3
  export const category:SchemaType =
3
4
  {
4
5
  type: "object",
@@ -1,5 +1,5 @@
1
1
  //examples
2
- import {SchemaType,RESTMethods,IsolationType} from '/Users/kstan/dev/lowcode/simpleapp-generator/src/type'
2
+ import {SchemaType,RESTMethods,IsolationType} from '/usr/local/lib/node_modules/@simitgroup/simpleapp-generator/src/type'
3
3
  export const product:SchemaType =
4
4
  {
5
5
  type: "object",