import { Store } from './store.service' ; import { HttpClient } from '@angular/common/http' ; import { Service } from './service' ; import { IDeal , IPipeline , IPipelineCreateInput , IPipelineFindInput } from '@gauzy/contracts' ; import { Injectable } from '@angular/core' ; import { API_PREFIX } from '../constants/app.constants' ; import { firstValueFrom } from "rxjs" ; @ Injectable ( ) export class PipelinesService extends Service < IPipeline , IPipelineFindInput , IPipelineCreateInput > { public constructor ( protected store , protected http ) { super ( { http , basePath : `${ API_PREFIX }/pipelines` } ) ; } getAll ( relations ? , findInput ? ) { const data = JSON . stringify ( { relations , findInput } ) ; return firstValueFrom ( this . http . get < { items : IPipeline [ ] ; total : number ; } > ( `${ this . basePath }` , { params : { data } } ) ) ; } public findDeals ( id , findInput ? ) { const data = JSON . stringify ( { findInput } ) ; return firstValueFrom ( this . http . get < { items : IDeal [ ] ; total : number ; } > ( `${ this . basePath }/${ id }/deals` , { params : { data } } ) ) ; } }