set consumer customer and saleInvoices

This commit is contained in:
2026-04-08 18:15:27 +03:30
parent 8990edf064
commit 359d8cc0a9
39 changed files with 947 additions and 26 deletions
@@ -0,0 +1,24 @@
import { IPaginatedResponse } from '@/core/models/service.model';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { CUSTOMER_SALE_INVOICES_API_ROUTES } from '../constants/apiRoutes/saleInvoices';
import { ICustomerSaleInvoicesRawResponse, ICustomerSaleInvoicesResponse } from '../models';
@Injectable({ providedIn: 'root' })
export class CustomerSaleInvoicesService {
constructor(private http: HttpClient) {}
private apiRoutes = CUSTOMER_SALE_INVOICES_API_ROUTES;
getAll(customerId: string): Observable<IPaginatedResponse<ICustomerSaleInvoicesResponse>> {
return this.http.get<IPaginatedResponse<ICustomerSaleInvoicesRawResponse>>(
this.apiRoutes.list(customerId),
);
}
getSingle(customerId: string, invoiceId: string): Observable<ICustomerSaleInvoicesResponse> {
return this.http.get<ICustomerSaleInvoicesRawResponse>(
this.apiRoutes.single(customerId, invoiceId),
);
}
}