import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {AuthService} from './auth.service';
import {Observable} from 'rxjs';
import {PayOutExModel} from '../models/payout.ex.model';
import {CompositeFilterDescriptor} from '@progress/kendo-data-query';

@Injectable({providedIn: 'root'})
export class PayOutService {
  constructor(private http: HttpClient, private auth: AuthService ){ }

  public getPayOutEx(id: string): Observable<PayOutExModel> {
    return this.http.get<PayOutExModel>(this.auth.getUrl('payout-ex/' + id));
  }

  public getPayOutList(filter: CompositeFilterDescriptor): Observable<PayOutExModel[]> {
    return this.http.post<PayOutExModel[]>(this.auth.getUrl('payout-ex-list/'), filter);
  }
}
