rez_core 5.0.88 → 5.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +26 -0
- package/.idea/250218_nodejs_core.iml +9 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/copilot.data.migration.edit.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/.prettierrc +3 -3
- package/README.md +99 -99
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/filter/service/filter.service.js +20 -20
- package/dist/module/integration/examples/usage.example.js +9 -9
- package/dist/module/meta/repository/attribute-master.repository.js +8 -8
- package/dist/module/meta/repository/entity-master.repository.js +2 -2
- package/dist/module/meta/service/entity-dynamic.service.js +21 -21
- package/dist/module/meta/service/entity-list.service.js +3 -3
- package/dist/module/meta/service/entity-relation.service.d.ts +1 -3
- package/dist/module/meta/service/entity-relation.service.js +22 -31
- 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 +6 -6
- package/dist/module/meta/service/resolver.service.js +15 -15
- package/dist/module/module/repository/menu.repository.js +5 -5
- package/dist/module/module/repository/menu.repository.js.map +1 -1
- package/dist/module/module/service/module-access.service.d.ts +3 -1
- package/dist/module/module/service/module-access.service.js +11 -4
- package/dist/module/module/service/module-access.service.js.map +1 -1
- package/dist/module/notification/controller/notification.controller.d.ts +1 -1
- package/dist/module/notification/service/notification.service.d.ts +6 -4
- package/dist/module/notification/service/notification.service.js +28 -26
- package/dist/module/notification/service/notification.service.js.map +1 -1
- package/dist/module/user/controller/login.controller.js +18 -18
- package/dist/module/workflow/controller/action.controller.d.ts +5 -2
- package/dist/module/workflow/controller/form-master.controller.d.ts +4 -1
- package/dist/module/workflow/repository/action-data.repository.d.ts +2 -3
- package/dist/module/workflow/repository/action-data.repository.js +29 -18
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
- package/dist/module/workflow/repository/action.repository.d.ts +6 -7
- package/dist/module/workflow/repository/action.repository.js +55 -63
- package/dist/module/workflow/repository/action.repository.js.map +1 -1
- package/dist/module/workflow/repository/comm-template.repository.d.ts +2 -3
- package/dist/module/workflow/repository/comm-template.repository.js +15 -9
- package/dist/module/workflow/repository/comm-template.repository.js.map +1 -1
- package/dist/module/workflow/repository/form-master.repository.d.ts +7 -4
- package/dist/module/workflow/repository/form-master.repository.js +14 -11
- package/dist/module/workflow/repository/form-master.repository.js.map +1 -1
- package/dist/module/workflow/repository/stage-group.repository.d.ts +4 -5
- package/dist/module/workflow/repository/stage-group.repository.js +34 -35
- package/dist/module/workflow/repository/stage-group.repository.js.map +1 -1
- package/dist/module/workflow/repository/stage-movement.repository.d.ts +6 -3
- package/dist/module/workflow/repository/stage-movement.repository.js +30 -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/service/action-template-mapping.service.js +4 -4
- package/dist/module/workflow/service/action.service.d.ts +13 -5
- package/dist/module/workflow/service/action.service.js +71 -20
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/module/workflow/service/entity-modification.service.d.ts +3 -3
- package/dist/module/workflow/service/entity-modification.service.js +5 -5
- package/dist/module/workflow/service/entity-modification.service.js.map +1 -1
- package/dist/module/workflow/service/form-master.service.d.ts +4 -1
- package/dist/module/workflow/service/stage-group.service.d.ts +2 -7
- package/dist/module/workflow/service/stage-group.service.js +19 -17
- package/dist/module/workflow/service/stage-group.service.js.map +1 -1
- package/dist/module/workflow/service/stage.service.d.ts +2 -3
- package/dist/module/workflow/service/stage.service.js +24 -11
- package/dist/module/workflow/service/stage.service.js.map +1 -1
- package/dist/module/workflow/service/task.service.d.ts +2 -5
- package/dist/module/workflow/service/task.service.js +49 -50
- package/dist/module/workflow/service/task.service.js.map +1 -1
- package/dist/module/workflow/service/workflow-list-master.service.d.ts +1 -3
- package/dist/module/workflow/service/workflow-list-master.service.js +38 -26
- package/dist/module/workflow/service/workflow-list-master.service.js.map +1 -1
- package/dist/module/workflow/service/workflow-meta.service.d.ts +6 -3
- package/dist/module/workflow/service/workflow-meta.service.js +78 -50
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
- package/dist/module/workflow/service/workflow.service.d.ts +1 -3
- package/dist/module/workflow/service/workflow.service.js +10 -6
- package/dist/module/workflow/service/workflow.service.js.map +1 -1
- package/dist/module/workflow-automation/service/schedule-handler.service.js +9 -9
- package/dist/module/workflow-schedule/processors/schedule.processor.d.ts +4 -2
- package/dist/module/workflow-schedule/processors/schedule.processor.js +51 -38
- package/dist/module/workflow-schedule/processors/schedule.processor.js.map +1 -1
- package/dist/module/workflow-schedule/service/workflow-schedule.service.d.ts +2 -3
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js +15 -14
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/service/reflection-helper.service.js +2 -2
- 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 +125 -125
- package/server.log +850 -0
- package/src/app.controller.ts +12 -12
- package/src/app.module.ts +66 -66
- package/src/app.service.ts +8 -8
- package/src/config/bull.config.ts +69 -69
- package/src/config/config.module.ts +17 -17
- package/src/config/database.config.ts +48 -48
- package/src/constant/global.constant.ts +67 -67
- package/src/core.module.ts +91 -91
- 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 +56 -56
- 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 +51 -51
- package/src/module/dashboard/service/dashboard.service.ts +73 -73
- 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 +272 -272
- 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 +47 -47
- package/src/module/entity_json/entity/entityJson.entity.ts +39 -39
- package/src/module/entity_json/entity_json.module.ts +18 -18
- package/src/module/entity_json/service/entityJson.repository.ts +37 -37
- package/src/module/entity_json/service/entity_json.service.ts +234 -234
- 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 +33 -33
- package/src/module/filter/repository/saved-filter.repository.ts +168 -168
- package/src/module/filter/repository/saved.filter-detail.repository.ts +19 -19
- package/src/module/filter/service/filter-evaluator.service.ts +82 -82
- package/src/module/filter/service/filter.service.ts +1304 -1304
- 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 +2634 -2634
- package/src/module/integration/service/oauth.service.ts +224 -224
- package/src/module/integration/service/wrapper.service.ts +716 -716
- 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 +37 -37
- package/src/module/linked_attributes/entity/linked_attribute.entity.ts +51 -51
- package/src/module/linked_attributes/linked_attributes.module.ts +16 -16
- package/src/module/linked_attributes/repository/linked_attribute.repository.ts +12 -12
- package/src/module/linked_attributes/service/linked_attributes.service.ts +75 -75
- 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 +173 -173
- package/src/module/listmaster/repository/list-master.repository.ts +56 -56
- 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 +281 -281
- 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 +35 -35
- 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 +32 -32
- package/src/module/mapper/service/field-mapper.service.ts +269 -269
- package/src/module/mapper/service/mapper.service.ts +81 -81
- 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 +84 -84
- package/src/module/meta/controller/entity-dynamic.controller.ts +125 -125
- package/src/module/meta/controller/entity-master.controller.ts +41 -41
- 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 +92 -92
- 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 -166
- package/src/module/meta/repository/app-master.repository.ts +20 -20
- package/src/module/meta/repository/attribute-master.repository.ts +156 -156
- package/src/module/meta/repository/entity-attribute-update.repository.ts +48 -48
- package/src/module/meta/repository/entity-master.repository.ts +109 -109
- 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 +130 -130
- package/src/module/meta/service/common.service.ts +9 -9
- package/src/module/meta/service/entity-attribute-update.service.ts +28 -28
- package/src/module/meta/service/entity-dynamic.service.ts +813 -813
- package/src/module/meta/service/entity-list.service.ts +205 -205
- package/src/module/meta/service/entity-master.service.ts +171 -171
- package/src/module/meta/service/entity-realation-data.service.ts +9 -9
- package/src/module/meta/service/entity-relation.service.ts +69 -87
- 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 +510 -510
- package/src/module/meta/service/populate-meta.service.ts +222 -222
- package/src/module/meta/service/preference.service.ts +16 -16
- package/src/module/meta/service/resolver.service.ts +292 -292
- 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 +199 -195
- 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 +164 -160
- package/src/module/notification/service/otp.service.ts +133 -133
- 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 +198 -198
- 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 +326 -326
- package/src/module/user/service/role.service.ts +197 -197
- package/src/module/user/service/user-role-mapping.service.ts +98 -98
- package/src/module/user/service/user-session.service.ts +177 -177
- package/src/module/user/service/user.service.ts +368 -368
- 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 -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 +344 -339
- package/src/module/workflow/repository/action.repository.ts +338 -341
- package/src/module/workflow/repository/activity-log.repository.ts +148 -148
- package/src/module/workflow/repository/comm-template.repository.ts +157 -151
- package/src/module/workflow/repository/form-master.repository.ts +50 -59
- package/src/module/workflow/repository/stage-group.repository.ts +186 -197
- package/src/module/workflow/repository/stage-movement.repository.ts +256 -253
- package/src/module/workflow/repository/stage.repository.ts +160 -160
- package/src/module/workflow/repository/task.repository.ts +151 -151
- 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 +131 -131
- package/src/module/workflow/service/action.service.ts +306 -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 +61 -61
- package/src/module/workflow/service/form-master.service.ts +35 -35
- package/src/module/workflow/service/populate-workflow.service.ts +320 -320
- package/src/module/workflow/service/stage-action-mapping.service.ts +5 -5
- package/src/module/workflow/service/stage-group.service.ts +344 -342
- package/src/module/workflow/service/stage.service.ts +207 -199
- package/src/module/workflow/service/task.service.ts +546 -549
- package/src/module/workflow/service/workflow-list-master.service.ts +68 -60
- package/src/module/workflow/service/workflow-meta.service.ts +639 -635
- package/src/module/workflow/service/workflow.service.ts +213 -209
- package/src/module/workflow/workflow.module.ts +180 -180
- package/src/module/workflow-automation/SCHEDULING_GUIDE.md +145 -145
- package/src/module/workflow-automation/controller/workflow-automation.controller.ts +43 -43
- package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +26 -26
- package/src/module/workflow-automation/entity/workflow-automation.entity.ts +40 -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/schedule-handler.service.ts +168 -168
- package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +219 -219
- package/src/module/workflow-automation/service/workflow-automation.service.ts +515 -515
- package/src/module/workflow-automation/workflow-automation.module.ts +54 -54
- package/src/module/workflow-schedule/INSTALLATION.md +244 -244
- package/src/module/workflow-schedule/MULTI_PROJECT_GUIDE.md +196 -196
- package/src/module/workflow-schedule/README.md +422 -422
- package/src/module/workflow-schedule/constants/schedule.constants.ts +48 -48
- package/src/module/workflow-schedule/controller/workflow-schedule.controller.ts +255 -255
- package/src/module/workflow-schedule/docs/CLAUDE_CODE_GUIDE.md +510 -510
- package/src/module/workflow-schedule/docs/CLAUDE_CODE_PROMPT.md +362 -362
- package/src/module/workflow-schedule/docs/RUN_CLAUDE_CODE.sh +68 -68
- package/src/module/workflow-schedule/dto/create-schedule.dto.ts +147 -147
- package/src/module/workflow-schedule/dto/get-execution-logs.dto.ts +119 -119
- package/src/module/workflow-schedule/dto/update-schedule.dto.ts +96 -96
- package/src/module/workflow-schedule/entities/scheduled-workflow.entity.ts +148 -148
- package/src/module/workflow-schedule/entities/workflow-execution-log.entity.ts +154 -154
- package/src/module/workflow-schedule/interfaces/schedule-job-data.interface.ts +53 -53
- package/src/module/workflow-schedule/interfaces/workflow-schedule-options.interface.ts +12 -12
- package/src/module/workflow-schedule/processors/schedule.processor.ts +620 -584
- package/src/module/workflow-schedule/service/workflow-schedule.service.ts +598 -600
- package/src/module/workflow-schedule/workflow-schedule.module.ts +67 -67
- package/src/resources/dev.properties.yaml +31 -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 +133 -133
- 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 -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 +27 -27
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +24 -24
- package/.vscode/extensions.json +0 -5
|
@@ -17,16 +17,15 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const stage_group_entity_1 = require("../entity/stage-group.entity");
|
|
18
18
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
19
|
const typeorm_2 = require("typeorm");
|
|
20
|
-
const media_data_service_1 = require("../../meta/service/media-data.service");
|
|
21
20
|
const stage_entity_1 = require("../entity/stage.entity");
|
|
22
21
|
const task_data_entity_1 = require("../entity/task-data.entity");
|
|
22
|
+
const reflection_helper_service_1 = require("../../../utils/service/reflection-helper.service");
|
|
23
23
|
let StageGroupRepository = class StageGroupRepository {
|
|
24
|
-
constructor(stageGroupRepository, stageRepository, taskDataRepo,
|
|
24
|
+
constructor(stageGroupRepository, stageRepository, taskDataRepo, reflectionHelper) {
|
|
25
25
|
this.stageGroupRepository = stageGroupRepository;
|
|
26
26
|
this.stageRepository = stageRepository;
|
|
27
27
|
this.taskDataRepo = taskDataRepo;
|
|
28
|
-
this.
|
|
29
|
-
this.mediaDataService = mediaDataService;
|
|
28
|
+
this.reflectionHelper = reflectionHelper;
|
|
30
29
|
}
|
|
31
30
|
async getAllStageGroup(workflow_id, organization_id) {
|
|
32
31
|
if (!workflow_id) {
|
|
@@ -74,43 +73,44 @@ let StageGroupRepository = class StageGroupRepository {
|
|
|
74
73
|
const stagesRaw = await this.stageRepository.find({
|
|
75
74
|
where: {
|
|
76
75
|
stage_group_id: (0, typeorm_2.In)(stageGroupIds),
|
|
77
|
-
organization_id: loggedInUser.organization_id
|
|
76
|
+
organization_id: loggedInUser.organization_id,
|
|
78
77
|
},
|
|
79
78
|
order: {
|
|
80
79
|
sequence: 'ASC',
|
|
81
|
-
}
|
|
80
|
+
},
|
|
82
81
|
});
|
|
83
82
|
const stageIds = stagesRaw.map((s) => Number(s.id));
|
|
84
83
|
if (stageIds.length === 0) {
|
|
85
84
|
return stageGroups.map((sg) => ({ ...sg, stages: [] }));
|
|
86
85
|
}
|
|
87
|
-
const
|
|
88
|
-
.
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const sendCommCounts = await
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
86
|
+
const taskCounts = await this.taskDataRepo
|
|
87
|
+
.createQueryBuilder('t')
|
|
88
|
+
.select('t.stage_id', 'stage_id')
|
|
89
|
+
.addSelect('COUNT(*)', 'task_count')
|
|
90
|
+
.where('t.stage_id IN (:...stageIds)', { stageIds })
|
|
91
|
+
.andWhere('t.is_system = false')
|
|
92
|
+
.andWhere('t.mapped_entity_id = :leadId', { leadId: lead_id })
|
|
93
|
+
.groupBy('t.stage_id')
|
|
94
|
+
.getRawMany();
|
|
95
|
+
const leadMeetingRepo = this.reflectionHelper.getRepoService('LeadScheduleMeet');
|
|
96
|
+
const meetingCounts = await leadMeetingRepo
|
|
97
|
+
.createQueryBuilder('m')
|
|
98
|
+
.select('m.stage_id', 'stage_id')
|
|
99
|
+
.addSelect('COUNT(*)', 'meeting_count')
|
|
100
|
+
.where('m.stage_id IN (:...stageIds)', { stageIds })
|
|
101
|
+
.andWhere('m.mapped_entity_id = :leadId', { leadId: lead_id })
|
|
102
|
+
.groupBy('m.stage_id')
|
|
103
|
+
.getRawMany();
|
|
104
|
+
const leadCommunicationRepo = this.reflectionHelper.getRepoService('LeadCommunication');
|
|
105
|
+
const sendCommCounts = await leadCommunicationRepo
|
|
106
|
+
.createQueryBuilder('c')
|
|
107
|
+
.select('c.stage_id', 'stage_id')
|
|
108
|
+
.addSelect('COUNT(*)', 'send_comm_count')
|
|
109
|
+
.where('c.stage_id IN (:...stageIds)', { stageIds })
|
|
110
|
+
.andWhere('c.mapped_entity_id = :leadId', { leadId: lead_id })
|
|
111
|
+
.andWhere('c.type IN (:...types)', { types: ['SEND', 'LOG'] })
|
|
112
|
+
.groupBy('c.stage_id')
|
|
113
|
+
.getRawMany();
|
|
114
114
|
const taskCountMap = new Map(taskCounts.map((r) => [Number(r.stage_id), Number(r.task_count)]));
|
|
115
115
|
const meetingCountMap = new Map(meetingCounts.map((r) => [Number(r.stage_id), Number(r.meeting_count)]));
|
|
116
116
|
const sendCommCountMap = new Map(sendCommCounts.map((r) => [Number(r.stage_id), Number(r.send_comm_count)]));
|
|
@@ -140,7 +140,6 @@ exports.StageGroupRepository = StageGroupRepository = __decorate([
|
|
|
140
140
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
141
141
|
typeorm_2.Repository,
|
|
142
142
|
typeorm_2.Repository,
|
|
143
|
-
|
|
144
|
-
media_data_service_1.MediaDataService])
|
|
143
|
+
reflection_helper_service_1.ReflectionHelper])
|
|
145
144
|
], StageGroupRepository);
|
|
146
145
|
//# sourceMappingURL=stage-group.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage-group.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage-group.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"stage-group.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage-group.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoF;AACpF,qEAA0D;AAC1D,6CAAmD;AACnD,qCAAyC;AACzC,yDAA+C;AAC/C,iEAA4D;AAC5D,gGAAoF;AAG7E,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAEmB,oBAA4C,EAE5C,eAAkC,EAElC,YAAwC,EACxC,gBAAkC;QALlC,yBAAoB,GAApB,oBAAoB,CAAwB;QAE5C,oBAAe,GAAf,eAAe,CAAmB;QAElC,iBAAY,GAAZ,YAAY,CAA4B;QACxC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAErD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,WAAmB,EAAE,eAAuB;QACjE,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,M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AAc,CAAC,CAAA;qCAHM,oBAAU;QAEf,oBAAU;QAEb,oBAAU;QACN,4CAAgB;GAR1C,oBAAoB,CAgLhC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { Repository
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
2
|
import { WorkflowLevelMappingEntity } from '../entity/workflow-level-mapping.entity';
|
|
3
3
|
import { StageGroup } from '../entity/stage-group.entity';
|
|
4
4
|
import { Stage } from '../entity/stage.entity';
|
|
5
5
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
6
6
|
import { ReflectionHelper } from '../../../utils/service/reflection-helper.service';
|
|
7
|
+
import { ActionDataEntity } from '../entity/action-data.entity';
|
|
8
|
+
import { TaskDataEntity } from '../entity/task-data.entity';
|
|
7
9
|
export declare class StageMovementRepository {
|
|
8
10
|
private readonly workflowLevelMappingRepo;
|
|
9
11
|
private readonly stageGroupRepo;
|
|
10
12
|
private readonly stageRepo;
|
|
11
|
-
private readonly dataSource;
|
|
12
13
|
private readonly reflectionHelper;
|
|
13
|
-
|
|
14
|
+
private readonly actionDataEntityRepository;
|
|
15
|
+
private readonly taskDataEntityRepository;
|
|
16
|
+
constructor(workflowLevelMappingRepo: Repository<WorkflowLevelMappingEntity>, stageGroupRepo: Repository<StageGroup>, stageRepo: Repository<Stage>, reflectionHelper: ReflectionHelper, actionDataEntityRepository: Repository<ActionDataEntity>, taskDataEntityRepository: Repository<TaskDataEntity>);
|
|
14
17
|
getFirstStage({ loggedInUser, mapped_entity_type, mapped_entity_id, }: {
|
|
15
18
|
loggedInUser: any;
|
|
16
19
|
mapped_entity_type: string;
|
|
@@ -20,13 +20,16 @@ const workflow_level_mapping_entity_1 = require("../entity/workflow-level-mappin
|
|
|
20
20
|
const stage_group_entity_1 = require("../entity/stage-group.entity");
|
|
21
21
|
const stage_entity_1 = require("../entity/stage.entity");
|
|
22
22
|
const reflection_helper_service_1 = require("../../../utils/service/reflection-helper.service");
|
|
23
|
+
const action_data_entity_1 = require("../entity/action-data.entity");
|
|
24
|
+
const task_data_entity_1 = require("../entity/task-data.entity");
|
|
23
25
|
let StageMovementRepository = class StageMovementRepository {
|
|
24
|
-
constructor(workflowLevelMappingRepo, stageGroupRepo, stageRepo,
|
|
26
|
+
constructor(workflowLevelMappingRepo, stageGroupRepo, stageRepo, reflectionHelper, actionDataEntityRepository, taskDataEntityRepository) {
|
|
25
27
|
this.workflowLevelMappingRepo = workflowLevelMappingRepo;
|
|
26
28
|
this.stageGroupRepo = stageGroupRepo;
|
|
27
29
|
this.stageRepo = stageRepo;
|
|
28
|
-
this.dataSource = dataSource;
|
|
29
30
|
this.reflectionHelper = reflectionHelper;
|
|
31
|
+
this.actionDataEntityRepository = actionDataEntityRepository;
|
|
32
|
+
this.taskDataEntityRepository = taskDataEntityRepository;
|
|
30
33
|
}
|
|
31
34
|
async getFirstStage({ loggedInUser, mapped_entity_type, mapped_entity_id, }) {
|
|
32
35
|
let workflowLevelMapping = await this.workflowLevelMappingRepo.findOne({
|
|
@@ -111,25 +114,25 @@ let StageMovementRepository = class StageMovementRepository {
|
|
|
111
114
|
async getAllActionByStageId(stageId) {
|
|
112
115
|
const actionRepo = this.reflectionHelper.getRepoService('ActionEntity');
|
|
113
116
|
const result = await actionRepo
|
|
114
|
-
.createQueryBuilder(
|
|
115
|
-
.leftJoin(
|
|
116
|
-
.leftJoin(
|
|
117
|
-
.where(
|
|
117
|
+
.createQueryBuilder('a')
|
|
118
|
+
.leftJoin('frm_wf_stage_action_mapping', 'm', 'a.id = m.action_id::bigint')
|
|
119
|
+
.leftJoin('frm_wf_action_category', 'ac', 'a.action_category::bigint = ac.id')
|
|
120
|
+
.where('m.stage_id::bigint = :stageId', { stageId: Number(stageId) })
|
|
118
121
|
.select([
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
'a.*',
|
|
123
|
+
'm.id AS mapping_id',
|
|
124
|
+
'm.stage_id AS stage_id',
|
|
125
|
+
'ac.code AS action_category_code',
|
|
123
126
|
])
|
|
124
|
-
.orderBy(
|
|
127
|
+
.orderBy('a.sequence', 'ASC')
|
|
125
128
|
.getRawMany();
|
|
126
129
|
const actionResourceMappingRepo = this.reflectionHelper.getRepoService('ActionResourcesMapping');
|
|
127
130
|
for (const item of result) {
|
|
128
131
|
if (item.action_category_code === 'SDFM') {
|
|
129
132
|
const actionData = await actionResourceMappingRepo.findOne({
|
|
130
133
|
where: {
|
|
131
|
-
stg_act_mapping_id: item.mapping_id
|
|
132
|
-
}
|
|
134
|
+
stg_act_mapping_id: item.mapping_id,
|
|
135
|
+
},
|
|
133
136
|
});
|
|
134
137
|
item.form_id = actionData?.form_id || null;
|
|
135
138
|
}
|
|
@@ -139,14 +142,21 @@ let StageMovementRepository = class StageMovementRepository {
|
|
|
139
142
|
async saveActionData(action, loggedInUser) {
|
|
140
143
|
if (action.length > 0) {
|
|
141
144
|
for (const act of action) {
|
|
142
|
-
await this.
|
|
145
|
+
await this.actionDataEntityRepository.save({
|
|
146
|
+
stage_id: act.stage_id,
|
|
147
|
+
user_id: loggedInUser.id,
|
|
148
|
+
action_id: act.id,
|
|
149
|
+
});
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
152
|
}
|
|
146
153
|
async saveTaskData(actionData, loggedInUser) {
|
|
147
154
|
if (actionData.length > 0) {
|
|
148
155
|
for (const action of actionData) {
|
|
149
|
-
await this.
|
|
156
|
+
await this.taskDataEntityRepository.save({
|
|
157
|
+
action_id: action.id,
|
|
158
|
+
user_id: String(loggedInUser.id),
|
|
159
|
+
});
|
|
150
160
|
}
|
|
151
161
|
}
|
|
152
162
|
}
|
|
@@ -157,10 +167,13 @@ exports.StageMovementRepository = StageMovementRepository = __decorate([
|
|
|
157
167
|
__param(0, (0, typeorm_1.InjectRepository)(workflow_level_mapping_entity_1.WorkflowLevelMappingEntity)),
|
|
158
168
|
__param(1, (0, typeorm_1.InjectRepository)(stage_group_entity_1.StageGroup)),
|
|
159
169
|
__param(2, (0, typeorm_1.InjectRepository)(stage_entity_1.Stage)),
|
|
170
|
+
__param(4, (0, typeorm_1.InjectRepository)(action_data_entity_1.ActionDataEntity)),
|
|
171
|
+
__param(5, (0, typeorm_1.InjectRepository)(task_data_entity_1.TaskDataEntity)),
|
|
160
172
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
161
173
|
typeorm_2.Repository,
|
|
162
174
|
typeorm_2.Repository,
|
|
163
|
-
|
|
164
|
-
|
|
175
|
+
reflection_helper_service_1.ReflectionHelper,
|
|
176
|
+
typeorm_2.Repository,
|
|
177
|
+
typeorm_2.Repository])
|
|
165
178
|
], StageMovementRepository);
|
|
166
179
|
//# sourceMappingURL=stage-movement.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage-movement.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage-movement.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"stage-movement.repository.js","sourceRoot":"","sources":["../../../../src/module/workflow/repository/stage-movement.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAA+C;AAC/C,2FAAqF;AACrF,qEAA0D;AAC1D,yDAA+C;AAE/C,gGAAoF;AACpF,qEAAgE;AAChE,iEAA4D;AAGrD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAEmB,wBAAgE,EAEhE,cAAsC,EAEtC,SAA4B,EAC5B,gBAAkC,EAElC,0BAAwD,EAExD,wBAAoD;QATpD,6BAAwB,GAAxB,wBAAwB,CAAwC;QAEhE,mBAAc,GAAd,cAAc,CAAwB;QAEtC,cAAS,GAAT,SAAS,CAAmB;QAC5B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAElC,+BAA0B,GAA1B,0BAA0B,CAA8B;QAExD,6BAAwB,GAAxB,wBAAwB,CAA4B;IACpE,CAAC;IAEJ,KAAK,CAAC,aAAa,CAAC,EACl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A;IAE5B,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;IAGvB,WAAA,IAAA,0BAAgB,EAAC,qCAAgB,CAAC,CAAA;IAElC,WAAA,IAAA,0BAAgB,EAAC,iCAAc,CAAC,CAAA;qCARU,oBAAU;QAEpB,oBAAU;QAEf,oBAAU;QACH,4CAAgB;QAEN,oBAAU;QAEZ,oBAAU;GAZ5C,uBAAuB,CAmPnC"}
|
|
@@ -62,14 +62,14 @@ let StageRepository = class StageRepository {
|
|
|
62
62
|
if (!stageGroup) {
|
|
63
63
|
return [];
|
|
64
64
|
}
|
|
65
|
-
const rows = await this.dataSource.query(`
|
|
66
|
-
SELECT
|
|
67
|
-
g.id as stage_group_id, g.name as stage_group_name, g.workflow_id,
|
|
68
|
-
s.*
|
|
69
|
-
FROM frm_wf_stage_group g
|
|
70
|
-
INNER JOIN frm_wf_stage s ON s.stage_group_id = g.id
|
|
71
|
-
WHERE g.workflow_id = $1 AND g.organization_id = $2 AND g.id = $3
|
|
72
|
-
ORDER BY g.id, s.id
|
|
65
|
+
const rows = await this.dataSource.query(`
|
|
66
|
+
SELECT
|
|
67
|
+
g.id as stage_group_id, g.name as stage_group_name, g.workflow_id,
|
|
68
|
+
s.*
|
|
69
|
+
FROM frm_wf_stage_group g
|
|
70
|
+
INNER JOIN frm_wf_stage s ON s.stage_group_id = g.id
|
|
71
|
+
WHERE g.workflow_id = $1 AND g.organization_id = $2 AND g.id = $3
|
|
72
|
+
ORDER BY g.id, s.id
|
|
73
73
|
`, [stageGroup.workflow_id, organization_id, stage_group_id]);
|
|
74
74
|
if (!rows || rows.length === 0) {
|
|
75
75
|
return [];
|
|
@@ -113,10 +113,10 @@ let ActionTemplateMappingService = class ActionTemplateMappingService extends en
|
|
|
113
113
|
.andWhere('ct.organization_id = :orgId', { orgId: loggedInUser.organization_id })
|
|
114
114
|
.andWhere('ct.level_type = :levelType', { levelType: loggedInUser.level_type })
|
|
115
115
|
.andWhere('ct.level_id = :levelId', { levelId: Number(loggedInUser.level_id) })
|
|
116
|
-
.andWhere(`ct.status IN (
|
|
117
|
-
SELECT id FROM frm_list_master_items
|
|
118
|
-
WHERE code = 'STATUS_ACTIVE'
|
|
119
|
-
AND organization_id = :orgId2
|
|
116
|
+
.andWhere(`ct.status IN (
|
|
117
|
+
SELECT id FROM frm_list_master_items
|
|
118
|
+
WHERE code = 'STATUS_ACTIVE'
|
|
119
|
+
AND organization_id = :orgId2
|
|
120
120
|
)`, { orgId2: loggedInUser.organization_id })
|
|
121
121
|
.getRawMany();
|
|
122
122
|
}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
2
2
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
3
3
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
4
|
-
import {
|
|
4
|
+
import { EntityManager, Repository } from 'typeorm';
|
|
5
5
|
import { ActionRepository } from '../repository/action.repository';
|
|
6
|
+
import { ActionResourcesMapping } from '../entity/action-resources-mapping.entity';
|
|
7
|
+
import { StageActionMapping } from '../entity/stage-action-mapping.entity';
|
|
8
|
+
import { ActionTemplateMapping } from '../entity/action-template-mapping.entity';
|
|
6
9
|
export declare class ActionService extends EntityServiceImpl {
|
|
7
|
-
private readonly dataSource;
|
|
8
10
|
private readonly actionRepository;
|
|
9
|
-
|
|
11
|
+
private readonly actionResourcesMappingRepository;
|
|
12
|
+
private readonly stageActionMappingRepository;
|
|
13
|
+
private readonly actionTemplateMappingRepository;
|
|
14
|
+
constructor(actionRepository: ActionRepository, actionResourcesMappingRepository: Repository<ActionResourcesMapping>, stageActionMappingRepository: Repository<StageActionMapping>, actionTemplateMappingRepository: Repository<ActionTemplateMapping>);
|
|
10
15
|
getEntityData(entityType: string, id: number, loggedInUser: any): Promise<any>;
|
|
11
16
|
createEntity(entityData: BaseEntity, loggedInUser: UserData | null, manager?: EntityManager | null, appcode?: string): Promise<any>;
|
|
12
17
|
updateEntity(entityData: BaseEntity, loggedInUser: UserData): Promise<any>;
|
|
13
18
|
deleteEntity(entityType: string, id: number, loggedInUser: UserData): Promise<any>;
|
|
14
19
|
getReasonCode(loggedInUser: UserData): Promise<any>;
|
|
15
|
-
defaultReasonCode(list_type: string, loggedInUser: UserData): Promise<
|
|
20
|
+
defaultReasonCode(list_type: string, loggedInUser: UserData): Promise<{
|
|
21
|
+
label: any;
|
|
22
|
+
value: any;
|
|
23
|
+
}[]>;
|
|
16
24
|
getActions(loggedInUser: UserData, stage_id: number): Promise<any[]>;
|
|
17
25
|
getDependentActions(loggedInUser: UserData, stage_id: number, action_id: number | undefined): Promise<any>;
|
|
18
26
|
getAction(loggedInUser: UserData, stage_id: number, mapped_entity_id: number, mapped_entity_type: string): Promise<{
|
|
@@ -25,7 +33,7 @@ export declare class ActionService extends EntityServiceImpl {
|
|
|
25
33
|
name: any;
|
|
26
34
|
reason_code: any;
|
|
27
35
|
default_reason_code: any;
|
|
28
|
-
is_default:
|
|
36
|
+
is_default: any;
|
|
29
37
|
is_current: any;
|
|
30
38
|
is_done: any;
|
|
31
39
|
is_mandatory: any;
|
|
@@ -8,30 +8,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.ActionService = void 0;
|
|
13
16
|
const common_1 = require("@nestjs/common");
|
|
14
17
|
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
15
18
|
const typeorm_1 = require("typeorm");
|
|
16
19
|
const action_repository_1 = require("../repository/action.repository");
|
|
20
|
+
const action_resources_mapping_entity_1 = require("../entity/action-resources-mapping.entity");
|
|
21
|
+
const typeorm_2 = require("@nestjs/typeorm");
|
|
22
|
+
const stage_action_mapping_entity_1 = require("../entity/stage-action-mapping.entity");
|
|
23
|
+
const action_template_mapping_entity_1 = require("../entity/action-template-mapping.entity");
|
|
17
24
|
let ActionService = class ActionService extends entity_service_impl_service_1.EntityServiceImpl {
|
|
18
|
-
constructor(
|
|
25
|
+
constructor(actionRepository, actionResourcesMappingRepository, stageActionMappingRepository, actionTemplateMappingRepository) {
|
|
19
26
|
super();
|
|
20
|
-
this.dataSource = dataSource;
|
|
21
27
|
this.actionRepository = actionRepository;
|
|
28
|
+
this.actionResourcesMappingRepository = actionResourcesMappingRepository;
|
|
29
|
+
this.stageActionMappingRepository = stageActionMappingRepository;
|
|
30
|
+
this.actionTemplateMappingRepository = actionTemplateMappingRepository;
|
|
22
31
|
}
|
|
23
32
|
async getEntityData(entityType, id, loggedInUser) {
|
|
24
33
|
const actionData = await super.getEntityData(entityType, id, loggedInUser);
|
|
25
34
|
if (!actionData) {
|
|
26
35
|
return null;
|
|
27
36
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
let actionResourceMappingRepo = this.reflectionHelper.getRepoService('ActionResourcesMapping');
|
|
38
|
+
await actionResourceMappingRepo.find({
|
|
39
|
+
where: {},
|
|
40
|
+
});
|
|
41
|
+
const result = await actionResourceMappingRepo
|
|
42
|
+
.createQueryBuilder('arm')
|
|
43
|
+
.select([
|
|
44
|
+
'arm.template_code AS template_code',
|
|
45
|
+
'arm.form_id AS form_id',
|
|
46
|
+
])
|
|
47
|
+
.where(`arm.stg_act_mapping_id IN (
|
|
48
|
+
SELECT sam.id
|
|
49
|
+
FROM frm_wf_stage_action_mapping sam
|
|
50
|
+
WHERE sam.action_id = :actionId
|
|
51
|
+
AND sam.entity_type = 'WFSA'
|
|
52
|
+
)`)
|
|
53
|
+
.setParameter('actionId', actionData.id)
|
|
54
|
+
.getRawMany();
|
|
35
55
|
const templates = result
|
|
36
56
|
.filter((t) => t.template_code !== null)
|
|
37
57
|
.map((t) => t.template_code);
|
|
@@ -69,7 +89,10 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
69
89
|
await super.createEntity(resourceMapping, loggedInUser);
|
|
70
90
|
}
|
|
71
91
|
}
|
|
72
|
-
await this.
|
|
92
|
+
await this.actionResourcesMappingRepository.delete({
|
|
93
|
+
stg_act_mapping_id: stageActionMappingData.id,
|
|
94
|
+
type: 'form',
|
|
95
|
+
});
|
|
73
96
|
if (actionData.form) {
|
|
74
97
|
const resourceMapping = {
|
|
75
98
|
stg_act_mapping_id: stageActionMappingData.id,
|
|
@@ -89,11 +112,16 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
89
112
|
if (!action) {
|
|
90
113
|
throw new Error('Action not found or could not be updated');
|
|
91
114
|
}
|
|
92
|
-
const
|
|
115
|
+
const stageMap = await this.stageActionMappingRepository.findOne({
|
|
116
|
+
where: {
|
|
117
|
+
action_id: action.id,
|
|
118
|
+
entity_type: 'WFSA',
|
|
119
|
+
},
|
|
120
|
+
});
|
|
93
121
|
let stageActionMappingData;
|
|
94
|
-
if (
|
|
122
|
+
if (stageMap) {
|
|
95
123
|
const stageActionMapping = {
|
|
96
|
-
id:
|
|
124
|
+
id: stageMap.id,
|
|
97
125
|
action_id: action.id,
|
|
98
126
|
stage_id,
|
|
99
127
|
entity_type: 'WFSA',
|
|
@@ -109,7 +137,10 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
109
137
|
};
|
|
110
138
|
stageActionMappingData = await super.createEntity(newStageMapping, loggedInUser);
|
|
111
139
|
}
|
|
112
|
-
await this.
|
|
140
|
+
await this.actionResourcesMappingRepository.delete({
|
|
141
|
+
stg_act_mapping_id: stageActionMappingData.id,
|
|
142
|
+
type: 'template',
|
|
143
|
+
});
|
|
113
144
|
if (Array.isArray(template) && template.length > 0) {
|
|
114
145
|
for (let i = 0; i < template.length; i++) {
|
|
115
146
|
const templateCode = template[i];
|
|
@@ -123,7 +154,10 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
123
154
|
console.log(res);
|
|
124
155
|
}
|
|
125
156
|
}
|
|
126
|
-
await this.
|
|
157
|
+
await this.actionResourcesMappingRepository.delete({
|
|
158
|
+
stg_act_mapping_id: stageActionMappingData.id,
|
|
159
|
+
type: 'form',
|
|
160
|
+
});
|
|
127
161
|
if (form) {
|
|
128
162
|
const resourceMapping = {
|
|
129
163
|
stg_act_mapping_id: stageActionMappingData.id,
|
|
@@ -136,9 +170,21 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
136
170
|
return action;
|
|
137
171
|
}
|
|
138
172
|
async deleteEntity(entityType, id, loggedInUser) {
|
|
139
|
-
await this.
|
|
140
|
-
|
|
141
|
-
|
|
173
|
+
await this.actionTemplateMappingRepository
|
|
174
|
+
.createQueryBuilder()
|
|
175
|
+
.delete()
|
|
176
|
+
.where(`stg_act_mapping_id IN (
|
|
177
|
+
SELECT sam.id
|
|
178
|
+
FROM frm_wf_stage_action_mapping sam
|
|
179
|
+
WHERE sam.action_id = :actionId
|
|
180
|
+
AND sam.entity_type = 'WFSA'
|
|
181
|
+
)`)
|
|
182
|
+
.setParameter('actionId', id)
|
|
183
|
+
.execute();
|
|
184
|
+
await this.stageActionMappingRepository.delete({
|
|
185
|
+
action_id: id,
|
|
186
|
+
entity_type: 'WFSA',
|
|
187
|
+
});
|
|
142
188
|
const deleteAction = await super.deleteEntity(entityType, id, loggedInUser);
|
|
143
189
|
return deleteAction;
|
|
144
190
|
}
|
|
@@ -162,7 +208,12 @@ let ActionService = class ActionService extends entity_service_impl_service_1.En
|
|
|
162
208
|
exports.ActionService = ActionService;
|
|
163
209
|
exports.ActionService = ActionService = __decorate([
|
|
164
210
|
(0, common_1.Injectable)(),
|
|
165
|
-
|
|
166
|
-
|
|
211
|
+
__param(1, (0, typeorm_2.InjectRepository)(action_resources_mapping_entity_1.ActionResourcesMapping)),
|
|
212
|
+
__param(2, (0, typeorm_2.InjectRepository)(stage_action_mapping_entity_1.StageActionMapping)),
|
|
213
|
+
__param(3, (0, typeorm_2.InjectRepository)(action_template_mapping_entity_1.ActionTemplateMapping)),
|
|
214
|
+
__metadata("design:paramtypes", [action_repository_1.ActionRepository,
|
|
215
|
+
typeorm_1.Repository,
|
|
216
|
+
typeorm_1.Repository,
|
|
217
|
+
typeorm_1.Repository])
|
|
167
218
|
], ActionService);
|
|
168
219
|
//# sourceMappingURL=action.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"action.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAE5C,gGAAwF;AAExF,qCAAoD;AACpD,uEAAmE;AAEnE,+FAAmF;AACnF,6CAAmD;AACnD,uFAA2E;AAC3E,6FAAiF;AAG1E,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,+CAAiB;IAClD,YACmB,gBAAkC,EAElC,gCAAoE,EAEpE,4BAA4D,EAE5D,+BAAkE;QAEnF,KAAK,EAAE,CAAC;QARS,qBAAgB,GAAhB,gBAAgB,CAAkB;QAElC,qCAAgC,GAAhC,gCAAgC,CAAoC;QAEpE,iCAA4B,GAA5B,4BAA4B,CAAgC;QAE5D,oCAA+B,GAA/B,+BAA+B,CAAmC;IAGrF,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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BAAgB,EAAC,wDAAsB,CAAC,CAAA;IAExC,WAAA,IAAA,0BAAgB,EAAC,gDAAkB,CAAC,CAAA;IAEpC,WAAA,IAAA,0BAAgB,EAAC,sDAAqB,CAAC,CAAA;qCALL,oCAAgB;QAEA,oBAAU;QAEd,oBAAU;QAEP,oBAAU;GARnD,aAAa,CAoSzB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
2
2
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
3
|
-
import {
|
|
3
|
+
import { EntityManager } from 'typeorm';
|
|
4
4
|
export declare class EntityModificationService extends EntityServiceImpl {
|
|
5
|
-
private readonly
|
|
6
|
-
constructor(
|
|
5
|
+
private readonly entityManager;
|
|
6
|
+
constructor(entityManager: EntityManager);
|
|
7
7
|
logModification(modificationData: any, loggedInUser: UserData): Promise<any>;
|
|
8
8
|
}
|
|
@@ -14,9 +14,9 @@ const common_1 = require("@nestjs/common");
|
|
|
14
14
|
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
let EntityModificationService = class EntityModificationService extends entity_service_impl_service_1.EntityServiceImpl {
|
|
17
|
-
constructor(
|
|
17
|
+
constructor(entityManager) {
|
|
18
18
|
super();
|
|
19
|
-
this.
|
|
19
|
+
this.entityManager = entityManager;
|
|
20
20
|
}
|
|
21
21
|
async logModification(modificationData, loggedInUser) {
|
|
22
22
|
const { mapped_entity_type, mapped_entity_id, attribute_key } = modificationData;
|
|
@@ -29,8 +29,8 @@ let EntityModificationService = class EntityModificationService extends entity_s
|
|
|
29
29
|
throw new common_1.NotFoundException('Entity metadata not found in frm_entity_master');
|
|
30
30
|
}
|
|
31
31
|
const tableName = entityMeta.db_table_name;
|
|
32
|
-
const [entityRow] = await this.
|
|
33
|
-
SELECT * FROM ${tableName} WHERE id = $1
|
|
32
|
+
const [entityRow] = await this.entityManager.query(`
|
|
33
|
+
SELECT * FROM ${tableName} WHERE id = $1
|
|
34
34
|
`, [mapped_entity_id]);
|
|
35
35
|
if (!entityRow) {
|
|
36
36
|
throw new common_1.NotFoundException(`No record found in ${tableName} with ID ${mapped_entity_id}`);
|
|
@@ -43,6 +43,6 @@ let EntityModificationService = class EntityModificationService extends entity_s
|
|
|
43
43
|
exports.EntityModificationService = EntityModificationService;
|
|
44
44
|
exports.EntityModificationService = EntityModificationService = __decorate([
|
|
45
45
|
(0, common_1.Injectable)(),
|
|
46
|
-
__metadata("design:paramtypes", [typeorm_1.
|
|
46
|
+
__metadata("design:paramtypes", [typeorm_1.EntityManager])
|
|
47
47
|
], EntityModificationService);
|
|
48
48
|
//# sourceMappingURL=entity-modification.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-modification.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/entity-modification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAIwB;AACxB,gGAAwF;AAExF,
|
|
1
|
+
{"version":3,"file":"entity-modification.service.js","sourceRoot":"","sources":["../../../../src/module/workflow/service/entity-modification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAIwB;AACxB,gGAAwF;AAExF,qCAAoD;AAI7C,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,+CAAiB;IAC9D,YAA6B,aAA4B;QAEvD,KAAK,EAAE,CAAC;QAFmB,kBAAa,GAAb,aAAa,CAAe;IAGzD,CAAC;IACD,KAAK,CAAC,eAAe,CAAC,gBAAqB,EAAE,YAAsB;QACjE,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAC3D,gBAAgB,CAAC;QACnB,MAAM,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QAEzC,IAAI,CAAC,kBAAkB,IAAI,CAAC,gBAAgB,IAAI,CAAC,aAAa,EAAE,CAAC;YAC/D,MAAM,IAAI,4BAAmB,CAC3B,4FAA4F,CAC7F,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;QAElG,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;YAC7C,MAAM,IAAI,0BAAiB,CACzB,gDAAgD,CACjD,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC;QAG3C,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAChD;oBACc,SAAS;KACxB,EACC,CAAC,gBAAgB,CAAC,CACnB,CAAC;QAEF,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,0BAAiB,CACzB,sBAAsB,SAAS,YAAY,gBAAgB,EAAE,CAC9D,CAAC;QACJ,CAAC;QAGD,MAAM,qBAAqB,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;QAGvD,gBAAgB,CAAC,aAAa,GAAG,qBAAqB,CAAC;QAGvD,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AAjDY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAEiC,uBAAa;GAD9C,yBAAyB,CAiDrC"}
|
|
@@ -4,7 +4,10 @@ import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.s
|
|
|
4
4
|
export declare class FormMasterService extends EntityServiceImpl {
|
|
5
5
|
private readonly formMasterRepository;
|
|
6
6
|
constructor(formMasterRepository: FormMasterRepository);
|
|
7
|
-
getForms(loggedInUser: UserData, source_entity_type: string): Promise<
|
|
7
|
+
getForms(loggedInUser: UserData, source_entity_type: string): Promise<{
|
|
8
|
+
label: any;
|
|
9
|
+
value: any;
|
|
10
|
+
}[]>;
|
|
8
11
|
saveForm(data: {
|
|
9
12
|
entity_id: number;
|
|
10
13
|
entity_type: string;
|