import { Injectable } from "@nestjs/common"; import { EntityServiceImpl } from "./entity-service-impl.service"; import { EntityUpdateRepository } from "../repository/entity-attribute-update.repository"; import { ActionHandler } from "src/module/workflow-automation/interface/action.decorator"; @Injectable() @ActionHandler('update_attribute') export class EntityUpdateService extends EntityServiceImpl{ constructor( private readonly entityUpdateRepository:EntityUpdateRepository ){ super(); } name = 'update_attribute'; async execute(payload: any): Promise { let { entity, user, config } = payload; if (entity.entity_type !== 'LEAD') { entity = await this.getEntityData('LEAD', entity.parent_id,user ); } return this.entityUpdateRepository.updateEntityAttribute(entity,config,user); } }