ui update, init to consumer statistics and manage pos user types
This commit is contained in:
@@ -2,6 +2,7 @@ const baseUrl = '/api/v1/pos';
|
||||
|
||||
export const POS_API_ROUTES = {
|
||||
info: () => `${baseUrl}`,
|
||||
accessible: () => `${baseUrl}/accessible`,
|
||||
goods: () => `${baseUrl}/goods`,
|
||||
goodCategories: () => `${baseUrl}/good_categories`,
|
||||
submitOrder: () => `${baseUrl}/sales_invoices`,
|
||||
|
||||
@@ -5,7 +5,12 @@ import {
|
||||
IGoodRawResponse,
|
||||
IGoodResponse,
|
||||
} from '@/domains/pos/models/good.io';
|
||||
import { IPosInfoRawResponse, IPosInfoResponse } from '@/domains/pos/models/pos.io';
|
||||
import {
|
||||
IPosAccessibleRawResponse,
|
||||
IPosAccessibleResponse,
|
||||
IPosInfoRawResponse,
|
||||
IPosInfoResponse,
|
||||
} from '@/domains/pos/models/pos.io';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
@@ -21,6 +26,11 @@ export class PosService {
|
||||
getInfo(): Observable<IPosInfoResponse> {
|
||||
return this.http.get<IPosInfoRawResponse>(this.apiRoutes.info());
|
||||
}
|
||||
|
||||
getAccessible(): Observable<IListingResponse<IPosAccessibleResponse>> {
|
||||
return this.http.get<IListingResponse<IPosAccessibleRawResponse>>(this.apiRoutes.accessible());
|
||||
}
|
||||
|
||||
getGoods(searchQuery: string): Observable<IListingResponse<IGoodResponse>> {
|
||||
return this.http.get<IListingResponse<IGoodRawResponse>>(this.apiRoutes.goods());
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<div class="flex gap-4 grow overflow-hidden h-full">
|
||||
<div class="grow h-full overflow-auto">
|
||||
<pos-goods />
|
||||
</div>
|
||||
<div class="shrink-0 h-full">
|
||||
<pos-order-section />
|
||||
</div>
|
||||
@if (posInfo()) {
|
||||
<div class="grow h-full overflow-auto">
|
||||
<pos-goods />
|
||||
</div>
|
||||
<div class="shrink-0 h-full">
|
||||
<pos-order-section />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||
import { Component } from '@angular/core';
|
||||
import { PosStore } from '@/domains/pos/pos.store';
|
||||
import { Component, computed, inject } from '@angular/core';
|
||||
import { PosGoodsComponent } from '../components/goods.component';
|
||||
import { PosOrderSectionComponent } from '../components/order/order-section.component';
|
||||
|
||||
@@ -10,4 +11,8 @@ import { PosOrderSectionComponent } from '../components/order/order-section.comp
|
||||
|
||||
imports: [PosGoodsComponent, PosOrderSectionComponent],
|
||||
})
|
||||
export class PosLandingComponent {}
|
||||
export class PosLandingComponent {
|
||||
private readonly posStore = inject(PosStore);
|
||||
|
||||
readonly posInfo = computed(() => this.posStore.entity());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user