import { EstimatesPagenationParameters , Estimate } from '../models/estimates.models' ; export class EstimatesAPI { harvest ; baseUrl : string ; constructor ( harvest ) { this . baseUrl = '/v2/estimates' ; this . harvest = harvest ; } public get ( id ) { return this . harvest . request ( 'GET' , `${ this . baseUrl }/${ id }` ) ; } public list ( query = { } ) { return this . harvest . request ( 'GET' , this . baseUrl , query ) ; } public create ( data ) { return this . harvest . request ( 'POST' , this . baseUrl , data ) ; } public update ( id , data ) { return this . harvest . request ( 'PATCH' , `${ this . baseUrl }/${ id }` , data ) ; } public delete ( id ) { return this . harvest . request ( 'DELETE' , `${ this . baseUrl }/${ id }` ) ; } public send ( id ) { return this . harvest . request ( 'POST' , `${ this . baseUrl }/${ id }/messages` , { event_type : 'send' } ) ; } public accept ( id ) { return this . harvest . request ( 'POST' , `${ this . baseUrl }/${ id }/messages` , { event_type : 'accept' } ) ; } public decline ( id ) { return this . harvest . request ( 'POST' , `${ this . baseUrl }/${ id }/messages` , { event_type : 'decline' } ) ; } public reopen ( id ) { return this . harvest . request ( 'POST' , `${ this . baseUrl }/${ id }/messages` , { event_type : 're-open' } ) ; } }