import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { CONSUMERS_API_ROUTES } from '../constants';
import { IConsumerInfoRawResponse, IConsumerInfoResponse } from '../models';

@Injectable({ providedIn: 'root' })
export class ConsumerService {
  constructor(private http: HttpClient) {}

  private apiRoutes = CONSUMERS_API_ROUTES;

  getInfo(): Observable<IConsumerInfoResponse> {
    return this.http.get<IConsumerInfoRawResponse>(this.apiRoutes.info());
  }
}
