2025-12-14 20:34:15 +03:30
|
|
|
import { JalaliDateDirective } from '@/shared/directives';
|
2025-12-26 16:47:47 +03:30
|
|
|
import { Component, inject } from '@angular/core';
|
|
|
|
|
import { ActivatedRoute } from '@angular/router';
|
2025-12-14 20:34:15 +03:30
|
|
|
import images from 'src/assets/images';
|
|
|
|
|
import { PosOrderCardComponent } from '../components/order/order-card.component';
|
|
|
|
|
import { PosProductsComponent } from '../components/products/products.component';
|
2025-12-26 16:47:47 +03:30
|
|
|
import { POSStore, POS_ID } from '../store';
|
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-26 16:47:47 +03:30
|
|
|
providers: [
|
|
|
|
|
{
|
|
|
|
|
provide: POS_ID,
|
|
|
|
|
useFactory: (route: ActivatedRoute) => Number(route.snapshot.params['posId']),
|
|
|
|
|
deps: [ActivatedRoute],
|
|
|
|
|
},
|
|
|
|
|
POSStore,
|
|
|
|
|
],
|
2025-12-14 10:16:14 +03:30
|
|
|
})
|
|
|
|
|
export class POSComponent {
|
2025-12-26 16:47:47 +03:30
|
|
|
private readonly store = inject(POSStore);
|
2025-12-14 20:34:15 +03:30
|
|
|
|
|
|
|
|
placeholderLogo = images.placeholders.logo;
|
|
|
|
|
|
|
|
|
|
now = new Date();
|
|
|
|
|
|
2025-12-26 16:47:47 +03:30
|
|
|
info = this.store.info;
|
|
|
|
|
infoLoading = this.store.getInfoLoading;
|
2025-12-14 20:34:15 +03:30
|
|
|
|
2025-12-26 16:47:47 +03:30
|
|
|
// getInfo() {
|
|
|
|
|
// this.infoLoading.set(true);
|
|
|
|
|
// this.service.getInfo(Number(this.posId)).subscribe({
|
|
|
|
|
// next: (res) => {
|
|
|
|
|
// this.info.set(res);
|
|
|
|
|
// this.infoLoading.set(false);
|
|
|
|
|
// },
|
|
|
|
|
// error: () => {
|
|
|
|
|
// this.infoLoading.set(false);
|
|
|
|
|
// },
|
|
|
|
|
// });
|
|
|
|
|
// }
|
2025-12-14 10:16:14 +03:30
|
|
|
}
|