import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { BancosModel } from "../model/Bancos";
import {BancoDto } from "../model/Bancos.dto";
import {environment} from "../../../../../environments/environment";

@Injectable({
  providedIn: 'root'
})
export class PorcentajeRetencionService {




    constructor(private http: HttpClient) {
    }

    url = `${environment.HOST}/`;
    endpoint: string = 'porcentajeRetencion';


    saveObject(obj): Observable<any> {
        return this.http.post(this.url + this.endpoint + '/guardarPorcentajeRet', obj);
    }

    getAll(): Observable<any> {
        return this.http.get(this.url + this.endpoint + '/listarPorcentajes');
    }

    getById(key): Observable<any> {
        return this.http.get(this.url + this.endpoint + '/buscarPorIdPorcentaje/' + key);
    }


    deleteObject(key): Observable<any> {
        return this.http.delete(this.url + this.endpoint + '/eliminarPorcentajes/' + key);
    }

    getByFecha(key): Observable<any> {
        return this.http.get(this.url + this.endpoint + '/findByFecha/' + key);
    }
}
