rez_core 5.0.88 → 5.0.90

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.
Files changed (459) hide show
  1. package/.claude/settings.local.json +26 -0
  2. package/.idea/250218_nodejs_core.iml +9 -0
  3. package/.idea/codeStyles/Project.xml +59 -0
  4. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  5. package/.idea/copilot.data.migration.agent.xml +6 -0
  6. package/.idea/copilot.data.migration.ask.xml +6 -0
  7. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  8. package/.idea/copilot.data.migration.edit.xml +6 -0
  9. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  10. package/.idea/misc.xml +6 -0
  11. package/.idea/modules.xml +8 -0
  12. package/.idea/prettier.xml +6 -0
  13. package/.idea/vcs.xml +6 -0
  14. package/.prettierrc +3 -3
  15. package/README.md +99 -99
  16. package/dist/module/auth/guards/role.guard.js +3 -3
  17. package/dist/module/filter/service/filter.service.js +20 -20
  18. package/dist/module/integration/examples/usage.example.js +9 -9
  19. package/dist/module/meta/repository/attribute-master.repository.js +8 -8
  20. package/dist/module/meta/repository/entity-master.repository.js +2 -2
  21. package/dist/module/meta/service/entity-dynamic.service.js +21 -21
  22. package/dist/module/meta/service/entity-list.service.js +3 -3
  23. package/dist/module/meta/service/entity-relation.service.d.ts +1 -3
  24. package/dist/module/meta/service/entity-relation.service.js +22 -31
  25. package/dist/module/meta/service/entity-relation.service.js.map +1 -1
  26. package/dist/module/meta/service/entity-service-impl.service.js +3 -3
  27. package/dist/module/meta/service/media-data.service.js +6 -6
  28. package/dist/module/meta/service/resolver.service.js +15 -15
  29. package/dist/module/module/repository/menu.repository.js +5 -5
  30. package/dist/module/module/repository/menu.repository.js.map +1 -1
  31. package/dist/module/module/service/module-access.service.d.ts +3 -1
  32. package/dist/module/module/service/module-access.service.js +11 -4
  33. package/dist/module/module/service/module-access.service.js.map +1 -1
  34. package/dist/module/notification/controller/notification.controller.d.ts +1 -1
  35. package/dist/module/notification/service/notification.service.d.ts +6 -4
  36. package/dist/module/notification/service/notification.service.js +28 -26
  37. package/dist/module/notification/service/notification.service.js.map +1 -1
  38. package/dist/module/user/controller/login.controller.js +18 -18
  39. package/dist/module/workflow/controller/action.controller.d.ts +5 -2
  40. package/dist/module/workflow/controller/form-master.controller.d.ts +4 -1
  41. package/dist/module/workflow/repository/action-data.repository.d.ts +2 -3
  42. package/dist/module/workflow/repository/action-data.repository.js +29 -18
  43. package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
  44. package/dist/module/workflow/repository/action.repository.d.ts +6 -7
  45. package/dist/module/workflow/repository/action.repository.js +55 -63
  46. package/dist/module/workflow/repository/action.repository.js.map +1 -1
  47. package/dist/module/workflow/repository/comm-template.repository.d.ts +2 -3
  48. package/dist/module/workflow/repository/comm-template.repository.js +15 -9
  49. package/dist/module/workflow/repository/comm-template.repository.js.map +1 -1
  50. package/dist/module/workflow/repository/form-master.repository.d.ts +7 -4
  51. package/dist/module/workflow/repository/form-master.repository.js +14 -11
  52. package/dist/module/workflow/repository/form-master.repository.js.map +1 -1
  53. package/dist/module/workflow/repository/stage-group.repository.d.ts +4 -5
  54. package/dist/module/workflow/repository/stage-group.repository.js +34 -35
  55. package/dist/module/workflow/repository/stage-group.repository.js.map +1 -1
  56. package/dist/module/workflow/repository/stage-movement.repository.d.ts +6 -3
  57. package/dist/module/workflow/repository/stage-movement.repository.js +30 -17
  58. package/dist/module/workflow/repository/stage-movement.repository.js.map +1 -1
  59. package/dist/module/workflow/repository/stage.repository.js +8 -8
  60. package/dist/module/workflow/service/action-template-mapping.service.js +4 -4
  61. package/dist/module/workflow/service/action.service.d.ts +13 -5
  62. package/dist/module/workflow/service/action.service.js +71 -20
  63. package/dist/module/workflow/service/action.service.js.map +1 -1
  64. package/dist/module/workflow/service/entity-modification.service.d.ts +3 -3
  65. package/dist/module/workflow/service/entity-modification.service.js +5 -5
  66. package/dist/module/workflow/service/entity-modification.service.js.map +1 -1
  67. package/dist/module/workflow/service/form-master.service.d.ts +4 -1
  68. package/dist/module/workflow/service/stage-group.service.d.ts +2 -7
  69. package/dist/module/workflow/service/stage-group.service.js +19 -17
  70. package/dist/module/workflow/service/stage-group.service.js.map +1 -1
  71. package/dist/module/workflow/service/stage.service.d.ts +2 -3
  72. package/dist/module/workflow/service/stage.service.js +24 -11
  73. package/dist/module/workflow/service/stage.service.js.map +1 -1
  74. package/dist/module/workflow/service/task.service.d.ts +2 -5
  75. package/dist/module/workflow/service/task.service.js +49 -50
  76. package/dist/module/workflow/service/task.service.js.map +1 -1
  77. package/dist/module/workflow/service/workflow-list-master.service.d.ts +1 -3
  78. package/dist/module/workflow/service/workflow-list-master.service.js +38 -26
  79. package/dist/module/workflow/service/workflow-list-master.service.js.map +1 -1
  80. package/dist/module/workflow/service/workflow-meta.service.d.ts +6 -3
  81. package/dist/module/workflow/service/workflow-meta.service.js +78 -50
  82. package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
  83. package/dist/module/workflow/service/workflow.service.d.ts +1 -3
  84. package/dist/module/workflow/service/workflow.service.js +10 -6
  85. package/dist/module/workflow/service/workflow.service.js.map +1 -1
  86. package/dist/module/workflow-automation/service/schedule-handler.service.js +9 -9
  87. package/dist/module/workflow-schedule/processors/schedule.processor.d.ts +4 -2
  88. package/dist/module/workflow-schedule/processors/schedule.processor.js +51 -38
  89. package/dist/module/workflow-schedule/processors/schedule.processor.js.map +1 -1
  90. package/dist/module/workflow-schedule/service/workflow-schedule.service.d.ts +2 -3
  91. package/dist/module/workflow-schedule/service/workflow-schedule.service.js +15 -14
  92. package/dist/module/workflow-schedule/service/workflow-schedule.service.js.map +1 -1
  93. package/dist/tsconfig.build.tsbuildinfo +1 -1
  94. package/dist/utils/service/reflection-helper.service.js +2 -2
  95. package/docs/modules/event-driven-integration-design.md +91 -91
  96. package/docs/modules/integration.md +250 -250
  97. package/eslint.config.mjs +34 -34
  98. package/nest-cli.json +14 -14
  99. package/package.json +125 -125
  100. package/server.log +850 -0
  101. package/src/app.controller.ts +12 -12
  102. package/src/app.module.ts +66 -66
  103. package/src/app.service.ts +8 -8
  104. package/src/config/bull.config.ts +69 -69
  105. package/src/config/config.module.ts +17 -17
  106. package/src/config/database.config.ts +48 -48
  107. package/src/constant/global.constant.ts +67 -67
  108. package/src/core.module.ts +91 -91
  109. package/src/decorators/roles.decorator.ts +7 -7
  110. package/src/dtos/response.dto.ts +6 -6
  111. package/src/dtos/response.ts +5 -5
  112. package/src/index.ts +1 -1
  113. package/src/module/auth/auth.module.ts +49 -49
  114. package/src/module/auth/controller/auth.controller.ts +28 -28
  115. package/src/module/auth/guards/google-auth.guard.ts +9 -9
  116. package/src/module/auth/guards/jwt.guard.ts +22 -22
  117. package/src/module/auth/guards/role.guard.ts +68 -68
  118. package/src/module/auth/services/auth.service.ts +56 -56
  119. package/src/module/auth/services/jwt.service.ts +11 -11
  120. package/src/module/auth/strategies/google.strategy.ts +54 -54
  121. package/src/module/auth/strategies/jwt.strategy.ts +58 -58
  122. package/src/module/auth/strategies/local.strategy.ts +13 -13
  123. package/src/module/dashboard/controller/dashboard.controller.ts +36 -36
  124. package/src/module/dashboard/dashboard.module.ts +21 -21
  125. package/src/module/dashboard/entity/dashboard_page_data.entity.ts +27 -27
  126. package/src/module/dashboard/entity/widget_master.entity.ts +18 -18
  127. package/src/module/dashboard/repository/dashboard.repository.ts +51 -51
  128. package/src/module/dashboard/service/dashboard.service.ts +73 -73
  129. package/src/module/enterprise/controller/organization.controller.ts +36 -36
  130. package/src/module/enterprise/enterprise.module.ts +30 -30
  131. package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
  132. package/src/module/enterprise/entity/organization-app-mapping.entity.ts +13 -13
  133. package/src/module/enterprise/entity/organization.entity.ts +92 -92
  134. package/src/module/enterprise/repository/enterprise.repository.ts +31 -31
  135. package/src/module/enterprise/repository/organization.repository.ts +26 -26
  136. package/src/module/enterprise/repository/school.repository.ts +272 -272
  137. package/src/module/enterprise/service/brand.service.ts +5 -5
  138. package/src/module/enterprise/service/enterprise.service.ts +16 -16
  139. package/src/module/enterprise/service/organization-app-mapping.service.ts +4 -4
  140. package/src/module/enterprise/service/organization.service.ts +145 -145
  141. package/src/module/entity_json/controller/entity_json.controller.ts +47 -47
  142. package/src/module/entity_json/entity/entityJson.entity.ts +39 -39
  143. package/src/module/entity_json/entity_json.module.ts +18 -18
  144. package/src/module/entity_json/service/entityJson.repository.ts +37 -37
  145. package/src/module/entity_json/service/entity_json.service.ts +234 -234
  146. package/src/module/filter/controller/filter.controller.ts +84 -84
  147. package/src/module/filter/dto/filter-request.dto.ts +38 -38
  148. package/src/module/filter/entity/saved-filter-detail.entity.ts +41 -41
  149. package/src/module/filter/entity/saved-filter-master.entity.ts +23 -23
  150. package/src/module/filter/filter.module.ts +33 -33
  151. package/src/module/filter/repository/saved-filter.repository.ts +168 -168
  152. package/src/module/filter/repository/saved.filter-detail.repository.ts +19 -19
  153. package/src/module/filter/service/filter-evaluator.service.ts +82 -82
  154. package/src/module/filter/service/filter.service.ts +1304 -1304
  155. package/src/module/filter/service/saved-filter.service.ts +170 -170
  156. package/src/module/ics/controller/ics.controller.ts +21 -21
  157. package/src/module/ics/dto/ics.dto.ts +55 -55
  158. package/src/module/ics/ics.module.ts +13 -13
  159. package/src/module/ics/service/ics.service.ts +57 -57
  160. package/src/module/integration/controller/calender-event.controller.ts +31 -31
  161. package/src/module/integration/controller/integration.controller.ts +662 -662
  162. package/src/module/integration/controller/wrapper.controller.ts +37 -37
  163. package/src/module/integration/dto/create-config.dto.ts +526 -526
  164. package/src/module/integration/entity/integration-config.entity.ts +112 -112
  165. package/src/module/integration/entity/integration-entity-mapper.entity.ts +14 -14
  166. package/src/module/integration/entity/integration-source.entity.ts +17 -17
  167. package/src/module/integration/entity/user-integration.entity.ts +71 -71
  168. package/src/module/integration/examples/usage.example.ts +338 -338
  169. package/src/module/integration/factories/base.factory.ts +7 -7
  170. package/src/module/integration/factories/email.factory.ts +49 -49
  171. package/src/module/integration/factories/integration.factory.ts +121 -121
  172. package/src/module/integration/factories/sms.factory.ts +51 -51
  173. package/src/module/integration/factories/telephone.factory.ts +41 -41
  174. package/src/module/integration/factories/whatsapp.factory.ts +56 -56
  175. package/src/module/integration/integration.module.ts +110 -110
  176. package/src/module/integration/service/calendar-event.service.ts +118 -118
  177. package/src/module/integration/service/integration-entity-mapper.service.ts +17 -17
  178. package/src/module/integration/service/integration-queue.service.ts +229 -229
  179. package/src/module/integration/service/integration.service.ts +2634 -2634
  180. package/src/module/integration/service/oauth.service.ts +224 -224
  181. package/src/module/integration/service/wrapper.service.ts +716 -716
  182. package/src/module/integration/strategies/email/gmail-api.strategy.ts +280 -280
  183. package/src/module/integration/strategies/email/outlook-api.strategy.ts +44 -44
  184. package/src/module/integration/strategies/email/outlook.strategy.ts +64 -64
  185. package/src/module/integration/strategies/email/sendgrid-api.strategy.ts +260 -260
  186. package/src/module/integration/strategies/integration.strategy.ts +97 -97
  187. package/src/module/integration/strategies/sms/gupshup-sms.strategy.ts +146 -146
  188. package/src/module/integration/strategies/sms/msg91-sms.strategy.ts +164 -164
  189. package/src/module/integration/strategies/sms/tubelight-sms.strategy.ts +163 -163
  190. package/src/module/integration/strategies/telephone/ozonetel-voice.strategy.ts +238 -238
  191. package/src/module/integration/strategies/telephone/tubelight-voice.strategy.ts +210 -210
  192. package/src/module/integration/strategies/whatsapp/gupshup-whatsapp.strategy.ts +359 -359
  193. package/src/module/integration/strategies/whatsapp/tubelight-whatsapp.strategy.ts +372 -372
  194. package/src/module/integration/strategies/whatsapp/whatsapp-cloud.strategy.ts +403 -403
  195. package/src/module/integration/strategies/whatsapp/whatsapp.strategy.ts +57 -57
  196. package/src/module/layout/controller/layout.controller.ts +47 -47
  197. package/src/module/layout/entity/header-items.entity.ts +28 -28
  198. package/src/module/layout/entity/header-section.entity.ts +19 -19
  199. package/src/module/layout/layout.module.ts +21 -21
  200. package/src/module/layout/repository/header-items.repository.ts +18 -18
  201. package/src/module/layout/repository/header-section.repository.ts +22 -22
  202. package/src/module/layout/service/header-section.service.ts +25 -25
  203. package/src/module/layout_preference/controller/layout_preference.controller.ts +73 -73
  204. package/src/module/layout_preference/entity/layout_preference.entity.ts +28 -28
  205. package/src/module/layout_preference/layout_preference.module.ts +22 -22
  206. package/src/module/layout_preference/repository/layout_preference.repository.ts +65 -65
  207. package/src/module/layout_preference/service/layout_preference.service.ts +191 -191
  208. package/src/module/lead/controller/lead.controller.ts +30 -30
  209. package/src/module/lead/lead.module.ts +14 -14
  210. package/src/module/lead/repository/lead.repository.ts +41 -41
  211. package/src/module/lead/service/lead.service.ts +54 -54
  212. package/src/module/linked_attributes/controller/linked_attributes.controller.ts +37 -37
  213. package/src/module/linked_attributes/entity/linked_attribute.entity.ts +51 -51
  214. package/src/module/linked_attributes/linked_attributes.module.ts +16 -16
  215. package/src/module/linked_attributes/repository/linked_attribute.repository.ts +12 -12
  216. package/src/module/linked_attributes/service/linked_attributes.service.ts +75 -75
  217. package/src/module/listmaster/controller/list-master.controller.ts +230 -230
  218. package/src/module/listmaster/entity/list-master-items.entity.ts +43 -43
  219. package/src/module/listmaster/entity/list-master.entity.ts +33 -33
  220. package/src/module/listmaster/listmaster.module.ts +46 -46
  221. package/src/module/listmaster/repository/list-master-items.repository.ts +173 -173
  222. package/src/module/listmaster/repository/list-master.repository.ts +56 -56
  223. package/src/module/listmaster/service/list-master-engine.ts +19 -19
  224. package/src/module/listmaster/service/list-master-extension.interface.ts +4 -4
  225. package/src/module/listmaster/service/list-master-item.service.ts +281 -281
  226. package/src/module/listmaster/service/list-master-registry.ts +15 -15
  227. package/src/module/listmaster/service/list-master.service.ts +535 -535
  228. package/src/module/mapper/controller/field-mapper.controller.ts +76 -76
  229. package/src/module/mapper/controller/mapper.controller.ts +20 -20
  230. package/src/module/mapper/dto/field-mapper.dto.ts +14 -14
  231. package/src/module/mapper/entity/field-lovs.entity.ts +19 -19
  232. package/src/module/mapper/entity/field-mapper.entity.ts +53 -53
  233. package/src/module/mapper/entity/mapper.entity.ts +16 -16
  234. package/src/module/mapper/mapper.module.ts +35 -35
  235. package/src/module/mapper/repository/field-lovs.repository.ts +35 -35
  236. package/src/module/mapper/repository/field-mapper.repository.ts +42 -42
  237. package/src/module/mapper/repository/mapper.repository.ts +32 -32
  238. package/src/module/mapper/service/field-mapper.service.ts +269 -269
  239. package/src/module/mapper/service/mapper.service.ts +81 -81
  240. package/src/module/master/controller/master.controller.ts +74 -74
  241. package/src/module/master/service/master.service.ts +483 -483
  242. package/src/module/meta/controller/app-master.controller.ts +38 -38
  243. package/src/module/meta/controller/attribute-master.controller.ts +84 -84
  244. package/src/module/meta/controller/entity-dynamic.controller.ts +125 -125
  245. package/src/module/meta/controller/entity-master.controller.ts +41 -41
  246. package/src/module/meta/controller/entity-relation.controller.ts +36 -36
  247. package/src/module/meta/controller/entity.controller.ts +392 -392
  248. package/src/module/meta/controller/entity.public.controller.ts +75 -75
  249. package/src/module/meta/controller/media.controller.ts +107 -107
  250. package/src/module/meta/controller/meta.controller.ts +96 -96
  251. package/src/module/meta/controller/view-master.controller.ts +86 -86
  252. package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
  253. package/src/module/meta/dto/entity-tab.dto.ts +4 -4
  254. package/src/module/meta/dto/entity-table.dto.ts +9 -9
  255. package/src/module/meta/entity/app-master.entity.ts +34 -34
  256. package/src/module/meta/entity/attribute-master.entity.ts +92 -92
  257. package/src/module/meta/entity/base-entity.entity.ts +75 -75
  258. package/src/module/meta/entity/entity-master.entity.ts +85 -85
  259. package/src/module/meta/entity/entity-relation-data.entity.ts +29 -29
  260. package/src/module/meta/entity/entity-relation.entity.ts +23 -23
  261. package/src/module/meta/entity/entity-table-column.entity.ts +61 -61
  262. package/src/module/meta/entity/entity-table.entity.ts +50 -50
  263. package/src/module/meta/entity/media-data.entity.ts +32 -32
  264. package/src/module/meta/entity/preference.entity.ts +62 -62
  265. package/src/module/meta/entity/view-master.entity.ts +41 -41
  266. package/src/module/meta/entity.module.ts +166 -166
  267. package/src/module/meta/repository/app-master.repository.ts +20 -20
  268. package/src/module/meta/repository/attribute-master.repository.ts +156 -156
  269. package/src/module/meta/repository/entity-attribute-update.repository.ts +48 -48
  270. package/src/module/meta/repository/entity-master.repository.ts +109 -109
  271. package/src/module/meta/repository/entity-table-column.repository.ts +39 -39
  272. package/src/module/meta/repository/entity-table.repository.ts +53 -53
  273. package/src/module/meta/repository/media-data.repository.ts +50 -50
  274. package/src/module/meta/repository/preference.repository.ts +20 -20
  275. package/src/module/meta/repository/user-app-mapping.repository.ts +28 -28
  276. package/src/module/meta/repository/view-master.repository.ts +42 -42
  277. package/src/module/meta/service/app-master.service.ts +37 -37
  278. package/src/module/meta/service/attribute-master.service.ts +130 -130
  279. package/src/module/meta/service/common.service.ts +9 -9
  280. package/src/module/meta/service/entity-attribute-update.service.ts +28 -28
  281. package/src/module/meta/service/entity-dynamic.service.ts +813 -813
  282. package/src/module/meta/service/entity-list.service.ts +205 -205
  283. package/src/module/meta/service/entity-master.service.ts +171 -171
  284. package/src/module/meta/service/entity-realation-data.service.ts +9 -9
  285. package/src/module/meta/service/entity-relation.service.ts +69 -87
  286. package/src/module/meta/service/entity-service-impl.service.ts +525 -525
  287. package/src/module/meta/service/entity-table-column.service.ts +39 -39
  288. package/src/module/meta/service/entity-table.service.ts +150 -150
  289. package/src/module/meta/service/entity-validation.service.ts +187 -187
  290. package/src/module/meta/service/entity.service.ts +67 -67
  291. package/src/module/meta/service/field-group.service.ts +103 -103
  292. package/src/module/meta/service/media-data.service.ts +510 -510
  293. package/src/module/meta/service/populate-meta.service.ts +222 -222
  294. package/src/module/meta/service/preference.service.ts +16 -16
  295. package/src/module/meta/service/resolver.service.ts +292 -292
  296. package/src/module/meta/service/section-master.service.ts +104 -104
  297. package/src/module/meta/service/update-form-json.service.ts +22 -22
  298. package/src/module/meta/service/user-app-mapping.service.ts +17 -17
  299. package/src/module/meta/service/view-master.service.ts +127 -127
  300. package/src/module/microservice-client/microservice-clients.module.ts +13 -13
  301. package/src/module/microservice-client/service/microservice-client-factory.ts +37 -37
  302. package/src/module/microservice-client/service/microservice-clients.ts +4 -4
  303. package/src/module/module/controller/menu.controller.ts +15 -15
  304. package/src/module/module/controller/module-access.controller.ts +134 -134
  305. package/src/module/module/entity/menu.entity.ts +43 -43
  306. package/src/module/module/entity/module-access.entity.ts +25 -25
  307. package/src/module/module/entity/module-action.entity.ts +17 -17
  308. package/src/module/module/entity/module.entity.ts +52 -52
  309. package/src/module/module/module.module.ts +42 -42
  310. package/src/module/module/repository/menu.repository.ts +184 -184
  311. package/src/module/module/repository/module-access.repository.ts +344 -344
  312. package/src/module/module/service/menu.service.ts +82 -82
  313. package/src/module/module/service/module-access.service.ts +199 -195
  314. package/src/module/notification/controller/notification.controller.ts +58 -58
  315. package/src/module/notification/controller/otp.controller.ts +117 -117
  316. package/src/module/notification/entity/notification.entity.ts +26 -26
  317. package/src/module/notification/entity/otp.entity.ts +28 -28
  318. package/src/module/notification/firebase-admin.config.ts +22 -22
  319. package/src/module/notification/notification.module.ts +69 -69
  320. package/src/module/notification/repository/otp.repository.ts +27 -27
  321. package/src/module/notification/service/email.service.ts +127 -127
  322. package/src/module/notification/service/notification.service.ts +164 -160
  323. package/src/module/notification/service/otp.service.ts +133 -133
  324. package/src/module/third-party-module/entity/third-party-api-registry.entity.ts +52 -52
  325. package/src/module/third-party-module/repository/third-party-api-registry.repository.ts +20 -20
  326. package/src/module/third-party-module/service/api-registry.service.ts +13 -13
  327. package/src/module/third-party-module/third-party.module.ts +12 -12
  328. package/src/module/user/controller/login.controller.ts +198 -198
  329. package/src/module/user/controller/user.controller.ts +40 -40
  330. package/src/module/user/dto/create-user.dto.ts +62 -62
  331. package/src/module/user/dto/update-user.dto.ts +4 -4
  332. package/src/module/user/entity/role.entity.ts +33 -33
  333. package/src/module/user/entity/user-role-mapping.entity.ts +38 -38
  334. package/src/module/user/entity/user-session.entity.ts +73 -73
  335. package/src/module/user/entity/user.entity.ts +59 -59
  336. package/src/module/user/repository/role.repository.ts +96 -96
  337. package/src/module/user/repository/user-role-mapping.repository.ts +126 -126
  338. package/src/module/user/repository/user.repository.ts +50 -50
  339. package/src/module/user/repository/userSession.repository.ts +33 -33
  340. package/src/module/user/service/login.service.ts +326 -326
  341. package/src/module/user/service/role.service.ts +197 -197
  342. package/src/module/user/service/user-role-mapping.service.ts +98 -98
  343. package/src/module/user/service/user-session.service.ts +177 -177
  344. package/src/module/user/service/user.service.ts +368 -368
  345. package/src/module/user/user.module.ts +65 -65
  346. package/src/module/workflow/controller/action-category.controller.ts +54 -54
  347. package/src/module/workflow/controller/action-resource-mapping.controller.ts +23 -23
  348. package/src/module/workflow/controller/action-template-mapping.controller.ts +35 -35
  349. package/src/module/workflow/controller/action.controller.ts +111 -111
  350. package/src/module/workflow/controller/activity-log.controller.ts +55 -55
  351. package/src/module/workflow/controller/comm-template.controller.ts +43 -43
  352. package/src/module/workflow/controller/entity-modification.controller.ts +35 -35
  353. package/src/module/workflow/controller/form-master.controller.ts +43 -43
  354. package/src/module/workflow/controller/stage-group.controller.ts +48 -48
  355. package/src/module/workflow/controller/stage.controller.ts +50 -50
  356. package/src/module/workflow/controller/task.controller.ts +77 -77
  357. package/src/module/workflow/controller/workflow-list-master.controller.ts +44 -44
  358. package/src/module/workflow/controller/workflow-meta.controller.ts +80 -80
  359. package/src/module/workflow/controller/workflow.controller.ts +67 -67
  360. package/src/module/workflow/entity/action-category.entity.ts +38 -38
  361. package/src/module/workflow/entity/action-data.entity.ts +55 -55
  362. package/src/module/workflow/entity/action-resources-mapping.entity.ts +29 -29
  363. package/src/module/workflow/entity/action-template-mapping.entity.ts +17 -17
  364. package/src/module/workflow/entity/action.entity.ts +53 -53
  365. package/src/module/workflow/entity/activity-log.entity.ts +43 -43
  366. package/src/module/workflow/entity/comm-template.entity.ts +43 -43
  367. package/src/module/workflow/entity/entity-modification.entity.ts +38 -38
  368. package/src/module/workflow/entity/form.entity.ts +25 -25
  369. package/src/module/workflow/entity/stage-action-mapping.entity.ts +17 -17
  370. package/src/module/workflow/entity/stage-group.entity.ts +23 -23
  371. package/src/module/workflow/entity/stage-movement-data.entity.ts +38 -38
  372. package/src/module/workflow/entity/stage.entity.ts +20 -20
  373. package/src/module/workflow/entity/task-data.entity.ts +88 -88
  374. package/src/module/workflow/entity/template-attach-mapper.entity.ts +30 -30
  375. package/src/module/workflow/entity/workflow-data.entity.ts +11 -11
  376. package/src/module/workflow/entity/workflow-level-mapping.entity.ts +18 -18
  377. package/src/module/workflow/entity/workflow.entity.ts +20 -20
  378. package/src/module/workflow/repository/action-category.repository.ts +79 -79
  379. package/src/module/workflow/repository/action-data.repository.ts +344 -339
  380. package/src/module/workflow/repository/action.repository.ts +338 -341
  381. package/src/module/workflow/repository/activity-log.repository.ts +148 -148
  382. package/src/module/workflow/repository/comm-template.repository.ts +157 -151
  383. package/src/module/workflow/repository/form-master.repository.ts +50 -59
  384. package/src/module/workflow/repository/stage-group.repository.ts +186 -197
  385. package/src/module/workflow/repository/stage-movement.repository.ts +256 -253
  386. package/src/module/workflow/repository/stage.repository.ts +160 -160
  387. package/src/module/workflow/repository/task.repository.ts +151 -151
  388. package/src/module/workflow/repository/workflow.repository.ts +42 -42
  389. package/src/module/workflow/service/action-category.service.ts +33 -33
  390. package/src/module/workflow/service/action-data.service.ts +62 -62
  391. package/src/module/workflow/service/action-resources-mapping.service.ts +10 -10
  392. package/src/module/workflow/service/action-template-mapping.service.ts +131 -131
  393. package/src/module/workflow/service/action.service.ts +306 -279
  394. package/src/module/workflow/service/activity-log.service.ts +107 -107
  395. package/src/module/workflow/service/comm-template.service.ts +180 -180
  396. package/src/module/workflow/service/entity-modification.service.ts +61 -61
  397. package/src/module/workflow/service/form-master.service.ts +35 -35
  398. package/src/module/workflow/service/populate-workflow.service.ts +320 -320
  399. package/src/module/workflow/service/stage-action-mapping.service.ts +5 -5
  400. package/src/module/workflow/service/stage-group.service.ts +344 -342
  401. package/src/module/workflow/service/stage.service.ts +207 -199
  402. package/src/module/workflow/service/task.service.ts +546 -549
  403. package/src/module/workflow/service/workflow-list-master.service.ts +68 -60
  404. package/src/module/workflow/service/workflow-meta.service.ts +639 -635
  405. package/src/module/workflow/service/workflow.service.ts +213 -209
  406. package/src/module/workflow/workflow.module.ts +180 -180
  407. package/src/module/workflow-automation/SCHEDULING_GUIDE.md +145 -145
  408. package/src/module/workflow-automation/controller/workflow-automation.controller.ts +43 -43
  409. package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +26 -26
  410. package/src/module/workflow-automation/entity/workflow-automation.entity.ts +40 -40
  411. package/src/module/workflow-automation/interface/action.decorator.ts +7 -7
  412. package/src/module/workflow-automation/interface/action.interface.ts +5 -5
  413. package/src/module/workflow-automation/service/action-registery.service.ts +35 -35
  414. package/src/module/workflow-automation/service/schedule-handler.service.ts +168 -168
  415. package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +219 -219
  416. package/src/module/workflow-automation/service/workflow-automation.service.ts +515 -515
  417. package/src/module/workflow-automation/workflow-automation.module.ts +54 -54
  418. package/src/module/workflow-schedule/INSTALLATION.md +244 -244
  419. package/src/module/workflow-schedule/MULTI_PROJECT_GUIDE.md +196 -196
  420. package/src/module/workflow-schedule/README.md +422 -422
  421. package/src/module/workflow-schedule/constants/schedule.constants.ts +48 -48
  422. package/src/module/workflow-schedule/controller/workflow-schedule.controller.ts +255 -255
  423. package/src/module/workflow-schedule/docs/CLAUDE_CODE_GUIDE.md +510 -510
  424. package/src/module/workflow-schedule/docs/CLAUDE_CODE_PROMPT.md +362 -362
  425. package/src/module/workflow-schedule/docs/RUN_CLAUDE_CODE.sh +68 -68
  426. package/src/module/workflow-schedule/dto/create-schedule.dto.ts +147 -147
  427. package/src/module/workflow-schedule/dto/get-execution-logs.dto.ts +119 -119
  428. package/src/module/workflow-schedule/dto/update-schedule.dto.ts +96 -96
  429. package/src/module/workflow-schedule/entities/scheduled-workflow.entity.ts +148 -148
  430. package/src/module/workflow-schedule/entities/workflow-execution-log.entity.ts +154 -154
  431. package/src/module/workflow-schedule/interfaces/schedule-job-data.interface.ts +53 -53
  432. package/src/module/workflow-schedule/interfaces/workflow-schedule-options.interface.ts +12 -12
  433. package/src/module/workflow-schedule/processors/schedule.processor.ts +620 -584
  434. package/src/module/workflow-schedule/service/workflow-schedule.service.ts +598 -600
  435. package/src/module/workflow-schedule/workflow-schedule.module.ts +67 -67
  436. package/src/resources/dev.properties.yaml +31 -31
  437. package/src/resources/local.properties.yaml +27 -27
  438. package/src/resources/properties.module.ts +12 -12
  439. package/src/resources/properties.yaml.ts +11 -11
  440. package/src/resources/uat.properties.yaml +31 -31
  441. package/src/table.config.ts +133 -133
  442. package/src/utils/dto/excel-data.dto.ts +14 -14
  443. package/src/utils/dto/excelsheet-data.dto.ts +5 -5
  444. package/src/utils/service/base64util.service.ts +18 -18
  445. package/src/utils/service/clockIDGenUtil.service.ts +21 -21
  446. package/src/utils/service/codeGenerator.service.ts +22 -22
  447. package/src/utils/service/dateUtil.service.ts +17 -17
  448. package/src/utils/service/encryptUtil.service.ts +97 -97
  449. package/src/utils/service/excel-helper.service.ts +72 -72
  450. package/src/utils/service/excelUtil.service.ts +15 -15
  451. package/src/utils/service/file-util.service.ts +11 -11
  452. package/src/utils/service/json-util.service.ts +23 -23
  453. package/src/utils/service/loggingUtil.service.ts +88 -88
  454. package/src/utils/service/reflection-helper.service.ts +62 -62
  455. package/src/utils/service/wbsCodeGen.service.ts +8 -8
  456. package/src/utils/utils.module.ts +27 -27
  457. package/tsconfig.build.json +4 -4
  458. package/tsconfig.json +24 -24
  459. package/.vscode/extensions.json +0 -5
@@ -17,16 +17,15 @@ const common_1 = require("@nestjs/common");
17
17
  const stage_group_entity_1 = require("../entity/stage-group.entity");
18
18
  const typeorm_1 = require("@nestjs/typeorm");
19
19
  const typeorm_2 = require("typeorm");
20
- const media_data_service_1 = require("../../meta/service/media-data.service");
21
20
  const stage_entity_1 = require("../entity/stage.entity");
22
21
  const task_data_entity_1 = require("../entity/task-data.entity");
22
+ const reflection_helper_service_1 = require("../../../utils/service/reflection-helper.service");
23
23
  let StageGroupRepository = class StageGroupRepository {
24
- constructor(stageGroupRepository, stageRepository, taskDataRepo, dataSource, mediaDataService) {
24
+ constructor(stageGroupRepository, stageRepository, taskDataRepo, reflectionHelper) {
25
25
  this.stageGroupRepository = stageGroupRepository;
26
26
  this.stageRepository = stageRepository;
27
27
  this.taskDataRepo = taskDataRepo;
28
- this.dataSource = dataSource;
29
- this.mediaDataService = mediaDataService;
28
+ this.reflectionHelper = reflectionHelper;
30
29
  }
31
30
  async getAllStageGroup(workflow_id, organization_id) {
32
31
  if (!workflow_id) {
@@ -74,43 +73,44 @@ let StageGroupRepository = class StageGroupRepository {
74
73
  const stagesRaw = await this.stageRepository.find({
75
74
  where: {
76
75
  stage_group_id: (0, typeorm_2.In)(stageGroupIds),
77
- organization_id: loggedInUser.organization_id
76
+ organization_id: loggedInUser.organization_id,
78
77
  },
79
78
  order: {
80
79
  sequence: 'ASC',
81
- }
80
+ },
82
81
  });
83
82
  const stageIds = stagesRaw.map((s) => Number(s.id));
84
83
  if (stageIds.length === 0) {
85
84
  return stageGroups.map((sg) => ({ ...sg, stages: [] }));
86
85
  }
87
- const stagePlaceholders = stageIds
88
- .map((_, idx) => `$${idx + 1}`)
89
- .join(", ");
90
- const params_task = [...stageIds];
91
- const taskCounts = await this.dataSource.query(`
92
- SELECT stage_id, COUNT(*) AS task_count
93
- FROM frm_wf_task_data
94
- WHERE stage_id IN (${stagePlaceholders})
95
- AND is_system = FALSE
96
- AND mapped_entity_id = ${lead_id}
97
- GROUP BY stage_id
98
- `, params_task);
99
- const meetingCounts = await this.dataSource.query(`
100
- SELECT stage_id, COUNT(*) AS meeting_count
101
- FROM crm_lead_meeting
102
- WHERE stage_id IN (${stagePlaceholders})
103
- AND mapped_entity_id = ${lead_id}
104
- GROUP BY stage_id
105
- `, params_task);
106
- const sendCommCounts = await this.dataSource.query(`
107
- SELECT stage_id, COUNT(*) AS send_comm_count
108
- FROM crm_lead_communication
109
- WHERE stage_id IN (${stagePlaceholders})
110
- AND mapped_entity_id = ${lead_id}
111
- AND type IN ('SEND','LOG')
112
- GROUP BY stage_id
113
- `, params_task);
86
+ const taskCounts = await this.taskDataRepo
87
+ .createQueryBuilder('t')
88
+ .select('t.stage_id', 'stage_id')
89
+ .addSelect('COUNT(*)', 'task_count')
90
+ .where('t.stage_id IN (:...stageIds)', { stageIds })
91
+ .andWhere('t.is_system = false')
92
+ .andWhere('t.mapped_entity_id = :leadId', { leadId: lead_id })
93
+ .groupBy('t.stage_id')
94
+ .getRawMany();
95
+ const leadMeetingRepo = this.reflectionHelper.getRepoService('LeadScheduleMeet');
96
+ const meetingCounts = await leadMeetingRepo
97
+ .createQueryBuilder('m')
98
+ .select('m.stage_id', 'stage_id')
99
+ .addSelect('COUNT(*)', 'meeting_count')
100
+ .where('m.stage_id IN (:...stageIds)', { stageIds })
101
+ .andWhere('m.mapped_entity_id = :leadId', { leadId: lead_id })
102
+ .groupBy('m.stage_id')
103
+ .getRawMany();
104
+ const leadCommunicationRepo = this.reflectionHelper.getRepoService('LeadCommunication');
105
+ const sendCommCounts = await leadCommunicationRepo
106
+ .createQueryBuilder('c')
107
+ .select('c.stage_id', 'stage_id')
108
+ .addSelect('COUNT(*)', 'send_comm_count')
109
+ .where('c.stage_id IN (:...stageIds)', { stageIds })
110
+ .andWhere('c.mapped_entity_id = :leadId', { leadId: lead_id })
111
+ .andWhere('c.type IN (:...types)', { types: ['SEND', 'LOG'] })
112
+ .groupBy('c.stage_id')
113
+ .getRawMany();
114
114
  const taskCountMap = new Map(taskCounts.map((r) => [Number(r.stage_id), Number(r.task_count)]));
115
115
  const meetingCountMap = new Map(meetingCounts.map((r) => [Number(r.stage_id), Number(r.meeting_count)]));
116
116
  const sendCommCountMap = new Map(sendCommCounts.map((r) => [Number(r.stage_id), Number(r.send_comm_count)]));
@@ -140,7 +140,6 @@ exports.StageGroupRepository = StageGroupRepository = __decorate([
140
140
  __metadata("design:paramtypes", [typeorm_2.Repository,
141
141
  typeorm_2.Repository,
142
142
  typeorm_2.Repository,
143
- typeorm_2.DataSource,
144
- media_data_service_1.MediaDataService])
143
+ reflection_helper_service_1.ReflectionHelper])
145
144
  ], StageGroupRepository);
146
145
  //# sourceMappingURL=stage-group.repository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stage-group.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage-group.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAKwB;AACxB,qEAA0D;AAC1D,6CAAmD;AACnD,qCAAqD;AACrD,8EAA8E;AAC9E,yDAA+C;AAC/C,iEAA4D;AAGrD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAEmB,oBAA4C,EAE5C,eAAkC,EAElC,YAAwC,EACxC,UAAsB,EACtB,gBAAkC;QANlC,yBAAoB,GAApB,oBAAoB,CAAwB;QAE5C,oBAAe,GAAf,eAAe,CAAmB;QAElC,iBAAY,GAAZ,YAAY,CAA4B;QACxC,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;IAClD,CAAC;IAEJ,KAAK,CAAC,gBAAgB,CAAC,WAAmB,EAAE,eAAuB;QACjE,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,4BAAmB,CAAC,yBAAyB,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;YAClD,KAAK,EAAE;gBACL,WAAW;gBACX,eAAe;aAChB;YACD,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK;aAChB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,0BAAiB,CACzB,iDAAiD,CAClD,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;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+BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;IAEvB,WAAA,IAAA,0BAAgB,EAAC,iCAAc,CAAC,CAAA;qCAHM,oBAAU;QAEf,oBAAU;QAEb,oBAAU;QACZ,oBAAU;QACJ,qCAAgB;GAT1C,oBAAoB,CAsLhC"}
1
+ {"version":3,"file":"stage-group.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage-group.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoF;AACpF,qEAA0D;AAC1D,6CAAmD;AACnD,qCAAyC;AACzC,yDAA+C;AAC/C,iEAA4D;AAC5D,gGAAoF;AAG7E,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAEmB,oBAA4C,EAE5C,eAAkC,EAElC,YAAwC,EACxC,gBAAkC;QALlC,yBAAoB,GAApB,oBAAoB,CAAwB;QAE5C,oBAAe,GAAf,eAAe,CAAmB;QAElC,iBAAY,GAAZ,YAAY,CAA4B;QACxC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAErD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,WAAmB,EAAE,eAAuB;QACjE,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,4BAAmB,CAAC,yBAAyB,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;YAClD,KAAK,EAAE;gBACL,WAAW;gBACX,eAAe;aAChB;YACD,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK;aAChB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,0BAAiB,CACzB,iDAAiD,CAClD,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,2BAA2B,CAAC,S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YACxD,KAAK,CAAC,eAAe,GAAG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE3D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;gBACxC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;YACzC,CAAC;YAED,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC;QAKD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC9B,GAAG,EAAE;YACL,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE;SAC1C,CAAC,CAAC,CAAC;IACN,CAAC;CACF,CAAA;AAhLY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;IAEvB,WAAA,IAAA,0BAAgB,EAAC,iCAAc,CAAC,CAAA;qCAHM,oBAAU;QAEf,oBAAU;QAEb,oBAAU;QACN,4CAAgB;GAR1C,oBAAoB,CAgLhC"}
@@ -1,16 +1,19 @@
1
- import { Repository, DataSource } from 'typeorm';
1
+ import { Repository } from 'typeorm';
2
2
  import { WorkflowLevelMappingEntity } from '../entity/workflow-level-mapping.entity';
3
3
  import { StageGroup } from '../entity/stage-group.entity';
4
4
  import { Stage } from '../entity/stage.entity';
5
5
  import { UserData } from 'src/module/user/entity/user.entity';
6
6
  import { ReflectionHelper } from '../../../utils/service/reflection-helper.service';
7
+ import { ActionDataEntity } from '../entity/action-data.entity';
8
+ import { TaskDataEntity } from '../entity/task-data.entity';
7
9
  export declare class StageMovementRepository {
8
10
  private readonly workflowLevelMappingRepo;
9
11
  private readonly stageGroupRepo;
10
12
  private readonly stageRepo;
11
- private readonly dataSource;
12
13
  private readonly reflectionHelper;
13
- constructor(workflowLevelMappingRepo: Repository<WorkflowLevelMappingEntity>, stageGroupRepo: Repository<StageGroup>, stageRepo: Repository<Stage>, dataSource: DataSource, reflectionHelper: ReflectionHelper);
14
+ private readonly actionDataEntityRepository;
15
+ private readonly taskDataEntityRepository;
16
+ constructor(workflowLevelMappingRepo: Repository<WorkflowLevelMappingEntity>, stageGroupRepo: Repository<StageGroup>, stageRepo: Repository<Stage>, reflectionHelper: ReflectionHelper, actionDataEntityRepository: Repository<ActionDataEntity>, taskDataEntityRepository: Repository<TaskDataEntity>);
14
17
  getFirstStage({ loggedInUser, mapped_entity_type, mapped_entity_id, }: {
15
18
  loggedInUser: any;
16
19
  mapped_entity_type: string;
@@ -20,13 +20,16 @@ const workflow_level_mapping_entity_1 = require("../entity/workflow-level-mappin
20
20
  const stage_group_entity_1 = require("../entity/stage-group.entity");
21
21
  const stage_entity_1 = require("../entity/stage.entity");
22
22
  const reflection_helper_service_1 = require("../../../utils/service/reflection-helper.service");
23
+ const action_data_entity_1 = require("../entity/action-data.entity");
24
+ const task_data_entity_1 = require("../entity/task-data.entity");
23
25
  let StageMovementRepository = class StageMovementRepository {
24
- constructor(workflowLevelMappingRepo, stageGroupRepo, stageRepo, dataSource, reflectionHelper) {
26
+ constructor(workflowLevelMappingRepo, stageGroupRepo, stageRepo, reflectionHelper, actionDataEntityRepository, taskDataEntityRepository) {
25
27
  this.workflowLevelMappingRepo = workflowLevelMappingRepo;
26
28
  this.stageGroupRepo = stageGroupRepo;
27
29
  this.stageRepo = stageRepo;
28
- this.dataSource = dataSource;
29
30
  this.reflectionHelper = reflectionHelper;
31
+ this.actionDataEntityRepository = actionDataEntityRepository;
32
+ this.taskDataEntityRepository = taskDataEntityRepository;
30
33
  }
31
34
  async getFirstStage({ loggedInUser, mapped_entity_type, mapped_entity_id, }) {
32
35
  let workflowLevelMapping = await this.workflowLevelMappingRepo.findOne({
@@ -111,25 +114,25 @@ let StageMovementRepository = class StageMovementRepository {
111
114
  async getAllActionByStageId(stageId) {
112
115
  const actionRepo = this.reflectionHelper.getRepoService('ActionEntity');
113
116
  const result = await actionRepo
114
- .createQueryBuilder("a")
115
- .leftJoin("frm_wf_stage_action_mapping", "m", "a.id = m.action_id::bigint")
116
- .leftJoin("frm_wf_action_category", "ac", "a.action_category::bigint = ac.id")
117
- .where("m.stage_id::bigint = :stageId", { stageId: Number(stageId) })
117
+ .createQueryBuilder('a')
118
+ .leftJoin('frm_wf_stage_action_mapping', 'm', 'a.id = m.action_id::bigint')
119
+ .leftJoin('frm_wf_action_category', 'ac', 'a.action_category::bigint = ac.id')
120
+ .where('m.stage_id::bigint = :stageId', { stageId: Number(stageId) })
118
121
  .select([
119
- "a.*",
120
- "m.id AS mapping_id",
121
- "m.stage_id",
122
- "ac.code AS action_category_code",
122
+ 'a.*',
123
+ 'm.id AS mapping_id',
124
+ 'm.stage_id AS stage_id',
125
+ 'ac.code AS action_category_code',
123
126
  ])
124
- .orderBy("a.sequence", "ASC")
127
+ .orderBy('a.sequence', 'ASC')
125
128
  .getRawMany();
126
129
  const actionResourceMappingRepo = this.reflectionHelper.getRepoService('ActionResourcesMapping');
127
130
  for (const item of result) {
128
131
  if (item.action_category_code === 'SDFM') {
129
132
  const actionData = await actionResourceMappingRepo.findOne({
130
133
  where: {
131
- stg_act_mapping_id: item.mapping_id
132
- }
134
+ stg_act_mapping_id: item.mapping_id,
135
+ },
133
136
  });
134
137
  item.form_id = actionData?.form_id || null;
135
138
  }
@@ -139,14 +142,21 @@ let StageMovementRepository = class StageMovementRepository {
139
142
  async saveActionData(action, loggedInUser) {
140
143
  if (action.length > 0) {
141
144
  for (const act of action) {
142
- await this.dataSource.query(`INSERT INTO frm_wf_action_data (stage_id, user_id, action_id) VALUES ($1, $2, $3)`, [act.stage_id, loggedInUser.id, act.id]);
145
+ await this.actionDataEntityRepository.save({
146
+ stage_id: act.stage_id,
147
+ user_id: loggedInUser.id,
148
+ action_id: act.id,
149
+ });
143
150
  }
144
151
  }
145
152
  }
146
153
  async saveTaskData(actionData, loggedInUser) {
147
154
  if (actionData.length > 0) {
148
155
  for (const action of actionData) {
149
- await this.dataSource.query(`INSERT INTO frm_wf_task_data (action_id, user_id) VALUES ($1, $2)`, [action.id, loggedInUser.id]);
156
+ await this.taskDataEntityRepository.save({
157
+ action_id: action.id,
158
+ user_id: String(loggedInUser.id),
159
+ });
150
160
  }
151
161
  }
152
162
  }
@@ -157,10 +167,13 @@ exports.StageMovementRepository = StageMovementRepository = __decorate([
157
167
  __param(0, (0, typeorm_1.InjectRepository)(workflow_level_mapping_entity_1.WorkflowLevelMappingEntity)),
158
168
  __param(1, (0, typeorm_1.InjectRepository)(stage_group_entity_1.StageGroup)),
159
169
  __param(2, (0, typeorm_1.InjectRepository)(stage_entity_1.Stage)),
170
+ __param(4, (0, typeorm_1.InjectRepository)(action_data_entity_1.ActionDataEntity)),
171
+ __param(5, (0, typeorm_1.InjectRepository)(task_data_entity_1.TaskDataEntity)),
160
172
  __metadata("design:paramtypes", [typeorm_2.Repository,
161
173
  typeorm_2.Repository,
162
174
  typeorm_2.Repository,
163
- typeorm_2.DataSource,
164
- reflection_helper_service_1.ReflectionHelper])
175
+ reflection_helper_service_1.ReflectionHelper,
176
+ typeorm_2.Repository,
177
+ typeorm_2.Repository])
165
178
  ], StageMovementRepository);
166
179
  //# sourceMappingURL=stage-movement.repository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stage-movement.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage-movement.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAA2D;AAC3D,2FAAqF;AACrF,qEAA0D;AAC1D,yDAA+C;AAG/C,gGAAoF;AAG7E,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACl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AAC,EAAE,CAAC,CAC7B,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAhPY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,0DAA0B,CAAC,CAAA;IAE5C,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;qCAHmB,oBAAU;QAEpB,oBAAU;QAEf,oBAAU;QACT,oBAAU;QACJ,4CAAgB;GAT1C,uBAAuB,CAgPnC"}
1
+ {"version":3,"file":"stage-movement.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage-movement.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAA+C;AAC/C,2FAAqF;AACrF,qEAA0D;AAC1D,yDAA+C;AAE/C,gGAAoF;AACpF,qEAAgE;AAChE,iEAA4D;AAGrD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAEmB,wBAAgE,EAEhE,cAAsC,EAEtC,SAA4B,EAC5B,gBAAkC,EAElC,0BAAwD,EAExD,wBAAoD;QATpD,6BAAwB,GAAxB,wBAAwB,CAAwC;QAEhE,mBAAc,GAAd,cAAc,CAAwB;QAEtC,cAAS,GAAT,SAAS,CAAmB;QAC5B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAElC,+BAA0B,GAA1B,0BAA0B,CAA8B;QAExD,6BAAwB,GAAxB,wBAAwB,CAA4B;IACpE,CAAC;IAEJ,KAAK,CAAC,aAAa,CAAC,EAClB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,GAKjB;QAEC,IAAI,oBAAoB,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC;YACrE,KAAK,EAAE;gBACL,iBAAiB,EAAE,YAAY,CAAC,UAAU;gBAC1C,eAAe,EAAE,YAAY,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AU;QACH,4CAAgB;QAEN,oBAAU;QAEZ,oBAAU;GAZ5C,uBAAuB,CAmPnC"}
@@ -62,14 +62,14 @@ let StageRepository = class StageRepository {
62
62
  if (!stageGroup) {
63
63
  return [];
64
64
  }
65
- const rows = await this.dataSource.query(`
66
- SELECT
67
- g.id as stage_group_id, g.name as stage_group_name, g.workflow_id,
68
- s.*
69
- FROM frm_wf_stage_group g
70
- INNER JOIN frm_wf_stage s ON s.stage_group_id = g.id
71
- WHERE g.workflow_id = $1 AND g.organization_id = $2 AND g.id = $3
72
- ORDER BY g.id, s.id
65
+ const rows = await this.dataSource.query(`
66
+ SELECT
67
+ g.id as stage_group_id, g.name as stage_group_name, g.workflow_id,
68
+ s.*
69
+ FROM frm_wf_stage_group g
70
+ INNER JOIN frm_wf_stage s ON s.stage_group_id = g.id
71
+ WHERE g.workflow_id = $1 AND g.organization_id = $2 AND g.id = $3
72
+ ORDER BY g.id, s.id
73
73
  `, [stageGroup.workflow_id, organization_id, stage_group_id]);
74
74
  if (!rows || rows.length === 0) {
75
75
  return [];
@@ -113,10 +113,10 @@ let ActionTemplateMappingService = class ActionTemplateMappingService extends en
113
113
  .andWhere('ct.organization_id = :orgId', { orgId: loggedInUser.organization_id })
114
114
  .andWhere('ct.level_type = :levelType', { levelType: loggedInUser.level_type })
115
115
  .andWhere('ct.level_id = :levelId', { levelId: Number(loggedInUser.level_id) })
116
- .andWhere(`ct.status IN (
117
- SELECT id FROM frm_list_master_items
118
- WHERE code = 'STATUS_ACTIVE'
119
- AND organization_id = :orgId2
116
+ .andWhere(`ct.status IN (
117
+ SELECT id FROM frm_list_master_items
118
+ WHERE code = 'STATUS_ACTIVE'
119
+ AND organization_id = :orgId2
120
120
  )`, { orgId2: loggedInUser.organization_id })
121
121
  .getRawMany();
122
122
  }
@@ -1,18 +1,26 @@
1
1
  import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
2
  import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
3
3
  import { UserData } from 'src/module/user/entity/user.entity';
4
- import { DataSource, EntityManager } from 'typeorm';
4
+ import { EntityManager, Repository } from 'typeorm';
5
5
  import { ActionRepository } from '../repository/action.repository';
6
+ import { ActionResourcesMapping } from '../entity/action-resources-mapping.entity';
7
+ import { StageActionMapping } from '../entity/stage-action-mapping.entity';
8
+ import { ActionTemplateMapping } from '../entity/action-template-mapping.entity';
6
9
  export declare class ActionService extends EntityServiceImpl {
7
- private readonly dataSource;
8
10
  private readonly actionRepository;
9
- constructor(dataSource: DataSource, actionRepository: ActionRepository);
11
+ private readonly actionResourcesMappingRepository;
12
+ private readonly stageActionMappingRepository;
13
+ private readonly actionTemplateMappingRepository;
14
+ constructor(actionRepository: ActionRepository, actionResourcesMappingRepository: Repository<ActionResourcesMapping>, stageActionMappingRepository: Repository<StageActionMapping>, actionTemplateMappingRepository: Repository<ActionTemplateMapping>);
10
15
  getEntityData(entityType: string, id: number, loggedInUser: any): Promise<any>;
11
16
  createEntity(entityData: BaseEntity, loggedInUser: UserData | null, manager?: EntityManager | null, appcode?: string): Promise<any>;
12
17
  updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
13
18
  deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;
14
19
  getReasonCode(loggedInUser: UserData): Promise<any>;
15
- defaultReasonCode(list_type: string, loggedInUser: UserData): Promise<any>;
20
+ defaultReasonCode(list_type: string, loggedInUser: UserData): Promise<{
21
+ label: any;
22
+ value: any;
23
+ }[]>;
16
24
  getActions(loggedInUser: UserData, stage_id: number): Promise<any[]>;
17
25
  getDependentActions(loggedInUser: UserData, stage_id: number, action_id: number | undefined): Promise<any>;
18
26
  getAction(loggedInUser: UserData, stage_id: number, mapped_entity_id: number, mapped_entity_type: string): Promise<{
@@ -25,7 +33,7 @@ export declare class ActionService extends EntityServiceImpl {
25
33
  name: any;
26
34
  reason_code: any;
27
35
  default_reason_code: any;
28
- is_default: boolean;
36
+ is_default: any;
29
37
  is_current: any;
30
38
  is_done: any;
31
39
  is_mandatory: any;
@@ -8,30 +8,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.ActionService = void 0;
13
16
  const common_1 = require("@nestjs/common");
14
17
  const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
15
18
  const typeorm_1 = require("typeorm");
16
19
  const action_repository_1 = require("../repository/action.repository");
20
+ const action_resources_mapping_entity_1 = require("../entity/action-resources-mapping.entity");
21
+ const typeorm_2 = require("@nestjs/typeorm");
22
+ const stage_action_mapping_entity_1 = require("../entity/stage-action-mapping.entity");
23
+ const action_template_mapping_entity_1 = require("../entity/action-template-mapping.entity");
17
24
  let ActionService = class ActionService extends entity_service_impl_service_1.EntityServiceImpl {
18
- constructor(dataSource, actionRepository) {
25
+ constructor(actionRepository, actionResourcesMappingRepository, stageActionMappingRepository, actionTemplateMappingRepository) {
19
26
  super();
20
- this.dataSource = dataSource;
21
27
  this.actionRepository = actionRepository;
28
+ this.actionResourcesMappingRepository = actionResourcesMappingRepository;
29
+ this.stageActionMappingRepository = stageActionMappingRepository;
30
+ this.actionTemplateMappingRepository = actionTemplateMappingRepository;
22
31
  }
23
32
  async getEntityData(entityType, id, loggedInUser) {
24
33
  const actionData = await super.getEntityData(entityType, id, loggedInUser);
25
34
  if (!actionData) {
26
35
  return null;
27
36
  }
28
- const result = await this.dataSource.query(`SELECT template_code, form_id
29
- FROM frm_wf_action_resources_mapping
30
- WHERE stg_act_mapping_id IN (
31
- SELECT id
32
- FROM frm_wf_stage_action_mapping
33
- WHERE action_id = $1 AND entity_type = 'WFSA'
34
- )`, [actionData.id]);
37
+ let actionResourceMappingRepo = this.reflectionHelper.getRepoService('ActionResourcesMapping');
38
+ await actionResourceMappingRepo.find({
39
+ where: {},
40
+ });
41
+ const result = await actionResourceMappingRepo
42
+ .createQueryBuilder('arm')
43
+ .select([
44
+ 'arm.template_code AS template_code',
45
+ 'arm.form_id AS form_id',
46
+ ])
47
+ .where(`arm.stg_act_mapping_id IN (
48
+ SELECT sam.id
49
+ FROM frm_wf_stage_action_mapping sam
50
+ WHERE sam.action_id = :actionId
51
+ AND sam.entity_type = 'WFSA'
52
+ )`)
53
+ .setParameter('actionId', actionData.id)
54
+ .getRawMany();
35
55
  const templates = result
36
56
  .filter((t) => t.template_code !== null)
37
57
  .map((t) => t.template_code);
@@ -69,7 +89,10 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
69
89
  await super.createEntity(resourceMapping, loggedInUser);
70
90
  }
71
91
  }
72
- await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = $1 AND type = 'form'`, [stageActionMappingData.id]);
92
+ await this.actionResourcesMappingRepository.delete({
93
+ stg_act_mapping_id: stageActionMappingData.id,
94
+ type: 'form',
95
+ });
73
96
  if (actionData.form) {
74
97
  const resourceMapping = {
75
98
  stg_act_mapping_id: stageActionMappingData.id,
@@ -89,11 +112,16 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
89
112
  if (!action) {
90
113
  throw new Error('Action not found or could not be updated');
91
114
  }
92
- const stageMapID = await this.dataSource.query(`SELECT id FROM frm_wf_stage_action_mapping WHERE action_id = $1 AND entity_type = 'WFSA'`, [action.id]);
115
+ const stageMap = await this.stageActionMappingRepository.findOne({
116
+ where: {
117
+ action_id: action.id,
118
+ entity_type: 'WFSA',
119
+ },
120
+ });
93
121
  let stageActionMappingData;
94
- if (stageMapID.length > 0) {
122
+ if (stageMap) {
95
123
  const stageActionMapping = {
96
- id: stageMapID[0].id,
124
+ id: stageMap.id,
97
125
  action_id: action.id,
98
126
  stage_id,
99
127
  entity_type: 'WFSA',
@@ -109,7 +137,10 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
109
137
  };
110
138
  stageActionMappingData = await super.createEntity(newStageMapping, loggedInUser);
111
139
  }
112
- await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = $1 AND type = 'template'`, [stageActionMappingData.id]);
140
+ await this.actionResourcesMappingRepository.delete({
141
+ stg_act_mapping_id: stageActionMappingData.id,
142
+ type: 'template',
143
+ });
113
144
  if (Array.isArray(template) && template.length > 0) {
114
145
  for (let i = 0; i < template.length; i++) {
115
146
  const templateCode = template[i];
@@ -123,7 +154,10 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
123
154
  console.log(res);
124
155
  }
125
156
  }
126
- await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = $1 AND type = 'form'`, [stageActionMappingData.id]);
157
+ await this.actionResourcesMappingRepository.delete({
158
+ stg_act_mapping_id: stageActionMappingData.id,
159
+ type: 'form',
160
+ });
127
161
  if (form) {
128
162
  const resourceMapping = {
129
163
  stg_act_mapping_id: stageActionMappingData.id,
@@ -136,9 +170,21 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
136
170
  return action;
137
171
  }
138
172
  async deleteEntity(entityType, id, loggedInUser) {
139
- await this.dataSource.query(`DELETE FROM frm_wf_action_template_mapping WHERE stg_act_mapping_id IN (SELECT
140
- id FROM frm_wf_stage_action_mapping WHERE action_id = $1 AND entity_type = 'WFSA')`, [id]);
141
- await this.dataSource.query(`DELETE FROM frm_wf_stage_action_mapping WHERE action_id = $1 AND entity_type ='WFSA'`, [id]);
173
+ await this.actionTemplateMappingRepository
174
+ .createQueryBuilder()
175
+ .delete()
176
+ .where(`stg_act_mapping_id IN (
177
+ SELECT sam.id
178
+ FROM frm_wf_stage_action_mapping sam
179
+ WHERE sam.action_id = :actionId
180
+ AND sam.entity_type = 'WFSA'
181
+ )`)
182
+ .setParameter('actionId', id)
183
+ .execute();
184
+ await this.stageActionMappingRepository.delete({
185
+ action_id: id,
186
+ entity_type: 'WFSA',
187
+ });
142
188
  const deleteAction = await super.deleteEntity(entityType, id, loggedInUser);
143
189
  return deleteAction;
144
190
  }
@@ -162,7 +208,12 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
162
208
  exports.ActionService = ActionService;
163
209
  exports.ActionService = ActionService = __decorate([
164
210
  (0, common_1.Injectable)(),
165
- __metadata("design:paramtypes", [typeorm_1.DataSource,
166
- action_repository_1.ActionRepository])
211
+ __param(1, (0, typeorm_2.InjectRepository)(action_resources_mapping_entity_1.ActionResourcesMapping)),
212
+ __param(2, (0, typeorm_2.InjectRepository)(stage_action_mapping_entity_1.StageActionMapping)),
213
+ __param(3, (0, typeorm_2.InjectRepository)(action_template_mapping_entity_1.ActionTemplateMapping)),
214
+ __metadata("design:paramtypes", [action_repository_1.ActionRepository,
215
+ typeorm_1.Repository,
216
+ typeorm_1.Repository,
217
+ typeorm_1.Repository])
167
218
  ], ActionService);
168
219
  //# sourceMappingURL=action.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AAEjE,gGAAwF;AAExF,qCAAgE;AAChE,uEAAmE;AAI5D,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,+CAAiB;IAClD,YACmB,UAAsB,EACtB,gBAAkC;QAEnD,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;IAGrD,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,UAAkB,EAClB,EAAU,EACV,YAAY;QAEZ,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAE3E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,M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AO,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,YAAsB,EAAE,QAAgB;QACvD,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,YAAsB,EACtB,QAAgB,EAChB,SAA6B;QAE7B,OAAO,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAC9C,YAAY,EACZ,QAAQ,EACR,SAAS,CACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CACb,YAAsB,EACtB,QAAgB,EAChB,gBAAwB,EACxB,kBAA0B;QAE1B,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QACzC,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACpC,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,CACnB,CAAC;IACJ,CAAC;CACF,CAAA;AA7QY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAGoB,oBAAU;QACJ,oCAAgB;GAH1C,aAAa,CA6QzB"}
1
+ {"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAE5C,gGAAwF;AAExF,qCAAoD;AACpD,uEAAmE;AAEnE,+FAAmF;AACnF,6CAAmD;AACnD,uFAA2E;AAC3E,6FAAiF;AAG1E,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,+CAAiB;IAClD,YACmB,gBAAkC,EAElC,gCAAoE,EAEpE,4BAA4D,EAE5D,+BAAkE;QAEnF,KAAK,EAAE,CAAC;QARS,qBAAgB,GAAhB,gBAAgB,CAAkB;QAElC,qCAAgC,GAAhC,gCAAgC,CAAoC;QAEpE,iCAA4B,GAA5B,4BAA4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AAwB,EACxB,kBAA0B;QAE1B,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QACzC,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACpC,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,CACnB,CAAC;IACJ,CAAC;CACF,CAAA;AApSY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAIR,WAAA,IAAA,0BAAgB,EAAC,wDAAsB,CAAC,CAAA;IAExC,WAAA,IAAA,0BAAgB,EAAC,gDAAkB,CAAC,CAAA;IAEpC,WAAA,IAAA,0BAAgB,EAAC,sDAAqB,CAAC,CAAA;qCALL,oCAAgB;QAEA,oBAAU;QAEd,oBAAU;QAEP,oBAAU;GARnD,aAAa,CAoSzB"}
@@ -1,8 +1,8 @@
1
1
  import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
2
2
  import { UserData } from 'src/module/user/entity/user.entity';
3
- import { DataSource } from 'typeorm';
3
+ import { EntityManager } from 'typeorm';
4
4
  export declare class EntityModificationService extends EntityServiceImpl {
5
- private readonly dataSource;
6
- constructor(dataSource: DataSource);
5
+ private readonly entityManager;
6
+ constructor(entityManager: EntityManager);
7
7
  logModification(modificationData: any, loggedInUser: UserData): Promise<any>;
8
8
  }
@@ -14,9 +14,9 @@ const common_1 = require("@nestjs/common");
14
14
  const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
15
15
  const typeorm_1 = require("typeorm");
16
16
  let EntityModificationService = class EntityModificationService extends entity_service_impl_service_1.EntityServiceImpl {
17
- constructor(dataSource) {
17
+ constructor(entityManager) {
18
18
  super();
19
- this.dataSource = dataSource;
19
+ this.entityManager = entityManager;
20
20
  }
21
21
  async logModification(modificationData, loggedInUser) {
22
22
  const { mapped_entity_type, mapped_entity_id, attribute_key } = modificationData;
@@ -29,8 +29,8 @@ let EntityModificationService = class EntityModificationService extends entity_s
29
29
  throw new common_1.NotFoundException('Entity metadata not found in frm_entity_master');
30
30
  }
31
31
  const tableName = entityMeta.db_table_name;
32
- const [entityRow] = await this.dataSource.query(`
33
- SELECT * FROM ${tableName} WHERE id = $1
32
+ const [entityRow] = await this.entityManager.query(`
33
+ SELECT * FROM ${tableName} WHERE id = $1
34
34
  `, [mapped_entity_id]);
35
35
  if (!entityRow) {
36
36
  throw new common_1.NotFoundException(`No record found in ${tableName} with ID ${mapped_entity_id}`);
@@ -43,6 +43,6 @@ let EntityModificationService = class EntityModificationService extends entity_s
43
43
  exports.EntityModificationService = EntityModificationService;
44
44
  exports.EntityModificationService = EntityModificationService = __decorate([
45
45
  (0, common_1.Injectable)(),
46
- __metadata("design:paramtypes", [typeorm_1.DataSource])
46
+ __metadata("design:paramtypes", [typeorm_1.EntityManager])
47
47
  ], EntityModificationService);
48
48
  //# sourceMappingURL=entity-modification.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity-modification.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/entity-modification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAIwB;AACxB,gGAAwF;AAExF,qCAAqC;AAI9B,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,+CAAiB;IAC9D,YAA6B,UAAsB;QAEjD,KAAK,EAAE,CAAC;QAFmB,eAAU,GAAV,UAAU,CAAY;IAGnD,CAAC;IACD,KAAK,CAAC,eAAe,CAAC,gBAAqB,EAAE,YAAsB;QACjE,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAC3D,gBAAgB,CAAC;QACnB,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QAEzC,IAAI,CAAC,kBAAkB,IAAI,CAAC,gBAAgB,IAAI,CAAC,aAAa,EAAE,CAAC;YAC/D,MAAM,IAAI,4BAAmB,CAC3B,4FAA4F,CAC7F,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;QAElG,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;YAC7C,MAAM,IAAI,0BAAiB,CACzB,gDAAgD,CACjD,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC;QAG3C,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAC7C;oBACc,SAAS;KACxB,EACC,CAAC,gBAAgB,CAAC,CACnB,CAAC;QAEF,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,0BAAiB,CACzB,sBAAsB,SAAS,YAAY,gBAAgB,EAAE,CAC9D,CAAC;QACJ,CAAC;QAGD,MAAM,qBAAqB,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;QAGvD,gBAAgB,CAAC,aAAa,GAAG,qBAAqB,CAAC;QAGvD,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AAjDY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAE8B,oBAAU;GADxC,yBAAyB,CAiDrC"}
1
+ {"version":3,"file":"entity-modification.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/entity-modification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAIwB;AACxB,gGAAwF;AAExF,qCAAoD;AAI7C,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,+CAAiB;IAC9D,YAA6B,aAA4B;QAEvD,KAAK,EAAE,CAAC;QAFmB,kBAAa,GAAb,aAAa,CAAe;IAGzD,CAAC;IACD,KAAK,CAAC,eAAe,CAAC,gBAAqB,EAAE,YAAsB;QACjE,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAC3D,gBAAgB,CAAC;QACnB,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QAEzC,IAAI,CAAC,kBAAkB,IAAI,CAAC,gBAAgB,IAAI,CAAC,aAAa,EAAE,CAAC;YAC/D,MAAM,IAAI,4BAAmB,CAC3B,4FAA4F,CAC7F,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;QAElG,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;YAC7C,MAAM,IAAI,0BAAiB,CACzB,gDAAgD,CACjD,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC;QAG3C,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAChD;oBACc,SAAS;KACxB,EACC,CAAC,gBAAgB,CAAC,CACnB,CAAC;QAEF,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,0BAAiB,CACzB,sBAAsB,SAAS,YAAY,gBAAgB,EAAE,CAC9D,CAAC;QACJ,CAAC;QAGD,MAAM,qBAAqB,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;QAGvD,gBAAgB,CAAC,aAAa,GAAG,qBAAqB,CAAC;QAGvD,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AAjDY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAEiC,uBAAa;GAD9C,yBAAyB,CAiDrC"}
@@ -4,7 +4,10 @@ import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.s
4
4
  export declare class FormMasterService extends EntityServiceImpl {
5
5
  private readonly formMasterRepository;
6
6
  constructor(formMasterRepository: FormMasterRepository);
7
- getForms(loggedInUser: UserData, source_entity_type: string): Promise<any>;
7
+ getForms(loggedInUser: UserData, source_entity_type: string): Promise<{
8
+ label: any;
9
+ value: any;
10
+ }[]>;
8
11
  saveForm(data: {
9
12
  entity_id: number;
10
13
  entity_type: string;