@simitgroup/simpleapp-generator 1.0.40 → 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
@@ -32,409 +32,7 @@ pnpm start
32
32
  sh build.sh updatebackend
33
33
  sh build.sh updatefrontend
34
34
  ```
35
+ 3. to add different user group permission, you may change `project1/groups`
35
36
 
36
37
 
37
38
 
38
-
39
-
40
-
41
-
42
-
43
-
44
- todo:
45
- ## high priority Job
46
-
47
- [ ] add special search like isolate by user for autocomplete (add property of)
48
- choose org then branch
49
- [ ] create invoice and receipt
50
- [x] fix error reporting and success reporting at frontend
51
- [x] define some allow override and some not
52
- [ ] json schema can set generate what page type, no define = no generate page
53
- [ ] create tenant/org/branch auto increament
54
- [ ] focus on functions customer, product, invoice and receipt
55
- [~] repeat same typscript formula at frontend and backend
56
- [ ] frontend search
57
- [ ] new transaction CRUD ui
58
- [ ] student UI
59
- [ ] structure of save into another document
60
-
61
- Permission and Authorization
62
- [x] hide no permission window
63
- [ ] hide no permission buttons
64
- [x] permission user/group (pick hard coded group from some place)
65
- [ ] figure how to get enum list from permission list for user schema
66
-
67
-
68
-
69
- 1. copy group-to-role to both frontend and backend
70
- 2. loop backend role code, and define into user role
71
- 3. loop frontend role code, and
72
- 1 update to getMenus,
73
- 2. existing all menus store as permission list
74
- 3. crud and etc page need verify existing user can go in this menu or not. if can't will render no permission
75
- 4. use directive to control show or not show button (new, save, delete)
76
-
77
-
78
-
79
- Custom Document Status and API
80
- [ ] document status control
81
- [ ] document api touch up
82
- 1. auto add document status column
83
- 2. change document status when change status
84
- 3. enum document status, but UI dont show the field
85
- 4. have document action, then show document button
86
-
87
-
88
- # Quick start
89
- ** You need to have mongodb installed **
90
- 1. git clone from simpleapp-generator
91
- ```sh
92
- npm -i @simitgroup/simpleapp-generator@latest
93
- git clone https://github.com/SIMITGROUP/simpleapp-generator-template myapp
94
- # edit myapp/config.json to match you mongodb connection string
95
- cd ~/myapp
96
- simpleapp-generator -c config.json
97
- ```
98
- 2. start backend
99
- ```sh
100
- cd ~/myapp/backend
101
- pnpm start:dev
102
- ```
103
- 3. start frontend
104
- ```sh
105
- cd ~/myapp/frontend
106
- pnpm dev
107
- ```
108
- 4. try ui:
109
- * frontend: [http://localhost:8080](http://localhost:8080)
110
- * backend: [http://localhost:8000/api](http://localhost:8000/api)
111
- 5. Open project with vscode, explore json schema and the generated forms
112
- ```sh
113
- code ~/mydoc
114
- ```
115
- you can change your project at:
116
- * myapp/backend/.env
117
- * myapp/backend/src/hooks/*
118
-
119
- * myapp/frontend/.env
120
- * myapp/frontend/pages/*
121
-
122
-
123
-
124
- # Special Properties:
125
- ## Special root level property
126
- _id:
127
- tenantId:
128
- orgId:
129
- branchId:
130
- created:
131
- createdby:
132
- updated:
133
- updatedby:
134
- documentStatus
135
- _v:
136
- x-document-status: [optional]array of document satus: such as:
137
- {
138
- "":{"readonly":false,"allowApi":["confirm","void"],"description":"new"},
139
- "D":{"readonly":false,"allowApi":["confirm","void"],"description":"draft"},
140
- "V":{"readonly":true,"allowApi":[],"description":"v"},
141
- "CO":{"readonly":true,"allowApi":["void","revert"],"description":"confirmed"},
142
- "CL":{"readonly":true,"allowApi":[],"description":"closed"}
143
- }
144
- x-document-api: [optional]array of custom api (beside default)
145
-
146
- ```typescript
147
- [
148
- {"action":"confirm","method":"put","setDocumentStatus":"CO", "bpmn":"generic-confirm",
149
- "data":{"document":"document"}},
150
- {"action":"void",,"method":"put", "setDocumentStatus":"V", "bpmn":"generic-void",
151
- "data":{"document":"document"}},
152
- {"action":"revert",,"method":"put", "setDocumentStatus":"D", "bpmn":"generic-revert",
153
- "data":{"document":"document"}},
154
- {"action":"duplicate", ,"method":"post","data":{"document":"document"}},
155
- {"action":"switchStatus",,"method":"put","data":{"statusName":"string","document":"document"}}
156
- ]
157
- ```
158
- ## Custom Format
159
-
160
- ## Custom Property
161
-
162
- # Concept of Development
163
- Development using simpleapp-generator involve below steps:
164
- ## Simple
165
- 1. create appropriate jsonschema
166
- 2. generate frontend and backend architectures
167
- 3. start backend service, obtain and save api definations into openapi.yaml
168
- 4. regenerate codes so frontend can obtain openapi clients
169
- 5. align frontend UI, add necessary component such as css and ui components
170
-
171
- ## Advance
172
- 1. complete simple task
173
- 2. add more api/process at backend `controller`,`service`,`schema`. Such as:
174
- a. customized search and filters
175
- b. customized workflows
176
- c. connect external api
177
- d. additional data processing and validation which is not supported by jsonschema (AJV)
178
- 3. security like sso/jwt, plugins
179
- a. keycloak integration at frontends
180
- b. backend manage jwt
181
- 4. allow additional field formats, validations by modifying ajv
182
- a. allow custom jsonschema field property, and do something at backend
183
- b. allow custom field format, and do something at backend
184
- 5. repeat same typscript formula at frontend and backend
185
-
186
- Special Root Level property
187
- [x] x-ignore-autocomplete: optional boolean, define it to allow undefine x-document-no & x-document-label
188
- [x] x-isolation-type: optional string, how data isolated, 'none,tenant,org,branch', default 'org'
189
-
190
- Special Field Level property
191
-
192
-
193
-
194
- # JSON Schema supported String Format
195
- all format recognize by ajv plus below:
196
-
197
- 1. tel: only digit, auto generate input tel
198
- 2. documentno : will use documentno generator for auto generate document no
199
- 3. text: do nothing, will auto generate textarea
200
- 4. html editor: do nothing, will auto generate html editor
201
-
202
-
203
-
204
- # Todo
205
- ## Update documentation and reference
206
- 1. create github simpleapp-generator-template and documentation
207
- 2. update documentation for `simpleapp-generator` and `simpleapp-vue-component`
208
-
209
-
210
- workflow ideal
211
- 1. define apiserver at backend .env
212
- 2. api-service class can have standardway for
213
- a. excute new workflow
214
- b. get tasklist belong to me or my group
215
- c. trigger task move
216
- d. cancel workflow
217
- e. can define workflow inputs
218
- 3. bind hook to workflow?
219
-
220
-
221
-
222
-
223
-
224
- 1. try possibility of no backend modifications
225
- 3. completely hide all generated codes of frontend and backend, except allow change items
226
- 1. define hidden control infra of admin tenant, user api+ui (like need special role system-admin from keycloak)
227
- add lodash plugin at both side
228
-
229
-
230
- autocomplete can have more dependency filter like setting in jsonschema
231
- 2. way in jsonschema to use share source code for frontend/backend like
232
- calculate tax
233
- calculate subtotal
234
-
235
- 5. new transaction crud
236
- d. windows
237
- new user no tenant record how to do?
238
- 8. way to handle :id/api
239
- 9. service class which not using source code
240
-
241
-
242
-
243
- 1. create follow data
244
- a. users
245
- b. tenant / users
246
- c. org
247
- branch/user
248
- group
249
-
250
-
251
- 3. json schema setting can define isolation type
252
- 2. page/index first login can pick tenant
253
- 3. create all window as xorg/index
254
- 4. transaction crud window
255
- with x-document-api can have button for api-buttons, control by document status
256
- support readonly status
257
- 5. simple crud only support crud
258
- 6. support document-no
259
- 7. add special isolation method by user
260
- 8. beautify nuxt page
261
- 9. foreign key with different schema
262
-
263
-
264
- 2. tidy up error at frontend/backend messages
265
- fix success msg at frontend
266
- 11.add simple and consistent external hook in service class.
267
- 13.have way to create more api using different openapi schema but on same object
268
- 1. support half schema setting in crud, the rest at background
269
-
270
- no auto logout after session expired, or auto renew token
271
- - menulist ** less priority, can customize manually
272
- 10.auto bind apiclient methods to compatible with openapi methods
273
- a. create backend service method
274
- b. create controller handle
275
-
276
- b. add popup dialog for edit table
277
- c. separate list table and form table
278
- d.
279
- 5. tenant setting
280
- 6. user management
281
- 5. security of string input, block xss
282
- 12.add pusher listener in apiclient also
283
-
284
- 18. add transaction screen templates
285
-
286
-
287
- ## Lower Priority
288
- 3. multi-lingual
289
- 6. audit trails
290
- 7. permissions
291
- 7. update record need replace updated,updatedby, line item also need headache
292
-
293
- 11.frontend add parent/child ui for invoices
294
-
295
- [done]
296
- x16. support table details in generator
297
- x3. settle instancePath in form
298
- x17. auto add source code for addarray item
299
- a. render autocomplete readonly field
300
- xauto index x-document-name
301
- x8. jwt
302
- ximprove tel control to allow empty string
303
- x15. some autocomplete wish to allow additional column like 6% tax, now become additional fields
304
- x9. frontend authentication
305
- x1. auto pretty backend and frontend
306
- x2. fix pages:id issue
307
- x3. search at backend
308
- 1. remain codes after regenerate (backend)
309
- x - service
310
- x - schema
311
- x - controller
312
- x8. block uniquekey
313
- 1. remain codes after regenerate (frontend)
314
- x - pages
315
- x - composable (no need )
316
- x6. fill in data for tenant/org/branch created,updated,createdby,updatedby
317
- 14. force x-document-no/name is required
318
-
319
-
320
-
321
- ## Bug fix
322
- 1. Openapi some schema like primarykey/more not generated, cause error in ide
323
-
324
-
325
- Document Numbering System
326
- 1. generate prepare list of document no for generate.
327
- x-document-no + document-format
328
- 2. if x-document-no, will auto add docformat={}
329
- 3. button can pick document-no format
330
- 4. have add new function
331
- 5. if type manually wont create new
332
- 6. preview next no api
333
- 7. generate next no api
334
- 8. if _id = '', will auto preview next no
335
- 9. after change default format, will preview another next no
336
- 10. have list to pick format
337
- 11. support transactions
338
- 12. only list current branch document no options
339
- 11. master data
340
- a. add list for document type
341
- b. click doctype then can available document settings
342
- c. document will set by branch
343
-
344
-
345
- SimpleApp-Vue-Component Fix:
346
- 1. table
347
- a. column title
348
- b. nested column data, like primarykey label
349
- c. search and functions like filters, pagination, large datas
350
- 1. single/multi select
351
- 4. search at frontend
352
-
353
-
354
- Coding Rules
355
- 1. create type and codes in 'shares'
356
- 2. service class and doc class
357
-
358
-
359
-
360
-
361
- JSON Properties
362
- document level property
363
- {
364
- "type":"object"
365
- "x-simpleapp-config":{
366
- //isolation type, none/tenant/org/branch
367
- "isolationType":"none",
368
-
369
- //what special allow access it, undefine mean only super admin, and resource+action role can go in
370
- "requiredRoles":["SuperAdmin"],
371
-
372
- // page type (example: crud), undefine will not generate page in frontend
373
- "pageType":"crud",
374
-
375
- //unique key for document, it build compound index depends on isolationtype
376
- "uniqueKey":"invoiceNo",
377
-
378
- //use as display name in autocomplete, also add into textsearch
379
- "documentTitle":"InvoiceTitle", //no define this will not have auto complete and text search for this field
380
-
381
-
382
- //frontend uniqueKey field become special input field which can generate doc number, once activated auto create new field `docNoFormat`
383
- "generateDocumentNumber":true,
384
-
385
- //frontend use this field to show current month document, docNumberFormat generator will have monthly document number setting
386
- "documentDate":"invoiceDate",
387
-
388
- //manage document status and accessibility, it auto add field `documentStatus` when define
389
- "allStatus":[
390
- {"status":"CO","readOnly":true,"actions":["revert","void","close"]},
391
- {"status":"V","readOnly":true,"actions":["revert"]},
392
- ],
393
-
394
- //all custom api, response, paras, operation put here. variable define at entrypoint or querypara
395
- "allApi":[{
396
- "action":"confirm",
397
- "entrypoint":":id/confirm",
398
- "requiredrole":["SuperUser"],
399
- "method":"post",
400
- "execute":"ping",
401
- "description":"confirm document and change status to CO"
402
- },{
403
- "action":"void",
404
- "entrypoint":":id/void",
405
- "querypara":["reason"],
406
- "requiredrole":["SuperUser"],
407
- "method":"post",
408
- "execute":"ping",
409
- "description":"confirm document and change status to CO"
410
- }],
411
-
412
- // simple => pure model and service(no page,api),
413
- // default => force masterdata property,
414
- // transaction => force masterdata property
415
- "schemaType": "default",
416
-
417
- //frontend(client) and backend (processor) typescript class auto import this lib, helper for `formula`
418
- "libs":[{"lib":"lodash","as":"_"}], // both process class and frontend client class will import same lib
419
-
420
- // frontend apply recalculation everytime current document change
421
- // backend auto apply formula during create and update
422
- "formula": [ //apply both frontend and backend, it different with concept on change, sequence of formula important
423
- {"jsonpath":"$.subtotal","formula":"jslib.getDocumentSubTotal(@F{$.details})"}, //apply formula into single field
424
- {"jsonpath":"$.tags","formula":"$F{$.tags}.map(item=>item.toUppeCase())"}, //apply upper case to all item in string array
425
- {"jsonpath":"$.details","loop":"jslib.calculateLineTotal(item)"}, //apply multiple calculation of subtotal, tax, amtaftertax and etc, using loop
426
- {"jsonpath":"$.total","formula":"@F{$.subtotal} + @F{$.taxamt}"}, //apply simple formula here
427
- ],
428
-
429
- // auto generate fields
430
- documentType: 'SI',
431
- documentName: 'Sales Invoice',
432
-
433
- //auto generated foreign keys catalogue
434
- "foreignKeys":{ "customer":["$.customer._id"], "user":[{"$.preparedby._id"},{$.approveby._id"}]}
435
- },
436
- "properties":{
437
- "invoiceDate":{"type":"string"},
438
- //and others field
439
- }
440
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simitgroup/simpleapp-generator",
3
- "version": "1.0.40",
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
+ }