feat: add new form field components for company details and consumer management
- Implemented CompanyNameComponent, DescriptionComponent, DeviceIdComponent, EconomicCodeComponent, EmailComponent, FirstNameComponent, FiscalCodeComponent, GuildIdComponent, LastNameComponent, LegalNameComponent, LicenseStartsAtComponent, MobileComponent, MobileNumberComponent, ModelComponent, NameComponent, NationalCodeComponent, NationalIdComponent, PartnerTokenComponent, PosTypeComponent, PostalCodeComponent, ProviderIdComponent, QuantityComponent, RegistrationCodeComponent, RegistrationNumberComponent, SerialNumberComponent, SetOffComponent, SkuComponent, TerminalComponent, UnitPriceComponent, UsernameComponent. - Added field control configurations for new fields in the form. - Updated routing and branding configurations for TIS tenant. - Created consumer type models for handling individual and legal consumer data.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<p-dialog
|
||||
<shared-dialog
|
||||
header="فرم کاربر"
|
||||
[(visible)]="visible"
|
||||
[modal]="true"
|
||||
@@ -7,7 +7,7 @@
|
||||
(onHide)="close()"
|
||||
>
|
||||
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
|
||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" />
|
||||
<field-username [control]="form.controls.username" />
|
||||
<app-enum-select [control]="form.controls.type" name="type" type="accountType" />
|
||||
<shared-password-input
|
||||
[passwordControl]="form.controls.password"
|
||||
@@ -15,4 +15,4 @@
|
||||
/>
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</p-dialog>
|
||||
</shared-dialog>
|
||||
|
||||
@@ -2,11 +2,12 @@ import { MustMatch, password } from '@/core/validators';
|
||||
// import { CatalogRolesComponent } from '@/shared/catalog/roles';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { InputComponent, SharedPasswordInputComponent } from '@/shared/components';
|
||||
import { SharedPasswordInputComponent, UsernameComponent } from '@/shared/components';
|
||||
import { fieldControl } from '@/shared/constants/fields';
|
||||
import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { IAccountRequest, IAccountResponse } from '../../models';
|
||||
import { AdminUserAccountsService } from '../../services/accounts.service';
|
||||
|
||||
@@ -15,8 +16,8 @@ import { AdminUserAccountsService } from '../../services/accounts.service';
|
||||
templateUrl: './form.component.html',
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
Dialog,
|
||||
InputComponent,
|
||||
SharedDialogComponent,
|
||||
UsernameComponent,
|
||||
FormFooterActionsComponent,
|
||||
EnumSelectComponent,
|
||||
SharedPasswordInputComponent,
|
||||
@@ -35,9 +36,8 @@ export class UserAccountFormComponent extends AbstractFormDialog<
|
||||
if (this.editMode) {
|
||||
return this.fb.group(
|
||||
{
|
||||
username: [this.initialValues?.username || '', [Validators.required]],
|
||||
// @ts-ignore
|
||||
type: [this.initialValues?.type, [Validators.required]],
|
||||
username: fieldControl.username(this.initialValues?.username || ''),
|
||||
type: [this.initialValues?.type || '', [Validators.required]],
|
||||
|
||||
password: ['', [password()]],
|
||||
confirmPassword: [''],
|
||||
@@ -49,9 +49,9 @@ export class UserAccountFormComponent extends AbstractFormDialog<
|
||||
}
|
||||
return this.fb.group(
|
||||
{
|
||||
username: [this.initialValues?.username || '', [Validators.required]],
|
||||
username: fieldControl.username(this.initialValues?.username || ''),
|
||||
// @ts-ignore
|
||||
type: [this.initialValues?.type, [Validators.required]],
|
||||
type: [this.initialValues?.type || '', [Validators.required]],
|
||||
|
||||
password: ['', [Validators.required, password()]],
|
||||
confirmPassword: ['', [Validators.required]],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<p-dialog
|
||||
<shared-dialog
|
||||
header="فرم کاربر"
|
||||
[(visible)]="visible"
|
||||
[modal]="true"
|
||||
@@ -13,4 +13,4 @@
|
||||
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</p-dialog>
|
||||
</shared-dialog>
|
||||
|
||||
@@ -5,14 +5,14 @@ import { InputComponent } from '@/shared/components';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Dialog } from 'primeng/dialog';
|
||||
import { IUserRequest, IUserResponse } from '../models';
|
||||
import { UsersService } from '../services/main.service';
|
||||
import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'superAdmin-user-form',
|
||||
templateUrl: './form.component.html',
|
||||
imports: [ReactiveFormsModule, Dialog, InputComponent, FormFooterActionsComponent],
|
||||
imports: [ReactiveFormsModule, SharedDialogComponent, InputComponent, FormFooterActionsComponent],
|
||||
})
|
||||
export class UserAccountFormComponent extends AbstractFormDialog<IUserRequest, IUserResponse> {
|
||||
private readonly service = inject(UsersService);
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import { TAccountType } from '@/core/constants/accountTypes.const';
|
||||
|
||||
export interface IAccountRawResponse {
|
||||
username: string;
|
||||
id: string;
|
||||
username?: string;
|
||||
status?: string;
|
||||
type?: string;
|
||||
created_at?: string;
|
||||
}
|
||||
export interface IAccountResponse extends IAccountRawResponse {}
|
||||
|
||||
export interface IAccountRequest {
|
||||
username: string;
|
||||
password?: string;
|
||||
type: TAccountType;
|
||||
type?: TAccountType;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user