set consumer customer and saleInvoices
This commit is contained in:
@@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user