import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { firstValueFrom } from 'rxjs' ; import { ICandidatePersonalQualities , ICandidatePersonalQualitiesCreateInput , ICandidatePersonalQualitiesFindInput } from '@gauzy/contracts' ; import { API_PREFIX } from '../constants/app.constants' ; @ Injectable ( ) export class CandidatePersonalQualitiesService { constructor ( private http ) { } create ( createInput ) { return firstValueFrom ( this . http . post < ICandidatePersonalQualities > ( `${ API_PREFIX }/candidate-personal-qualities` , createInput ) ) ; } createBulk ( interviewId , personalQualities ) { return firstValueFrom ( this . http . post < ICandidatePersonalQualities [ ] > ( `${ API_PREFIX }/candidate-personal-qualities/bulk` , { interviewId , personalQualities } ) ) ; } getAll ( findInput ? ) { const data = JSON . stringify ( { findInput } ) ; return firstValueFrom ( this . http . get < { items : ICandidatePersonalQualities [ ] ; total : number ; } > ( `${ API_PREFIX }/candidate-personal-qualities` , { params : { data } } ) ) ; } findByInterviewId ( interviewId ) { return firstValueFrom ( this . http . get < ICandidatePersonalQualities [ ] > ( `${ API_PREFIX }/candidate-personal-qualities/interview/${ interviewId }` ) ) ; } update ( id , updateInput ) { return firstValueFrom ( this . http . put ( `${ API_PREFIX }/candidate-personal-qualities/${ id }` , updateInput ) ) ; } delete ( id ) { return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/candidate-personal-qualities/${ id }` ) ) ; } deleteBulkByInterviewId ( id , personalQualities ? ) { const data = JSON . stringify ( { personalQualities } ) ; return firstValueFrom ( this . http . delete ( `${ API_PREFIX }/candidate-personal-qualities/bulk/${ id }` , { params : { data } } ) ) ; } }