init to pos domain

This commit is contained in:
2026-03-18 13:35:57 +03:30
parent f2766e2d7d
commit 1e2f94261e
42 changed files with 635 additions and 809 deletions
@@ -1 +1 @@
<consumer-complex-goods-list [businessId]="businessId()" [complexId]="complexId()" />
<consumer-complex-goods-list [businessId]="businessId()" [complexId]="complexId()" [guildId]="business()?.guild!.id" />
@@ -24,6 +24,8 @@ export class ConsumerComplexGoodsComponent {
businessId = signal<string>(this.pageParams()['businessActivityId']);
complexId = signal<string>(this.pageParams()['complexId']);
business = computed(() => this.businessStore.entity());
ngOnInit() {
this.setBreadcrumb();
}
@@ -1,5 +1,8 @@
<div class="flex flex-col gap-6">
<app-card-data cardTitle="اطلاعات پایانه‌ی فروش" [editable]="true" [(editMode)]="editMode">
<ng-template #moreAction>
<p-button type="button" variant="outlined" (onClick)="toPosLanding()"> ورود به پایانه </p-button>
</ng-template>
<div class="flex flex-col gap-4">
<div class="grid grid-cols-3 gap-4 items-center">
<app-key-value label="عنوان" [value]="pos()?.name" />
@@ -3,6 +3,8 @@ import { AppCardComponent, KeyValueComponent } from '@/shared/components';
import pageParamsUtils from '@/utils/page-params.utils';
import { Component, computed, effect, inject, signal } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { CookieService } from 'ngx-cookie-service';
import { Button } from 'primeng/button';
import { ConsumerPosFormComponent } from '../../components/poses/form.component';
import { BusinessActivityStore } from '../../store/businessActivity.store';
import { ConsumerComplexStore } from '../../store/complex.store';
@@ -11,7 +13,7 @@ import { PosStore } from '../../store/pos.store';
@Component({
selector: 'superAdmin-user-pos',
templateUrl: './single.component.html',
imports: [AppCardComponent, KeyValueComponent, ConsumerPosFormComponent],
imports: [AppCardComponent, KeyValueComponent, ConsumerPosFormComponent, Button],
})
export class SuperAdminUserPosComponent {
private readonly businessStore = inject(BusinessActivityStore);
@@ -19,6 +21,7 @@ export class SuperAdminUserPosComponent {
private readonly store = inject(PosStore);
private readonly route = inject(ActivatedRoute);
private readonly breadcrumbService = inject(BreadcrumbService);
private readonly cookieService = inject(CookieService);
pageParams = computed(() => pageParamsUtils(this.route));
@@ -42,6 +45,16 @@ export class SuperAdminUserPosComponent {
this.store.getData(this.businessId(), this.complexId(), this.posId());
}
toPosLanding() {
this.cookieService.set('posId', this.posId(), {
sameSite: 'Lax', // or 'Strict' for same-site requests only
secure: false,
path: '/',
domain: 'localhost',
});
window.open('/pos', '_blank');
}
setBreadcrumb() {
this.breadcrumbService.setItems([
...this.businessStore.breadcrumbItems(),