feat: update POS and account components to use new field names and improve form handling

This commit is contained in:
2026-04-24 04:27:40 +03:30
parent d857361cb7
commit 5bb5f10dbf
26 changed files with 323 additions and 73 deletions
@@ -8,7 +8,7 @@
>
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
<app-input label="عنوان" [control]="form.controls.name" name="name" />
<app-input label="سریال دستگاه" [control]="form.controls.serial" name="serial" />
<app-input label="سریال دستگاه" [control]="form.controls.serial_number" name="serial_number" />
<!-- <app-input label="مدل دستگاه" [control]="form.controls.model" name="model" /> -->
<app-enum-select [control]="form.controls.pos_type" type="posType" name="pos_type" />
@if (form.controls.pos_type.value === "PSP") {
@@ -35,7 +35,7 @@ export class ConsumerPosFormComponent extends AbstractFormDialog<IPosRequest, IP
initForm = () => {
const form = this.fb.group({
name: [this.initialValues?.name || '', [Validators.required]],
serial: [this.initialValues?.serial || '', [Validators.required]],
serial_number: [this.initialValues?.serial_number || '', [Validators.required]],
// model: [this.initialValues?.model || '', [Validators.required]],
pos_type: [this.initialValues?.pos_type || '', [Validators.required]],
device_id: [this.initialValues?.device?.id || ''],
@@ -3,7 +3,7 @@ import ISummary from '@/core/models/summary';
export interface IPosRawResponse {
id: string;
name: string;
serial: string;
serial_number: string;
model?: string;
status: string;
pos_type: string;
@@ -15,7 +15,7 @@ export interface IPosResponse extends IPosRawResponse {}
export interface IPosRequest {
name: string;
serial: string;
serial_number: string;
model?: string;
status: string;
pos_type: string;