Refactor nested column definitions and improve license info handling

- Updated column definitions in various components to use `nestedOption` instead of `nestedPath` for better clarity and consistency.
- Removed commented-out license status checks and related UI elements from the layout component.
- Simplified license info interface by removing unnecessary properties.
- Enhanced consumer accounts and business activities components to display additional license information.
- Adjusted form components to conditionally include fields based on selected device type.
- Improved the handling of discount calculations in the gold payload form component.
- Added new fields for branch code in complex components and adjusted related views.
- Cleaned up unused console logs in form data utility.
This commit is contained in:
2026-04-24 02:23:47 +03:30
parent e58bcbef57
commit d857361cb7
41 changed files with 268 additions and 121 deletions
@@ -5,6 +5,8 @@
<app-key-value label="عنوان" [value]="businessActivity()?.name" />
<app-key-value label="کد اقتصادی" [value]="businessActivity()?.economic_code" />
<app-key-value label="صنف" [value]="businessActivity()?.guild?.name" />
<app-key-value label="تاریخ انقضای مجوز" [value]="businessActivity()?.license_info?.expires_at" type="date" />
<app-key-value label="تعداد کاربران مجاز" [value]="businessActivity()?.license_info?.accounts_limit" />
</div>
</div>
</app-card-data>
@@ -3,6 +3,7 @@
<div class="flex flex-col gap-4">
<div class="grid grid-cols-3 gap-4 items-center">
<app-key-value label="عنوان" [value]="complex()?.name" />
<app-key-value label="کد شعبه" [value]="complex()?.branch_code" />
<app-key-value label="آدرس" [value]="complex()?.address" />
</div>
</div>
@@ -6,25 +6,6 @@
<app-key-value label="نام مشتری" [value]="consumer()?.fullname" />
<app-key-value label="شماره موبایل" [value]="consumer()?.mobile_number" />
<app-key-value label="وضعیت" [value]="consumer()?.status" />
@if (licenseStatus() === "EXPIRED") {
<app-key-value label="وضعیت لایسنس">
<p-button size="small" outlined severity="warn" (onClick)="openLicenseForm()">
منقضی شده در <span [jalaliDate]="license()!.expires_at"></span>
</p-button>
</app-key-value>
<!-- <app-key-value label="ارایه شده توسط" [value]="license()?.partner?.name || 'برند نرم‌افزار'" /> -->
} @else if (licenseStatus() === "ACTIVE") {
<app-key-value label="وضعیت لایسنس">
<p-button size="small" outlined severity="success" (onClick)="openLicenseForm()">
تا تاریخ <span [jalaliDate]="license()!.expires_at"></span>
</p-button>
</app-key-value>
<!-- <app-key-value label="ارایه شده توسط" [value]="license()?.partner?.name || 'برند نرم‌افزار'" /> -->
} @else {
<app-key-value label="وضعیت لایسنس">
<p-button size="small" outlined severity="danger" (onClick)="openLicenseForm()"> ارایه نشده </p-button>
</app-key-value>
}
</div>
</div>
</app-card-data>
@@ -39,13 +20,4 @@
[initialValues]="consumer() || undefined"
(onSubmit)="getData()"
/>
<partner-consumer-license-form
[(visible)]="visibleLicenseForm"
[editMode]="!!license()?.id"
[consumerId]="consumerId()"
[licenseId]="license()?.id"
[initialValues]="license() || undefined"
(onSubmit)="getData()"
/>
</div>