import { Injectable } from '@nestjs/common'; import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service'; import { UserData } from 'src/module/user/entity/user.entity'; import { DataSource } from 'typeorm'; import { ActionDataRepository } from '../repository/action-data.repository'; @Injectable() export class ActionDataService extends EntityServiceImpl { constructor( private readonly dataSource: DataSource, private readonly actionDataRepo: ActionDataRepository, ) { super(); } async saveActionData( action: any, loggedInUser: UserData, mapped_entity_id, mapped_entity_type, ): Promise { return this.actionDataRepo.saveActionData( action, loggedInUser, mapped_entity_id, mapped_entity_type, ); } async updateActionStatus( loggedInUser: UserData, mapped_entity_type: string, mapped_entity_id: number, stage_id: number, action_id: number, ): Promise { return this.actionDataRepo.updateActionStatus( loggedInUser, mapped_entity_type, mapped_entity_id, stage_id, action_id, ); } async resubmitAction( loggedInUser: UserData, mapped_entity_type: string, mapped_entity_id: number, stage_id: number, action_id: number, ) { const { organization_id } = loggedInUser; return this.actionDataRepo.resubmitAction( organization_id, mapped_entity_type, mapped_entity_id, stage_id, action_id, ); } }