import { ISaleInvoiceFullResponse } from '@/domains/consumer/models';
import { ISaleInvoiceFullRawResponse } from '@/shared/components/invoices/sale-invoice-full-response.model';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { PUBLIC_SALE_INVOICES_API_ROUTES } from '../constants';

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

  private apiRoutes = PUBLIC_SALE_INVOICES_API_ROUTES;

  getSingle(invoiceId: string): Observable<ISaleInvoiceFullResponse> {
    return this.http.get<ISaleInvoiceFullRawResponse>(this.apiRoutes.single(invoiceId));
  }
}
