rez_core 4.0.167 → 4.0.172
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/.prettierrc +3 -3
- package/README.md +99 -99
- package/dist/app.module.js +9 -0
- package/dist/app.module.js.map +1 -1
- package/dist/config/bull.config.d.ts +10 -0
- package/dist/config/bull.config.js +66 -0
- package/dist/config/bull.config.js.map +1 -0
- 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 +12 -16
- package/dist/config/database.config.js.map +1 -1
- package/dist/core.module.d.ts +1 -1
- package/dist/core.module.js +7 -7
- package/dist/core.module.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.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/entity_json/controller/entity_json.controller.d.ts +8 -0
- package/dist/module/entity_json/controller/entity_json.controller.js +42 -0
- package/dist/module/entity_json/controller/entity_json.controller.js.map +1 -0
- package/dist/module/entity_json/entity_json.module.d.ts +2 -0
- package/dist/module/entity_json/entity_json.module.js +26 -0
- package/dist/module/entity_json/entity_json.module.js.map +1 -0
- package/dist/module/entity_json/service/entity_json.service.d.ts +7 -0
- package/dist/module/entity_json/service/entity_json.service.js +80 -0
- package/dist/module/entity_json/service/entity_json.service.js.map +1 -0
- 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 +1 -4
- package/dist/module/filter/service/filter.service.js +39 -69
- 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 +3 -1
- package/dist/module/integration/service/wrapper.service.js +67 -65
- package/dist/module/integration/service/wrapper.service.js.map +1 -1
- package/dist/module/linked_attributes/controller/linked_attributes.controller.d.ts +5 -0
- package/dist/module/linked_attributes/controller/linked_attributes.controller.js +29 -0
- package/dist/module/linked_attributes/controller/linked_attributes.controller.js.map +1 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.d.ts +9 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.js +70 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.js.map +1 -0
- package/dist/module/linked_attributes/linked_attributes.module.d.ts +2 -0
- package/dist/module/linked_attributes/linked_attributes.module.js +29 -0
- package/dist/module/linked_attributes/linked_attributes.module.js.map +1 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.d.ts +6 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.js +31 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.js.map +1 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.d.ts +5 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.js +34 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.js.map +1 -0
- 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 +4 -1
- package/dist/module/meta/controller/attribute-master.controller.js +15 -2
- 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 +7 -0
- 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-attribute-update.repository.d.ts +6 -0
- package/dist/module/meta/repository/entity-attribute-update.repository.js +44 -0
- package/dist/module/meta/repository/entity-attribute-update.repository.js.map +1 -0
- 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-attribute-update.service.d.ts +7 -0
- package/dist/module/meta/service/entity-attribute-update.service.js +36 -0
- package/dist/module/meta/service/entity-attribute-update.service.js.map +1 -0
- 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 +1 -0
- package/dist/module/workflow/entity/action.entity.js +5 -1
- 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 +5 -4
- 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 +3 -1
- package/dist/module/workflow/repository/task.repository.js +10 -5
- 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 +68 -54
- 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 +53 -51
- 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 +6 -0
- package/dist/module/workflow-automation/controller/workflow-automation.controller.js +16 -0
- 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 +2 -0
- package/dist/module/workflow-automation/entity/workflow-automation.entity.js +8 -0
- package/dist/module/workflow-automation/entity/workflow-automation.entity.js.map +1 -1
- package/dist/module/workflow-automation/service/schedule-handler.service.d.ts +16 -0
- package/dist/module/workflow-automation/service/schedule-handler.service.js +109 -0
- package/dist/module/workflow-automation/service/schedule-handler.service.js.map +1 -0
- 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 +13 -1
- package/dist/module/workflow-automation/service/workflow-automation.service.js +115 -6
- package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
- package/dist/module/workflow-automation/workflow-automation.module.js +14 -1
- package/dist/module/workflow-automation/workflow-automation.module.js.map +1 -1
- package/dist/module/workflow-schedule/constants/schedule.constants.d.ts +27 -0
- package/dist/module/workflow-schedule/constants/schedule.constants.js +31 -0
- package/dist/module/workflow-schedule/constants/schedule.constants.js.map +1 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.d.ts +83 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js +220 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js.map +1 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.d.ts +32 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.js +163 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.js.map +1 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.d.ts +35 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js +124 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js.map +1 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.d.ts +19 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.js +106 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.js.map +1 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.d.ts +30 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js +113 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js.map +1 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.d.ts +34 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js +118 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js.map +1 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.d.ts +44 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js +3 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js.map +1 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.d.ts +31 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.js +409 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.js.map +1 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.d.ts +44 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js +434 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js.map +1 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.d.ts +2 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.js +44 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.js.map +1 -0
- package/dist/table.config.js +5 -1
- package/dist/table.config.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/service/loggingUtil.service.d.ts +9 -2
- package/dist/utils/service/loggingUtil.service.js +65 -14
- 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 +2 -0
- 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 +124 -120
- package/src/app.controller.ts +12 -12
- package/src/app.module.ts +62 -52
- package/src/app.service.ts +8 -8
- package/src/config/bull.config.ts +69 -0
- package/src/config/config.module.ts +18 -17
- package/src/config/database.config.ts +23 -48
- package/src/constant/global.constant.ts +67 -67
- package/src/core.module.ts +86 -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/entity_json/controller/entity_json.controller.ts +21 -0
- package/src/module/entity_json/entity_json.module.ts +13 -0
- package/src/module/entity_json/service/entity_json.service.ts +88 -0
- 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 +1005 -1053
- 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 +700 -494
- 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/linked_attributes/controller/linked_attributes.controller.ts +10 -0
- package/src/module/linked_attributes/entity/linked_attribute.entity.ts +48 -0
- package/src/module/linked_attributes/linked_attributes.module.ts +16 -0
- package/src/module/linked_attributes/repository/linked_attribute.repository.ts +12 -0
- package/src/module/linked_attributes/service/linked_attributes.service.ts +22 -0
- 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 +271 -266
- 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 +74 -66
- 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 +166 -158
- 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-attribute-update.repository.ts +44 -0
- 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-attribute-update.service.ts +29 -0
- 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 +53 -50
- 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 +334 -333
- 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 +134 -126
- 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 +569 -560
- package/src/module/workflow/service/workflow-list-master.service.ts +60 -60
- package/src/module/workflow/service/workflow-meta.service.ts +654 -640
- 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 +43 -21
- package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +26 -26
- package/src/module/workflow-automation/entity/workflow-automation.entity.ts +40 -35
- 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/schedule-handler.service.ts +150 -0
- package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +214 -214
- package/src/module/workflow-automation/service/workflow-automation.service.ts +508 -347
- package/src/module/workflow-automation/workflow-automation.module.ts +47 -34
- package/src/module/workflow-schedule/INSTALLATION.md +244 -0
- package/src/module/workflow-schedule/README.md +422 -0
- package/src/module/workflow-schedule/constants/schedule.constants.ts +48 -0
- package/src/module/workflow-schedule/controller/workflow-schedule.controller.ts +255 -0
- package/src/module/workflow-schedule/docs/CLAUDE_CODE_GUIDE.md +510 -0
- package/src/module/workflow-schedule/docs/CLAUDE_CODE_PROMPT.md +362 -0
- package/src/module/workflow-schedule/docs/RUN_CLAUDE_CODE.sh +68 -0
- package/src/module/workflow-schedule/dto/create-schedule.dto.ts +147 -0
- package/src/module/workflow-schedule/dto/get-execution-logs.dto.ts +119 -0
- package/src/module/workflow-schedule/dto/update-schedule.dto.ts +96 -0
- package/src/module/workflow-schedule/entities/scheduled-workflow.entity.ts +148 -0
- package/src/module/workflow-schedule/entities/workflow-execution-log.entity.ts +154 -0
- package/src/module/workflow-schedule/interfaces/schedule-job-data.interface.ts +53 -0
- package/src/module/workflow-schedule/processors/schedule.processor.ts +584 -0
- package/src/module/workflow-schedule/service/workflow-schedule.service.ts +600 -0
- package/src/module/workflow-schedule/workflow-schedule.module.ts +43 -0
- package/src/resources/dev.properties.yaml +30 -31
- 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 +130 -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 +88 -34
- 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 +27 -25
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +24 -24
- package/.claude/settings.local.json +0 -26
- package/.idea/250218_nodejs_core.iml +0 -9
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/copilot.data.migration.agent.xml +0 -6
- package/.idea/copilot.data.migration.ask.xml +0 -6
- package/.idea/copilot.data.migration.ask2agent.xml +0 -6
- package/.idea/copilot.data.migration.edit.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/server.log +0 -850
|
@@ -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 = ?
|
|
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 = ?
|
|
36
|
+
AND listtype = "MOD" AND code = ?
|
|
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 = ? AND organization_id = ? AND level_type = ? AND level_id = ? AND status IN (SELECT id FROM frm_list_master_items WHERE code = "STATUS_ACTIVE" AND organization_id = ?)
|
|
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 = ?
|
|
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 = ?
|
|
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 (?) AND mode = ? AND organization_id = ? AND level_type = ? AND level_id = ? AND status IN (SELECT id FROM frm_list_master_items WHERE code = "STATUS_ACTIVE" AND organization_id = ?)
|
|
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 = ? 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 = ? 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 = ? 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 = ? 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 = ? 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 = ? AND entity_type = 'WFSA')`, [id]);
|
|
141
|
+
await this.dataSource.query(`DELETE FROM frm_wf_stage_action_mapping WHERE action_id = ? 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,MAA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AAkB,EAAE,sBAAsB,CAAC,EAAE;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,EAA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B,EACtB,QAAgB,EAChB,SAA6B;QAE7B,OAAO,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAC9C,YAAY,EACZ,QAAQ,EACR,SAAS,CACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CACb,YAAsB,EACtB,QAAgB,EAChB,gBAAwB,EACxB,kBAA0B;QAE1B,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QACzC,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACpC,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,CACnB,CAAC;IACJ,CAAC;CACF,CAAA;AA7QY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAGoB,oBAAU;QACJ,oCAAgB;GAH1C,aAAa,CA6QzB"}
|
|
@@ -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 = ? AND organization_id = ?
|
|
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 = ?
|
|
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 = ?`, [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 (?, ?, ?)`, [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 = ?`, [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 (?)`, [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 = ?`, [rest.action_requirement]);
|
|
126
|
+
const newIsMandatoryList = await this.dataSource.query(`SELECT id, code FROM frm_list_master_items WHERE organization_id = ? 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 = ? 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 = ?`, [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;A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AAS;SAClB,CAAC;IACJ,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 = ?`, [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 = ?`, [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 = ? AND organization_id = ?`, [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 = ? AND level_id =? AND level_type = ?`, [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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AED,KAAK,CAAC,YAAY,CAChB,UAAkB,EAClB,EAAU,EACV,YAAsB;QAEtB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAC7C,yFAAyF,EACzF,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 = ?`, [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 = ? 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,M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,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAOR,WAAA,IAAA,0BAAgB,EAAC,8CAAiB,CAAC,CAAA;IAGnC,WAAA,IAAA,eAAM,EAAC,eAAe,CAAC,CAAA;qCALU,kCAAe;QACV,6CAAoB;QAEvB,oBAAU;QACjB,oBAAU;QAEP,8BAAa;GAVpC,YAAY,CAoLxB"}
|
|
@@ -37,29 +37,23 @@ 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
|
-
|
|
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}`);
|
|
40
|
+
let { entity, user, config } = payload;
|
|
41
|
+
const { organization_id, level_id, level_type } = entity;
|
|
42
|
+
if (entity.entity_type !== 'LEAD') {
|
|
43
|
+
entity = await this.getEntityData('LEAD', entity.parent_id, user);
|
|
50
44
|
}
|
|
51
45
|
const entityData = {
|
|
52
|
-
...config,
|
|
53
46
|
mapped_entity_id: entity.id,
|
|
54
47
|
mapped_entity_type: entity.entity_type,
|
|
55
|
-
task_owner:
|
|
56
|
-
stage_id: stageId,
|
|
48
|
+
task_owner: entity.lead_owner,
|
|
49
|
+
stage_id: entity.stageId,
|
|
57
50
|
status: config.status,
|
|
58
|
-
due_date:
|
|
59
|
-
due_time:
|
|
60
|
-
reminder: config.reminder,
|
|
51
|
+
due_date: Date.now() + 2,
|
|
52
|
+
due_time: Date.now(),
|
|
61
53
|
description: config.description,
|
|
62
54
|
is_mandatory: config.is_mandatory,
|
|
55
|
+
name: config.name,
|
|
56
|
+
entity_type: 'TASK',
|
|
63
57
|
};
|
|
64
58
|
return await this.createEntity(entityData, user);
|
|
65
59
|
}
|
|
@@ -93,9 +87,9 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
93
87
|
catch (error) {
|
|
94
88
|
console.error('Failed to log activity for meeting:', error?.message || error);
|
|
95
89
|
}
|
|
96
|
-
let relationData = await this.dataSource.query(`SELECT * FROM frm_entity_relation WHERE source_entity_type =
|
|
90
|
+
let relationData = await this.dataSource.query(`SELECT * FROM frm_entity_relation WHERE source_entity_type = ? AND target_entity_type = ?`, [createdEntity.mapped_entity_type, createdEntity.entity_type]);
|
|
97
91
|
if (relationData) {
|
|
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 (
|
|
92
|
+
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 (?, ?, ?, ?, ? , ?)`, [
|
|
99
93
|
loggedInUser.organization_id,
|
|
100
94
|
createdEntity.mapped_entity_id,
|
|
101
95
|
createdEntity.mapped_entity_type,
|
|
@@ -107,18 +101,36 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
107
101
|
return createdEntity;
|
|
108
102
|
}
|
|
109
103
|
async updateEntity(entityData, loggedInUser, appcode) {
|
|
110
|
-
const taskStatusQuery = `
|
|
111
|
-
SELECT name
|
|
112
|
-
FROM frm_list_master_items
|
|
113
|
-
WHERE id =
|
|
114
|
-
AND organization_id =
|
|
115
|
-
AND listtype = 'TKST'
|
|
116
|
-
LIMIT 1;
|
|
104
|
+
const taskStatusQuery = `
|
|
105
|
+
SELECT name
|
|
106
|
+
FROM frm_list_master_items
|
|
107
|
+
WHERE id = ?
|
|
108
|
+
AND organization_id = ?
|
|
109
|
+
AND listtype = 'TKST'
|
|
110
|
+
LIMIT 1;
|
|
117
111
|
`;
|
|
118
112
|
const statusRows = await this.dataSource.query(taskStatusQuery, [
|
|
119
113
|
entityData.status,
|
|
120
114
|
loggedInUser.organization_id,
|
|
121
115
|
]);
|
|
116
|
+
const oldStatusQuery = `
|
|
117
|
+
SELECT *
|
|
118
|
+
FROM frm_wf_task_data
|
|
119
|
+
WHERE id = ?
|
|
120
|
+
AND organization_id = ?
|
|
121
|
+
LIMIT 1;
|
|
122
|
+
`;
|
|
123
|
+
const [oldRow] = await this.dataSource.query(oldStatusQuery, [
|
|
124
|
+
entityData.id,
|
|
125
|
+
loggedInUser.organization_id,
|
|
126
|
+
]);
|
|
127
|
+
const oldStatusRows = await this.dataSource.query(taskStatusQuery, [
|
|
128
|
+
oldRow.status,
|
|
129
|
+
loggedInUser.organization_id,
|
|
130
|
+
]);
|
|
131
|
+
const isStatusChanged = statusRows.length > 0 &&
|
|
132
|
+
oldStatusRows.length > 0 &&
|
|
133
|
+
statusRows[0].name !== oldStatusRows[0].name;
|
|
122
134
|
const isCompletedStatus = statusRows.length > 0 &&
|
|
123
135
|
statusRows[0].name?.toLowerCase() === 'completed';
|
|
124
136
|
entityData.is_completed = isCompletedStatus;
|
|
@@ -135,17 +147,7 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
135
147
|
updatedEntity['is_mandatory'] = updatedEntity['is_mandatory'] ? '1' : '0';
|
|
136
148
|
}
|
|
137
149
|
try {
|
|
138
|
-
|
|
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) {
|
|
150
|
+
if (isCompletedStatus && isStatusChanged) {
|
|
149
151
|
const completedLogData = {
|
|
150
152
|
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
151
153
|
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
@@ -157,6 +159,18 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
157
159
|
};
|
|
158
160
|
await this.activityLogService.logActivity(completedLogData, loggedInUser);
|
|
159
161
|
}
|
|
162
|
+
else {
|
|
163
|
+
const editLogData = {
|
|
164
|
+
mapped_entity_id: updatedEntity.mapped_entity_id,
|
|
165
|
+
mapped_entity_type: updatedEntity.mapped_entity_type,
|
|
166
|
+
title: `Task edited`,
|
|
167
|
+
description: `${updatedEntity.code} was edited`,
|
|
168
|
+
category: activity_log_repository_1.ACTIVITY_CATEGORIES.TASK,
|
|
169
|
+
action: 'edit',
|
|
170
|
+
appcode: loggedInUser.appcode,
|
|
171
|
+
};
|
|
172
|
+
await this.activityLogService.logActivity(editLogData, loggedInUser);
|
|
173
|
+
}
|
|
160
174
|
}
|
|
161
175
|
catch (error) {
|
|
162
176
|
console.error('Failed to log activity for task:', error?.message || error);
|
|
@@ -201,18 +215,18 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
201
215
|
whereClauses.push(`t.is_done = ?`);
|
|
202
216
|
params.push(0);
|
|
203
217
|
}
|
|
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
|
|
218
|
+
const sql = `
|
|
219
|
+
SELECT
|
|
220
|
+
t.*,
|
|
221
|
+
sg.name AS stage_group_name,
|
|
222
|
+
s.name AS stage_name,
|
|
223
|
+
a.name AS action_name
|
|
224
|
+
FROM frm_wf_task_data t
|
|
225
|
+
LEFT JOIN frm_wf_stage s ON t.stage_id = s.id
|
|
226
|
+
LEFT JOIN frm_wf_stage_group sg ON s.stage_group_id = sg.id
|
|
227
|
+
LEFT JOIN frm_wf_action a ON t.action_id = a.id
|
|
228
|
+
WHERE ${whereClauses.join(' AND ')}
|
|
229
|
+
ORDER BY t.created_date DESC
|
|
216
230
|
`;
|
|
217
231
|
const taskData = await this.dataSource.query(sql, params);
|
|
218
232
|
if (taskData) {
|
|
@@ -241,11 +255,11 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
241
255
|
if (taskData.length === 0) {
|
|
242
256
|
return [];
|
|
243
257
|
}
|
|
244
|
-
const taskStatusQuery = `
|
|
245
|
-
SELECT id, name
|
|
246
|
-
FROM frm_list_master_items
|
|
247
|
-
WHERE organization_id =
|
|
248
|
-
AND listtype = 'TKST'
|
|
258
|
+
const taskStatusQuery = `
|
|
259
|
+
SELECT id, name
|
|
260
|
+
FROM frm_list_master_items
|
|
261
|
+
WHERE organization_id = ?
|
|
262
|
+
AND listtype = 'TKST'
|
|
249
263
|
`;
|
|
250
264
|
const taskAllStatus = await this.dataSource.query(taskStatusQuery, [
|
|
251
265
|
loggedInUser.organization_id,
|
|
@@ -327,7 +341,7 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
327
341
|
async createSystemNote(entity, loggedInUser) {
|
|
328
342
|
if (!entity || !entity.mapped_entity_id || !entity.reason_code)
|
|
329
343
|
return null;
|
|
330
|
-
const [reason] = await this.dataSource.query(`SELECT name FROM frm_list_master_items WHERE id =
|
|
344
|
+
const [reason] = await this.dataSource.query(`SELECT name FROM frm_list_master_items WHERE id = ? AND organization_id = ?`, [entity.reason_code, loggedInUser.organization_id]);
|
|
331
345
|
const notePayload = {
|
|
332
346
|
note_title: reason ? reason.name : entity.reason_code,
|
|
333
347
|
note: entity.remark,
|