import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';

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

  private baseUrl: string = "http://localhost:9077/AVB/service/pago";
  
  private baseUrlS: string = "http://localhost:9077/AVB/service/vuelo";

  private baseUrl2: string = "http://localhost:9077/AVB/service/escala";

  private baseUrl4: string = "http://localhost:9077/AVB/service/itinerarios";


  constructor(private httpClient: HttpClient) { }

  addPago(query: any): Observable<any>{    
    return this.httpClient.post<any>(this.baseUrl+"/",query);
  }

  addPagoAReserva(id:number,query:any):Observable<Object>{
    return this.httpClient.post(`${this.baseUrl+ "/reservas"}/${id}/pagos`,query);
  }

  updateEstadoReserva(id:number,query:any):Observable<Object>{
    return this.httpClient.put(`${this.baseUrl4+ "/actualizar"}/${id}`,query);
  }

}
