import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { City } from 'src/app/models/city';
import { SenorsPumpPriorityWharf } from 'src/app/models/sensorPump';
import { Wharf } from 'src/app/models/Wharf';
import { environment } from 'src/environments/environment';

@Injectable({
  providedIn: 'root'
})
export class WerfFormFourService {
  url = environment.url;

  constructor(private httpClient: HttpClient) {}

  getWharfById(id: number): Observable<Wharf> {
    return this.httpClient.get<Wharf>(this.url + '/Wharf/' + id);
  }

  getCities(): Observable<City[]> {
    return this.httpClient.get<City[]>(this.url + '/City/getCities');
  }

  getSenorsPumpPriorityWharf(id: number): Observable<SenorsPumpPriorityWharf> {
    return this.httpClient.get<SenorsPumpPriorityWharf>(this.url + '/SensorPump/GetSenorsPumpPriorityWharf/' + id);
  }
}
