rez_core 4.0.165 → 4.0.166
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 +8 -11
- package/.idea/codeStyles/Project.xml +58 -58
- package/.idea/codeStyles/codeStyleConfig.xml +4 -4
- 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 +1 -1
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +7 -7
- package/.idea/prettier.xml +5 -5
- package/.idea/vcs.xml +5 -5
- package/.prettierrc +3 -3
- package/README.md +99 -99
- package/dist/app.module.js +0 -9
- 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 +16 -12
- 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 +54 -34
- 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 +2 -2
- 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 +5 -10
- 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 -62
- 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 +1039 -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 +126 -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/entity_json/controller/entity_json.controller.d.ts +0 -8
- package/dist/module/entity_json/controller/entity_json.controller.js +0 -42
- package/dist/module/entity_json/controller/entity_json.controller.js.map +0 -1
- package/dist/module/entity_json/entity_json.module.d.ts +0 -2
- package/dist/module/entity_json/entity_json.module.js +0 -26
- package/dist/module/entity_json/entity_json.module.js.map +0 -1
- package/dist/module/entity_json/service/entity_json.service.d.ts +0 -7
- package/dist/module/entity_json/service/entity_json.service.js +0 -80
- package/dist/module/entity_json/service/entity_json.service.js.map +0 -1
- package/dist/module/linked_attributes/controller/linked_attributes.controller.d.ts +0 -5
- package/dist/module/linked_attributes/controller/linked_attributes.controller.js +0 -29
- package/dist/module/linked_attributes/controller/linked_attributes.controller.js.map +0 -1
- package/dist/module/linked_attributes/entity/linked_attribute.entity.d.ts +0 -9
- package/dist/module/linked_attributes/entity/linked_attribute.entity.js +0 -70
- package/dist/module/linked_attributes/entity/linked_attribute.entity.js.map +0 -1
- package/dist/module/linked_attributes/linked_attributes.module.d.ts +0 -2
- package/dist/module/linked_attributes/linked_attributes.module.js +0 -29
- package/dist/module/linked_attributes/linked_attributes.module.js.map +0 -1
- package/dist/module/linked_attributes/repository/linked_attribute.repository.d.ts +0 -6
- package/dist/module/linked_attributes/repository/linked_attribute.repository.js +0 -31
- package/dist/module/linked_attributes/repository/linked_attribute.repository.js.map +0 -1
- package/dist/module/linked_attributes/service/linked_attributes.service.d.ts +0 -5
- package/dist/module/linked_attributes/service/linked_attributes.service.js +0 -34
- package/dist/module/linked_attributes/service/linked_attributes.service.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/entity_json/controller/entity_json.controller.ts +0 -21
- package/src/module/entity_json/entity_json.module.ts +0 -13
- package/src/module/entity_json/service/entity_json.service.ts +0 -88
- package/src/module/linked_attributes/controller/linked_attributes.controller.ts +0 -10
- package/src/module/linked_attributes/entity/linked_attribute.entity.ts +0 -48
- package/src/module/linked_attributes/linked_attributes.module.ts +0 -16
- package/src/module/linked_attributes/repository/linked_attribute.repository.ts +0 -12
- package/src/module/linked_attributes/service/linked_attributes.service.ts +0 -22
- 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
|
@@ -17,11 +17,9 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const task_data_entity_1 = require("../entity/task-data.entity");
|
|
19
19
|
const typeorm_2 = require("typeorm");
|
|
20
|
-
const entity_dynamic_service_1 = require("../../meta/service/entity-dynamic.service");
|
|
21
20
|
let TaskRepository = class TaskRepository {
|
|
22
|
-
constructor(TaskRepository,
|
|
21
|
+
constructor(TaskRepository, dataSource) {
|
|
23
22
|
this.TaskRepository = TaskRepository;
|
|
24
|
-
this.entityDynamicService = entityDynamicService;
|
|
25
23
|
this.dataSource = dataSource;
|
|
26
24
|
}
|
|
27
25
|
async getAllTaskByUserIdAndStageId(condition) {
|
|
@@ -35,11 +33,11 @@ let TaskRepository = class TaskRepository {
|
|
|
35
33
|
async saveActionDataInTask(action, loggedInUser, mapped_entity_id, mapped_entity_type) {
|
|
36
34
|
if (!action?.length)
|
|
37
35
|
return;
|
|
38
|
-
const todoListMasterItemId = await this.dataSource.query(`SELECT id FROM frm_list_master_items WHERE code = 'in_progress' and organization_id =
|
|
39
|
-
const leadData = await this.dataSource.query(`SELECT * FROM crm_lead WHERE id =
|
|
36
|
+
const todoListMasterItemId = await this.dataSource.query(`SELECT id FROM frm_list_master_items WHERE code = 'in_progress' and organization_id = $1 and listtype = 'TKST' LIMIT 1;`, [loggedInUser.organization_id]);
|
|
37
|
+
const leadData = await this.dataSource.query(`SELECT * FROM crm_lead WHERE id = $1`, [mapped_entity_id]);
|
|
40
38
|
if (action.length > 0) {
|
|
41
39
|
for (const act of action) {
|
|
42
|
-
const is_mandatory = await this.dataSource.query(`SELECT code FROM frm_list_master_items WHERE id =
|
|
40
|
+
const is_mandatory = await this.dataSource.query(`SELECT code FROM frm_list_master_items WHERE id = $1 and organization_id = $2 LIMIT 1;`, [act.action_requirement, loggedInUser.organization_id]);
|
|
43
41
|
const now = new Date();
|
|
44
42
|
const dueDateTime = new Date(now);
|
|
45
43
|
dueDateTime.setDate(dueDateTime.getDate() + 2);
|
|
@@ -55,7 +53,6 @@ let TaskRepository = class TaskRepository {
|
|
|
55
53
|
const due_date = istFormatterDate.format(dueDateTime);
|
|
56
54
|
const due_time = istFormatterTime.format(dueDateTime);
|
|
57
55
|
console.log({ due_date, due_time });
|
|
58
|
-
const taskCode = await this.entityDynamicService.getCode('TASK', loggedInUser);
|
|
59
56
|
const taskData = this.TaskRepository.create({
|
|
60
57
|
stage_id: act.stage_id,
|
|
61
58
|
user_id: loggedInUser.id,
|
|
@@ -74,7 +71,6 @@ let TaskRepository = class TaskRepository {
|
|
|
74
71
|
status: todoListMasterItemId[0]?.id,
|
|
75
72
|
category: act?.action_category_code,
|
|
76
73
|
task_owner: leadData[0]?.lead_owner,
|
|
77
|
-
code: taskCode,
|
|
78
74
|
});
|
|
79
75
|
await this.TaskRepository.save(taskData);
|
|
80
76
|
}
|
|
@@ -89,7 +85,7 @@ let TaskRepository = class TaskRepository {
|
|
|
89
85
|
});
|
|
90
86
|
if (!task)
|
|
91
87
|
return;
|
|
92
|
-
const completedListMasterItemId = await this.dataSource.query(`SELECT id FROM frm_list_master_items WHERE code = 'completed' and organization_id =
|
|
88
|
+
const completedListMasterItemId = await this.dataSource.query(`SELECT id FROM frm_list_master_items WHERE code = 'completed' and organization_id = $1 and listtype = 'TKST' LIMIT 1;`, [loggedInUser.organization_id]);
|
|
93
89
|
task.modified_by = loggedInUser.id;
|
|
94
90
|
task.modified_date = new Date();
|
|
95
91
|
task.is_done = true;
|
|
@@ -102,7 +98,6 @@ exports.TaskRepository = TaskRepository = __decorate([
|
|
|
102
98
|
(0, common_1.Injectable)(),
|
|
103
99
|
__param(0, (0, typeorm_1.InjectRepository)(task_data_entity_1.TaskDataEntity)),
|
|
104
100
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
105
|
-
entity_dynamic_service_1.EntityDynamicService,
|
|
106
101
|
typeorm_2.DataSource])
|
|
107
102
|
], TaskRepository);
|
|
108
103
|
//# sourceMappingURL=task.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/task.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiE;AACjE,6CAAmD;AACnD,iEAA4D;AAC5D,qCAAiD;
|
|
1
|
+
{"version":3,"file":"task.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/task.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiE;AACjE,6CAAmD;AACnD,iEAA4D;AAC5D,qCAAiD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,cAA0C,EAC1C,UAAsB;QADtB,mBAAc,GAAd,cAAc,CAA4B;QAC1C,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEJ,KAAK,CAAC,4BAA4B,CAAC,SAAS;QAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YAC5C,KAAK,EAAE;gBACL,GAAG,SAAS;aACb;SACF,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,oBAAoB,CACxB,MAAW,EACX,YAAY,EACZ,gBAAwB,EACxB,kBAA0B;QAE1B,IAAI,CAAC,MAAM,EAAE,MAAM;YAAE,OAAO;QAE5B,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACtD,yHAAyH,EACzH,CAAC,YAAY,CAAC,eAAe,CAAC,CAC/B,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,U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,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAE/C,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;CACF,CAAA;AAvHY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,iCAAc,CAAC,CAAA;qCACA,oBAAU;QACd,oBAAU;GAJ9B,cAAc,CAuH1B"}
|
|
@@ -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,EAA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E;oBAC7C,aAAa,EAAE,YAAY;oBAC3B,IAAI,EAAE,UAAU;oBAChB,WAAW,EAAE,MAAM;iBACb,CAAC;gBAET,IAAI,UAAU,EAAE,eAAe,EAAE,CAAC;oBAChC,eAAe,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,CAA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QAE7B,OAAO,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAC9C,YAAY,EACZ,QAAQ,EACR,SAAS,CACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CACb,YAAsB,EACtB,QAAgB,EAChB,gBAAwB,EACxB,kBAA0B;QAE1B,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QACzC,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACpC,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,CACnB,CAAC;IACJ,CAAC;CACF,CAAA;AA7QY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAGoB,oBAAU;QACJ,oCAAgB;GAH1C,aAAa,CA6QzB"}
|
|
@@ -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,+DA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CAAC;CACF,CAAA;AAlSY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,IAAA,eAAM,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,GAA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Y,CAChB,UAAkB,EAClB,EAAU,EACV,YAAsB;QAEtB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAC7C,6FAA6F,EAC7F,CAAC,EAAE,EAAE,YAAY,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,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