import { IListingResponse } from '@/core/models/service.model';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { CONSUMER_STATISTICS_API_ROUTES } from '../constants';
import { IStatisticsSaleInvoicesRawResponse, IStatisticsSaleInvoicesResponse } from '../models';

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

  private apiRoutes = CONSUMER_STATISTICS_API_ROUTES;

  getInvoices(): Observable<IListingResponse<IStatisticsSaleInvoicesResponse>> {
    return this.http.get<IListingResponse<IStatisticsSaleInvoicesRawResponse>>(
      this.apiRoutes.invoices(),
    );
  }
}
