rez_core 3.1.210 → 4.0.2

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 (254) hide show
  1. package/dist/module/dashboard/entity/dashboard_page_data.entity.js +1 -1
  2. package/dist/module/dashboard/entity/dashboard_page_data.entity.js.map +1 -1
  3. package/dist/module/dashboard/entity/widget_master.entity.js +1 -1
  4. package/dist/module/dashboard/entity/widget_master.entity.js.map +1 -1
  5. package/dist/module/dashboard/repository/dashboard.repository.js +1 -1
  6. package/dist/module/dashboard/repository/dashboard.repository.js.map +1 -1
  7. package/dist/module/enterprise/repository/school.repository.js +5 -5
  8. package/dist/module/enterprise/repository/school.repository.js.map +1 -1
  9. package/dist/module/filter/entity/saved-filter-detail.entity.js +1 -1
  10. package/dist/module/filter/entity/saved-filter-detail.entity.js.map +1 -1
  11. package/dist/module/filter/entity/saved-filter-master.entity.js +1 -1
  12. package/dist/module/filter/entity/saved-filter-master.entity.js.map +1 -1
  13. package/dist/module/filter/repository/saved-filter.repository.js +1 -1
  14. package/dist/module/filter/service/filter-evaluator.service.js +1 -1
  15. package/dist/module/filter/service/filter.service.js +7 -1
  16. package/dist/module/filter/service/filter.service.js.map +1 -1
  17. package/dist/module/integration/entity/integration-config.entity.js +1 -1
  18. package/dist/module/integration/entity/integration-config.entity.js.map +1 -1
  19. package/dist/module/integration/entity/integration-entity-mapper.entity.js +1 -1
  20. package/dist/module/integration/entity/integration-entity-mapper.entity.js.map +1 -1
  21. package/dist/module/integration/entity/integration-source.entity.js +1 -1
  22. package/dist/module/integration/entity/integration-source.entity.js.map +1 -1
  23. package/dist/module/integration/entity/user-integration.entity.js +1 -1
  24. package/dist/module/integration/entity/user-integration.entity.js.map +1 -1
  25. package/dist/module/integration/service/integration.service.js +1 -1
  26. package/dist/module/integration/service/integration.service.js.map +1 -1
  27. package/dist/module/integration/service/wrapper.service.js +8 -8
  28. package/dist/module/integration/service/wrapper.service.js.map +1 -1
  29. package/dist/module/layout_preference/entity/layout_preference.entity.js +1 -1
  30. package/dist/module/layout_preference/entity/layout_preference.entity.js.map +1 -1
  31. package/dist/module/listmaster/entity/list-master-items.entity.js +1 -1
  32. package/dist/module/listmaster/entity/list-master-items.entity.js.map +1 -1
  33. package/dist/module/listmaster/entity/list-master.entity.js +1 -1
  34. package/dist/module/listmaster/entity/list-master.entity.js.map +1 -1
  35. package/dist/module/listmaster/service/list-master-item.service.js +1 -1
  36. package/dist/module/listmaster/service/list-master.service.js +4 -5
  37. package/dist/module/listmaster/service/list-master.service.js.map +1 -1
  38. package/dist/module/mapper/entity/field-lovs.entity.js +1 -1
  39. package/dist/module/mapper/entity/field-lovs.entity.js.map +1 -1
  40. package/dist/module/mapper/entity/field-mapper.entity.js +1 -1
  41. package/dist/module/mapper/entity/field-mapper.entity.js.map +1 -1
  42. package/dist/module/mapper/entity/mapper.entity.js +1 -1
  43. package/dist/module/mapper/entity/mapper.entity.js.map +1 -1
  44. package/dist/module/mapper/service/field-mapper.service.js +1 -1
  45. package/dist/module/mapper/service/mapper.service.js +2 -2
  46. package/dist/module/mapper/service/mapper.service.js.map +1 -1
  47. package/dist/module/master/service/master.service.js +8 -8
  48. package/dist/module/master/service/master.service.js.map +1 -1
  49. package/dist/module/meta/entity/attribute-master.entity.js +1 -1
  50. package/dist/module/meta/entity/attribute-master.entity.js.map +1 -1
  51. package/dist/module/meta/entity/entity-master.entity.js +1 -1
  52. package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
  53. package/dist/module/meta/entity/entity-relation-data.entity.js +1 -1
  54. package/dist/module/meta/entity/entity-relation-data.entity.js.map +1 -1
  55. package/dist/module/meta/entity/entity-relation.entity.js +1 -1
  56. package/dist/module/meta/entity/entity-relation.entity.js.map +1 -1
  57. package/dist/module/meta/entity/entity-table-column.entity.js +1 -1
  58. package/dist/module/meta/entity/entity-table-column.entity.js.map +1 -1
  59. package/dist/module/meta/entity/entity-table.entity.js +1 -1
  60. package/dist/module/meta/entity/entity-table.entity.js.map +1 -1
  61. package/dist/module/meta/entity/media-data.entity.js +1 -1
  62. package/dist/module/meta/entity/media-data.entity.js.map +1 -1
  63. package/dist/module/meta/entity/preference.entity.js +1 -1
  64. package/dist/module/meta/entity/preference.entity.js.map +1 -1
  65. package/dist/module/meta/entity/view-master.entity.js +1 -1
  66. package/dist/module/meta/entity/view-master.entity.js.map +1 -1
  67. package/dist/module/meta/repository/attribute-master.repository.js +1 -1
  68. package/dist/module/meta/repository/attribute-master.repository.js.map +1 -1
  69. package/dist/module/meta/repository/entity-master.repository.js +2 -2
  70. package/dist/module/meta/repository/entity-master.repository.js.map +1 -1
  71. package/dist/module/meta/service/entity-dynamic.service.js +15 -15
  72. package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
  73. package/dist/module/meta/service/entity-master.service.js +1 -1
  74. package/dist/module/meta/service/entity-relation.service.js +3 -3
  75. package/dist/module/meta/service/entity-service-impl.service.js +2 -2
  76. package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
  77. package/dist/module/meta/service/populate-meta.service.js +11 -11
  78. package/dist/module/meta/service/populate-meta.service.js.map +1 -1
  79. package/dist/module/meta/service/resolver.service.js +8 -8
  80. package/dist/module/meta/service/resolver.service.js.map +1 -1
  81. package/dist/module/notification/entity/notification.entity.js +1 -1
  82. package/dist/module/notification/entity/notification.entity.js.map +1 -1
  83. package/dist/module/notification/service/email.service.js +2 -2
  84. package/dist/module/notification/service/email.service.js.map +1 -1
  85. package/dist/module/notification/service/notification.service.js +2 -2
  86. package/dist/module/third-party-module/entity/third-party-api-registry.entity.js +1 -1
  87. package/dist/module/third-party-module/entity/third-party-api-registry.entity.js.map +1 -1
  88. package/dist/module/workflow/entity/action-category.entity.js +1 -1
  89. package/dist/module/workflow/entity/action-category.entity.js.map +1 -1
  90. package/dist/module/workflow/entity/action-data.entity.js +1 -1
  91. package/dist/module/workflow/entity/action-data.entity.js.map +1 -1
  92. package/dist/module/workflow/entity/action-resources-mapping.entity.js +1 -1
  93. package/dist/module/workflow/entity/action-resources-mapping.entity.js.map +1 -1
  94. package/dist/module/workflow/entity/action-template-mapping.entity.js +1 -1
  95. package/dist/module/workflow/entity/action-template-mapping.entity.js.map +1 -1
  96. package/dist/module/workflow/entity/action.entity.js +1 -1
  97. package/dist/module/workflow/entity/action.entity.js.map +1 -1
  98. package/dist/module/workflow/entity/activity-log.entity.js +1 -1
  99. package/dist/module/workflow/entity/activity-log.entity.js.map +1 -1
  100. package/dist/module/workflow/entity/comm-template.entity.js +1 -1
  101. package/dist/module/workflow/entity/comm-template.entity.js.map +1 -1
  102. package/dist/module/workflow/entity/entity-modification.entity.js +1 -1
  103. package/dist/module/workflow/entity/entity-modification.entity.js.map +1 -1
  104. package/dist/module/workflow/entity/form.entity.js +1 -1
  105. package/dist/module/workflow/entity/form.entity.js.map +1 -1
  106. package/dist/module/workflow/entity/stage-action-mapping.entity.js +1 -1
  107. package/dist/module/workflow/entity/stage-action-mapping.entity.js.map +1 -1
  108. package/dist/module/workflow/entity/stage-group.entity.js +1 -1
  109. package/dist/module/workflow/entity/stage-group.entity.js.map +1 -1
  110. package/dist/module/workflow/entity/stage-movement-data.entity.js +1 -1
  111. package/dist/module/workflow/entity/stage-movement-data.entity.js.map +1 -1
  112. package/dist/module/workflow/entity/stage.entity.js +1 -1
  113. package/dist/module/workflow/entity/stage.entity.js.map +1 -1
  114. package/dist/module/workflow/entity/task-data.entity.js +1 -1
  115. package/dist/module/workflow/entity/task-data.entity.js.map +1 -1
  116. package/dist/module/workflow/entity/template-attach-mapper.entity.js +1 -1
  117. package/dist/module/workflow/entity/template-attach-mapper.entity.js.map +1 -1
  118. package/dist/module/workflow/entity/workflow-data.entity.js +1 -1
  119. package/dist/module/workflow/entity/workflow-data.entity.js.map +1 -1
  120. package/dist/module/workflow/entity/workflow-level-mapping.entity.js +1 -1
  121. package/dist/module/workflow/entity/workflow-level-mapping.entity.js.map +1 -1
  122. package/dist/module/workflow/entity/workflow.entity.js +1 -1
  123. package/dist/module/workflow/entity/workflow.entity.js.map +1 -1
  124. package/dist/module/workflow/repository/action-data.repository.js +4 -4
  125. package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
  126. package/dist/module/workflow/repository/action.repository.js +14 -14
  127. package/dist/module/workflow/repository/action.repository.js.map +1 -1
  128. package/dist/module/workflow/repository/comm-template.repository.js +2 -2
  129. package/dist/module/workflow/repository/form-master.repository.js +2 -2
  130. package/dist/module/workflow/repository/form-master.repository.js.map +1 -1
  131. package/dist/module/workflow/repository/stage-group.repository.js +6 -6
  132. package/dist/module/workflow/repository/stage-group.repository.js.map +1 -1
  133. package/dist/module/workflow/repository/stage-movement.repository.js +6 -6
  134. package/dist/module/workflow/repository/stage-movement.repository.js.map +1 -1
  135. package/dist/module/workflow/repository/stage.repository.js +6 -6
  136. package/dist/module/workflow/repository/stage.repository.js.map +1 -1
  137. package/dist/module/workflow/repository/task.repository.js +3 -3
  138. package/dist/module/workflow/repository/task.repository.js.map +1 -1
  139. package/dist/module/workflow/service/action-template-mapping.service.js +4 -4
  140. package/dist/module/workflow/service/action-template-mapping.service.js.map +1 -1
  141. package/dist/module/workflow/service/action.service.js +9 -9
  142. package/dist/module/workflow/service/action.service.js.map +1 -1
  143. package/dist/module/workflow/service/entity-modification.service.js +2 -2
  144. package/dist/module/workflow/service/entity-modification.service.js.map +1 -1
  145. package/dist/module/workflow/service/populate-workflow.service.js +14 -14
  146. package/dist/module/workflow/service/populate-workflow.service.js.map +1 -1
  147. package/dist/module/workflow/service/stage-group.service.js +3 -3
  148. package/dist/module/workflow/service/stage-group.service.js.map +1 -1
  149. package/dist/module/workflow/service/stage.service.js +3 -3
  150. package/dist/module/workflow/service/stage.service.js.map +1 -1
  151. package/dist/module/workflow/service/task.service.js +11 -11
  152. package/dist/module/workflow/service/task.service.js.map +1 -1
  153. package/dist/module/workflow/service/workflow-list-master.service.js +5 -5
  154. package/dist/module/workflow/service/workflow-list-master.service.js.map +1 -1
  155. package/dist/module/workflow/service/workflow-meta.service.js +10 -10
  156. package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
  157. package/dist/module/workflow/service/workflow.service.js +3 -3
  158. package/dist/module/workflow/service/workflow.service.js.map +1 -1
  159. package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js +1 -1
  160. package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js.map +1 -1
  161. package/dist/module/workflow-automation/entity/workflow-automation.entity.js +1 -1
  162. package/dist/module/workflow-automation/entity/workflow-automation.entity.js.map +1 -1
  163. package/dist/module/workflow-automation/service/workflow-automation-engine.service.js +1 -1
  164. package/dist/module/workflow-automation/service/workflow-automation-engine.service.js.map +1 -1
  165. package/dist/tsconfig.build.tsbuildinfo +1 -1
  166. package/docs/modules/event-driven-integration-design.md +1 -1
  167. package/docs/modules/integration.md +4 -4
  168. package/package.json +1 -1
  169. package/src/module/dashboard/entity/dashboard_page_data.entity.ts +1 -1
  170. package/src/module/dashboard/entity/widget_master.entity.ts +1 -1
  171. package/src/module/dashboard/repository/dashboard.repository.ts +1 -1
  172. package/src/module/enterprise/repository/school.repository.ts +5 -5
  173. package/src/module/filter/entity/saved-filter-detail.entity.ts +1 -1
  174. package/src/module/filter/entity/saved-filter-master.entity.ts +1 -1
  175. package/src/module/filter/repository/saved-filter.repository.ts +1 -1
  176. package/src/module/filter/service/filter-evaluator.service.ts +1 -1
  177. package/src/module/filter/service/filter.service.ts +9 -1
  178. package/src/module/integration/entity/integration-config.entity.ts +1 -1
  179. package/src/module/integration/entity/integration-entity-mapper.entity.ts +1 -1
  180. package/src/module/integration/entity/integration-source.entity.ts +1 -1
  181. package/src/module/integration/entity/user-integration.entity.ts +1 -1
  182. package/src/module/integration/service/integration.service.ts +1 -1
  183. package/src/module/integration/service/wrapper.service.ts +8 -8
  184. package/src/module/layout_preference/entity/layout_preference.entity.ts +1 -1
  185. package/src/module/listmaster/entity/list-master-items.entity.ts +1 -1
  186. package/src/module/listmaster/entity/list-master.entity.ts +1 -1
  187. package/src/module/listmaster/service/list-master-item.service.ts +1 -1
  188. package/src/module/listmaster/service/list-master.service.ts +26 -24
  189. package/src/module/mapper/entity/field-lovs.entity.ts +1 -1
  190. package/src/module/mapper/entity/field-mapper.entity.ts +1 -1
  191. package/src/module/mapper/entity/mapper.entity.ts +1 -1
  192. package/src/module/mapper/service/field-mapper.service.ts +1 -1
  193. package/src/module/mapper/service/mapper.service.ts +2 -2
  194. package/src/module/master/service/master.service.ts +15 -15
  195. package/src/module/meta/entity/attribute-master.entity.ts +1 -1
  196. package/src/module/meta/entity/entity-master.entity.ts +1 -1
  197. package/src/module/meta/entity/entity-relation-data.entity.ts +1 -1
  198. package/src/module/meta/entity/entity-relation.entity.ts +1 -1
  199. package/src/module/meta/entity/entity-table-column.entity.ts +1 -1
  200. package/src/module/meta/entity/entity-table.entity.ts +1 -1
  201. package/src/module/meta/entity/media-data.entity.ts +1 -1
  202. package/src/module/meta/entity/preference.entity.ts +1 -1
  203. package/src/module/meta/entity/view-master.entity.ts +1 -1
  204. package/src/module/meta/repository/attribute-master.repository.ts +1 -1
  205. package/src/module/meta/repository/entity-master.repository.ts +2 -2
  206. package/src/module/meta/service/entity-dynamic.service.ts +15 -15
  207. package/src/module/meta/service/entity-master.service.ts +1 -1
  208. package/src/module/meta/service/entity-relation.service.ts +3 -3
  209. package/src/module/meta/service/entity-service-impl.service.ts +2 -2
  210. package/src/module/meta/service/populate-meta.service.ts +14 -14
  211. package/src/module/meta/service/resolver.service.ts +8 -8
  212. package/src/module/notification/entity/notification.entity.ts +1 -1
  213. package/src/module/notification/service/email.service.ts +3 -3
  214. package/src/module/notification/service/notification.service.ts +2 -2
  215. package/src/module/third-party-module/entity/third-party-api-registry.entity.ts +1 -1
  216. package/src/module/workflow/entity/action-category.entity.ts +1 -1
  217. package/src/module/workflow/entity/action-data.entity.ts +1 -1
  218. package/src/module/workflow/entity/action-resources-mapping.entity.ts +1 -1
  219. package/src/module/workflow/entity/action-template-mapping.entity.ts +1 -1
  220. package/src/module/workflow/entity/action.entity.ts +1 -1
  221. package/src/module/workflow/entity/activity-log.entity.ts +1 -1
  222. package/src/module/workflow/entity/comm-template.entity.ts +1 -1
  223. package/src/module/workflow/entity/entity-modification.entity.ts +1 -1
  224. package/src/module/workflow/entity/form.entity.ts +1 -1
  225. package/src/module/workflow/entity/stage-action-mapping.entity.ts +1 -1
  226. package/src/module/workflow/entity/stage-group.entity.ts +1 -1
  227. package/src/module/workflow/entity/stage-movement-data.entity.ts +1 -1
  228. package/src/module/workflow/entity/stage.entity.ts +1 -1
  229. package/src/module/workflow/entity/task-data.entity.ts +1 -1
  230. package/src/module/workflow/entity/template-attach-mapper.entity.ts +1 -1
  231. package/src/module/workflow/entity/workflow-data.entity.ts +1 -1
  232. package/src/module/workflow/entity/workflow-level-mapping.entity.ts +1 -1
  233. package/src/module/workflow/entity/workflow.entity.ts +1 -1
  234. package/src/module/workflow/repository/action-data.repository.ts +4 -4
  235. package/src/module/workflow/repository/action.repository.ts +15 -15
  236. package/src/module/workflow/repository/comm-template.repository.ts +2 -2
  237. package/src/module/workflow/repository/form-master.repository.ts +2 -2
  238. package/src/module/workflow/repository/stage-group.repository.ts +6 -6
  239. package/src/module/workflow/repository/stage-movement.repository.ts +6 -6
  240. package/src/module/workflow/repository/stage.repository.ts +8 -8
  241. package/src/module/workflow/repository/task.repository.ts +3 -3
  242. package/src/module/workflow/service/action-template-mapping.service.ts +4 -4
  243. package/src/module/workflow/service/action.service.ts +9 -9
  244. package/src/module/workflow/service/entity-modification.service.ts +3 -3
  245. package/src/module/workflow/service/populate-workflow.service.ts +20 -20
  246. package/src/module/workflow/service/stage-group.service.ts +3 -3
  247. package/src/module/workflow/service/stage.service.ts +3 -3
  248. package/src/module/workflow/service/task.service.ts +12 -12
  249. package/src/module/workflow/service/workflow-list-master.service.ts +5 -5
  250. package/src/module/workflow/service/workflow-meta.service.ts +10 -10
  251. package/src/module/workflow/service/workflow.service.ts +4 -4
  252. package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +1 -1
  253. package/src/module/workflow-automation/entity/workflow-automation.entity.ts +1 -1
  254. package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +2 -2
@@ -2,7 +2,7 @@ import { WORKFLOW } from 'src/constant/global.constant';
2
2
  import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
3
3
  import { Column, Entity } from 'typeorm';
4
4
 
5
- @Entity({ name: 'cr_wf_master' })
5
+ @Entity({ name: 'frm_wf_master' })
6
6
  export class Workflow extends BaseEntity {
7
7
  constructor() {
8
8
  super();
@@ -38,7 +38,7 @@ export class ActionDataRepository extends EntityServiceImpl {
38
38
  if (action.length > 0) {
39
39
  for (const act of action) {
40
40
  const is_mandatory = await this.dataSource.query(
41
- `SELECT code FROM cr_list_master_items WHERE id = ? and organization_id = ? LIMIT 1;`,
41
+ `SELECT code FROM frm_list_master_items WHERE id = ? and organization_id = ? LIMIT 1;`,
42
42
  [act.action_requirement, loggedInUser.organization_id],
43
43
  );
44
44
  const isFirst = act.sequence == minSequence;
@@ -86,13 +86,13 @@ export class ActionDataRepository extends EntityServiceImpl {
86
86
  // THEN INSERT SDFM IN RELATION TASK TABLE
87
87
 
88
88
  let relationData = await this.dataSource.query(
89
- `SELECT * FROM cr_entity_relation WHERE source_entity_type = ? AND target_entity_type = ?`,
89
+ `SELECT * FROM frm_entity_relation WHERE source_entity_type = ? AND target_entity_type = ?`,
90
90
  [createdEntity.mapped_entity_type, createdEntity.entity_type],
91
91
  );
92
92
 
93
93
  if (relationData) {
94
94
  await this.dataSource.query(
95
- `INSERT INTO cr_entity_relation_data (organization_id, source_entity_id, source_entity_type, target_entity_id, target_entity_type, relation_type) VALUES (?, ?, ?, ?, ?,?)`,
95
+ `INSERT INTO frm_entity_relation_data (organization_id, source_entity_id, source_entity_type, target_entity_id, target_entity_type, relation_type) VALUES (?, ?, ?, ?, ?,?)`,
96
96
  [
97
97
  loggedInUser.organization_id,
98
98
  createdEntity.mapped_entity_id,
@@ -234,7 +234,7 @@ export class ActionDataRepository extends EntityServiceImpl {
234
234
 
235
235
  // Reset status (optional: set to something like 'pending' if needed)
236
236
  const pendingListMasterItemId = await this.dataSource.query(
237
- `SELECT id FROM cr_list_master_items WHERE code = 'in_progress' AND organization_id = ? AND listtype = 'TKST' LIMIT 1;`,
237
+ `SELECT id FROM frm_list_master_items WHERE code = 'in_progress' AND organization_id = ? AND listtype = 'TKST' LIMIT 1;`,
238
238
  [organization_id],
239
239
  );
240
240
  task.status = pendingListMasterItemId[0]?.id ?? task.status;
@@ -22,7 +22,7 @@ export class ActionRepository {
22
22
  const result = await this.dataSource.query(
23
23
  `
24
24
  SELECT name, type
25
- FROM cr_list_master
25
+ FROM frm_list_master
26
26
  WHERE organization_id = ? AND source = 'master'
27
27
  `,
28
28
  [organization_id],
@@ -44,7 +44,7 @@ export class ActionRepository {
44
44
  const result = await this.dataSource.query(
45
45
  `
46
46
  SELECT name, id
47
- FROM cr_list_master_items
47
+ FROM frm_list_master_items
48
48
  WHERE listtype = ? AND organization_id = ?
49
49
  `,
50
50
  [list_type, organization_id],
@@ -64,7 +64,7 @@ export class ActionRepository {
64
64
  const stageActions = await this.dataSource.query(
65
65
  `
66
66
  SELECT id, action_id
67
- FROM cr_wf_stage_action_mapping
67
+ FROM frm_wf_stage_action_mapping
68
68
  WHERE stage_id = ?
69
69
  `,
70
70
  [stage_id],
@@ -79,7 +79,7 @@ export class ActionRepository {
79
79
  const templateMappings = await this.dataSource.query(
80
80
  `
81
81
  SELECT stg_act_mapping_id, template_code
82
- FROM cr_wf_action_template_mapping
82
+ FROM frm_wf_action_template_mapping
83
83
  WHERE stg_act_mapping_id IN (${mappingIds.map(() => '?').join(',')})
84
84
  `,
85
85
  mappingIds,
@@ -87,14 +87,14 @@ export class ActionRepository {
87
87
 
88
88
  const templateCodes = templateMappings.map((tm) => tm.template_code);
89
89
 
90
- // Step 3: Fetch template names from cr_wf_comm_template
90
+ // Step 3: Fetch template names from frm_wf_comm_template
91
91
  const templateCodeToName: Record<string, string> = {};
92
92
 
93
93
  if (templateCodes.length > 0) {
94
94
  const templates = await this.dataSource
95
95
  .createQueryBuilder()
96
96
  .select(['t.code AS code', 't.name AS name'])
97
- .from('cr_wf_comm_template', 't')
97
+ .from('frm_wf_comm_template', 't')
98
98
  .where('t.code IN (:...codes)', { codes: templateCodes })
99
99
  .andWhere('t.organization_id = :orgId', { orgId: organization_id })
100
100
  .getRawMany();
@@ -140,10 +140,10 @@ export class ActionRepository {
140
140
  'ac.name AS action_category',
141
141
  'ar.name AS action_requirement',
142
142
  ])
143
- .from('cr_wf_action', 'a')
144
- .leftJoin('cr_wf_action_category', 'ac', 'ac.id = a.action_category')
143
+ .from('frm_wf_action', 'a')
144
+ .leftJoin('frm_wf_action_category', 'ac', 'ac.id = a.action_category')
145
145
  .leftJoin(
146
- 'cr_list_master_items',
146
+ 'frm_list_master_items',
147
147
  'ar',
148
148
  `ar.id = a.action_requirement AND ar.listtype = 'ACRQ' AND ar.organization_id = :orgId`,
149
149
  { orgId: organization_id },
@@ -176,7 +176,7 @@ export class ActionRepository {
176
176
  const stageActions = await this.dataSource.query(
177
177
  `
178
178
  SELECT action_id
179
- FROM cr_wf_stage_action_mapping
179
+ FROM frm_wf_stage_action_mapping
180
180
  WHERE stage_id = ?
181
181
  `,
182
182
  [stage_id],
@@ -200,7 +200,7 @@ export class ActionRepository {
200
200
  actionResults = await this.dataSource
201
201
  .createQueryBuilder()
202
202
  .select(['a.id AS action_id', 'a.name AS action_name'])
203
- .from('cr_wf_action', 'a')
203
+ .from('frm_wf_action', 'a')
204
204
  .andWhere('a.id IN(:...actionIds)', { actionIds: filteredActionIds })
205
205
  .getRawMany();
206
206
 
@@ -221,7 +221,7 @@ export class ActionRepository {
221
221
  ) {
222
222
  // Step 1: Get all action mappings for the stage
223
223
  const stageActions = await this.dataSource.query(
224
- `SELECT id, action_id FROM cr_wf_stage_action_mapping WHERE stage_id = ?`,
224
+ `SELECT id, action_id FROM frm_wf_stage_action_mapping WHERE stage_id = ?`,
225
225
  [stage_id],
226
226
  );
227
227
 
@@ -253,8 +253,8 @@ export class ActionRepository {
253
253
  'ac.name AS action_category_name',
254
254
  'a.dependent_action_id AS dependent_action_id',
255
255
  ])
256
- .from('cr_wf_action', 'a')
257
- .leftJoin('cr_wf_action_category', 'ac', 'ac.id = a.action_category')
256
+ .from('frm_wf_action', 'a')
257
+ .leftJoin('frm_wf_action_category', 'ac', 'ac.id = a.action_category')
258
258
  .where('a.organization_id = :orgId', { orgId: organization_id })
259
259
  .andWhere('a.id IN (:...actionIds)', { actionIds })
260
260
  .getRawMany();
@@ -268,7 +268,7 @@ export class ActionRepository {
268
268
  'ad.is_mandatory AS is_mandatory',
269
269
  'ad.is_done AS is_done',
270
270
  ])
271
- .from('cr_wf_action_data', 'ad')
271
+ .from('frm_wf_action_data', 'ad')
272
272
  .where('ad.stage_id = :stageId', { stageId: stage_id })
273
273
  .andWhere('ad.action_id IN (:...actionIds)', { actionIds })
274
274
  .andWhere('ad.mapped_entity_id = :mapped_entity_id', { mapped_entity_id })
@@ -29,7 +29,7 @@ export class CommTemplateRepository {
29
29
  if (action_id) {
30
30
  const [actionResult] = await this.dataSource.query(
31
31
  `SELECT is_template
32
- FROM cr_wf_action
32
+ FROM frm_wf_action
33
33
  WHERE id = ? AND organization_id = ?
34
34
  LIMIT 1`,
35
35
  [action_id, organization_id],
@@ -42,7 +42,7 @@ export class CommTemplateRepository {
42
42
  is_template = actionResult.is_template;
43
43
 
44
44
  await this.dataSource.query(
45
- `UPDATE cr_wf_comm_template
45
+ `UPDATE frm_wf_comm_template
46
46
  SET is_template = ?
47
47
  WHERE mapped_entity_type = ?
48
48
  AND organization_id = ? AND level_id = ? AND level_type=?`,
@@ -20,7 +20,7 @@ export class FormMasterRepository {
20
20
  async getForms(organization_id: number, source_entity_type: string) {
21
21
  const forms = await this.dataSource.query(
22
22
  `SELECT fm.id as fm_id, fm.name as fm_form_name
23
- FROM cr_entity_view fm
23
+ FROM frm_entity_view fm
24
24
  WHERE fm.organization_id = ? AND fm.mapped_entity_type = ?`,
25
25
  [organization_id, source_entity_type],
26
26
  );
@@ -54,6 +54,6 @@ export class FormMasterRepository {
54
54
  // currentForm.status = 'submitted';
55
55
 
56
56
  // return this.formMasterEntity.update(currentForm.id, currentForm);
57
- return 'cr_form_master is removed package. So, this function is deactivated.';
57
+ return 'frm_form_master is removed package. So, this function is deactivated.';
58
58
  }
59
59
  }
@@ -84,11 +84,11 @@ export class StageGroupRepository {
84
84
  const stagesRaw = await this.dataSource.query(
85
85
  `
86
86
  SELECT
87
- cr_wf_stage.*
88
- FROM cr_wf_stage
89
- WHERE cr_wf_stage.stage_group_id IN (${stageGroupIds.map(() => '?').join(',')})
90
- AND cr_wf_stage.organization_id = ?
91
- ORDER BY cr_wf_stage.sequence ASC
87
+ frm_wf_stage.*
88
+ FROM frm_wf_stage
89
+ WHERE frm_wf_stage.stage_group_id IN (${stageGroupIds.map(() => '?').join(',')})
90
+ AND frm_wf_stage.organization_id = ?
91
+ ORDER BY frm_wf_stage.sequence ASC
92
92
  `,
93
93
  [...stageGroupIds, loggedInUser.organization_id],
94
94
  );
@@ -99,7 +99,7 @@ export class StageGroupRepository {
99
99
  const taskCounts = await this.dataSource.query(
100
100
  `
101
101
  SELECT stage_id, COUNT(*) AS task_count
102
- FROM cr_wf_task_data
102
+ FROM frm_wf_task_data
103
103
  WHERE stage_id IN (${stageIds.map(() => '?').join(',')}) AND is_system=0 AND mapped_entity_id = ?
104
104
  GROUP BY stage_id
105
105
  `,
@@ -188,10 +188,10 @@ export class StageMovementRepository {
188
188
  m.stage_id,
189
189
  ac.code AS action_category_code,
190
190
  arm.form_id
191
- FROM cr_wf_action a
192
- LEFT JOIN cr_wf_stage_action_mapping m ON a.id = m.action_id
193
- LEFT JOIN cr_wf_action_category ac ON a.action_category = ac.id
194
- LEFT JOIN cr_wf_action_resources_mapping arm ON m.id = arm.stg_act_mapping_id
191
+ FROM frm_wf_action a
192
+ LEFT JOIN frm_wf_stage_action_mapping m ON a.id = m.action_id
193
+ LEFT JOIN frm_wf_action_category ac ON a.action_category = ac.id
194
+ LEFT JOIN frm_wf_action_resources_mapping arm ON m.id = arm.stg_act_mapping_id
195
195
  WHERE m.stage_id = ?
196
196
  `,
197
197
  [stageId],
@@ -205,7 +205,7 @@ export class StageMovementRepository {
205
205
  if (action.length > 0) {
206
206
  for (const act of action) {
207
207
  await this.dataSource.query(
208
- `INSERT INTO cr_wf_action_data (stage_id, user_id, action_id) VALUES (?, ?, ?)`,
208
+ `INSERT INTO frm_wf_action_data (stage_id, user_id, action_id) VALUES (?, ?, ?)`,
209
209
  [act.stage_id, loggedInUser.id, act.id],
210
210
  );
211
211
  }
@@ -218,7 +218,7 @@ export class StageMovementRepository {
218
218
  if (actionData.length > 0) {
219
219
  for (const action of actionData) {
220
220
  await this.dataSource.query(
221
- `INSERT INTO cr_wf_task_data (action_id, user_id) VALUES (?, ?)`,
221
+ `INSERT INTO frm_wf_task_data (action_id, user_id) VALUES (?, ?)`,
222
222
  [action.id, loggedInUser.id],
223
223
  );
224
224
  }
@@ -24,7 +24,7 @@ export class StageRepository {
24
24
 
25
25
  // 1. Get stage group name
26
26
  const stageGroup = (await this.dataSource.manager.findOne(
27
- 'cr_wf_stage_group',
27
+ 'frm_wf_stage_group',
28
28
  {
29
29
  where: { id: stage_group_id },
30
30
  },
@@ -71,7 +71,7 @@ export class StageRepository {
71
71
 
72
72
  // 1. Find the stage group to get workflow_id
73
73
  const stageGroup = (await this.dataSource.manager.findOne(
74
- 'cr_wf_stage_group',
74
+ 'frm_wf_stage_group',
75
75
  {
76
76
  where: { id: stage_group_id, organization_id },
77
77
  },
@@ -87,8 +87,8 @@ export class StageRepository {
87
87
  SELECT
88
88
  g.id as stage_group_id, g.name as stage_group_name, g.workflow_id,
89
89
  s.*
90
- FROM cr_wf_stage_group g
91
- INNER JOIN cr_wf_stage s ON s.stage_group_id = g.id
90
+ FROM frm_wf_stage_group g
91
+ INNER JOIN frm_wf_stage s ON s.stage_group_id = g.id
92
92
  WHERE g.workflow_id = ? AND g.organization_id = ? AND g.id = ?
93
93
  ORDER BY g.id, s.id
94
94
  `,
@@ -99,8 +99,8 @@ export class StageRepository {
99
99
  // SELECT
100
100
  // g.id as stage_group_id, g.name as stage_group_name, g.workflow_id,
101
101
  // s.*
102
- // FROM cr_wf_stage_group g
103
- // INNER JOIN cr_wf_stage s ON s.stage_group_id = g.id
102
+ // FROM frm_wf_stage_group g
103
+ // INNER JOIN frm_wf_stage s ON s.stage_group_id = g.id
104
104
  // WHERE g.workflow_id = ? AND g.organization_id = ?
105
105
  // ORDER BY g.id, s.id
106
106
  // `,
@@ -122,7 +122,7 @@ export class StageRepository {
122
122
  ) {
123
123
  // 1. Find the current stage group
124
124
  const currentStageGroup = await this.dataSource.manager.findOne<any>(
125
- 'cr_wf_stage_group',
125
+ 'frm_wf_stage_group',
126
126
  { where: { id: stage_group_id, organization_id } },
127
127
  );
128
128
 
@@ -132,7 +132,7 @@ export class StageRepository {
132
132
 
133
133
  // 2. Get all stage groups in the same workflow with sequence <= current
134
134
  const stageGroups = await this.dataSource.manager.find<any>(
135
- 'cr_wf_stage_group',
135
+ 'frm_wf_stage_group',
136
136
  {
137
137
  where: {
138
138
  workflow_id: currentStageGroup.workflow_id,
@@ -30,7 +30,7 @@ export class TaskRepository {
30
30
  if (!action?.length) return;
31
31
 
32
32
  const todoListMasterItemId = await this.dataSource.query(
33
- `SELECT id FROM cr_list_master_items WHERE code = 'in_progress' and organization_id = ? and listtype = 'TKST' LIMIT 1;`,
33
+ `SELECT id FROM frm_list_master_items WHERE code = 'in_progress' and organization_id = ? and listtype = 'TKST' LIMIT 1;`,
34
34
  [loggedInUser.organization_id],
35
35
  );
36
36
 
@@ -46,7 +46,7 @@ export class TaskRepository {
46
46
  // search that is_mandatory is true or not in list_master_items for the given organization
47
47
 
48
48
  const is_mandatory = await this.dataSource.query(
49
- `SELECT code FROM cr_list_master_items WHERE id = ? and organization_id = ? LIMIT 1;`,
49
+ `SELECT code FROM frm_list_master_items WHERE id = ? and organization_id = ? LIMIT 1;`,
50
50
  [act.action_requirement, loggedInUser.organization_id],
51
51
  );
52
52
 
@@ -103,7 +103,7 @@ export class TaskRepository {
103
103
  if (!task) return;
104
104
 
105
105
  const completedListMasterItemId = await this.dataSource.query(
106
- `SELECT id FROM cr_list_master_items WHERE code = 'completed' and organization_id = ? and listtype = 'TKST' LIMIT 1;`,
106
+ `SELECT id FROM frm_list_master_items WHERE code = 'completed' and organization_id = ? and listtype = 'TKST' LIMIT 1;`,
107
107
  [loggedInUser.organization_id],
108
108
  );
109
109
 
@@ -15,7 +15,7 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
15
15
  ) {
16
16
  const stageAction = await this.dataSource.query(
17
17
  `
18
- SELECT id FROM cr_wf_stage_action_mapping
18
+ SELECT id FROM frm_wf_stage_action_mapping
19
19
  WHERE stage_id = ? AND action_id = ?
20
20
  `,
21
21
  [stage_id, action_id],
@@ -26,13 +26,13 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
26
26
 
27
27
  const templates = await this.dataSource.query(
28
28
  `
29
- SELECT template_code FROM cr_wf_action_resources_mapping
29
+ SELECT template_code FROM frm_wf_action_resources_mapping
30
30
  WHERE stg_act_mapping_id = ?
31
31
  `,
32
32
  [stgActMappingId],
33
33
  );
34
34
  const listMasterItemData = await this.dataSource.query(
35
- `SELECT code FROM cr_list_master_items WHERE id = ?`,
35
+ `SELECT code FROM frm_list_master_items WHERE id = ?`,
36
36
  [mode],
37
37
  );
38
38
 
@@ -44,7 +44,7 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
44
44
  const commTemplates = await this.dataSource.query(
45
45
  `
46
46
  SELECT id, name
47
- FROM cr_wf_comm_template
47
+ FROM frm_wf_comm_template
48
48
  WHERE code IN (?) AND mode = ? AND organization_id = ?
49
49
  `,
50
50
  [templateCodes, listMasterItemData[0].code, loggedInUser.organization_id],
@@ -28,10 +28,10 @@ export class ActionService extends EntityServiceImpl {
28
28
 
29
29
  const result = await this.dataSource.query(
30
30
  `SELECT template_code, form_id
31
- FROM cr_wf_action_resources_mapping
31
+ FROM frm_wf_action_resources_mapping
32
32
  WHERE stg_act_mapping_id IN (
33
33
  SELECT id
34
- FROM cr_wf_stage_action_mapping
34
+ FROM frm_wf_stage_action_mapping
35
35
  WHERE action_id = ? AND entity_type = 'WFSA'
36
36
  )`,
37
37
  [actionData.id],
@@ -98,7 +98,7 @@ export class ActionService extends EntityServiceImpl {
98
98
  }
99
99
 
100
100
  await this.dataSource.query(
101
- `DELETE FROM cr_wf_action_resources_mapping WHERE stg_act_mapping_id = ? AND type = 'form'`,
101
+ `DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = ? AND type = 'form'`,
102
102
  [stageActionMappingData.id],
103
103
  );
104
104
 
@@ -138,7 +138,7 @@ export class ActionService extends EntityServiceImpl {
138
138
  }
139
139
 
140
140
  const stageMapID = await this.dataSource.query(
141
- `SELECT id FROM cr_wf_stage_action_mapping WHERE action_id = ? AND entity_type = 'WFSA'`,
141
+ `SELECT id FROM frm_wf_stage_action_mapping WHERE action_id = ? AND entity_type = 'WFSA'`,
142
142
  [action.id],
143
143
  );
144
144
 
@@ -174,7 +174,7 @@ export class ActionService extends EntityServiceImpl {
174
174
 
175
175
  // delete existing template mappings for this action
176
176
  await this.dataSource.query(
177
- `DELETE FROM cr_wf_action_resources_mapping WHERE stg_act_mapping_id = ? AND type = 'template'`,
177
+ `DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = ? AND type = 'template'`,
178
178
  [stageActionMappingData.id],
179
179
  );
180
180
 
@@ -196,7 +196,7 @@ export class ActionService extends EntityServiceImpl {
196
196
  }
197
197
 
198
198
  await this.dataSource.query(
199
- `DELETE FROM cr_wf_action_resources_mapping WHERE stg_act_mapping_id = ? AND type = 'form'`,
199
+ `DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = ? AND type = 'form'`,
200
200
  [stageActionMappingData.id],
201
201
  );
202
202
 
@@ -219,13 +219,13 @@ export class ActionService extends EntityServiceImpl {
219
219
  loggedInUser: UserData,
220
220
  ): Promise<any> {
221
221
  await this.dataSource.query(
222
- `DELETE FROM cr_wf_action_template_mapping WHERE stg_act_mapping_id IN (SELECT
223
- id FROM cr_wf_stage_action_mapping WHERE action_id = ? AND entity_type = 'WFSA')`,
222
+ `DELETE FROM frm_wf_action_template_mapping WHERE stg_act_mapping_id IN (SELECT
223
+ id FROM frm_wf_stage_action_mapping WHERE action_id = ? AND entity_type = 'WFSA')`,
224
224
  [id],
225
225
  );
226
226
 
227
227
  await this.dataSource.query(
228
- `DELETE FROM cr_wf_stage_action_mapping WHERE action_id = ? AND entity_type ='WFSA'`,
228
+ `DELETE FROM frm_wf_stage_action_mapping WHERE action_id = ? AND entity_type ='WFSA'`,
229
229
  [id],
230
230
  );
231
231
 
@@ -23,11 +23,11 @@ export class EntityModificationService extends EntityServiceImpl {
23
23
  );
24
24
  }
25
25
 
26
- // Step 1: Fetch db_table_name from cr_entity_master
26
+ // Step 1: Fetch db_table_name from frm_entity_master
27
27
  const [entityMeta] = await this.dataSource.query(
28
28
  `
29
29
  SELECT db_table_name
30
- FROM cr_entity_master
30
+ FROM frm_entity_master
31
31
  WHERE mapped_entity_type = ? AND organization_id = ?
32
32
  `,
33
33
  [mapped_entity_type, organization_id],
@@ -35,7 +35,7 @@ export class EntityModificationService extends EntityServiceImpl {
35
35
 
36
36
  if (!entityMeta || !entityMeta.db_table_name) {
37
37
  throw new NotFoundException(
38
- 'Entity metadata not found in cr_entity_master',
38
+ 'Entity metadata not found in frm_entity_master',
39
39
  );
40
40
  }
41
41
 
@@ -29,14 +29,14 @@ export class PopulateWorkflowService extends EntityServiceImpl {
29
29
  // async populateWorkflowData(organization_id: number, loggedInUser: UserData) {
30
30
  // // Define workflow tables
31
31
  // const workflowTables = [
32
- // { table: 'cr_wf_master', entityType: 'WRFW', service: 'workflowService' },
32
+ // { table: 'frm_wf_master', entityType: 'WRFW', service: 'workflowService' },
33
33
  // {
34
- // table: 'cr_wf_stage_group',
34
+ // table: 'frm_wf_stage_group',
35
35
  // entityType: 'WFSG',
36
36
  // service: 'stageGroupService',
37
37
  // },
38
- // { table: 'cr_wf_stage', entityType: 'WFS', service: 'stageService' },
39
- // { table: 'cr_wf_action', entityType: 'WFAC', service: 'actionService' },
38
+ // { table: 'frm_wf_stage', entityType: 'WFS', service: 'stageService' },
39
+ // { table: 'frm_wf_action', entityType: 'WFAC', service: 'actionService' },
40
40
  // ];
41
41
 
42
42
  // const getAllFactoryData = async (table: { table: string }) => {
@@ -82,22 +82,22 @@ export class PopulateWorkflowService extends EntityServiceImpl {
82
82
 
83
83
  async populateWorkflowData(organization_id: number, loggedInUser: UserData) {
84
84
  let statusRow = await this.dataSource.query(
85
- `SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = ?`,
85
+ `SELECT * FROM frm_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = ?`,
86
86
  [organization_id],
87
87
  );
88
88
 
89
89
  if (statusRow.length === 0) {
90
90
  statusRow = await this.dataSource.query(
91
- `SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = -1`,
91
+ `SELECT * FROM frm_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = -1`,
92
92
  );
93
93
  }
94
94
 
95
95
  const statusValue = statusRow[0]?.id;
96
96
 
97
97
  // template populate
98
- // Step 1: Fetch default cr_wf_comm_template
98
+ // Step 1: Fetch default frm_wf_comm_template
99
99
  const defaultCommTemplates = await this.dataSource.query(
100
- `SELECT * FROM cr_wf_comm_template WHERE organization_id = -1 AND level_type = 'ORG' AND level_id = -1`,
100
+ `SELECT * FROM frm_wf_comm_template WHERE organization_id = -1 AND level_type = 'ORG' AND level_id = -1`,
101
101
  );
102
102
 
103
103
  if (defaultCommTemplates.length > 0) {
@@ -120,14 +120,14 @@ export class PopulateWorkflowService extends EntityServiceImpl {
120
120
  }
121
121
 
122
122
  const workflowTables = [
123
- { table: 'cr_wf_master', entityType: 'WRFW', service: 'workflowService' },
123
+ { table: 'frm_wf_master', entityType: 'WRFW', service: 'workflowService' },
124
124
  {
125
- table: 'cr_wf_stage_group',
125
+ table: 'frm_wf_stage_group',
126
126
  entityType: 'WFSG',
127
127
  service: 'stageGroupService',
128
128
  },
129
- { table: 'cr_wf_stage', entityType: 'WFS', service: 'stageService' },
130
- { table: 'cr_wf_action', entityType: 'WFAC', service: 'actionService' },
129
+ { table: 'frm_wf_stage', entityType: 'WFS', service: 'stageService' },
130
+ { table: 'frm_wf_action', entityType: 'WFAC', service: 'actionService' },
131
131
  ];
132
132
 
133
133
  // Fetch all base data
@@ -157,7 +157,7 @@ export class PopulateWorkflowService extends EntityServiceImpl {
157
157
 
158
158
  // adding new entry for workflow level mapping
159
159
  await this.dataSource.query(
160
- `INSERT INTO cr_wf_level_mapping (workflow_id, mapped_level_id, mapped_level_type) VALUES (?, ?, ?)`,
160
+ `INSERT INTO frm_wf_level_mapping (workflow_id, mapped_level_id, mapped_level_type) VALUES (?, ?, ?)`,
161
161
  [newWf.id, organization_id, 'ORG'],
162
162
  );
163
163
 
@@ -208,12 +208,12 @@ export class PopulateWorkflowService extends EntityServiceImpl {
208
208
  stageToStageGroupMap[id] = stage_group_id; // maintain
209
209
 
210
210
  // step 1 find old stage_id in stage_action_mapper and get all actions_ids
211
- // step 2 search action in cr_wf_action table with those action_ids
211
+ // step 2 search action in frm_wf_action table with those action_ids
212
212
  // step 3 create new action with new stage_id and new workflow_id
213
213
  // step 4 save new action
214
214
 
215
215
  const stageIds = await this.dataSource.query(
216
- `SELECT action_id FROM cr_wf_stage_action_mapping WHERE stage_id = ?`,
216
+ `SELECT action_id FROM frm_wf_stage_action_mapping WHERE stage_id = ?`,
217
217
  [id],
218
218
  );
219
219
 
@@ -222,7 +222,7 @@ export class PopulateWorkflowService extends EntityServiceImpl {
222
222
  let actions = [];
223
223
  if (actionIds.length > 0) {
224
224
  actions = await this.dataSource.query(
225
- `SELECT * FROM cr_wf_action WHERE id IN (?)`,
225
+ `SELECT * FROM frm_wf_action WHERE id IN (?)`,
226
226
  [actionIds],
227
227
  );
228
228
  } else {
@@ -242,13 +242,13 @@ export class PopulateWorkflowService extends EntityServiceImpl {
242
242
 
243
243
  // Step 1: Get the code of the old is_mandatory field
244
244
  const [oldIsMandatory] = await this.dataSource.query(
245
- `SELECT code FROM cr_list_master_items WHERE id = ?`,
245
+ `SELECT code FROM frm_list_master_items WHERE id = ?`,
246
246
  [rest.action_requirement],
247
247
  );
248
248
 
249
249
  // Step 2: Get all new 'ACRQ' list master items for the organization
250
250
  const newIsMandatoryList = await this.dataSource.query(
251
- `SELECT id, code FROM cr_list_master_items WHERE organization_id = ? AND listtype = 'ACRQ'`,
251
+ `SELECT id, code FROM frm_list_master_items WHERE organization_id = ? AND listtype = 'ACRQ'`,
252
252
  [organization_id],
253
253
  );
254
254
 
@@ -267,13 +267,13 @@ export class PopulateWorkflowService extends EntityServiceImpl {
267
267
  console.log(`Matched new mandatory item:`, matchedNewMandatory);
268
268
 
269
269
  const formActionCategory = await this.dataSource.query(
270
- `SELECT id FROM cr_wf_action_category WHERE id = ? and is_form = 1`,
270
+ `SELECT id FROM frm_wf_action_category WHERE id = ? and is_form = 1`,
271
271
  [row.action_category],
272
272
  );
273
273
 
274
274
  //get view master form
275
275
  const formViewMaster = await this.dataSource.query(
276
- `SELECT id FROM cr_entity_view WHERE code = "LEAD_FORM" and organization_id = ?`,
276
+ `SELECT id FROM frm_entity_view WHERE code = "LEAD_FORM" and organization_id = ?`,
277
277
  [organization_id],
278
278
  );
279
279
 
@@ -37,7 +37,7 @@ export class StageGroupService extends EntityServiceImpl {
37
37
  );
38
38
  const statusListMaster = await this.dataSource.query(
39
39
  `SELECT id, name
40
- FROM cr_list_master_items
40
+ FROM frm_list_master_items
41
41
  WHERE listtype = 'STS' AND organization_id = ?`,
42
42
  [organization_id],
43
43
  );
@@ -86,7 +86,7 @@ export class StageGroupService extends EntityServiceImpl {
86
86
  );
87
87
  if (leadData.length > 0 && leadData[0].lead_status != null) {
88
88
  const leadStatusResolved = await this.dataSource.query(
89
- `SELECT name FROM cr_list_master_items WHERE id = ? AND organization_id = ?`,
89
+ `SELECT name FROM frm_list_master_items WHERE id = ? AND organization_id = ?`,
90
90
  [leadData[0].lead_status, loggedInUser.organization_id],
91
91
  );
92
92
  if (leadStatusResolved.length > 0) {
@@ -286,7 +286,7 @@ export class StageGroupService extends EntityServiceImpl {
286
286
  loggedInUser: UserData,
287
287
  ): Promise<any> {
288
288
  const getAllStage = await this.dataSource.query(
289
- `SELECT id FROM cr_wf_stage WHERE stage_group_id = ? AND level_id =? AND level_type = ?`,
289
+ `SELECT id FROM frm_wf_stage WHERE stage_group_id = ? AND level_id =? AND level_type = ?`,
290
290
  [id, loggedInUser.level_id, loggedInUser.level_type],
291
291
  );
292
292
 
@@ -47,7 +47,7 @@ export class StageService extends EntityServiceImpl {
47
47
 
48
48
  const statusListMaster = await this.dataSource.query(
49
49
  `SELECT id, name
50
- FROM cr_list_master_items
50
+ FROM frm_list_master_items
51
51
  WHERE listtype = 'STS' AND organization_id = ?`,
52
52
  [organization_id],
53
53
  );
@@ -79,7 +79,7 @@ export class StageService extends EntityServiceImpl {
79
79
  mapped_entity_id: number;
80
80
  mapped_entity_type: string;
81
81
  is_current: string;
82
- }>('cr_wf_stage_movement_data', {
82
+ }>('frm_wf_stage_movement_data', {
83
83
  where: {
84
84
  mapped_entity_id: payload.mapped_entity_id,
85
85
  mapped_entity_type: 'LEAD',
@@ -133,7 +133,7 @@ export class StageService extends EntityServiceImpl {
133
133
  loggedInUser: UserData,
134
134
  ): Promise<any> {
135
135
  const getAllStageAction = await this.dataSource.query(
136
- `SELECT action_id FROM cr_wf_stage_action_mapping WHERE stage_id = ? AND entity_type = 'WFSA'`,
136
+ `SELECT action_id FROM frm_wf_stage_action_mapping WHERE stage_id = ? AND entity_type = 'WFSA'`,
137
137
  [id],
138
138
  );
139
139