2025-12-14 20:34:15 +03:30
|
|
|
import { Maybe } from '@/core';
|
|
|
|
|
import { JalaliDateDirective } from '@/shared/directives';
|
|
|
|
|
import { Component, signal } from '@angular/core';
|
|
|
|
|
import images from 'src/assets/images';
|
|
|
|
|
import { PosOrderCardComponent } from '../components/order/order-card.component';
|
|
|
|
|
import { PosProductsComponent } from '../components/products/products.component';
|
|
|
|
|
import { IPosInfoResponse } from '../models';
|
|
|
|
|
import { PosService } from '../services/main.service';
|
2025-12-14 10:16:14 +03:30
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-pos',
|
|
|
|
|
templateUrl: './pos.component.html',
|
2025-12-14 20:34:15 +03:30
|
|
|
imports: [JalaliDateDirective, PosProductsComponent, PosOrderCardComponent],
|
2025-12-14 10:16:14 +03:30
|
|
|
})
|
|
|
|
|
export class POSComponent {
|
2025-12-14 20:34:15 +03:30
|
|
|
constructor(private service: PosService) {
|
|
|
|
|
this.getInfo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
placeholderLogo = images.placeholders.logo;
|
|
|
|
|
|
|
|
|
|
now = new Date();
|
|
|
|
|
inventoryId = 2;
|
|
|
|
|
|
|
|
|
|
info = signal<Maybe<IPosInfoResponse>>(null);
|
|
|
|
|
infoLoading = signal(true);
|
|
|
|
|
|
|
|
|
|
getInfo() {
|
|
|
|
|
this.infoLoading.set(true);
|
|
|
|
|
this.service.getInfo().subscribe({
|
|
|
|
|
next: (res) => {
|
|
|
|
|
this.info.set(res);
|
|
|
|
|
this.infoLoading.set(false);
|
|
|
|
|
},
|
|
|
|
|
error: () => {
|
|
|
|
|
this.infoLoading.set(false);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-12-14 10:16:14 +03:30
|
|
|
}
|