feat: update consumer and partner components for improved data handling and UI enhancements

- Refactor ConsumerPosListComponent to dynamically set cookie domain based on hostname.
- Modify ConsumerUserFormContentComponent to correctly handle type selection and initialization.
- Enhance single.component.html to conditionally display consumer details based on type.
- Update ConsumerAccountListComponent to include nested role translation and pos details.
- Adjust IConsumerAccountRawResponse to use IEnumTranslate for role and add pos details.
- Refine ConsumersComponent to display translated status in the list view.
- Revise single.component.html for superAdmin to show translated consumer type and details.
- Improve AdminPartnerChargeAccountListComponent and AdminPartnerChargeLicenseTransactionListComponent by updating header labels.
- Add file upload functionality in form.component.html for partner creation.
- Enhance GuildFormComponent to handle file uploads and form data submission.
- Update AdminPartnerLicensesComponent to display consumer names correctly.
- Modify IPartnerActivatedLicenseResponse to include consumer_name for better clarity.
- Add logo_url to IPartnerRawResponse for displaying partner logos.
- Refactor PartnersService to handle FormData for partner creation and updates.
- Enhance list.component.html to include partner logos in the display.
- Update single.component.html for partners to show total counts for licenses and users.
- Implement payment result handling in AuthComponent for improved payment integration.
- Refactor SharedUploadFileComponent to manage file previews and uploads more effectively.
- Introduce IEnumTranslate interface for better type handling in consumer models.
- Update form-data utility to allow skipping specific fields during FormData construction.
- Add RTL support styles for file upload and avatar components.
- Change environment configuration for API base URL.
This commit is contained in:
2026-04-28 20:06:21 +03:30
parent 822bf96966
commit c89d4027d6
28 changed files with 362 additions and 70 deletions
@@ -1,6 +1,5 @@
import { MustMatch } from '@/core/validators';
import { AbstractForm } from '@/shared/abstractClasses';
import { fieldControl } from '@/shared/constants/fields';
import {
FirstNameComponent,
LastNameComponent,
@@ -12,6 +11,7 @@ import {
UsernameComponent,
} from '@/shared/components';
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
import { fieldControl } from '@/shared/constants/fields';
import { Component, inject, Input, signal } from '@angular/core';
import { FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
import { Divider } from 'primeng/divider';
@@ -56,10 +56,10 @@ export class ConsumerUserFormContentComponent extends AbstractForm<
},
];
selectedType = signal<string>(this.initialValues?.type || this.consumerTypes[0].value);
selectedType = signal<string>(this.initialValues?.type?.value || this.consumerTypes[0].value);
initForm = () => {
this.selectedType.set(this.initialValues?.type || this.consumerTypes[0].value);
this.selectedType.set(this.initialValues?.type?.value || this.consumerTypes[0].value);
const legal = this.fb.group({
name: fieldControl.legal_name(this.initialValues?.legal?.name || ''),
registration_code: fieldControl.registration_code(
@@ -4,8 +4,15 @@
<div class="flex flex-col gap-4">
<div class="grid grid-cols-3 gap-4 items-center">
<app-key-value label="نام مشتری" [value]="consumer()?.name" />
<app-key-value label="نوع مشتری" [value]="consumer()?.type" />
<app-key-value label="وضعیت" [value]="consumer()?.status" />
<app-key-value label="وضعیت" [value]="consumer()?.status?.translate" />
<app-key-value label="نوع مشتری" [value]="consumer()?.type?.translate" />
@if (consumer()?.type?.value === "LEGAL") {
<app-key-value label="شناسه ملی" [value]="consumer()?.legal?.registration_code" />
} @else {
<app-key-value label="شماره موبایل" [value]="consumer()?.individual?.mobile_number" />
<app-key-value label="کد ملی" [value]="consumer()?.individual?.national_code" />
}
</div>
</div>
</app-card-data>