rez_core 4.0.160 → 4.0.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +26 -0
- package/.idea/250218_nodejs_core.iml +9 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/copilot.data.migration.edit.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/.prettierrc +3 -3
- package/README.md +99 -99
- package/dist/app.module.js +0 -6
- package/dist/app.module.js.map +1 -1
- package/dist/config/config.module.js +2 -2
- package/dist/config/config.module.js.map +1 -1
- package/dist/config/database.config.d.ts +1 -1
- package/dist/config/database.config.js +15 -11
- package/dist/config/database.config.js.map +1 -1
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/auth/services/auth.service.js +3 -3
- package/dist/module/auth/services/auth.service.js.map +1 -1
- package/dist/module/enterprise/entity/organization.entity.js +1 -1
- package/dist/module/enterprise/repository/school.repository.js +3 -3
- package/dist/module/enterprise/repository/school.repository.js.map +1 -1
- package/dist/module/filter/repository/saved-filter.repository.js +4 -4
- package/dist/module/filter/service/filter-evaluator.service.js +3 -3
- package/dist/module/filter/service/filter-evaluator.service.js.map +1 -1
- package/dist/module/filter/service/filter.service.d.ts +4 -1
- package/dist/module/filter/service/filter.service.js +50 -31
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/integration/entity/integration-config.entity.js +6 -6
- package/dist/module/integration/entity/integration-config.entity.js.map +1 -1
- package/dist/module/integration/entity/integration-entity-mapper.entity.js +1 -1
- package/dist/module/integration/entity/integration-entity-mapper.entity.js.map +1 -1
- package/dist/module/integration/entity/integration-source.entity.js +4 -4
- package/dist/module/integration/entity/integration-source.entity.js.map +1 -1
- package/dist/module/integration/entity/user-integration.entity.js +4 -4
- package/dist/module/integration/entity/user-integration.entity.js.map +1 -1
- package/dist/module/integration/examples/usage.example.js +9 -9
- package/dist/module/integration/service/integration.service.js +1 -1
- package/dist/module/integration/service/wrapper.service.d.ts +1 -3
- package/dist/module/integration/service/wrapper.service.js +65 -67
- package/dist/module/integration/service/wrapper.service.js.map +1 -1
- package/dist/module/listmaster/entity/list-master-items.entity.js +3 -3
- package/dist/module/listmaster/entity/list-master-items.entity.js.map +1 -1
- package/dist/module/listmaster/entity/list-master.entity.js +4 -4
- package/dist/module/listmaster/entity/list-master.entity.js.map +1 -1
- package/dist/module/listmaster/service/list-master-item.service.js +3 -3
- package/dist/module/listmaster/service/list-master-item.service.js.map +1 -1
- package/dist/module/mapper/entity/field-mapper.entity.js +6 -6
- package/dist/module/mapper/entity/field-mapper.entity.js.map +1 -1
- package/dist/module/mapper/service/field-mapper.service.js +7 -7
- package/dist/module/mapper/service/field-mapper.service.js.map +1 -1
- package/dist/module/mapper/service/mapper.service.js +4 -4
- package/dist/module/mapper/service/mapper.service.js.map +1 -1
- package/dist/module/meta/controller/attribute-master.controller.d.ts +1 -4
- package/dist/module/meta/controller/attribute-master.controller.js +2 -15
- package/dist/module/meta/controller/attribute-master.controller.js.map +1 -1
- package/dist/module/meta/entity/app-master.entity.d.ts +2 -2
- package/dist/module/meta/entity/app-master.entity.js +4 -4
- package/dist/module/meta/entity/entity-master.entity.js +1 -1
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
- package/dist/module/meta/entity/view-master.entity.js +1 -1
- package/dist/module/meta/entity/view-master.entity.js.map +1 -1
- package/dist/module/meta/entity.module.js +0 -7
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/attribute-master.repository.js +2 -2
- package/dist/module/meta/repository/attribute-master.repository.js.map +1 -1
- package/dist/module/meta/repository/entity-master.repository.js +1 -1
- package/dist/module/meta/repository/entity-master.repository.js.map +1 -1
- package/dist/module/meta/service/attribute-master.service.js +1 -1
- package/dist/module/meta/service/attribute-master.service.js.map +1 -1
- package/dist/module/meta/service/entity-dynamic.service.js +27 -27
- package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
- package/dist/module/meta/service/entity-list.service.js +3 -3
- package/dist/module/meta/service/entity-master.service.js +4 -4
- package/dist/module/meta/service/entity-master.service.js.map +1 -1
- package/dist/module/meta/service/entity-relation.service.js +13 -13
- package/dist/module/meta/service/entity-relation.service.js.map +1 -1
- package/dist/module/meta/service/entity-service-impl.service.js +3 -3
- package/dist/module/meta/service/media-data.service.js +9 -9
- package/dist/module/meta/service/media-data.service.js.map +1 -1
- package/dist/module/meta/service/resolver.service.js +19 -19
- package/dist/module/meta/service/resolver.service.js.map +1 -1
- package/dist/module/module/repository/menu.repository.js +12 -12
- package/dist/module/notification/entity/otp.entity.js +1 -1
- package/dist/module/notification/entity/otp.entity.js.map +1 -1
- package/dist/module/notification/service/notification.service.js +9 -9
- package/dist/module/user/controller/login.controller.js +18 -18
- package/dist/module/user/entity/user-role-mapping.entity.js +1 -1
- package/dist/module/user/entity/user-role-mapping.entity.js.map +1 -1
- package/dist/module/user/service/login.service.js +1 -1
- package/dist/module/user/service/login.service.js.map +1 -1
- package/dist/module/user/service/role.service.js +4 -4
- package/dist/module/user/service/user-session.service.js +4 -4
- package/dist/module/user/service/user-session.service.js.map +1 -1
- package/dist/module/workflow/entity/action-category.entity.d.ts +1 -1
- package/dist/module/workflow/entity/action-category.entity.js +1 -1
- package/dist/module/workflow/entity/action-data.entity.js +1 -1
- package/dist/module/workflow/entity/action-data.entity.js.map +1 -1
- package/dist/module/workflow/entity/action.entity.d.ts +0 -1
- package/dist/module/workflow/entity/action.entity.js +1 -5
- package/dist/module/workflow/entity/action.entity.js.map +1 -1
- package/dist/module/workflow/entity/comm-template.entity.js +1 -1
- package/dist/module/workflow/entity/comm-template.entity.js.map +1 -1
- package/dist/module/workflow/entity/template-attach-mapper.entity.js +1 -1
- package/dist/module/workflow/entity/template-attach-mapper.entity.js.map +1 -1
- package/dist/module/workflow/repository/action-data.repository.js +4 -5
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
- package/dist/module/workflow/repository/action.repository.js +21 -21
- package/dist/module/workflow/repository/action.repository.js.map +1 -1
- package/dist/module/workflow/repository/comm-template.repository.js +7 -7
- package/dist/module/workflow/repository/comm-template.repository.js.map +1 -1
- package/dist/module/workflow/repository/form-master.repository.js +3 -3
- package/dist/module/workflow/repository/form-master.repository.js.map +1 -1
- package/dist/module/workflow/repository/stage-group.repository.js +23 -23
- package/dist/module/workflow/repository/stage-movement.repository.js +17 -17
- package/dist/module/workflow/repository/stage-movement.repository.js.map +1 -1
- package/dist/module/workflow/repository/stage.repository.js +8 -8
- package/dist/module/workflow/repository/task.repository.d.ts +1 -3
- package/dist/module/workflow/repository/task.repository.js +3 -8
- package/dist/module/workflow/repository/task.repository.js.map +1 -1
- package/dist/module/workflow/service/action-template-mapping.service.js +22 -22
- package/dist/module/workflow/service/action.service.js +13 -13
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/module/workflow/service/entity-modification.service.js +6 -6
- package/dist/module/workflow/service/populate-workflow.service.js +8 -8
- package/dist/module/workflow/service/populate-workflow.service.js.map +1 -1
- package/dist/module/workflow/service/stage-group.service.js +6 -6
- package/dist/module/workflow/service/stage-group.service.js.map +1 -1
- package/dist/module/workflow/service/stage.service.js +4 -4
- package/dist/module/workflow/service/stage.service.js.map +1 -1
- package/dist/module/workflow/service/task.service.js +55 -71
- package/dist/module/workflow/service/task.service.js.map +1 -1
- package/dist/module/workflow/service/workflow-list-master.service.js +16 -16
- package/dist/module/workflow/service/workflow-list-master.service.js.map +1 -1
- package/dist/module/workflow/service/workflow-meta.service.js +51 -53
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
- package/dist/module/workflow/service/workflow.service.js +5 -5
- package/dist/module/workflow/service/workflow.service.js.map +1 -1
- package/dist/module/workflow-automation/controller/workflow-automation.controller.d.ts +0 -6
- package/dist/module/workflow-automation/controller/workflow-automation.controller.js +0 -16
- package/dist/module/workflow-automation/controller/workflow-automation.controller.js.map +1 -1
- package/dist/module/workflow-automation/entity/workflow-automation-action.entity.d.ts +1 -1
- package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js +1 -1
- package/dist/module/workflow-automation/entity/workflow-automation.entity.d.ts +0 -2
- package/dist/module/workflow-automation/entity/workflow-automation.entity.js +0 -8
- package/dist/module/workflow-automation/entity/workflow-automation.entity.js.map +1 -1
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.d.ts +1 -1
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.js +1 -1
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.js.map +1 -1
- package/dist/module/workflow-automation/service/workflow-automation.service.d.ts +1 -13
- package/dist/module/workflow-automation/service/workflow-automation.service.js +6 -115
- package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
- package/dist/module/workflow-automation/workflow-automation.module.js +1 -14
- package/dist/module/workflow-automation/workflow-automation.module.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/service/loggingUtil.service.d.ts +2 -9
- package/dist/utils/service/loggingUtil.service.js +14 -65
- package/dist/utils/service/loggingUtil.service.js.map +1 -1
- package/dist/utils/service/reflection-helper.service.js +3 -3
- package/dist/utils/service/reflection-helper.service.js.map +1 -1
- package/dist/utils/utils.module.js +0 -2
- package/dist/utils/utils.module.js.map +1 -1
- package/docs/modules/event-driven-integration-design.md +91 -91
- package/docs/modules/integration.md +250 -250
- package/eslint.config.mjs +34 -34
- package/nest-cli.json +14 -14
- package/package.json +120 -124
- package/server.log +850 -0
- package/src/app.controller.ts +12 -12
- package/src/app.module.ts +52 -60
- package/src/app.service.ts +8 -8
- package/src/config/config.module.ts +17 -18
- package/src/config/database.config.ts +48 -23
- package/src/constant/global.constant.ts +67 -67
- package/src/core.module.ts +81 -81
- package/src/decorators/roles.decorator.ts +7 -7
- package/src/dtos/response.dto.ts +6 -6
- package/src/dtos/response.ts +5 -5
- package/src/index.ts +1 -1
- package/src/module/auth/auth.module.ts +49 -49
- package/src/module/auth/controller/auth.controller.ts +28 -28
- package/src/module/auth/guards/google-auth.guard.ts +9 -9
- package/src/module/auth/guards/jwt.guard.ts +22 -22
- package/src/module/auth/guards/role.guard.ts +68 -68
- package/src/module/auth/services/auth.service.ts +50 -50
- package/src/module/auth/services/jwt.service.ts +11 -11
- package/src/module/auth/strategies/google.strategy.ts +54 -54
- package/src/module/auth/strategies/jwt.strategy.ts +58 -58
- package/src/module/auth/strategies/local.strategy.ts +13 -13
- package/src/module/dashboard/controller/dashboard.controller.ts +36 -36
- package/src/module/dashboard/dashboard.module.ts +21 -21
- package/src/module/dashboard/entity/dashboard_page_data.entity.ts +27 -27
- package/src/module/dashboard/entity/widget_master.entity.ts +18 -18
- package/src/module/dashboard/repository/dashboard.repository.ts +42 -42
- package/src/module/dashboard/service/dashboard.service.ts +73 -73
- package/src/module/dev/dev.module.ts +12 -12
- package/src/module/dev/service/dev.service.ts +7 -7
- package/src/module/enterprise/controller/organization.controller.ts +36 -36
- package/src/module/enterprise/enterprise.module.ts +30 -30
- package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
- package/src/module/enterprise/entity/organization-app-mapping.entity.ts +13 -13
- package/src/module/enterprise/entity/organization.entity.ts +92 -92
- package/src/module/enterprise/repository/enterprise.repository.ts +31 -31
- package/src/module/enterprise/repository/organization.repository.ts +26 -26
- package/src/module/enterprise/repository/school.repository.ts +278 -278
- package/src/module/enterprise/service/brand.service.ts +5 -5
- package/src/module/enterprise/service/enterprise.service.ts +16 -16
- package/src/module/enterprise/service/organization-app-mapping.service.ts +4 -4
- package/src/module/enterprise/service/organization.service.ts +145 -145
- package/src/module/filter/controller/filter.controller.ts +84 -84
- package/src/module/filter/dto/filter-request.dto.ts +38 -38
- package/src/module/filter/entity/saved-filter-detail.entity.ts +41 -41
- package/src/module/filter/entity/saved-filter-master.entity.ts +23 -23
- package/src/module/filter/filter.module.ts +31 -31
- package/src/module/filter/repository/saved-filter.repository.ts +168 -168
- package/src/module/filter/service/filter-evaluator.service.ts +86 -86
- package/src/module/filter/service/filter.service.ts +1034 -1005
- package/src/module/filter/service/saved-filter.service.ts +170 -170
- package/src/module/ics/controller/ics.controller.ts +21 -21
- package/src/module/ics/dto/ics.dto.ts +55 -55
- package/src/module/ics/ics.module.ts +13 -13
- package/src/module/ics/service/ics.service.ts +57 -57
- package/src/module/integration/controller/calender-event.controller.ts +31 -31
- package/src/module/integration/controller/integration.controller.ts +662 -662
- package/src/module/integration/controller/wrapper.controller.ts +37 -37
- package/src/module/integration/dto/create-config.dto.ts +526 -526
- package/src/module/integration/entity/integration-config.entity.ts +112 -112
- package/src/module/integration/entity/integration-entity-mapper.entity.ts +14 -14
- package/src/module/integration/entity/integration-source.entity.ts +17 -17
- package/src/module/integration/entity/user-integration.entity.ts +71 -71
- package/src/module/integration/examples/usage.example.ts +338 -338
- package/src/module/integration/factories/base.factory.ts +7 -7
- package/src/module/integration/factories/email.factory.ts +49 -49
- package/src/module/integration/factories/integration.factory.ts +121 -121
- package/src/module/integration/factories/sms.factory.ts +51 -51
- package/src/module/integration/factories/telephone.factory.ts +41 -41
- package/src/module/integration/factories/whatsapp.factory.ts +56 -56
- package/src/module/integration/integration.module.ts +110 -110
- package/src/module/integration/service/calendar-event.service.ts +118 -118
- package/src/module/integration/service/integration-entity-mapper.service.ts +17 -17
- package/src/module/integration/service/integration-queue.service.ts +229 -229
- package/src/module/integration/service/integration.service.ts +2633 -2633
- package/src/module/integration/service/oauth.service.ts +224 -224
- package/src/module/integration/service/wrapper.service.ts +494 -700
- package/src/module/integration/strategies/email/gmail-api.strategy.ts +280 -280
- package/src/module/integration/strategies/email/outlook-api.strategy.ts +44 -44
- package/src/module/integration/strategies/email/outlook.strategy.ts +64 -64
- package/src/module/integration/strategies/email/sendgrid-api.strategy.ts +260 -260
- package/src/module/integration/strategies/integration.strategy.ts +97 -97
- package/src/module/integration/strategies/sms/gupshup-sms.strategy.ts +146 -146
- package/src/module/integration/strategies/sms/msg91-sms.strategy.ts +164 -164
- package/src/module/integration/strategies/sms/tubelight-sms.strategy.ts +163 -163
- package/src/module/integration/strategies/telephone/ozonetel-voice.strategy.ts +238 -238
- package/src/module/integration/strategies/telephone/tubelight-voice.strategy.ts +210 -210
- package/src/module/integration/strategies/whatsapp/gupshup-whatsapp.strategy.ts +359 -359
- package/src/module/integration/strategies/whatsapp/tubelight-whatsapp.strategy.ts +372 -372
- package/src/module/integration/strategies/whatsapp/whatsapp-cloud.strategy.ts +403 -403
- package/src/module/integration/strategies/whatsapp/whatsapp.strategy.ts +57 -57
- package/src/module/layout/controller/layout.controller.ts +47 -47
- package/src/module/layout/entity/header-items.entity.ts +28 -28
- package/src/module/layout/entity/header-section.entity.ts +19 -19
- package/src/module/layout/layout.module.ts +21 -21
- package/src/module/layout/repository/header-items.repository.ts +18 -18
- package/src/module/layout/repository/header-section.repository.ts +22 -22
- package/src/module/layout/service/header-section.service.ts +25 -25
- package/src/module/layout_preference/controller/layout_preference.controller.ts +73 -73
- package/src/module/layout_preference/entity/layout_preference.entity.ts +28 -28
- package/src/module/layout_preference/layout_preference.module.ts +22 -22
- package/src/module/layout_preference/repository/layout_preference.repository.ts +65 -65
- package/src/module/layout_preference/service/layout_preference.service.ts +191 -191
- package/src/module/lead/controller/lead.controller.ts +30 -30
- package/src/module/lead/lead.module.ts +14 -14
- package/src/module/lead/repository/lead.repository.ts +41 -41
- package/src/module/lead/service/lead.service.ts +54 -54
- package/src/module/listmaster/controller/list-master.controller.ts +230 -230
- package/src/module/listmaster/entity/list-master-items.entity.ts +43 -43
- package/src/module/listmaster/entity/list-master.entity.ts +33 -33
- package/src/module/listmaster/listmaster.module.ts +46 -46
- package/src/module/listmaster/repository/list-master-items.repository.ts +169 -169
- package/src/module/listmaster/repository/list-master.repository.ts +46 -46
- package/src/module/listmaster/service/list-master-engine.ts +19 -19
- package/src/module/listmaster/service/list-master-extension.interface.ts +4 -4
- package/src/module/listmaster/service/list-master-item.service.ts +292 -292
- package/src/module/listmaster/service/list-master-registry.ts +15 -15
- package/src/module/listmaster/service/list-master.service.ts +535 -535
- package/src/module/mapper/controller/field-mapper.controller.ts +76 -76
- package/src/module/mapper/controller/mapper.controller.ts +20 -20
- package/src/module/mapper/dto/field-mapper.dto.ts +14 -14
- package/src/module/mapper/entity/field-lovs.entity.ts +19 -19
- package/src/module/mapper/entity/field-mapper.entity.ts +53 -53
- package/src/module/mapper/entity/mapper.entity.ts +16 -16
- package/src/module/mapper/mapper.module.ts +34 -34
- package/src/module/mapper/repository/field-lovs.repository.ts +35 -35
- package/src/module/mapper/repository/field-mapper.repository.ts +42 -42
- package/src/module/mapper/repository/mapper.repository.ts +15 -15
- package/src/module/mapper/service/field-mapper.service.ts +266 -271
- package/src/module/mapper/service/mapper.service.ts +79 -79
- package/src/module/master/controller/master.controller.ts +74 -74
- package/src/module/master/service/master.service.ts +483 -483
- package/src/module/meta/controller/app-master.controller.ts +38 -38
- package/src/module/meta/controller/attribute-master.controller.ts +66 -74
- package/src/module/meta/controller/entity-dynamic.controller.ts +125 -125
- package/src/module/meta/controller/entity-master.controller.ts +28 -28
- package/src/module/meta/controller/entity-relation.controller.ts +36 -36
- package/src/module/meta/controller/entity.controller.ts +392 -392
- package/src/module/meta/controller/entity.public.controller.ts +75 -75
- package/src/module/meta/controller/media.controller.ts +107 -107
- package/src/module/meta/controller/meta.controller.ts +96 -96
- package/src/module/meta/controller/view-master.controller.ts +86 -86
- package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
- package/src/module/meta/dto/entity-tab.dto.ts +4 -4
- package/src/module/meta/dto/entity-table.dto.ts +9 -9
- package/src/module/meta/entity/app-master.entity.ts +34 -34
- package/src/module/meta/entity/attribute-master.entity.ts +89 -89
- package/src/module/meta/entity/base-entity.entity.ts +75 -75
- package/src/module/meta/entity/entity-master.entity.ts +85 -85
- package/src/module/meta/entity/entity-relation-data.entity.ts +29 -29
- package/src/module/meta/entity/entity-relation.entity.ts +23 -23
- package/src/module/meta/entity/entity-table-column.entity.ts +61 -61
- package/src/module/meta/entity/entity-table.entity.ts +50 -50
- package/src/module/meta/entity/media-data.entity.ts +32 -32
- package/src/module/meta/entity/preference.entity.ts +62 -62
- package/src/module/meta/entity/view-master.entity.ts +41 -41
- package/src/module/meta/entity.module.ts +158 -166
- package/src/module/meta/repository/app-master.repository.ts +20 -20
- package/src/module/meta/repository/attribute-master.repository.ts +118 -118
- package/src/module/meta/repository/entity-master.repository.ts +69 -69
- package/src/module/meta/repository/entity-table-column.repository.ts +39 -39
- package/src/module/meta/repository/entity-table.repository.ts +53 -53
- package/src/module/meta/repository/media-data.repository.ts +50 -50
- package/src/module/meta/repository/preference.repository.ts +20 -20
- package/src/module/meta/repository/user-app-mapping.repository.ts +28 -28
- package/src/module/meta/repository/view-master.repository.ts +42 -42
- package/src/module/meta/service/app-master.service.ts +37 -37
- package/src/module/meta/service/attribute-master.service.ts +126 -126
- package/src/module/meta/service/common.service.ts +9 -9
- package/src/module/meta/service/entity-dynamic.service.ts +819 -819
- package/src/module/meta/service/entity-list.service.ts +205 -205
- package/src/module/meta/service/entity-master.service.ts +169 -169
- package/src/module/meta/service/entity-realation-data.service.ts +9 -9
- package/src/module/meta/service/entity-relation.service.ts +69 -69
- package/src/module/meta/service/entity-service-impl.service.ts +525 -525
- package/src/module/meta/service/entity-table-column.service.ts +39 -39
- package/src/module/meta/service/entity-table.service.ts +150 -150
- package/src/module/meta/service/entity-validation.service.ts +187 -187
- package/src/module/meta/service/entity.service.ts +67 -67
- package/src/module/meta/service/field-group.service.ts +103 -103
- package/src/module/meta/service/media-data.service.ts +507 -507
- package/src/module/meta/service/populate-meta.service.ts +193 -193
- package/src/module/meta/service/preference.service.ts +16 -16
- package/src/module/meta/service/resolver.service.ts +267 -267
- package/src/module/meta/service/section-master.service.ts +104 -104
- package/src/module/meta/service/update-form-json.service.ts +22 -22
- package/src/module/meta/service/user-app-mapping.service.ts +17 -17
- package/src/module/meta/service/view-master.service.ts +127 -127
- package/src/module/microservice-client/microservice-clients.module.ts +13 -13
- package/src/module/microservice-client/service/microservice-client-factory.ts +37 -37
- package/src/module/microservice-client/service/microservice-clients.ts +4 -4
- package/src/module/module/controller/menu.controller.ts +15 -15
- package/src/module/module/controller/module-access.controller.ts +134 -134
- package/src/module/module/entity/menu.entity.ts +43 -43
- package/src/module/module/entity/module-access.entity.ts +25 -25
- package/src/module/module/entity/module-action.entity.ts +17 -17
- package/src/module/module/entity/module.entity.ts +52 -52
- package/src/module/module/module.module.ts +42 -42
- package/src/module/module/repository/menu.repository.ts +184 -184
- package/src/module/module/repository/module-access.repository.ts +344 -344
- package/src/module/module/service/menu.service.ts +82 -82
- package/src/module/module/service/module-access.service.ts +209 -209
- package/src/module/notification/controller/notification.controller.ts +58 -58
- package/src/module/notification/controller/otp.controller.ts +117 -117
- package/src/module/notification/entity/notification.entity.ts +26 -26
- package/src/module/notification/entity/otp.entity.ts +28 -28
- package/src/module/notification/firebase-admin.config.ts +22 -22
- package/src/module/notification/notification.module.ts +69 -69
- package/src/module/notification/repository/otp.repository.ts +27 -27
- package/src/module/notification/service/email.service.ts +127 -127
- package/src/module/notification/service/notification.service.ts +163 -163
- package/src/module/notification/service/otp.service.ts +132 -132
- package/src/module/third-party-module/entity/third-party-api-registry.entity.ts +52 -52
- package/src/module/third-party-module/repository/third-party-api-registry.repository.ts +20 -20
- package/src/module/third-party-module/service/api-registry.service.ts +13 -13
- package/src/module/third-party-module/third-party.module.ts +12 -12
- package/src/module/user/controller/login.controller.ts +197 -197
- package/src/module/user/controller/user.controller.ts +40 -40
- package/src/module/user/dto/create-user.dto.ts +62 -62
- package/src/module/user/dto/update-user.dto.ts +4 -4
- package/src/module/user/entity/role.entity.ts +33 -33
- package/src/module/user/entity/user-role-mapping.entity.ts +38 -38
- package/src/module/user/entity/user-session.entity.ts +73 -73
- package/src/module/user/entity/user.entity.ts +59 -59
- package/src/module/user/repository/role.repository.ts +96 -96
- package/src/module/user/repository/user-role-mapping.repository.ts +126 -126
- package/src/module/user/repository/user.repository.ts +50 -50
- package/src/module/user/repository/userSession.repository.ts +33 -33
- package/src/module/user/service/login.service.ts +304 -304
- package/src/module/user/service/role.service.ts +189 -189
- package/src/module/user/service/user-role-mapping.service.ts +98 -98
- package/src/module/user/service/user-session.service.ts +168 -168
- package/src/module/user/service/user.service.ts +365 -365
- package/src/module/user/user.module.ts +65 -65
- package/src/module/workflow/controller/action-category.controller.ts +54 -54
- package/src/module/workflow/controller/action-resource-mapping.controller.ts +23 -23
- package/src/module/workflow/controller/action-template-mapping.controller.ts +35 -35
- package/src/module/workflow/controller/action.controller.ts +111 -111
- package/src/module/workflow/controller/activity-log.controller.ts +55 -55
- package/src/module/workflow/controller/comm-template.controller.ts +43 -43
- package/src/module/workflow/controller/entity-modification.controller.ts +35 -35
- package/src/module/workflow/controller/form-master.controller.ts +43 -43
- package/src/module/workflow/controller/stage-group.controller.ts +48 -48
- package/src/module/workflow/controller/stage.controller.ts +50 -50
- package/src/module/workflow/controller/task.controller.ts +77 -77
- package/src/module/workflow/controller/workflow-list-master.controller.ts +44 -44
- package/src/module/workflow/controller/workflow-meta.controller.ts +80 -80
- package/src/module/workflow/controller/workflow.controller.ts +67 -67
- package/src/module/workflow/entity/action-category.entity.ts +38 -38
- package/src/module/workflow/entity/action-data.entity.ts +55 -55
- package/src/module/workflow/entity/action-resources-mapping.entity.ts +29 -29
- package/src/module/workflow/entity/action-template-mapping.entity.ts +17 -17
- package/src/module/workflow/entity/action.entity.ts +50 -53
- package/src/module/workflow/entity/activity-log.entity.ts +43 -43
- package/src/module/workflow/entity/comm-template.entity.ts +43 -43
- package/src/module/workflow/entity/entity-modification.entity.ts +38 -38
- package/src/module/workflow/entity/form.entity.ts +25 -25
- package/src/module/workflow/entity/stage-action-mapping.entity.ts +17 -17
- package/src/module/workflow/entity/stage-group.entity.ts +23 -23
- package/src/module/workflow/entity/stage-movement-data.entity.ts +38 -38
- package/src/module/workflow/entity/stage.entity.ts +20 -20
- package/src/module/workflow/entity/task-data.entity.ts +88 -88
- package/src/module/workflow/entity/template-attach-mapper.entity.ts +30 -30
- package/src/module/workflow/entity/workflow-data.entity.ts +11 -11
- package/src/module/workflow/entity/workflow-level-mapping.entity.ts +18 -18
- package/src/module/workflow/entity/workflow.entity.ts +20 -20
- package/src/module/workflow/repository/action-category.repository.ts +79 -79
- package/src/module/workflow/repository/action-data.repository.ts +333 -334
- package/src/module/workflow/repository/action.repository.ts +323 -323
- package/src/module/workflow/repository/activity-log.repository.ts +148 -148
- package/src/module/workflow/repository/comm-template.repository.ts +149 -149
- package/src/module/workflow/repository/form-master.repository.ts +59 -59
- package/src/module/workflow/repository/stage-group.repository.ts +176 -176
- package/src/module/workflow/repository/stage-movement.repository.ts +244 -244
- package/src/module/workflow/repository/stage.repository.ts +172 -172
- package/src/module/workflow/repository/task.repository.ts +127 -134
- package/src/module/workflow/repository/workflow.repository.ts +42 -42
- package/src/module/workflow/service/action-category.service.ts +33 -33
- package/src/module/workflow/service/action-data.service.ts +62 -62
- package/src/module/workflow/service/action-resources-mapping.service.ts +10 -10
- package/src/module/workflow/service/action-template-mapping.service.ts +106 -106
- package/src/module/workflow/service/action.service.ts +279 -279
- package/src/module/workflow/service/activity-log.service.ts +107 -107
- package/src/module/workflow/service/comm-template.service.ts +180 -180
- package/src/module/workflow/service/entity-modification.service.ts +67 -67
- package/src/module/workflow/service/form-master.service.ts +35 -35
- package/src/module/workflow/service/populate-workflow.service.ts +303 -303
- package/src/module/workflow/service/stage-action-mapping.service.ts +5 -5
- package/src/module/workflow/service/stage-group.service.ts +319 -319
- package/src/module/workflow/service/stage.service.ts +199 -199
- package/src/module/workflow/service/task.service.ts +560 -575
- package/src/module/workflow/service/workflow-list-master.service.ts +60 -60
- package/src/module/workflow/service/workflow-meta.service.ts +640 -654
- package/src/module/workflow/service/workflow.service.ts +205 -205
- package/src/module/workflow/workflow.module.ts +176 -176
- package/src/module/workflow-automation/controller/workflow-automation.controller.ts +21 -43
- package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +26 -26
- package/src/module/workflow-automation/entity/workflow-automation.entity.ts +35 -40
- package/src/module/workflow-automation/interface/action.decorator.ts +7 -7
- package/src/module/workflow-automation/interface/action.interface.ts +5 -5
- package/src/module/workflow-automation/service/action-registery.service.ts +35 -35
- package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +214 -214
- package/src/module/workflow-automation/service/workflow-automation.service.ts +347 -508
- package/src/module/workflow-automation/workflow-automation.module.ts +34 -47
- package/src/resources/dev.properties.yaml +31 -30
- package/src/resources/local.properties.yaml +27 -27
- package/src/resources/properties.module.ts +12 -12
- package/src/resources/properties.yaml.ts +11 -11
- package/src/resources/uat.properties.yaml +31 -31
- package/src/table.config.ts +126 -126
- package/src/utils/dto/excel-data.dto.ts +14 -14
- package/src/utils/dto/excelsheet-data.dto.ts +5 -5
- package/src/utils/service/base64util.service.ts +18 -18
- package/src/utils/service/clockIDGenUtil.service.ts +21 -21
- package/src/utils/service/codeGenerator.service.ts +22 -22
- package/src/utils/service/dateUtil.service.ts +17 -17
- package/src/utils/service/encryptUtil.service.ts +97 -97
- package/src/utils/service/excel-helper.service.ts +72 -72
- package/src/utils/service/excelUtil.service.ts +15 -15
- package/src/utils/service/file-util.service.ts +11 -11
- package/src/utils/service/json-util.service.ts +23 -23
- package/src/utils/service/loggingUtil.service.ts +34 -88
- package/src/utils/service/reflection-helper.service.ts +62 -62
- package/src/utils/service/wbsCodeGen.service.ts +8 -8
- package/src/utils/utils.module.ts +25 -27
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +24 -24
- package/dist/config/bull.config.d.ts +0 -10
- package/dist/config/bull.config.js +0 -66
- package/dist/config/bull.config.js.map +0 -1
- package/dist/module/meta/repository/entity-attribute-update.repository.d.ts +0 -6
- package/dist/module/meta/repository/entity-attribute-update.repository.js +0 -44
- package/dist/module/meta/repository/entity-attribute-update.repository.js.map +0 -1
- package/dist/module/meta/service/entity-attribute-update.service.d.ts +0 -7
- package/dist/module/meta/service/entity-attribute-update.service.js +0 -36
- package/dist/module/meta/service/entity-attribute-update.service.js.map +0 -1
- package/dist/module/workflow-automation/service/schedule-handler.service.d.ts +0 -16
- package/dist/module/workflow-automation/service/schedule-handler.service.js +0 -109
- package/dist/module/workflow-automation/service/schedule-handler.service.js.map +0 -1
- package/dist/module/workflow-schedule/constants/schedule.constants.d.ts +0 -27
- package/dist/module/workflow-schedule/constants/schedule.constants.js +0 -31
- package/dist/module/workflow-schedule/constants/schedule.constants.js.map +0 -1
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.d.ts +0 -83
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js +0 -220
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js.map +0 -1
- package/dist/module/workflow-schedule/dto/create-schedule.dto.d.ts +0 -32
- package/dist/module/workflow-schedule/dto/create-schedule.dto.js +0 -163
- package/dist/module/workflow-schedule/dto/create-schedule.dto.js.map +0 -1
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.d.ts +0 -35
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js +0 -124
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js.map +0 -1
- package/dist/module/workflow-schedule/dto/update-schedule.dto.d.ts +0 -19
- package/dist/module/workflow-schedule/dto/update-schedule.dto.js +0 -106
- package/dist/module/workflow-schedule/dto/update-schedule.dto.js.map +0 -1
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.d.ts +0 -30
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js +0 -113
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js.map +0 -1
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.d.ts +0 -34
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js +0 -118
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js.map +0 -1
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.d.ts +0 -44
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js +0 -3
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js.map +0 -1
- package/dist/module/workflow-schedule/processors/schedule.processor.d.ts +0 -31
- package/dist/module/workflow-schedule/processors/schedule.processor.js +0 -409
- package/dist/module/workflow-schedule/processors/schedule.processor.js.map +0 -1
- package/dist/module/workflow-schedule/service/workflow-schedule.service.d.ts +0 -44
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js +0 -434
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js.map +0 -1
- package/dist/module/workflow-schedule/workflow-schedule.module.d.ts +0 -2
- package/dist/module/workflow-schedule/workflow-schedule.module.js +0 -44
- package/dist/module/workflow-schedule/workflow-schedule.module.js.map +0 -1
- package/src/config/bull.config.ts +0 -69
- package/src/module/meta/repository/entity-attribute-update.repository.ts +0 -44
- package/src/module/meta/service/entity-attribute-update.service.ts +0 -29
- package/src/module/workflow-automation/service/schedule-handler.service.ts +0 -150
- package/src/module/workflow-schedule/INSTALLATION.md +0 -244
- package/src/module/workflow-schedule/README.md +0 -422
- package/src/module/workflow-schedule/constants/schedule.constants.ts +0 -48
- package/src/module/workflow-schedule/controller/workflow-schedule.controller.ts +0 -255
- package/src/module/workflow-schedule/docs/CLAUDE_CODE_GUIDE.md +0 -510
- package/src/module/workflow-schedule/docs/CLAUDE_CODE_PROMPT.md +0 -362
- package/src/module/workflow-schedule/docs/RUN_CLAUDE_CODE.sh +0 -68
- package/src/module/workflow-schedule/dto/create-schedule.dto.ts +0 -147
- package/src/module/workflow-schedule/dto/get-execution-logs.dto.ts +0 -119
- package/src/module/workflow-schedule/dto/update-schedule.dto.ts +0 -96
- package/src/module/workflow-schedule/entities/scheduled-workflow.entity.ts +0 -148
- package/src/module/workflow-schedule/entities/workflow-execution-log.entity.ts +0 -154
- package/src/module/workflow-schedule/interfaces/schedule-job-data.interface.ts +0 -53
- package/src/module/workflow-schedule/processors/schedule.processor.ts +0 -584
- package/src/module/workflow-schedule/service/workflow-schedule.service.ts +0 -600
- package/src/module/workflow-schedule/workflow-schedule.module.ts +0 -43
|
@@ -21,26 +21,26 @@ let ActionTemplateMappingService = class ActionTemplateMappingService extends en
|
|
|
21
21
|
async getTemplateByMode(stage_id, action_id, loggedInUser, mode) {
|
|
22
22
|
let stageAction = [];
|
|
23
23
|
if (action_id != 0) {
|
|
24
|
-
stageAction = await this.dataSource.query(`
|
|
25
|
-
SELECT id FROM frm_wf_stage_action_mapping
|
|
26
|
-
WHERE action_id =
|
|
24
|
+
stageAction = await this.dataSource.query(`
|
|
25
|
+
SELECT id FROM frm_wf_stage_action_mapping
|
|
26
|
+
WHERE action_id = $1
|
|
27
27
|
`, [action_id]);
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
let modeId = mode;
|
|
31
31
|
if (!modeId) {
|
|
32
|
-
const rows = await this.dataSource.query(`
|
|
33
|
-
SELECT id
|
|
34
|
-
FROM frm_list_master_items
|
|
35
|
-
WHERE organization_id =
|
|
36
|
-
AND listtype = "MOD" AND code =
|
|
32
|
+
const rows = await this.dataSource.query(`
|
|
33
|
+
SELECT id
|
|
34
|
+
FROM frm_list_master_items
|
|
35
|
+
WHERE organization_id = $1
|
|
36
|
+
AND listtype = "MOD" AND code = $2
|
|
37
37
|
`, [loggedInUser.organization_id, 'email']);
|
|
38
38
|
modeId = rows?.[0]?.id ?? 0;
|
|
39
39
|
}
|
|
40
|
-
const commTemplates = await this.dataSource.query(`
|
|
41
|
-
SELECT code as value, name as label , id
|
|
42
|
-
FROM frm_wf_comm_template
|
|
43
|
-
WHERE mode =
|
|
40
|
+
const commTemplates = await this.dataSource.query(`
|
|
41
|
+
SELECT code as value, name as label , id
|
|
42
|
+
FROM frm_wf_comm_template
|
|
43
|
+
WHERE mode = $1 AND organization_id = $2 AND level_type = $3 AND level_id = $4 AND status IN (SELECT id FROM frm_list_master_items WHERE code = "STATUS_ACTIVE" AND organization_id = $5)
|
|
44
44
|
`, [
|
|
45
45
|
modeId,
|
|
46
46
|
loggedInUser.organization_id,
|
|
@@ -54,23 +54,23 @@ let ActionTemplateMappingService = class ActionTemplateMappingService extends en
|
|
|
54
54
|
return [];
|
|
55
55
|
const stgActMappingId = stageAction[0].id;
|
|
56
56
|
if (!mode) {
|
|
57
|
-
const getModeFromAction = await this.dataSource.query(`
|
|
58
|
-
SELECT mode FROM frm_wf_action
|
|
59
|
-
WHERE id =
|
|
57
|
+
const getModeFromAction = await this.dataSource.query(`
|
|
58
|
+
SELECT mode FROM frm_wf_action
|
|
59
|
+
WHERE id = $1
|
|
60
60
|
`, [action_id]);
|
|
61
61
|
mode = getModeFromAction[0]?.mode;
|
|
62
62
|
}
|
|
63
|
-
const templates = await this.dataSource.query(`
|
|
64
|
-
SELECT template_code FROM frm_wf_action_resources_mapping
|
|
65
|
-
WHERE stg_act_mapping_id =
|
|
63
|
+
const templates = await this.dataSource.query(`
|
|
64
|
+
SELECT template_code FROM frm_wf_action_resources_mapping
|
|
65
|
+
WHERE stg_act_mapping_id = $1
|
|
66
66
|
`, [stgActMappingId]);
|
|
67
67
|
const templateCodes = templates.map((t) => t.template_code);
|
|
68
68
|
if (!templateCodes.length)
|
|
69
69
|
return [];
|
|
70
|
-
const commTemplates = await this.dataSource.query(`
|
|
71
|
-
SELECT code as value, name as label , id
|
|
72
|
-
FROM frm_wf_comm_template
|
|
73
|
-
WHERE code IN (
|
|
70
|
+
const commTemplates = await this.dataSource.query(`
|
|
71
|
+
SELECT code as value, name as label , id
|
|
72
|
+
FROM frm_wf_comm_template
|
|
73
|
+
WHERE code IN ($1) AND mode = $2 AND organization_id = $3 AND level_type = $4 AND level_id = $5 AND status IN (SELECT id FROM frm_list_master_items WHERE code = "STATUS_ACTIVE" AND organization_id = $6)
|
|
74
74
|
`, [
|
|
75
75
|
templateCodes,
|
|
76
76
|
mode,
|
|
@@ -25,12 +25,12 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
25
25
|
if (!actionData) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
-
const result = await this.dataSource.query(`SELECT template_code, form_id
|
|
29
|
-
FROM frm_wf_action_resources_mapping
|
|
30
|
-
WHERE stg_act_mapping_id IN (
|
|
31
|
-
SELECT id
|
|
32
|
-
FROM frm_wf_stage_action_mapping
|
|
33
|
-
WHERE action_id =
|
|
28
|
+
const result = await this.dataSource.query(`SELECT template_code, form_id
|
|
29
|
+
FROM frm_wf_action_resources_mapping
|
|
30
|
+
WHERE stg_act_mapping_id IN (
|
|
31
|
+
SELECT id
|
|
32
|
+
FROM frm_wf_stage_action_mapping
|
|
33
|
+
WHERE action_id = $1 AND entity_type = 'WFSA'
|
|
34
34
|
)`, [actionData.id]);
|
|
35
35
|
const templates = result
|
|
36
36
|
.filter((t) => t.template_code !== null)
|
|
@@ -69,7 +69,7 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
69
69
|
await super.createEntity(resourceMapping, loggedInUser);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id =
|
|
72
|
+
await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = $1 AND type = 'form'`, [stageActionMappingData.id]);
|
|
73
73
|
if (actionData.form) {
|
|
74
74
|
const resourceMapping = {
|
|
75
75
|
stg_act_mapping_id: stageActionMappingData.id,
|
|
@@ -89,7 +89,7 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
89
89
|
if (!action) {
|
|
90
90
|
throw new Error('Action not found or could not be updated');
|
|
91
91
|
}
|
|
92
|
-
const stageMapID = await this.dataSource.query(`SELECT id FROM frm_wf_stage_action_mapping WHERE action_id =
|
|
92
|
+
const stageMapID = await this.dataSource.query(`SELECT id FROM frm_wf_stage_action_mapping WHERE action_id = $1 AND entity_type = 'WFSA'`, [action.id]);
|
|
93
93
|
let stageActionMappingData;
|
|
94
94
|
if (stageMapID.length > 0) {
|
|
95
95
|
const stageActionMapping = {
|
|
@@ -109,7 +109,7 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
109
109
|
};
|
|
110
110
|
stageActionMappingData = await super.createEntity(newStageMapping, loggedInUser);
|
|
111
111
|
}
|
|
112
|
-
await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id =
|
|
112
|
+
await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = $1 AND type = 'template'`, [stageActionMappingData.id]);
|
|
113
113
|
if (Array.isArray(template) && template.length > 0) {
|
|
114
114
|
for (let i = 0; i < template.length; i++) {
|
|
115
115
|
const templateCode = template[i];
|
|
@@ -123,7 +123,7 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
123
123
|
console.log(res);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id =
|
|
126
|
+
await this.dataSource.query(`DELETE FROM frm_wf_action_resources_mapping WHERE stg_act_mapping_id = $1 AND type = 'form'`, [stageActionMappingData.id]);
|
|
127
127
|
if (form) {
|
|
128
128
|
const resourceMapping = {
|
|
129
129
|
stg_act_mapping_id: stageActionMappingData.id,
|
|
@@ -136,9 +136,9 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
136
136
|
return action;
|
|
137
137
|
}
|
|
138
138
|
async deleteEntity(entityType, id, loggedInUser) {
|
|
139
|
-
await this.dataSource.query(`DELETE FROM frm_wf_action_template_mapping WHERE stg_act_mapping_id IN (SELECT
|
|
140
|
-
id FROM frm_wf_stage_action_mapping WHERE action_id =
|
|
141
|
-
await this.dataSource.query(`DELETE FROM frm_wf_stage_action_mapping WHERE action_id =
|
|
139
|
+
await this.dataSource.query(`DELETE FROM frm_wf_action_template_mapping WHERE stg_act_mapping_id IN (SELECT
|
|
140
|
+
id FROM frm_wf_stage_action_mapping WHERE action_id = $1 AND entity_type = 'WFSA')`, [id]);
|
|
141
|
+
await this.dataSource.query(`DELETE FROM frm_wf_stage_action_mapping WHERE action_id = $1 AND entity_type ='WFSA'`, [id]);
|
|
142
142
|
const deleteAction = await super.deleteEntity(entityType, id, loggedInUser);
|
|
143
143
|
return deleteAction;
|
|
144
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AAEjE,gGAAwF;AAExF,qCAAgE;AAChE,uEAAmE;AAI5D,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,+CAAiB;IAClD,YACmB,UAAsB,EACtB,gBAAkC;QAEnD,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;IAGrD,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,UAAkB,EAClB,EAAU,EACV,YAAY;QAEZ,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAE3E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACxC;;;;;;KAMD,EACC,CAAC,UAAU,CAAC,EAAE,CAAC,CAChB,CAAC;QAEF,MAAM,SAAS,GAAG,MAAM;aACrB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,IAAI,CAAC;aACvC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;QAE/B,MAAM,IAAI,GAAG,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CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;gBAC/D,CAAC;gBAED,MAAM,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACzB,
|
|
1
|
+
{"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AAEjE,gGAAwF;AAExF,qCAAgE;AAChE,uEAAmE;AAI5D,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,+CAAiB;IAClD,YACmB,UAAsB,EACtB,gBAAkC;QAEnD,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;IAGrD,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,UAAkB,EAClB,EAAU,EACV,YAAY;QAEZ,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAE3E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACxC;;;;;;KAMD,EACC,CAAC,UAAU,CAAC,EAAE,CAAC,CAChB,CAAC;QAEF,MAAM,SAAS,GAAG,MAAM;aACrB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,IAAI,CAAC;aACvC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;QAE/B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;QAEpD,OAAO;YACL,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,QAAgB,EAChB,gBAAwB,EACxB,kBAA0B;QAE1B,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QACzC,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACpC,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,CACnB,CAAC;IACJ,CAAC;CACF,CAAA;AA7QY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAGoB,oBAAU;QACJ,oCAAgB;GAH1C,aAAa,CA6QzB"}
|
|
@@ -24,17 +24,17 @@ let EntityModificationService = class EntityModificationService extends entity_s
|
|
|
24
24
|
if (!mapped_entity_type || !mapped_entity_id || !attribute_key) {
|
|
25
25
|
throw new common_1.BadRequestException('Missing required modification data: mapped_entity_type, mapped_entity_id, or attribute_key');
|
|
26
26
|
}
|
|
27
|
-
const [entityMeta] = await this.dataSource.query(`
|
|
28
|
-
SELECT db_table_name
|
|
29
|
-
FROM frm_entity_master
|
|
30
|
-
WHERE mapped_entity_type =
|
|
27
|
+
const [entityMeta] = await this.dataSource.query(`
|
|
28
|
+
SELECT db_table_name
|
|
29
|
+
FROM frm_entity_master
|
|
30
|
+
WHERE mapped_entity_type = $1 AND organization_id = $2
|
|
31
31
|
`, [mapped_entity_type, organization_id]);
|
|
32
32
|
if (!entityMeta || !entityMeta.db_table_name) {
|
|
33
33
|
throw new common_1.NotFoundException('Entity metadata not found in frm_entity_master');
|
|
34
34
|
}
|
|
35
35
|
const tableName = entityMeta.db_table_name;
|
|
36
|
-
const [entityRow] = await this.dataSource.query(`
|
|
37
|
-
SELECT * FROM ${tableName} WHERE id =
|
|
36
|
+
const [entityRow] = await this.dataSource.query(`
|
|
37
|
+
SELECT * FROM ${tableName} WHERE id = $1
|
|
38
38
|
`, [mapped_entity_id]);
|
|
39
39
|
if (!entityRow) {
|
|
40
40
|
throw new common_1.NotFoundException(`No record found in ${tableName} with ID ${mapped_entity_id}`);
|
|
@@ -32,7 +32,7 @@ let PopulateWorkflowService = class PopulateWorkflowService extends entity_servi
|
|
|
32
32
|
this.actionService = actionService;
|
|
33
33
|
}
|
|
34
34
|
async populateWorkflowData(organization_id, loggedInUser) {
|
|
35
|
-
let statusRow = await this.dataSource.query(`SELECT * FROM frm_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id =
|
|
35
|
+
let statusRow = await this.dataSource.query(`SELECT * FROM frm_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = $1`, [organization_id]);
|
|
36
36
|
if (statusRow.length === 0) {
|
|
37
37
|
statusRow = await this.dataSource.query(`SELECT * FROM frm_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = -1`);
|
|
38
38
|
}
|
|
@@ -75,7 +75,7 @@ let PopulateWorkflowService = class PopulateWorkflowService extends entity_servi
|
|
|
75
75
|
entity_type: 'WRFW',
|
|
76
76
|
status: statusValue,
|
|
77
77
|
}, loggedInUser);
|
|
78
|
-
await this.dataSource.query(`INSERT INTO frm_wf_level_mapping (workflow_id, mapped_level_id, mapped_level_type) VALUES (
|
|
78
|
+
await this.dataSource.query(`INSERT INTO frm_wf_level_mapping (workflow_id, mapped_level_id, mapped_level_type) VALUES ($1, $2, $3)`, [newWf.id, organization_id, 'ORG']);
|
|
79
79
|
workflowIdMap[id] = newWf.id;
|
|
80
80
|
}
|
|
81
81
|
const stageGroupIdMap = {};
|
|
@@ -109,11 +109,11 @@ let PopulateWorkflowService = class PopulateWorkflowService extends entity_servi
|
|
|
109
109
|
}, loggedInUser);
|
|
110
110
|
stageIdMap[id] = newStage.id;
|
|
111
111
|
stageToStageGroupMap[id] = stage_group_id;
|
|
112
|
-
const stageIds = await this.dataSource.query(`SELECT action_id FROM frm_wf_stage_action_mapping WHERE stage_id =
|
|
112
|
+
const stageIds = await this.dataSource.query(`SELECT action_id FROM frm_wf_stage_action_mapping WHERE stage_id = $1`, [id]);
|
|
113
113
|
const actionIds = stageIds.map((item) => item.action_id);
|
|
114
114
|
let actions = [];
|
|
115
115
|
if (actionIds.length > 0) {
|
|
116
|
-
actions = await this.dataSource.query(`SELECT * FROM frm_wf_action WHERE id IN (
|
|
116
|
+
actions = await this.dataSource.query(`SELECT * FROM frm_wf_action WHERE id IN ($1)`, [actionIds]);
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
119
|
actions = [];
|
|
@@ -122,15 +122,15 @@ let PopulateWorkflowService = class PopulateWorkflowService extends entity_servi
|
|
|
122
122
|
for (const row of actions) {
|
|
123
123
|
const { id, created_date, modified_date, workflow_id, ...rest } = row;
|
|
124
124
|
const newWorkflowId = workflowIdMap[workflow_id];
|
|
125
|
-
const [oldIsMandatory] = await this.dataSource.query(`SELECT code FROM frm_list_master_items WHERE id =
|
|
126
|
-
const newIsMandatoryList = await this.dataSource.query(`SELECT id, code FROM frm_list_master_items WHERE organization_id =
|
|
125
|
+
const [oldIsMandatory] = await this.dataSource.query(`SELECT code FROM frm_list_master_items WHERE id = $1`, [rest.action_requirement]);
|
|
126
|
+
const newIsMandatoryList = await this.dataSource.query(`SELECT id, code FROM frm_list_master_items WHERE organization_id = $1 AND listtype = 'ACRQ'`, [organization_id]);
|
|
127
127
|
console.log(`Populating action for stage ${newStage.id} in workflow ${newWorkflowId}`);
|
|
128
128
|
console.log(`Old is_mandatory code: ${oldIsMandatory?.code}`);
|
|
129
129
|
console.log(`New is_mandatory list:`, newIsMandatoryList);
|
|
130
130
|
const matchedNewMandatory = newIsMandatoryList.find((item) => item.code === oldIsMandatory?.code);
|
|
131
131
|
console.log(`Matched new mandatory item:`, matchedNewMandatory);
|
|
132
|
-
const formActionCategory = await this.dataSource.query(`SELECT id FROM frm_wf_action_category WHERE id =
|
|
133
|
-
const formViewMaster = await this.dataSource.query(`SELECT id FROM frm_entity_view WHERE code = "LEAD_FORM" and organization_id =
|
|
132
|
+
const formActionCategory = await this.dataSource.query(`SELECT id FROM frm_wf_action_category WHERE id = $1 and is_form = 1`, [row.action_category]);
|
|
133
|
+
const formViewMaster = await this.dataSource.query(`SELECT id FROM frm_entity_view WHERE code = "LEAD_FORM" and organization_id = $1`, [organization_id]);
|
|
134
134
|
await this.actionService.createEntity({
|
|
135
135
|
...rest,
|
|
136
136
|
stage_id: newStage.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"populate-workflow.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/populate-workflow.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,qCAAqC;AACrC,sFAAiF;AACjF,2CAAoD;AACpD,gGAAwF;AACxF,yDAAqD;AAErD,+DAA0D;AAC1D,mDAA+C;AAC/C,qDAAiD;AAG1C,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,+CAAiB;IAC5D,YACmB,mBAAwC,EACxC,UAAsB,EAEtB,eAAgC,EAEhC,iBAAoC,EAEpC,YAA0B,EAE1B,aAA4B;QAE7C,KAAK,EAAE,CAAC;QAXS,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,eAAU,GAAV,UAAU,CAAY;QAEtB,oBAAe,GAAf,eAAe,CAAiB;QAEhC,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEpC,iBAAY,GAAZ,YAAY,CAAc;QAE1B,kBAAa,GAAb,aAAa,CAAe;IAG/C,CAAC;IAwDD,KAAK,CAAC,oBAAoB,CAAC,eAAuB,EAAE,YAAsB;QACxE,IAAI,SAAS,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACzC,
|
|
1
|
+
{"version":3,"file":"populate-workflow.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/populate-workflow.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,qCAAqC;AACrC,sFAAiF;AACjF,2CAAoD;AACpD,gGAAwF;AACxF,yDAAqD;AAErD,+DAA0D;AAC1D,mDAA+C;AAC/C,qDAAiD;AAG1C,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,+CAAiB;IAC5D,YACmB,mBAAwC,EACxC,UAAsB,EAEtB,eAAgC,EAE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M,EAAC,mBAAmB,CAAC,CAAA;IAE3B,WAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;IAEtB,WAAA,IAAA,eAAM,EAAC,eAAe,CAAC,CAAA;qCARc,2CAAmB;QAC5B,oBAAU;QAEL,kCAAe;QAEb,uCAAiB;QAEtB,4BAAY;QAEX,8BAAa;GAXpC,uBAAuB,CAkSnC"}
|
|
@@ -38,9 +38,9 @@ let StageGroupService = class StageGroupService extends entity_service_impl_serv
|
|
|
38
38
|
}
|
|
39
39
|
async getAllStageGroup(workflow_id, organization_id) {
|
|
40
40
|
const allStageGroup = await this.stageGroupRepository.getAllStageGroup(workflow_id, organization_id);
|
|
41
|
-
const statusListMaster = await this.dataSource.query(`SELECT id, name
|
|
42
|
-
FROM frm_list_master_items
|
|
43
|
-
WHERE listtype = 'STS' AND organization_id =
|
|
41
|
+
const statusListMaster = await this.dataSource.query(`SELECT id, name
|
|
42
|
+
FROM frm_list_master_items
|
|
43
|
+
WHERE listtype = 'STS' AND organization_id = $1`, [organization_id]);
|
|
44
44
|
const statusMap = new Map(statusListMaster.map((s) => [String(s.id), s.name]));
|
|
45
45
|
for (const stage of allStageGroup) {
|
|
46
46
|
stage.status = statusMap.get(String(stage.status));
|
|
@@ -57,9 +57,9 @@ let StageGroupService = class StageGroupService extends entity_service_impl_serv
|
|
|
57
57
|
});
|
|
58
58
|
let stage_group_data = await this.stageMovementRepo.query(`SELECT * FROM frm_wf_stage_group WHERE id = ?`, [stage_movement_data[0].stage_group_id]);
|
|
59
59
|
let leadStatus = null;
|
|
60
|
-
const leadData = await this.dataSource.query(`SELECT lead_status FROM crm_lead WHERE id =
|
|
60
|
+
const leadData = await this.dataSource.query(`SELECT lead_status FROM crm_lead WHERE id = $1`, [lead_id]);
|
|
61
61
|
if (leadData.length > 0 && leadData[0].lead_status != null) {
|
|
62
|
-
const leadStatusResolved = await this.dataSource.query(`SELECT name FROM frm_list_master_items WHERE id =
|
|
62
|
+
const leadStatusResolved = await this.dataSource.query(`SELECT name FROM frm_list_master_items WHERE id = $1 AND organization_id = $2`, [leadData[0].lead_status, loggedInUser.organization_id]);
|
|
63
63
|
if (leadStatusResolved.length > 0) {
|
|
64
64
|
leadStatus = leadStatusResolved[0].name;
|
|
65
65
|
}
|
|
@@ -185,7 +185,7 @@ let StageGroupService = class StageGroupService extends entity_service_impl_serv
|
|
|
185
185
|
return await super.getEntityData(entityType, id, loggedInUser);
|
|
186
186
|
}
|
|
187
187
|
async deleteEntity(entityType, id, loggedInUser) {
|
|
188
|
-
const getAllStage = await this.dataSource.query(`SELECT id FROM frm_wf_stage WHERE stage_group_id =
|
|
188
|
+
const getAllStage = await this.dataSource.query(`SELECT id FROM frm_wf_stage WHERE stage_group_id = $1 AND level_id = $2 AND level_type = $3`, [id, loggedInUser.level_id, loggedInUser.level_type]);
|
|
189
189
|
if (getAllStage.length > 0) {
|
|
190
190
|
for (const stage of getAllStage) {
|
|
191
191
|
await this.stageService.deleteEntity('WFS', stage.id, loggedInUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage-group.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/stage-group.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAAyE;AACzE,gGAAwF;AACxF,iFAA4E;AAG5E,mDAA+C;AAC/C,qCAAiD;AACjD,2FAAqF;AACrF,6CAAmD;AACnD,qFAAyE;AACzE,iCAAiC;AACjC,8EAA8E;AAC9E,iCAA0B;AAC1B,2CAA+C;AAGxC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,+CAAiB;IACtD,YACmB,oBAA0C,EAE1C,YAA0B,EAC1B,UAAsB,EAEtB,wBAAgE,EAEhE,iBAAgD,EAChD,gBAAkC,EAClC,aAA4B;QAE7C,KAAK,EAAE,CAAC;QAXS,yBAAoB,GAApB,oBAAoB,CAAsB;QAE1C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAY;QAEtB,6BAAwB,GAAxB,wBAAwB,CAAwC;QAEhE,sBAAiB,GAAjB,iBAAiB,CAA+B;QAChD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,kBAAa,GAAb,aAAa,CAAe;IAG/C,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,WAAmB,EAAE,eAAuB;QACjE,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CACpE,WAAW,EACX,eAAe,CAChB,CAAC;QACF,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAClD;;
|
|
1
|
+
{"version":3,"file":"stage-group.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/stage-group.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAAyE;AACzE,gGAAwF;AACxF,iFAA4E;AAG5E,mDAA+C;AAC/C,qCAAiD;AACjD,2FAAqF;AACrF,6CAAmD;AACnD,qFAAyE;AACzE,iCAAiC;AACjC,8EAA8E;AAC9E,iCAA0B;AAC1B,2CAA+C;AAGxC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,+CAAiB;IACtD,YACmB,oBAA0C,EAE1C,YAA0B,EAC1B,UAAsB,EAEtB,wBAAgE,EAEhE,iBAAgD,EAChD,gBAAkC,EAClC,aAA4B;QAE7C,KAAK,EAAE,CAAC;QAXS,yBAAoB,GAApB,oBAAoB,CAAsB;QAE1C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAY;QAEtB,6BAAwB,GAAxB,wBAAwB,CAAwC;QAEhE,sBAAiB,GAAjB,iBAAiB,CAA+B;QAChD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,kBAAa,GAAb,aAAa,CAAe;IAG/C,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,WAAmB,EAAE,eAAuB;QACjE,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CACp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CAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CACrD,CAAC;QAEF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;gBAChC,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;QAED,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,YAAY,CAC/C,UAAU,EACV,EAAE,EACF,YAAY,CACb,CAAC;QAEF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF,CAAA;AA7SY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAIR,WAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;IAGtB,WAAA,IAAA,0BAAgB,EAAC,0DAA0B,CAAC,CAAA;IAE5C,WAAA,IAAA,0BAAgB,EAAC,8CAAiB,CAAC,CAAA;qCANG,6CAAoB;QAE5B,4BAAY;QACd,oBAAU;QAEI,oBAAU;QAEjB,oBAAU;QACX,qCAAgB;QACnB,sBAAa;GAXpC,iBAAiB,CA6S7B"}
|
|
@@ -35,9 +35,9 @@ let StageService = StageService_1 = class StageService extends entity_service_im
|
|
|
35
35
|
async getAllStage(payload, organization_id, show_previous) {
|
|
36
36
|
if (!show_previous) {
|
|
37
37
|
const allStages = await this.stageRepository.getAllStage(payload.stage_group_id, organization_id);
|
|
38
|
-
const statusListMaster = await this.dataSource.query(`SELECT id, name
|
|
39
|
-
FROM frm_list_master_items
|
|
40
|
-
WHERE listtype = 'STS' AND organization_id =
|
|
38
|
+
const statusListMaster = await this.dataSource.query(`SELECT id, name
|
|
39
|
+
FROM frm_list_master_items
|
|
40
|
+
WHERE listtype = 'STS' AND organization_id = $1`, [organization_id]);
|
|
41
41
|
const statusMap = new Map(statusListMaster.map((s) => [String(s.id), s.name]));
|
|
42
42
|
for (const stage of allStages) {
|
|
43
43
|
stage.status = statusMap.get(String(stage.status));
|
|
@@ -75,7 +75,7 @@ let StageService = StageService_1 = class StageService extends entity_service_im
|
|
|
75
75
|
return await super.getEntityData(entityType, id, loggedInUser);
|
|
76
76
|
}
|
|
77
77
|
async deleteEntity(entityType, id, loggedInUser) {
|
|
78
|
-
const getAllStageAction = await this.dataSource.query(`SELECT action_id FROM frm_wf_stage_action_mapping WHERE stage_id =
|
|
78
|
+
const getAllStageAction = await this.dataSource.query(`SELECT action_id FROM frm_wf_stage_action_mapping WHERE stage_id = $1 AND entity_type = 'WFSA'`, [id]);
|
|
79
79
|
if (getAllStageAction.length > 0) {
|
|
80
80
|
for (const action of getAllStageAction) {
|
|
81
81
|
await this.actionService.deleteEntity('WFAC', action.action_id, loggedInUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/stage.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAiD;AACjD,2CAMwB;AACxB,gGAAwF;AAGxF,qEAAiE;AACjE,qCAAiD;AACjD,iFAA4E;AAC5E,6CAAmD;AACnD,qFAAyE;AAGlE,IAAM,YAAY,oBAAlB,MAAM,YAAa,SAAQ,+CAAiB;IAGjD,YACmB,eAAgC,EAChC,oBAA0C,EAE3D,iBAAiE,EAChD,UAAsB,EAEvC,aAA6C;QAE7C,KAAK,EAAE,CAAC;QARS,oBAAe,GAAf,eAAe,CAAiB;QAChC,yBAAoB,GAApB,oBAAoB,CAAsB;QAE1C,sBAAiB,GAAjB,iBAAiB,CAA+B;QAChD,eAAU,GAAV,UAAU,CAAY;QAEtB,kBAAa,GAAb,aAAa,CAAe;QAT9B,WAAM,GAAG,IAAI,eAAM,CAAC,cAAY,CAAC,IAAI,CAAC,CAAC;IAYxD,CAAC;IAED,KAAK,CAAC,WAAW,CACf,OAGC,EACD,eAAuB,EACvB,aAAsB;QAEtB,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CACtD,OAAO,CAAC,cAAc,EACtB,eAAe,CAChB,CAAC;YAEF,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAClD;;
|
|
1
|
+
{"version":3,"file":"stage.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/stage.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAiD;AACjD,2CAMwB;AACxB,gGAAwF;AAGxF,qEAAiE;AACjE,qCAAiD;AACjD,iFAA4E;AAC5E,6CAAmD;AACnD,qFAAyE;AAGlE,IAAM,YAAY,oBAAlB,MAAM,YAAa,SAAQ,+CAAiB;IAGjD,YACmB,eAAgC,EAChC,oBAA0C,EAE3D,iBAAiE,EAChD,UAAsB,EAEvC,aAA6C;QAE7C,KAAK,EAAE,CAAC;QARS,oBAAe,GAAf,eAAe,CAAiB;QAChC,yBAAoB,GAApB,oBAAoB,CAAsB;QAE1C,sBAAiB,GAAjB,iBAAiB,CAA+B;QAChD,eAAU,GAAV,UAAU,CAAY;QAEtB,kBAAa,GAAb,aAAa,CAAe;QAT9B,WAAM,GAAG,IAAI,eAAM,CAAC,cAAY,CAAC,IAAI,CAAC,CAAC;IAYxD,CAAC;IAED,KAAK,CAAC,WAAW,CACf,OAGC,EACD,eAAuB,EACvB,aAAsB;QAEtB,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CACtD,OAAO,CAAC,cAAc,EACtB,eAAe,CAChB,CAAC;YAEF,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAClD;;uDAE+C,EAC/C,CAAC,eAAe,CAAC,CAClB,CAAC;YAGF,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,gBAAgB,CAAC,GAAG,CAAC,CAAC,CA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V,6CAAoB;QAEvB,oBAAU;QACjB,oBAAU;QAEP,8BAAa;GAVpC,YAAY,CAoLxB"}
|
|
@@ -37,25 +37,29 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
37
37
|
this.name = 'add_task';
|
|
38
38
|
}
|
|
39
39
|
async execute(payload) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const { entity, user, config } = payload;
|
|
41
|
+
let toValue = null;
|
|
42
|
+
const stageRow = await this.dataSource.query(`SELECT stage_id
|
|
43
|
+
FROM frm_wf_stage_movement_data
|
|
44
|
+
WHERE mapped_entity_id = $1
|
|
45
|
+
AND is_current = 'Y'
|
|
46
|
+
LIMIT 1`, [entity.id]);
|
|
47
|
+
const stageId = stageRow.length > 0 ? stageRow[0].stage_id : null;
|
|
48
|
+
if (!stageId) {
|
|
49
|
+
throw new Error(`No current stage found in frm_wf_stage_movement_data for entity_id=${entity.id}`);
|
|
44
50
|
}
|
|
45
|
-
let status = await this.dataSource.query(`SELECT id FROM frm_list_master_items WHERE organization_id = ? AND level_id = ? AND level_type= ? AND listtype="TKST"`, [organization_id, level_id, level_type]);
|
|
46
|
-
const statusId = status[0].id;
|
|
47
51
|
const entityData = {
|
|
52
|
+
...config,
|
|
48
53
|
mapped_entity_id: entity.id,
|
|
49
54
|
mapped_entity_type: entity.entity_type,
|
|
50
|
-
task_owner:
|
|
51
|
-
stage_id:
|
|
52
|
-
status:
|
|
53
|
-
due_date:
|
|
54
|
-
due_time:
|
|
55
|
+
task_owner: config.task_owner,
|
|
56
|
+
stage_id: stageId,
|
|
57
|
+
status: config.status,
|
|
58
|
+
due_date: config.due_date,
|
|
59
|
+
due_time: config.due_time,
|
|
60
|
+
reminder: config.reminder,
|
|
55
61
|
description: config.description,
|
|
56
62
|
is_mandatory: config.is_mandatory,
|
|
57
|
-
name: config.name,
|
|
58
|
-
entity_type: 'TASK',
|
|
59
63
|
};
|
|
60
64
|
return await this.createEntity(entityData, user);
|
|
61
65
|
}
|
|
@@ -89,9 +93,9 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
89
93
|
catch (error) {
|
|
90
94
|
console.error('Failed to log activity for meeting:', error?.message || error);
|
|
91
95
|
}
|
|
92
|
-
let relationData = await this.dataSource.query(`SELECT * FROM frm_entity_relation WHERE source_entity_type =
|
|
96
|
+
let relationData = await this.dataSource.query(`SELECT * FROM frm_entity_relation WHERE source_entity_type = $1 AND target_entity_type = $2`, [createdEntity.mapped_entity_type, createdEntity.entity_type]);
|
|
93
97
|
if (relationData) {
|
|
94
|
-
await this.dataSource.query(`INSERT INTO frm_entity_relation_data (organization_id, source_entity_id, source_entity_type, target_entity_id, target_entity_type, relation_type) VALUES (
|
|
98
|
+
await this.dataSource.query(`INSERT INTO frm_entity_relation_data (organization_id, source_entity_id, source_entity_type, target_entity_id, target_entity_type, relation_type) VALUES ($1, $2, $3, $4, $5 , $6)`, [
|
|
95
99
|
loggedInUser.organization_id,
|
|
96
100
|
createdEntity.mapped_entity_id,
|
|
97
101
|
createdEntity.mapped_entity_type,
|
|
@@ -103,36 +107,18 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
103
107
|
return createdEntity;
|
|
104
108
|
}
|
|
105
109
|
async updateEntity(entityData, loggedInUser, appcode) {
|
|
106
|
-
const taskStatusQuery = `
|
|
107
|
-
SELECT name
|
|
108
|
-
FROM frm_list_master_items
|
|
109
|
-
WHERE id =
|
|
110
|
-
AND organization_id =
|
|
111
|
-
AND listtype = 'TKST'
|
|
112
|
-
LIMIT 1;
|
|
110
|
+
const taskStatusQuery = `
|
|
111
|
+
SELECT name
|
|
112
|
+
FROM frm_list_master_items
|
|
113
|
+
WHERE id = $1
|
|
114
|
+
AND organization_id = $2
|
|
115
|
+
AND listtype = 'TKST'
|
|
116
|
+
LIMIT 1;
|
|
113
117
|
`;
|
|
114
118
|
const statusRows = await this.dataSource.query(taskStatusQuery, [
|
|
115
119
|
entityData.status,
|
|
116
120
|
loggedInUser.organization_id,
|
|
117
121
|
]);
|
|
118
|
-
const oldStatusQuery = `
|
|
119
|
-
SELECT *
|
|
120
|
-
FROM frm_wf_task_data
|
|
121
|
-
WHERE id = ?
|
|
122
|
-
AND organization_id = ?
|
|
123
|
-
LIMIT 1;
|
|
124
|
-
`;
|
|
125
|
-
const [oldRow] = await this.dataSource.query(oldStatusQuery, [
|
|
126
|
-
entityData.id,
|
|
127
|
-
loggedInUser.organization_id,
|
|
128
|
-
]);
|
|
129
|
-
const oldStatusRows = await this.dataSource.query(taskStatusQuery, [
|
|
130
|
-
oldRow.status,
|
|
131
|
-
loggedInUser.organization_id,
|
|
132
|
-
]);
|
|
133
|
-
const isStatusChanged = statusRows.length > 0 &&
|
|
134
|
-
oldStatusRows.length > 0 &&
|
|
135
|
-
statusRows[0].name !== oldStatusRows[0].name;
|
|
136
122
|
const isCompletedStatus = statusRows.length > 0 &&
|
|
137
123
|
statusRows[0].name?.toLowerCase() === 'completed';
|
|
138
124
|
entityData.is_completed = isCompletedStatus;
|
|
@@ -149,7 +135,17 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
149
135
|
updatedEntity['is_mandatory'] = updatedEntity['is_mandatory'] ? '1' : '0';
|
|
150
136
|
}
|
|
151
137
|
try {
|
|
152
|
-
|
|
138
|
+
const editLogData = {
|
|
139
|
+
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
140
|
+
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
141
|
+
title: `Task edited`,
|
|
142
|
+
description: `${updatedEntity.code} was edited`,
|
|
143
|
+
category: activity_log_repository_1.ACTIVITY_CATEGORIES.TASK,
|
|
144
|
+
action: 'edit',
|
|
145
|
+
appcode: loggedInUser.appcode,
|
|
146
|
+
};
|
|
147
|
+
await this.activityLogService.logActivity(editLogData, loggedInUser);
|
|
148
|
+
if (isCompletedStatus) {
|
|
153
149
|
const completedLogData = {
|
|
154
150
|
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
155
151
|
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
@@ -161,18 +157,6 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
161
157
|
};
|
|
162
158
|
await this.activityLogService.logActivity(completedLogData, loggedInUser);
|
|
163
159
|
}
|
|
164
|
-
else {
|
|
165
|
-
const editLogData = {
|
|
166
|
-
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
167
|
-
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
168
|
-
title: `Task edited`,
|
|
169
|
-
description: `${updatedEntity.code} was edited`,
|
|
170
|
-
category: activity_log_repository_1.ACTIVITY_CATEGORIES.TASK,
|
|
171
|
-
action: 'edit',
|
|
172
|
-
appcode: loggedInUser.appcode,
|
|
173
|
-
};
|
|
174
|
-
await this.activityLogService.logActivity(editLogData, loggedInUser);
|
|
175
|
-
}
|
|
176
160
|
}
|
|
177
161
|
catch (error) {
|
|
178
162
|
console.error('Failed to log activity for task:', error?.message || error);
|
|
@@ -217,18 +201,18 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
217
201
|
whereClauses.push(`t.is_done = ?`);
|
|
218
202
|
params.push(0);
|
|
219
203
|
}
|
|
220
|
-
const sql = `
|
|
221
|
-
SELECT
|
|
222
|
-
t.*,
|
|
223
|
-
sg.name AS stage_group_name,
|
|
224
|
-
s.name AS stage_name,
|
|
225
|
-
a.name AS action_name
|
|
226
|
-
FROM frm_wf_task_data t
|
|
227
|
-
LEFT JOIN frm_wf_stage s ON t.stage_id = s.id
|
|
228
|
-
LEFT JOIN frm_wf_stage_group sg ON s.stage_group_id = sg.id
|
|
229
|
-
LEFT JOIN frm_wf_action a ON t.action_id = a.id
|
|
230
|
-
WHERE ${whereClauses.join(' AND ')}
|
|
231
|
-
ORDER BY t.created_date DESC
|
|
204
|
+
const sql = `
|
|
205
|
+
SELECT
|
|
206
|
+
t.*,
|
|
207
|
+
sg.name AS stage_group_name,
|
|
208
|
+
s.name AS stage_name,
|
|
209
|
+
a.name AS action_name
|
|
210
|
+
FROM frm_wf_task_data t
|
|
211
|
+
LEFT JOIN frm_wf_stage s ON t.stage_id = s.id
|
|
212
|
+
LEFT JOIN frm_wf_stage_group sg ON s.stage_group_id = sg.id
|
|
213
|
+
LEFT JOIN frm_wf_action a ON t.action_id = a.id
|
|
214
|
+
WHERE ${whereClauses.join(' AND ')}
|
|
215
|
+
ORDER BY t.created_date DESC
|
|
232
216
|
`;
|
|
233
217
|
const taskData = await this.dataSource.query(sql, params);
|
|
234
218
|
if (taskData) {
|
|
@@ -257,11 +241,11 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
257
241
|
if (taskData.length === 0) {
|
|
258
242
|
return [];
|
|
259
243
|
}
|
|
260
|
-
const taskStatusQuery = `
|
|
261
|
-
SELECT id, name
|
|
262
|
-
FROM frm_list_master_items
|
|
263
|
-
WHERE organization_id = ?
|
|
264
|
-
AND listtype = 'TKST'
|
|
244
|
+
const taskStatusQuery = `
|
|
245
|
+
SELECT id, name
|
|
246
|
+
FROM frm_list_master_items
|
|
247
|
+
WHERE organization_id = ?
|
|
248
|
+
AND listtype = 'TKST'
|
|
265
249
|
`;
|
|
266
250
|
const taskAllStatus = await this.dataSource.query(taskStatusQuery, [
|
|
267
251
|
loggedInUser.organization_id,
|
|
@@ -343,7 +327,7 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
343
327
|
async createSystemNote(entity, loggedInUser) {
|
|
344
328
|
if (!entity || !entity.mapped_entity_id || !entity.reason_code)
|
|
345
329
|
return null;
|
|
346
|
-
const [reason] = await this.dataSource.query(`SELECT name FROM frm_list_master_items WHERE id =
|
|
330
|
+
const [reason] = await this.dataSource.query(`SELECT name FROM frm_list_master_items WHERE id = $1 AND organization_id = $2`, [entity.reason_code, loggedInUser.organization_id]);
|
|
347
331
|
const notePayload = {
|
|
348
332
|
note_title: reason ? reason.name : entity.reason_code,
|
|
349
333
|
note: entity.remark,
|