import { Inject, Injectable } from '@nestjs/common'; import { FormMasterRepository } from '../repository/form-master.repository'; import { UserData } from 'src/module/user/entity/user.entity'; import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service'; @Injectable() export class FormMasterService extends EntityServiceImpl { constructor(private readonly formMasterRepository: FormMasterRepository) { super(); } async getForms(loggedInUser: UserData, source_entity_type: string) { const { organization_id } = loggedInUser; return this.formMasterRepository.getForms( organization_id, source_entity_type, ); } async saveForm( data: { entity_id: number; entity_type: string; view_id: number }, loggedInUser: UserData, ) { // return this.formMasterRepository.saveForm(data, loggedInUser); } async submitForm(data: any, loggedInUser: UserData) { const { form_data, redirect_data } = data; // update from super.updateEntity(form_data, loggedInUser); return this.formMasterRepository.submitForm(redirect_data, loggedInUser); } }