rez_core 3.1.165 → 3.1.168

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 (387) hide show
  1. package/.prettierrc +3 -3
  2. package/README.md +99 -99
  3. package/dist/module/auth/guards/role.guard.js +3 -3
  4. package/dist/module/auth/services/auth.service.js +2 -2
  5. package/dist/module/filter/repository/saved-filter.repository.js +4 -4
  6. package/dist/module/filter/service/filter-evaluator.service.js +2 -2
  7. package/dist/module/filter/service/filter.service.js +7 -7
  8. package/dist/module/integration/examples/usage.example.js +9 -9
  9. package/dist/module/integration/service/integration.service.js +1 -1
  10. package/dist/module/integration/service/wrapper.service.js +26 -26
  11. package/dist/module/listmaster/service/list-master-item.service.js +2 -2
  12. package/dist/module/listmaster/service/list-master.service.js +5 -3
  13. package/dist/module/listmaster/service/list-master.service.js.map +1 -1
  14. package/dist/module/mapper/service/field-mapper.service.js +4 -4
  15. package/dist/module/mapper/service/mapper.service.js +2 -2
  16. package/dist/module/meta/service/entity-dynamic.service.js +18 -18
  17. package/dist/module/meta/service/entity-list.service.js +3 -3
  18. package/dist/module/meta/service/entity-master.service.js +3 -3
  19. package/dist/module/meta/service/entity-relation.service.js +11 -11
  20. package/dist/module/meta/service/entity-service-impl.service.js +3 -3
  21. package/dist/module/meta/service/resolver.service.d.ts +4 -2
  22. package/dist/module/meta/service/resolver.service.js +26 -54
  23. package/dist/module/meta/service/resolver.service.js.map +1 -1
  24. package/dist/module/module/repository/menu.repository.js +12 -12
  25. package/dist/module/notification/service/notification.service.js +12 -12
  26. package/dist/module/user/controller/login.controller.js +18 -18
  27. package/dist/module/user/service/role.service.js +4 -4
  28. package/dist/module/user/service/user-session.service.js +2 -2
  29. package/dist/module/workflow/repository/action.repository.js +16 -16
  30. package/dist/module/workflow/repository/comm-template.repository.js +6 -6
  31. package/dist/module/workflow/repository/form-master.repository.js +2 -2
  32. package/dist/module/workflow/repository/stage-group.repository.js +23 -23
  33. package/dist/module/workflow/repository/stage-movement.repository.js +11 -11
  34. package/dist/module/workflow/repository/stage.repository.js +8 -8
  35. package/dist/module/workflow/service/action-template-mapping.service.js +10 -10
  36. package/dist/module/workflow/service/action.service.js +7 -7
  37. package/dist/module/workflow/service/entity-modification.service.js +6 -6
  38. package/dist/module/workflow/service/populate-workflow.service.js +1 -1
  39. package/dist/module/workflow/service/populate-workflow.service.js.map +1 -1
  40. package/dist/module/workflow/service/stage-group.service.js +5 -5
  41. package/dist/module/workflow/service/stage.service.js +2 -2
  42. package/dist/module/workflow/service/task.service.js +33 -33
  43. package/dist/module/workflow/service/workflow-list-master.service.js +15 -15
  44. package/dist/module/workflow/service/workflow-meta.service.js +50 -50
  45. package/dist/module/workflow/service/workflow.service.js +2 -2
  46. package/dist/tsconfig.build.tsbuildinfo +1 -1
  47. package/dist/utils/service/reflection-helper.service.js +2 -2
  48. package/docs/modules/event-driven-integration-design.md +91 -91
  49. package/docs/modules/integration.md +250 -250
  50. package/eslint.config.mjs +34 -34
  51. package/nest-cli.json +14 -14
  52. package/package.json +118 -118
  53. package/src/app.controller.ts +12 -12
  54. package/src/app.module.ts +49 -49
  55. package/src/app.service.ts +8 -8
  56. package/src/config/config.module.ts +18 -18
  57. package/src/config/database.config.ts +23 -23
  58. package/src/constant/global.constant.ts +67 -67
  59. package/src/core.module.ts +81 -81
  60. package/src/decorators/roles.decorator.ts +7 -7
  61. package/src/dtos/response.dto.ts +6 -6
  62. package/src/dtos/response.ts +5 -5
  63. package/src/index.ts +1 -1
  64. package/src/module/auth/auth.module.ts +49 -49
  65. package/src/module/auth/controller/auth.controller.ts +28 -28
  66. package/src/module/auth/guards/google-auth.guard.ts +9 -9
  67. package/src/module/auth/guards/jwt.guard.ts +22 -22
  68. package/src/module/auth/guards/role.guard.ts +68 -68
  69. package/src/module/auth/services/auth.service.ts +50 -50
  70. package/src/module/auth/services/jwt.service.ts +11 -11
  71. package/src/module/auth/strategies/google.strategy.ts +54 -54
  72. package/src/module/auth/strategies/jwt.strategy.ts +58 -58
  73. package/src/module/auth/strategies/local.strategy.ts +13 -13
  74. package/src/module/dashboard/controller/dashboard.controller.ts +36 -36
  75. package/src/module/dashboard/dashboard.module.ts +21 -21
  76. package/src/module/dashboard/entity/dashboard_page_data.entity.ts +27 -27
  77. package/src/module/dashboard/entity/widget_master.entity.ts +18 -18
  78. package/src/module/dashboard/repository/dashboard.repository.ts +42 -42
  79. package/src/module/dashboard/service/dashboard.service.ts +73 -73
  80. package/src/module/dev/dev.module.ts +12 -12
  81. package/src/module/dev/service/dev.service.ts +7 -7
  82. package/src/module/enterprise/controller/organization.controller.ts +36 -36
  83. package/src/module/enterprise/enterprise.module.ts +30 -30
  84. package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
  85. package/src/module/enterprise/entity/organization-app-mapping.entity.ts +13 -13
  86. package/src/module/enterprise/entity/organization.entity.ts +92 -92
  87. package/src/module/enterprise/repository/enterprise.repository.ts +31 -31
  88. package/src/module/enterprise/repository/organization.repository.ts +26 -26
  89. package/src/module/enterprise/repository/school.repository.ts +281 -281
  90. package/src/module/enterprise/service/brand.service.ts +5 -5
  91. package/src/module/enterprise/service/enterprise.service.ts +16 -16
  92. package/src/module/enterprise/service/organization-app-mapping.service.ts +4 -4
  93. package/src/module/enterprise/service/organization.service.ts +145 -145
  94. package/src/module/filter/controller/filter.controller.ts +84 -84
  95. package/src/module/filter/dto/filter-request.dto.ts +38 -38
  96. package/src/module/filter/entity/saved-filter-detail.entity.ts +41 -41
  97. package/src/module/filter/entity/saved-filter-master.entity.ts +23 -23
  98. package/src/module/filter/filter.module.ts +31 -31
  99. package/src/module/filter/repository/saved-filter.repository.ts +168 -168
  100. package/src/module/filter/service/filter-evaluator.service.ts +86 -86
  101. package/src/module/filter/service/filter.service.ts +841 -841
  102. package/src/module/filter/service/saved-filter.service.ts +170 -170
  103. package/src/module/ics/controller/ics.controller.ts +21 -21
  104. package/src/module/ics/dto/ics.dto.ts +55 -55
  105. package/src/module/ics/ics.module.ts +13 -13
  106. package/src/module/ics/service/ics.service.ts +57 -57
  107. package/src/module/integration/controller/calender-event.controller.ts +31 -31
  108. package/src/module/integration/controller/integration.controller.ts +662 -662
  109. package/src/module/integration/controller/wrapper.controller.ts +37 -37
  110. package/src/module/integration/dto/create-config.dto.ts +526 -526
  111. package/src/module/integration/entity/integration-config.entity.ts +112 -112
  112. package/src/module/integration/entity/integration-entity-mapper.entity.ts +14 -14
  113. package/src/module/integration/entity/integration-source.entity.ts +17 -17
  114. package/src/module/integration/entity/user-integration.entity.ts +71 -71
  115. package/src/module/integration/examples/usage.example.ts +338 -338
  116. package/src/module/integration/factories/base.factory.ts +7 -7
  117. package/src/module/integration/factories/email.factory.ts +49 -49
  118. package/src/module/integration/factories/integration.factory.ts +121 -121
  119. package/src/module/integration/factories/sms.factory.ts +51 -51
  120. package/src/module/integration/factories/telephone.factory.ts +41 -41
  121. package/src/module/integration/factories/whatsapp.factory.ts +56 -56
  122. package/src/module/integration/integration.module.ts +110 -110
  123. package/src/module/integration/service/calendar-event.service.ts +118 -118
  124. package/src/module/integration/service/integration-entity-mapper.service.ts +17 -17
  125. package/src/module/integration/service/integration-queue.service.ts +229 -229
  126. package/src/module/integration/service/integration.service.ts +2572 -2572
  127. package/src/module/integration/service/oauth.service.ts +224 -224
  128. package/src/module/integration/service/wrapper.service.ts +454 -454
  129. package/src/module/integration/strategies/email/gmail-api.strategy.ts +280 -280
  130. package/src/module/integration/strategies/email/outlook-api.strategy.ts +44 -44
  131. package/src/module/integration/strategies/email/outlook.strategy.ts +64 -64
  132. package/src/module/integration/strategies/email/sendgrid-api.strategy.ts +260 -260
  133. package/src/module/integration/strategies/integration.strategy.ts +97 -97
  134. package/src/module/integration/strategies/sms/gupshup-sms.strategy.ts +146 -146
  135. package/src/module/integration/strategies/sms/msg91-sms.strategy.ts +164 -164
  136. package/src/module/integration/strategies/sms/tubelight-sms.strategy.ts +163 -163
  137. package/src/module/integration/strategies/telephone/ozonetel-voice.strategy.ts +238 -238
  138. package/src/module/integration/strategies/telephone/tubelight-voice.strategy.ts +210 -210
  139. package/src/module/integration/strategies/whatsapp/gupshup-whatsapp.strategy.ts +359 -359
  140. package/src/module/integration/strategies/whatsapp/tubelight-whatsapp.strategy.ts +372 -372
  141. package/src/module/integration/strategies/whatsapp/whatsapp-cloud.strategy.ts +403 -403
  142. package/src/module/integration/strategies/whatsapp/whatsapp.strategy.ts +57 -57
  143. package/src/module/layout/controller/layout.controller.ts +47 -47
  144. package/src/module/layout/entity/header-items.entity.ts +28 -28
  145. package/src/module/layout/entity/header-section.entity.ts +19 -19
  146. package/src/module/layout/layout.module.ts +21 -21
  147. package/src/module/layout/repository/header-items.repository.ts +18 -18
  148. package/src/module/layout/repository/header-section.repository.ts +22 -22
  149. package/src/module/layout/service/header-section.service.ts +25 -25
  150. package/src/module/layout_preference/controller/layout_preference.controller.ts +47 -47
  151. package/src/module/layout_preference/entity/layout_preference.entity.ts +28 -28
  152. package/src/module/layout_preference/layout_preference.module.ts +18 -18
  153. package/src/module/layout_preference/repository/layout_preference.repository.ts +30 -30
  154. package/src/module/layout_preference/service/layout_preference.service.ts +172 -172
  155. package/src/module/lead/controller/lead.controller.ts +30 -30
  156. package/src/module/lead/lead.module.ts +14 -14
  157. package/src/module/lead/repository/lead.repository.ts +41 -41
  158. package/src/module/lead/service/lead.service.ts +54 -54
  159. package/src/module/listmaster/controller/list-master.controller.ts +187 -187
  160. package/src/module/listmaster/entity/list-master-items.entity.ts +41 -41
  161. package/src/module/listmaster/entity/list-master.entity.ts +32 -32
  162. package/src/module/listmaster/listmaster.module.ts +44 -44
  163. package/src/module/listmaster/repository/list-master-items.repository.ts +169 -169
  164. package/src/module/listmaster/repository/list-master.repository.ts +46 -46
  165. package/src/module/listmaster/service/list-master-engine.ts +19 -19
  166. package/src/module/listmaster/service/list-master-extension.interface.ts +4 -4
  167. package/src/module/listmaster/service/list-master-item.service.ts +292 -292
  168. package/src/module/listmaster/service/list-master-registry.ts +15 -15
  169. package/src/module/listmaster/service/list-master.service.ts +424 -420
  170. package/src/module/mapper/controller/field-mapper.controller.ts +69 -69
  171. package/src/module/mapper/controller/mapper.controller.ts +14 -14
  172. package/src/module/mapper/dto/field-mapper.dto.ts +14 -14
  173. package/src/module/mapper/entity/field-lovs.entity.ts +19 -19
  174. package/src/module/mapper/entity/field-mapper.entity.ts +53 -53
  175. package/src/module/mapper/entity/mapper.entity.ts +16 -16
  176. package/src/module/mapper/mapper.module.ts +34 -34
  177. package/src/module/mapper/repository/field-lovs.repository.ts +35 -35
  178. package/src/module/mapper/repository/field-mapper.repository.ts +42 -42
  179. package/src/module/mapper/repository/mapper.repository.ts +15 -15
  180. package/src/module/mapper/service/field-mapper.service.ts +223 -223
  181. package/src/module/mapper/service/mapper.service.ts +72 -72
  182. package/src/module/master/controller/master.controller.ts +74 -74
  183. package/src/module/master/service/master.service.ts +483 -483
  184. package/src/module/meta/controller/app-master.controller.ts +38 -38
  185. package/src/module/meta/controller/attribute-master.controller.ts +66 -66
  186. package/src/module/meta/controller/entity-dynamic.controller.ts +125 -125
  187. package/src/module/meta/controller/entity-master.controller.ts +28 -28
  188. package/src/module/meta/controller/entity-relation.controller.ts +36 -36
  189. package/src/module/meta/controller/entity.controller.ts +385 -385
  190. package/src/module/meta/controller/media.controller.ts +82 -82
  191. package/src/module/meta/controller/meta.controller.ts +96 -96
  192. package/src/module/meta/controller/view-master.controller.ts +86 -86
  193. package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
  194. package/src/module/meta/dto/entity-tab.dto.ts +4 -4
  195. package/src/module/meta/dto/entity-table.dto.ts +9 -9
  196. package/src/module/meta/entity/app-master.entity.ts +34 -34
  197. package/src/module/meta/entity/attribute-master.entity.ts +87 -87
  198. package/src/module/meta/entity/base-entity.entity.ts +75 -75
  199. package/src/module/meta/entity/entity-master.entity.ts +78 -78
  200. package/src/module/meta/entity/entity-relation-data.entity.ts +29 -29
  201. package/src/module/meta/entity/entity-relation.entity.ts +23 -23
  202. package/src/module/meta/entity/entity-table-column.entity.ts +61 -61
  203. package/src/module/meta/entity/entity-table.entity.ts +50 -50
  204. package/src/module/meta/entity/media-data.entity.ts +32 -32
  205. package/src/module/meta/entity/preference.entity.ts +62 -62
  206. package/src/module/meta/entity/view-master.entity.ts +41 -41
  207. package/src/module/meta/entity.module.ts +156 -156
  208. package/src/module/meta/repository/app-master.repository.ts +20 -20
  209. package/src/module/meta/repository/attribute-master.repository.ts +110 -110
  210. package/src/module/meta/repository/entity-master.repository.ts +69 -69
  211. package/src/module/meta/repository/entity-table-column.repository.ts +39 -39
  212. package/src/module/meta/repository/entity-table.repository.ts +53 -53
  213. package/src/module/meta/repository/media-data.repository.ts +50 -50
  214. package/src/module/meta/repository/preference.repository.ts +20 -20
  215. package/src/module/meta/repository/user-app-mapping.repository.ts +28 -28
  216. package/src/module/meta/repository/view-master.repository.ts +42 -42
  217. package/src/module/meta/service/app-master.service.ts +37 -37
  218. package/src/module/meta/service/attribute-master.service.ts +117 -117
  219. package/src/module/meta/service/common.service.ts +9 -9
  220. package/src/module/meta/service/entity-dynamic.service.ts +762 -762
  221. package/src/module/meta/service/entity-list.service.ts +205 -205
  222. package/src/module/meta/service/entity-master.service.ts +164 -164
  223. package/src/module/meta/service/entity-realation-data.service.ts +9 -9
  224. package/src/module/meta/service/entity-relation.service.ts +69 -69
  225. package/src/module/meta/service/entity-service-impl.service.ts +524 -524
  226. package/src/module/meta/service/entity-table-column.service.ts +39 -39
  227. package/src/module/meta/service/entity-table.service.ts +150 -150
  228. package/src/module/meta/service/entity-validation.service.ts +185 -185
  229. package/src/module/meta/service/entity.service.ts +67 -67
  230. package/src/module/meta/service/field-group.service.ts +103 -103
  231. package/src/module/meta/service/media-data.service.ts +149 -149
  232. package/src/module/meta/service/populate-meta.service.ts +173 -173
  233. package/src/module/meta/service/preference.service.ts +16 -16
  234. package/src/module/meta/service/resolver.service.ts +214 -274
  235. package/src/module/meta/service/section-master.service.ts +104 -104
  236. package/src/module/meta/service/update-form-json.service.ts +22 -22
  237. package/src/module/meta/service/user-app-mapping.service.ts +17 -17
  238. package/src/module/meta/service/view-master.service.ts +111 -111
  239. package/src/module/module/controller/menu.controller.ts +15 -15
  240. package/src/module/module/controller/module-access.controller.ts +132 -132
  241. package/src/module/module/entity/menu.entity.ts +43 -43
  242. package/src/module/module/entity/module-access.entity.ts +25 -25
  243. package/src/module/module/entity/module-action.entity.ts +17 -17
  244. package/src/module/module/entity/module.entity.ts +52 -52
  245. package/src/module/module/module.module.ts +42 -42
  246. package/src/module/module/repository/menu.repository.ts +184 -184
  247. package/src/module/module/repository/module-access.repository.ts +331 -331
  248. package/src/module/module/service/menu.service.ts +82 -82
  249. package/src/module/module/service/module-access.service.ts +209 -209
  250. package/src/module/notification/controller/notification.controller.ts +58 -58
  251. package/src/module/notification/controller/otp.controller.ts +117 -117
  252. package/src/module/notification/entity/notification.entity.ts +23 -23
  253. package/src/module/notification/entity/otp.entity.ts +28 -28
  254. package/src/module/notification/firebase-admin.config.ts +22 -22
  255. package/src/module/notification/notification.module.ts +69 -69
  256. package/src/module/notification/repository/otp.repository.ts +27 -27
  257. package/src/module/notification/service/email.service.ts +127 -127
  258. package/src/module/notification/service/notification.service.ts +138 -138
  259. package/src/module/notification/service/otp.service.ts +125 -125
  260. package/src/module/third-party-module/entity/third-party-api-registry.entity.ts +52 -52
  261. package/src/module/third-party-module/repository/third-party-api-registry.repository.ts +20 -20
  262. package/src/module/third-party-module/service/api-registry.service.ts +13 -13
  263. package/src/module/third-party-module/third-party.module.ts +12 -12
  264. package/src/module/user/controller/login.controller.ts +197 -197
  265. package/src/module/user/controller/user.controller.ts +40 -40
  266. package/src/module/user/dto/create-user.dto.ts +62 -62
  267. package/src/module/user/dto/update-user.dto.ts +4 -4
  268. package/src/module/user/entity/role.entity.ts +33 -33
  269. package/src/module/user/entity/user-role-mapping.entity.ts +38 -38
  270. package/src/module/user/entity/user-session.entity.ts +61 -61
  271. package/src/module/user/entity/user.entity.ts +68 -68
  272. package/src/module/user/repository/role.repository.ts +96 -96
  273. package/src/module/user/repository/user-role-mapping.repository.ts +126 -126
  274. package/src/module/user/repository/user.repository.ts +50 -50
  275. package/src/module/user/repository/userSession.repository.ts +33 -33
  276. package/src/module/user/service/login.service.ts +280 -280
  277. package/src/module/user/service/role.service.ts +189 -189
  278. package/src/module/user/service/user-role-mapping.service.ts +98 -98
  279. package/src/module/user/service/user-session.service.ts +168 -168
  280. package/src/module/user/service/user.service.ts +353 -353
  281. package/src/module/user/user.module.ts +65 -65
  282. package/src/module/workflow/controller/action-category.controller.ts +54 -54
  283. package/src/module/workflow/controller/action-resource-mapping.controller.ts +23 -23
  284. package/src/module/workflow/controller/action-template-mapping.controller.ts +35 -35
  285. package/src/module/workflow/controller/action.controller.ts +95 -95
  286. package/src/module/workflow/controller/activity-log.controller.ts +55 -55
  287. package/src/module/workflow/controller/comm-template.controller.ts +34 -34
  288. package/src/module/workflow/controller/entity-modification.controller.ts +35 -35
  289. package/src/module/workflow/controller/form-master.controller.ts +43 -43
  290. package/src/module/workflow/controller/stage-group.controller.ts +48 -48
  291. package/src/module/workflow/controller/stage.controller.ts +50 -50
  292. package/src/module/workflow/controller/task.controller.ts +77 -77
  293. package/src/module/workflow/controller/workflow-list-master.controller.ts +44 -44
  294. package/src/module/workflow/controller/workflow-meta.controller.ts +80 -80
  295. package/src/module/workflow/controller/workflow.controller.ts +67 -67
  296. package/src/module/workflow/entity/action-category.entity.ts +38 -38
  297. package/src/module/workflow/entity/action-data.entity.ts +55 -55
  298. package/src/module/workflow/entity/action-resources-mapping.entity.ts +29 -29
  299. package/src/module/workflow/entity/action-template-mapping.entity.ts +17 -17
  300. package/src/module/workflow/entity/action.entity.ts +50 -50
  301. package/src/module/workflow/entity/activity-log.entity.ts +43 -43
  302. package/src/module/workflow/entity/comm-template.entity.ts +43 -43
  303. package/src/module/workflow/entity/entity-modification.entity.ts +38 -38
  304. package/src/module/workflow/entity/form.entity.ts +25 -25
  305. package/src/module/workflow/entity/stage-action-mapping.entity.ts +17 -17
  306. package/src/module/workflow/entity/stage-group.entity.ts +23 -23
  307. package/src/module/workflow/entity/stage-movement-data.entity.ts +38 -38
  308. package/src/module/workflow/entity/stage.entity.ts +20 -20
  309. package/src/module/workflow/entity/task-data.entity.ts +88 -88
  310. package/src/module/workflow/entity/template-attach-mapper.entity.ts +30 -30
  311. package/src/module/workflow/entity/workflow-data.entity.ts +11 -11
  312. package/src/module/workflow/entity/workflow-level-mapping.entity.ts +18 -18
  313. package/src/module/workflow/entity/workflow.entity.ts +20 -20
  314. package/src/module/workflow/repository/action-category.repository.ts +79 -79
  315. package/src/module/workflow/repository/action-data.repository.ts +219 -219
  316. package/src/module/workflow/repository/action.repository.ts +277 -277
  317. package/src/module/workflow/repository/activity-log.repository.ts +121 -121
  318. package/src/module/workflow/repository/comm-template.repository.ts +142 -142
  319. package/src/module/workflow/repository/form-master.repository.ts +59 -59
  320. package/src/module/workflow/repository/stage-group.repository.ts +176 -176
  321. package/src/module/workflow/repository/stage-movement.repository.ts +227 -227
  322. package/src/module/workflow/repository/stage.repository.ts +172 -172
  323. package/src/module/workflow/repository/task.repository.ts +113 -113
  324. package/src/module/workflow/repository/workflow.repository.ts +42 -42
  325. package/src/module/workflow/service/action-category.service.ts +33 -33
  326. package/src/module/workflow/service/action-data.service.ts +62 -62
  327. package/src/module/workflow/service/action-resources-mapping.service.ts +10 -10
  328. package/src/module/workflow/service/action-template-mapping.service.ts +55 -55
  329. package/src/module/workflow/service/action.service.ts +263 -263
  330. package/src/module/workflow/service/activity-log.service.ts +107 -107
  331. package/src/module/workflow/service/comm-template.service.ts +121 -121
  332. package/src/module/workflow/service/entity-modification.service.ts +67 -67
  333. package/src/module/workflow/service/form-master.service.ts +35 -35
  334. package/src/module/workflow/service/populate-workflow.service.ts +303 -303
  335. package/src/module/workflow/service/stage-action-mapping.service.ts +5 -5
  336. package/src/module/workflow/service/stage-group.service.ts +300 -300
  337. package/src/module/workflow/service/stage.service.ts +199 -199
  338. package/src/module/workflow/service/task.service.ts +504 -504
  339. package/src/module/workflow/service/workflow-list-master.service.ts +60 -60
  340. package/src/module/workflow/service/workflow-meta.service.ts +581 -581
  341. package/src/module/workflow/service/workflow.service.ts +205 -205
  342. package/src/module/workflow/workflow.module.ts +172 -172
  343. package/src/module/workflow-automation/controller/workflow-automation.controller.ts +21 -21
  344. package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +26 -26
  345. package/src/module/workflow-automation/entity/workflow-automation.entity.ts +35 -35
  346. package/src/module/workflow-automation/interface/action.decorator.ts +7 -7
  347. package/src/module/workflow-automation/interface/action.interface.ts +5 -5
  348. package/src/module/workflow-automation/service/action-registery.service.ts +35 -35
  349. package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +214 -214
  350. package/src/module/workflow-automation/service/workflow-automation.service.ts +345 -345
  351. package/src/module/workflow-automation/workflow-automation.module.ts +34 -34
  352. package/src/resources/dev.properties.yaml +30 -30
  353. package/src/resources/local.properties.yaml +27 -27
  354. package/src/resources/properties.module.ts +12 -12
  355. package/src/resources/properties.yaml.ts +11 -11
  356. package/src/resources/uat.properties.yaml +15 -15
  357. package/src/utils/dto/excel-data.dto.ts +14 -14
  358. package/src/utils/dto/excelsheet-data.dto.ts +5 -5
  359. package/src/utils/service/base64util.service.ts +18 -18
  360. package/src/utils/service/clockIDGenUtil.service.ts +21 -21
  361. package/src/utils/service/codeGenerator.service.ts +22 -22
  362. package/src/utils/service/dateUtil.service.ts +17 -17
  363. package/src/utils/service/encryptUtil.service.ts +97 -97
  364. package/src/utils/service/excel-helper.service.ts +72 -72
  365. package/src/utils/service/excelUtil.service.ts +15 -15
  366. package/src/utils/service/file-util.service.ts +11 -11
  367. package/src/utils/service/json-util.service.ts +23 -23
  368. package/src/utils/service/loggingUtil.service.ts +34 -34
  369. package/src/utils/service/reflection-helper.service.ts +62 -62
  370. package/src/utils/service/wbsCodeGen.service.ts +8 -8
  371. package/src/utils/utils.module.ts +25 -25
  372. package/tsconfig.build.json +4 -4
  373. package/tsconfig.json +24 -24
  374. package/.claude/settings.local.json +0 -26
  375. package/.idea/250218_nodejs_core.iml +0 -9
  376. package/.idea/codeStyles/Project.xml +0 -59
  377. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  378. package/.idea/copilot.data.migration.agent.xml +0 -6
  379. package/.idea/copilot.data.migration.ask.xml +0 -6
  380. package/.idea/copilot.data.migration.ask2agent.xml +0 -6
  381. package/.idea/copilot.data.migration.edit.xml +0 -6
  382. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  383. package/.idea/misc.xml +0 -6
  384. package/.idea/modules.xml +0 -8
  385. package/.idea/prettier.xml +0 -6
  386. package/.idea/vcs.xml +0 -6
  387. package/server.log +0 -850
@@ -75,11 +75,11 @@ let EntityListService = class EntityListService {
75
75
  }
76
76
  getQuery(source, groupByColumn) {
77
77
  if (groupByColumn) {
78
- return `SELECT ${groupByColumn} as tab_value, COUNT(1) AS tab_value_count
78
+ return `SELECT ${groupByColumn} as tab_value, COUNT(1) AS tab_value_count
79
79
  FROM ${source}`;
80
80
  }
81
81
  else {
82
- return `SELECT *
82
+ return `SELECT *
83
83
  FROM ${source}`;
84
84
  }
85
85
  }
@@ -123,7 +123,7 @@ let EntityListService = class EntityListService {
123
123
  return { query, argumentList: argsObjectList };
124
124
  }
125
125
  async getMaxSequenceNumber(tableName, parentType, parentId) {
126
- const query = `SELECT COUNT(1) seq_no
126
+ const query = `SELECT COUNT(1) seq_no
127
127
  FROM ${tableName} WHERE 1=1 `;
128
128
  const argsObjectList = [];
129
129
  const result = await this.entityManager.query(query, argsObjectList);
@@ -70,9 +70,9 @@ let EntityMasterService = class EntityMasterService {
70
70
  if (!entityMasterData) {
71
71
  throw new Error(`Entity master with mapped_entity_type "${entityType}" not found.`);
72
72
  }
73
- const attributes = await this.dataSource.query(`SELECT *
74
- FROM cr_entity_attribute
75
- WHERE mapped_entity_type = ?
73
+ const attributes = await this.dataSource.query(`SELECT *
74
+ FROM cr_entity_attribute
75
+ WHERE mapped_entity_type = ?
76
76
  AND organization_id = ? `, [entityMasterData.mapped_entity_type, loggedInUser.organization_id]);
77
77
  entityMasterData['attribute_list'] = attributes;
78
78
  entityMasterData['operation_list'] = {
@@ -19,12 +19,12 @@ let EntityRelationService = class EntityRelationService extends entity_service_i
19
19
  this.dataSource = dataSource;
20
20
  }
21
21
  async getEntityRelations(entityType, loggedInUser, includeSelf = false) {
22
- const relations = await this.dataSource.query(`SELECT name as label, target_entity_type as value, id
23
- FROM cr_entity_relation
22
+ const relations = await this.dataSource.query(`SELECT name as label, target_entity_type as value, id
23
+ FROM cr_entity_relation
24
24
  WHERE source_entity_type = ? AND organization_id = ?`, [entityType, loggedInUser.organization_id]);
25
25
  if (includeSelf) {
26
- const [entity] = await this.dataSource.query(`SELECT name as label
27
- FROM cr_entity_master
26
+ const [entity] = await this.dataSource.query(`SELECT name as label
27
+ FROM cr_entity_master
28
28
  WHERE mapped_entity_type = ? AND organization_id = ?`, [entityType, loggedInUser.organization_id]);
29
29
  if (entity) {
30
30
  relations.unshift({
@@ -39,13 +39,13 @@ let EntityRelationService = class EntityRelationService extends entity_service_i
39
39
  async getRelatedEntityIds(sourceEntity, targetEntity, targetIds, orgId) {
40
40
  if (!targetIds.length)
41
41
  return [];
42
- const result = await this.dataSource.query(`
43
- SELECT DISTINCT source_entity_id
44
- FROM cr_entity_relation_data
45
- WHERE source_entity_type = ?
46
- AND target_entity_type = ?
47
- AND target_entity_id IN (?)
48
- AND organization_id = ?
42
+ const result = await this.dataSource.query(`
43
+ SELECT DISTINCT source_entity_id
44
+ FROM cr_entity_relation_data
45
+ WHERE source_entity_type = ?
46
+ AND target_entity_type = ?
47
+ AND target_entity_id IN (?)
48
+ AND organization_id = ?
49
49
  `, [sourceEntity, targetEntity, targetIds, orgId]);
50
50
  return result.map((r) => r.source_entity_id);
51
51
  }
@@ -50,9 +50,9 @@ let EntityServiceImpl = class EntityServiceImpl {
50
50
  maxSeqNo = Number(maxSeqNo) + 1;
51
51
  entityData.code = entityData.entity_type + maxSeqNo;
52
52
  }
53
- const statusList = await repo.query(`SELECT id
54
- FROM cr_list_master_items
55
- WHERE code = ?
53
+ const statusList = await repo.query(`SELECT id
54
+ FROM cr_list_master_items
55
+ WHERE code = ?
56
56
  AND organization_id = ?`, [global_constant_1.STATUS_ACTIVE, loggedInUser?.organization_id || -1]);
57
57
  console.log('Status List:', statusList);
58
58
  console.log(`status_code,${global_constant_1.STATUS_ACTIVE},statusList, ${loggedInUser?.organization_id}`);
@@ -1,8 +1,10 @@
1
- import { UserData } from 'src/module/user/entity/user.entity';
2
1
  import { DataSource } from 'typeorm';
2
+ import { UserData } from '../../user/entity/user.entity';
3
+ import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
3
4
  export declare class ResolverService {
4
5
  private readonly dataSource;
5
- constructor(dataSource: DataSource);
6
+ private readonly listMasterService;
7
+ constructor(dataSource: DataSource, listMasterService: ListMasterService);
6
8
  getResolvedData(loggedInUser: any, entityData: any, entityType: string): Promise<any>;
7
9
  getResolvedValue(loggedInUser: UserData, attrKey: string, rawValue: any, entityType: string): Promise<any>;
8
10
  getResolvedId(loggedInUser: UserData, attrKey: string, displayValue: any, entityType: string): Promise<any>;
@@ -8,14 +8,19 @@ 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.ResolverService = void 0;
13
- const common_1 = require("@nestjs/common");
14
16
  const typeorm_1 = require("typeorm");
17
+ const common_1 = require("@nestjs/common");
15
18
  const moment = require("moment");
19
+ const list_master_service_1 = require("../../listmaster/service/list-master.service");
16
20
  let ResolverService = class ResolverService {
17
- constructor(dataSource) {
21
+ constructor(dataSource, listMasterService) {
18
22
  this.dataSource = dataSource;
23
+ this.listMasterService = listMasterService;
19
24
  }
20
25
  async getResolvedData(loggedInUser, entityData, entityType) {
21
26
  const attributeItems = await this.dataSource.query(`SELECT * FROM cr_entity_attribute WHERE mapped_entity_type = ? AND organization_id = ?`, [entityType, loggedInUser.organization_id]);
@@ -25,66 +30,31 @@ let ResolverService = class ResolverService {
25
30
  const codeValue = entityData[field];
26
31
  if (!codeValue)
27
32
  continue;
28
- if (attr.data_source_type === 'entity') {
29
- const [entityDef] = await this.dataSource.query(`SELECT * FROM cr_entity_master WHERE mapped_entity_type = ? AND organization_id = ?`, [attr.datasource_list, loggedInUser.organization_id]);
30
- if (!entityDef) {
31
- resolvedEntityData[field] = codeValue;
32
- continue;
33
- }
34
- const tableName = entityDef.db_table_name;
33
+ if (attr.data_source_type === 'entity' || attr.data_source_type === 'master') {
34
+ const type = attr.data_source_type === 'entity' ? attr.datasource_list : attr.list_type;
35
+ const params = {};
35
36
  if (Array.isArray(codeValue)) {
36
37
  const resolvedValues = [];
37
38
  for (const code of codeValue) {
38
- if (tableName == 'sso_organization') {
39
- const [item] = await this.dataSource.query(`SELECT * FROM ${tableName} WHERE code = ?`, [code]);
40
- resolvedValues.push(item?.[attr.data_source_attribute] ?? code);
41
- }
42
- else {
43
- const [item] = await this.dataSource.query(`SELECT * FROM ${tableName} WHERE code = ? AND organization_id = ?`, [code, loggedInUser.organization_id]);
44
- resolvedValues.push(item?.[attr.data_source_attribute] ?? code);
45
- }
46
- }
47
- resolvedEntityData[field] = resolvedValues;
48
- }
49
- else {
50
- if (tableName == 'sso_organization' ||
51
- tableName == 'sso_app_master') {
52
- const [item] = await this.dataSource.query(`SELECT * FROM ${tableName} WHERE id = ?`, [codeValue]);
53
- resolvedEntityData[field] =
54
- item?.[attr.data_source_attribute] ?? codeValue;
55
- }
56
- else {
57
- const [item] = await this.dataSource.query(`SELECT * FROM ${tableName} WHERE id = ? AND organization_id = ?`, [codeValue, loggedInUser.organization_id]);
58
- resolvedEntityData[field] =
59
- item?.[attr.data_source_attribute] ?? codeValue;
60
- }
61
- }
62
- }
63
- else if (attr.data_source_type === 'master') {
64
- if (Array.isArray(codeValue)) {
65
- const resolvedValues = [];
66
- for (const code of codeValue) {
67
- const [item] = await this.dataSource.query(`SELECT * FROM cr_list_master_items WHERE id = ? AND organization_id = ?`, [code, loggedInUser.organization_id]);
39
+ const options = await this.listMasterService.getDropdownOptions(type, params, undefined, loggedInUser, true);
40
+ const item = options.find(opt => opt.id === code || opt.code === code);
68
41
  resolvedValues.push(item?.[attr.data_source_attribute] ?? code);
69
42
  }
70
43
  resolvedEntityData[field] = resolvedValues;
71
44
  }
72
45
  else {
73
- const [item] = await this.dataSource.query(`SELECT * FROM cr_list_master_items WHERE id = ? AND organization_id = ?`, [codeValue, loggedInUser.organization_id]);
74
- resolvedEntityData[field] =
75
- item?.[attr.data_source_attribute] ?? codeValue;
46
+ const options = await this.listMasterService.getDropdownOptions(type, params, undefined, loggedInUser, true);
47
+ const item = options.find(opt => opt.id === codeValue || opt.code === codeValue);
48
+ resolvedEntityData[field] = item?.[attr.data_source_attribute] ?? codeValue;
76
49
  }
77
50
  }
78
- else if (attr.element_type === 'date' ||
79
- attr.element_type === 'datetime') {
51
+ else if (attr.element_type === 'date' || attr.element_type === 'datetime') {
80
52
  const dateValue = moment(codeValue).utcOffset('+05:30');
81
53
  if (dateValue.isValid()) {
82
- if (attr.element_type === 'date') {
83
- resolvedEntityData[field] = dateValue.format('DD-MM-YYYY');
84
- }
85
- else {
86
- resolvedEntityData[field] = dateValue.format('DD-MM-YYYY HH:mm:ss');
87
- }
54
+ resolvedEntityData[field] =
55
+ attr.element_type === 'date'
56
+ ? dateValue.format('DD-MM-YYYY')
57
+ : dateValue.format('DD-MM-YYYY HH:mm:ss');
88
58
  }
89
59
  }
90
60
  }
@@ -149,12 +119,12 @@ let ResolverService = class ResolverService {
149
119
  displayValue === '') {
150
120
  return displayValue;
151
121
  }
152
- const [attr] = await this.dataSource.query(`SELECT * FROM cr_entity_attribute
122
+ const [attr] = await this.dataSource.query(`SELECT * FROM cr_entity_attribute
153
123
  WHERE mapped_entity_type = ? AND organization_id = ? AND attribute_key = ?`, [entityType, loggedInUser.organization_id, attrKey]);
154
124
  if (!attr)
155
125
  return displayValue;
156
126
  if (attr.data_source_type === 'entity') {
157
- const [entityDef] = await this.dataSource.query(`SELECT * FROM cr_entity_master
127
+ const [entityDef] = await this.dataSource.query(`SELECT * FROM cr_entity_master
158
128
  WHERE mapped_entity_type = ? AND organization_id = ?`, [attr.datasource_list, loggedInUser.organization_id]);
159
129
  if (!entityDef)
160
130
  return displayValue;
@@ -169,7 +139,7 @@ let ResolverService = class ResolverService {
169
139
  return item?.id ?? displayValue;
170
140
  }
171
141
  else if (attr.data_source_type === 'master') {
172
- const [item] = await this.dataSource.query(`SELECT id FROM cr_list_master_items
142
+ const [item] = await this.dataSource.query(`SELECT id FROM cr_list_master_items
173
143
  WHERE ${attr.data_source_attribute} = ? AND organization_id = ?`, [displayValue, loggedInUser.organization_id]);
174
144
  return item?.id ?? displayValue;
175
145
  }
@@ -179,6 +149,8 @@ let ResolverService = class ResolverService {
179
149
  exports.ResolverService = ResolverService;
180
150
  exports.ResolverService = ResolverService = __decorate([
181
151
  (0, common_1.Injectable)(),
182
- __metadata("design:paramtypes", [typeorm_1.DataSource])
152
+ __param(1, (0, common_1.Inject)('ListMasterService')),
153
+ __metadata("design:paramtypes", [typeorm_1.DataSource,
154
+ list_master_service_1.ListMasterService])
183
155
  ], ResolverService);
184
156
  //# sourceMappingURL=resolver.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/resolver.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,qCAAqC;AACrC,iCAAiC;AAG1B,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC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,CAAC,CAAC,YAAY,CAAC;gBAChB,CAAC,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;YAEnD,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAC1D,OAAO,IAAI,EAAE,EAAE,IAAI,YAAY,CAAC;QAClC,CAAC;aAGI,IAAI,IAAI,CAAC,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YAC5C,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACxC;iBACS,IAAI,CAAC,qBAAqB,8BAA8B,EACjE,CAAC,YAAY,EAAE,YAAY,CAAC,eAAe,CAAC,CAC7C,CAAC;YACF,OAAO,IAAI,EAAE,EAAE,IAAI,YAAY,CAAC;QAClC,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;CACF,CAAA;AA3QY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAE8B,oBAAU;GADxC,eAAe,CA2Q3B"}
1
+ {"version":3,"file":"resolver.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/resolver.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,2CAAoD;AAEpD,iCAAiC;AACjC,sFAAsF;AAG/E,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAA6B,UAAsB,EAEhC,iBAAoC;QAF1B,eAAU,GAAV,UAAU,CAAY;QAEhC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAK,CAAC;IAE7D,KAAK,CAAC,eAAe,CACnB,YAAiB,EACjB,UAAe,EACf,UAAkB;QAElB,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAChD,wFAAwF,EACxF,CAAC,UAAU,EAAE,YAAY,CAAC,eAAe,CAAC,CAC3C,CAAC;QAEF,MAAM,kBAAkB,GA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ACS,IAAI,CAAC,qBAAqB,8BAA8B,EACjE,CAAC,YAAY,EAAE,YAAY,CAAC,eAAe,CAAC,CAC7C,CAAC;YACF,OAAO,IAAI,EAAE,EAAE,IAAI,YAAY,CAAC;QAClC,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;CACF,CAAA;AA9MY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,mBAAmB,CAAC,CAAA;qCADW,oBAAU;QAEb,uCAAiB;GAH5C,eAAe,CA8M3B"}
@@ -60,10 +60,10 @@ let MenuRepository = class MenuRepository extends typeorm_1.Repository {
60
60
  async getMenuItems(moduleCodes, appcode, levelType) {
61
61
  return await this.menuData
62
62
  .createQueryBuilder('menu')
63
- .leftJoin('sso_module', 'module', `
64
- menu.module_code = module.module_code
65
- AND LOWER(menu.appcode) = LOWER(module.appcode)
66
- AND menu.level_type = module.level_type
63
+ .leftJoin('sso_module', 'module', `
64
+ menu.module_code = module.module_code
65
+ AND LOWER(menu.appcode) = LOWER(module.appcode)
66
+ AND menu.level_type = module.level_type
67
67
  `)
68
68
  .where('menu.module_code IN (:...moduleCodes)', { moduleCodes })
69
69
  .andWhere('LOWER(menu.appcode) = LOWER(:appcode)', { appcode })
@@ -82,11 +82,11 @@ let MenuRepository = class MenuRepository extends typeorm_1.Repository {
82
82
  async resolveUserRoles(userId, appcode, levelType, levelId) {
83
83
  const repo = this.dataSource.getRepository(user_role_mapping_entity_1.UserRoleMapping);
84
84
  if (userId) {
85
- const getUserDetails = await this.dataSource.query(`
86
- SELECT * from sso_user where id = ?
85
+ const getUserDetails = await this.dataSource.query(`
86
+ SELECT * from sso_user where id = ?
87
87
  `, [userId]);
88
- const getUserUrm = await this.dataSource.query(`
89
- SELECT * from sso_user_role_mapping where user_id = ? and appcode = ?
88
+ const getUserUrm = await this.dataSource.query(`
89
+ SELECT * from sso_user_role_mapping where user_id = ? and appcode = ?
90
90
  `, [userId, appcode]);
91
91
  if (getUserDetails.length > 0 &&
92
92
  getUserDetails[0].organization_id === 1) {
@@ -105,10 +105,10 @@ let MenuRepository = class MenuRepository extends typeorm_1.Repository {
105
105
  if (roles.length)
106
106
  return roles.map((r) => r.urm_role_id);
107
107
  if (levelType === 'SCH') {
108
- const [sch] = await this.dataSource.query(`
109
- SELECT s.brand_id, s.organization_id
110
- FROM eth_school_profile s
111
- WHERE s.id = ?
108
+ const [sch] = await this.dataSource.query(`
109
+ SELECT s.brand_id, s.organization_id
110
+ FROM eth_school_profile s
111
+ WHERE s.id = ?
112
112
  `, [levelId]);
113
113
  const brandId = sch?.brand_id;
114
114
  const orgId = sch?.organization_id;
@@ -63,14 +63,14 @@ let NotificationsService = class NotificationsService {
63
63
  const isReadBool = String(filterQuery.is_read).toLowerCase() === 'true';
64
64
  isReadFilter = isReadBool ? 1 : 0;
65
65
  }
66
- let query = `
67
- SELECT
68
- n.*,
69
- u.name AS user_name,
70
- u.profile_image AS user_profile
71
- FROM cr_notification n
72
- LEFT JOIN eth_user_profile u ON n.user_id = u.parent_id
73
- WHERE n.user_id = ? AND n.level_id = ? AND n.level_type = ?
66
+ let query = `
67
+ SELECT
68
+ n.*,
69
+ u.name AS user_name,
70
+ u.profile_image AS user_profile
71
+ FROM cr_notification n
72
+ LEFT JOIN eth_user_profile u ON n.user_id = u.parent_id
73
+ WHERE n.user_id = ? AND n.level_id = ? AND n.level_type = ?
74
74
  `;
75
75
  const params = [id, level_id, level_type];
76
76
  if (isReadFilter !== undefined) {
@@ -97,10 +97,10 @@ let NotificationsService = class NotificationsService {
97
97
  }
98
98
  async markAllAsRead(loggedInUser) {
99
99
  const { id, level_id, level_type } = loggedInUser;
100
- const query = `
101
- UPDATE cr_notification
102
- SET is_read = 1
103
- WHERE user_id = ? AND level_id = ? AND level_type = ? AND is_read = 0
100
+ const query = `
101
+ UPDATE cr_notification
102
+ SET is_read = 1
103
+ WHERE user_id = ? AND level_id = ? AND level_type = ? AND is_read = 0
104
104
  `;
105
105
  const params = [id, level_id, level_type];
106
106
  const result = await this.dataSource.query(query, params);
@@ -57,27 +57,27 @@ let LoginController = class LoginController {
57
57
  try {
58
58
  const actualState = state.replace('gmail_config:', '');
59
59
  const result = await this.integrationService.handleGmailTokensCallback(email, googleAccessToken, googleRefreshToken, actualState);
60
- return res.send(`<html><body><script>
61
- window.opener.postMessage({ type: 'CONFIG_SUCCESS' }, '*');
62
- window.close();
60
+ return res.send(`<html><body><script>
61
+ window.opener.postMessage({ type: 'CONFIG_SUCCESS' }, '*');
62
+ window.close();
63
63
  </script> <p>Configuration successful. You can close this window.</p> </body></html>`);
64
64
  }
65
65
  catch (error) {
66
- return res.send(`
67
- <html>
68
- <body>
69
- <script>
70
- if (window.opener) {
71
- window.opener.postMessage({
72
- type: "CONFIG_FAILED",
73
- error: "${error.message || 'Something went wrong'}"
74
- }, "*");
75
- }
76
- window.close();
77
- </script>
78
- <p>Configuration failed. Please close this window.</p>
79
- </body>
80
- </html>
66
+ return res.send(`
67
+ <html>
68
+ <body>
69
+ <script>
70
+ if (window.opener) {
71
+ window.opener.postMessage({
72
+ type: "CONFIG_FAILED",
73
+ error: "${error.message || 'Something went wrong'}"
74
+ }, "*");
75
+ }
76
+ window.close();
77
+ </script>
78
+ <p>Configuration failed. Please close this window.</p>
79
+ </body>
80
+ </html>
81
81
  `);
82
82
  }
83
83
  }
@@ -76,10 +76,10 @@ let RoleService = class RoleService extends entity_service_impl_service_1.Entity
76
76
  if (!existingRole) {
77
77
  return { success: false, error: 'Role not found' };
78
78
  }
79
- const associatedUsers = await this.entityManager.query(`SELECT map.*
80
- FROM sso_user_role_mapping map
81
- JOIN sso_user usr ON map.user_id = usr.id
82
- WHERE usr.status = ${resolveStatus.id}
79
+ const associatedUsers = await this.entityManager.query(`SELECT map.*
80
+ FROM sso_user_role_mapping map
81
+ JOIN sso_user usr ON map.user_id = usr.id
82
+ WHERE usr.status = ${resolveStatus.id}
83
83
  and map.role_id = ${existingRole?.id}`);
84
84
  if (associatedUsers.length > 0) {
85
85
  return {
@@ -71,8 +71,8 @@ let UserSessionService = class UserSessionService {
71
71
  };
72
72
  let getUserDetails;
73
73
  if (currentUser) {
74
- getUserDetails = await this.dataSource.query(`
75
- SELECT * from sso_user where id = ?
74
+ getUserDetails = await this.dataSource.query(`
75
+ SELECT * from sso_user where id = ?
76
76
  `, [currentUser.id]);
77
77
  }
78
78
  if (getUserDetails[0].organization_id == 1 && payload.level_type == 'ORG') {
@@ -24,10 +24,10 @@ let ActionRepository = class ActionRepository {
24
24
  }
25
25
  async getReasonCode(loggedInUser) {
26
26
  const { organization_id } = loggedInUser;
27
- const result = await this.dataSource.query(`
28
- SELECT name, type
29
- FROM cr_list_master
30
- WHERE organization_id = ? AND source = 'master'
27
+ const result = await this.dataSource.query(`
28
+ SELECT name, type
29
+ FROM cr_list_master
30
+ WHERE organization_id = ? AND source = 'master'
31
31
  `, [organization_id]);
32
32
  const formatted = result.map((item) => ({
33
33
  label: item.name,
@@ -40,10 +40,10 @@ let ActionRepository = class ActionRepository {
40
40
  if (!list_type) {
41
41
  throw new common_1.BadRequestException('list_type is required');
42
42
  }
43
- const result = await this.dataSource.query(`
44
- SELECT name, id
45
- FROM cr_list_master_items
46
- WHERE listtype = ? AND organization_id = ?
43
+ const result = await this.dataSource.query(`
44
+ SELECT name, id
45
+ FROM cr_list_master_items
46
+ WHERE listtype = ? AND organization_id = ?
47
47
  `, [list_type, organization_id]);
48
48
  return result.map((row) => ({
49
49
  label: row.name,
@@ -52,19 +52,19 @@ let ActionRepository = class ActionRepository {
52
52
  }
53
53
  async getActions(loggedInUser, stage_id) {
54
54
  const { organization_id } = loggedInUser;
55
- const stageActions = await this.dataSource.query(`
56
- SELECT id, action_id
57
- FROM cr_wf_stage_action_mapping
58
- WHERE stage_id = ?
55
+ const stageActions = await this.dataSource.query(`
56
+ SELECT id, action_id
57
+ FROM cr_wf_stage_action_mapping
58
+ WHERE stage_id = ?
59
59
  `, [stage_id]);
60
60
  if (!stageActions?.length)
61
61
  return [];
62
62
  const actionIds = stageActions.map((sa) => sa.action_id);
63
63
  const mappingIds = stageActions.map((sa) => sa.id);
64
- const templateMappings = await this.dataSource.query(`
65
- SELECT stg_act_mapping_id, template_code
66
- FROM cr_wf_action_template_mapping
67
- WHERE stg_act_mapping_id IN (${mappingIds.map(() => '?').join(',')})
64
+ const templateMappings = await this.dataSource.query(`
65
+ SELECT stg_act_mapping_id, template_code
66
+ FROM cr_wf_action_template_mapping
67
+ WHERE stg_act_mapping_id IN (${mappingIds.map(() => '?').join(',')})
68
68
  `, mappingIds);
69
69
  const templateCodes = templateMappings.map((tm) => tm.template_code);
70
70
  const templateCodeToName = {};
@@ -30,17 +30,17 @@ let CommTemplateRepository = class CommTemplateRepository {
30
30
  const { organization_id, level_id, level_type } = loggedInUser;
31
31
  let is_template;
32
32
  if (action_id) {
33
- const [actionResult] = await this.dataSource.query(`SELECT is_template
34
- FROM cr_wf_action
35
- WHERE id = ? AND organization_id = ?
33
+ const [actionResult] = await this.dataSource.query(`SELECT is_template
34
+ FROM cr_wf_action
35
+ WHERE id = ? AND organization_id = ?
36
36
  LIMIT 1`, [action_id, organization_id]);
37
37
  if (!actionResult) {
38
38
  throw new Error('Invalid action_id');
39
39
  }
40
40
  is_template = actionResult.is_template;
41
- await this.dataSource.query(`UPDATE cr_wf_comm_template
42
- SET is_template = ?
43
- WHERE mapped_entity_type = ?
41
+ await this.dataSource.query(`UPDATE cr_wf_comm_template
42
+ SET is_template = ?
43
+ WHERE mapped_entity_type = ?
44
44
  AND organization_id = ? AND level_id = ? AND level_type=?`, [is_template, entity_type, organization_id, level_id, level_type]);
45
45
  }
46
46
  const whereCondition = {
@@ -17,8 +17,8 @@ let FormMasterRepository = class FormMasterRepository {
17
17
  this.dataSource = dataSource;
18
18
  }
19
19
  async getForms(organization_id, source_entity_type) {
20
- const forms = await this.dataSource.query(`SELECT fm.id as fm_id, fm.name as fm_form_name
21
- FROM cr_entity_view fm
20
+ const forms = await this.dataSource.query(`SELECT fm.id as fm_id, fm.name as fm_form_name
21
+ FROM cr_entity_view fm
22
22
  WHERE fm.organization_id = ? AND fm.mapped_entity_type = ?`, [organization_id, source_entity_type]);
23
23
  const formatted = forms.map((form) => ({
24
24
  label: form.fm_form_name,
@@ -67,33 +67,33 @@ let StageGroupRepository = class StageGroupRepository {
67
67
  if (!stageGroups.length)
68
68
  return [];
69
69
  const stageGroupIds = stageGroups.map((sg) => sg.id);
70
- const stagesRaw = await this.dataSource.query(`
71
- SELECT
72
- cr_wf_stage.*
73
- FROM cr_wf_stage
74
- WHERE cr_wf_stage.stage_group_id IN (${stageGroupIds.map(() => '?').join(',')})
75
- AND cr_wf_stage.organization_id = ?
76
- ORDER BY cr_wf_stage.sequence ASC
70
+ const stagesRaw = await this.dataSource.query(`
71
+ SELECT
72
+ cr_wf_stage.*
73
+ FROM cr_wf_stage
74
+ WHERE cr_wf_stage.stage_group_id IN (${stageGroupIds.map(() => '?').join(',')})
75
+ AND cr_wf_stage.organization_id = ?
76
+ ORDER BY cr_wf_stage.sequence ASC
77
77
  `, [...stageGroupIds, loggedInUser.organization_id]);
78
78
  const stageIds = stagesRaw.map((s) => s.id);
79
- const taskCounts = await this.dataSource.query(`
80
- SELECT stage_id, COUNT(*) AS task_count
81
- FROM cr_wf_task_data
82
- WHERE stage_id IN (${stageIds.map(() => '?').join(',')}) AND is_system=0 AND mapped_entity_id = ?
83
- GROUP BY stage_id
79
+ const taskCounts = await this.dataSource.query(`
80
+ SELECT stage_id, COUNT(*) AS task_count
81
+ FROM cr_wf_task_data
82
+ WHERE stage_id IN (${stageIds.map(() => '?').join(',')}) AND is_system=0 AND mapped_entity_id = ?
83
+ GROUP BY stage_id
84
84
  `, [...stageIds, lead_id]);
85
- const meetingCounts = await this.dataSource.query(`
86
- SELECT stage_id, COUNT(*) AS meeting_count
87
- FROM crm_lead_meeting
88
- WHERE stage_id IN (${stageIds.map(() => '?').join(',')}) AND mapped_entity_id = ?
89
- GROUP BY stage_id
85
+ const meetingCounts = await this.dataSource.query(`
86
+ SELECT stage_id, COUNT(*) AS meeting_count
87
+ FROM crm_lead_meeting
88
+ WHERE stage_id IN (${stageIds.map(() => '?').join(',')}) AND mapped_entity_id = ?
89
+ GROUP BY stage_id
90
90
  `, [...stageIds, lead_id]);
91
- const sendCommCounts = await this.dataSource.query(`
92
- SELECT stage_id, COUNT(*) AS send_comm_count
93
- FROM crm_lead_communication
94
- WHERE stage_id IN (${stageIds.map(() => '?').join(',')}) AND mapped_entity_id = ?
95
- AND type IN ('SEND', 'LOG')
96
- GROUP BY stage_id
91
+ const sendCommCounts = await this.dataSource.query(`
92
+ SELECT stage_id, COUNT(*) AS send_comm_count
93
+ FROM crm_lead_communication
94
+ WHERE stage_id IN (${stageIds.map(() => '?').join(',')}) AND mapped_entity_id = ?
95
+ AND type IN ('SEND', 'LOG')
96
+ GROUP BY stage_id
97
97
  `, [...stageIds, lead_id]);
98
98
  const taskCountMap = new Map(taskCounts.map((row) => [Number(row.stage_id), Number(row.task_count)]));
99
99
  const meetingCountMap = new Map(meetingCounts.map((row) => [
@@ -107,17 +107,17 @@ let StageMovementRepository = class StageMovementRepository {
107
107
  return nextStageGroupFirstStage || null;
108
108
  }
109
109
  async getAllActionByStageId(stageId) {
110
- const result = await this.dataSource.query(`
111
- SELECT
112
- a.*,
113
- m.stage_id,
114
- ac.code AS action_category_code,
115
- arm.form_id
116
- FROM cr_wf_action a
117
- LEFT JOIN cr_wf_stage_action_mapping m ON a.id = m.action_id
118
- LEFT JOIN cr_wf_action_category ac ON a.action_category = ac.id
119
- LEFT JOIN cr_wf_action_resources_mapping arm ON m.id = arm.stg_act_mapping_id
120
- WHERE m.stage_id = ?
110
+ const result = await this.dataSource.query(`
111
+ SELECT
112
+ a.*,
113
+ m.stage_id,
114
+ ac.code AS action_category_code,
115
+ arm.form_id
116
+ FROM cr_wf_action a
117
+ LEFT JOIN cr_wf_stage_action_mapping m ON a.id = m.action_id
118
+ LEFT JOIN cr_wf_action_category ac ON a.action_category = ac.id
119
+ LEFT JOIN cr_wf_action_resources_mapping arm ON m.id = arm.stg_act_mapping_id
120
+ WHERE m.stage_id = ?
121
121
  `, [stageId]);
122
122
  return result;
123
123
  }