import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { MessageService } from './message.service'; import { serviceBaseUrl } from './config'; import { Fee, OverheadAdvance } from './data-objects'; import { Saldo } from './ext-data-objects'; @Injectable({ providedIn: 'root' }) export class ExtApiService { constructor(private messageService: MessageService, private http: HttpClient) { } async getOverheadAdvancesByFlat(id: number): Promise { this.messageService.add(`ExtApiService: get overheadadvances by flat ${id}`); return this.http.get(`${serviceBaseUrl}/v1/overhead_advances/flat/${id}`).toPromise() } async getFeeByTenancies(id: number): Promise { this.messageService.add(`ExtApiService: get fees by flat ${id}`); return this.http.get(`${serviceBaseUrl}/v1/fees/tenancy/${id}`).toPromise() } async getAccountSaldo(id: number): Promise { this.messageService.add(`ExtApiService: get saldo for account ${id}`); return this.http.get(`${serviceBaseUrl}/v1/account/saldo/${id}`).toPromise() } }