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:
2026-04-27 21:53:11 +03:30
parent c085104976
commit 822bf96966
235 changed files with 4007 additions and 1260 deletions
@@ -1,4 +1,4 @@
<p-dialog
<shared-dialog
header="فرم کاربر"
[(visible)]="visible"
[modal]="true"
@@ -7,12 +7,12 @@
(onHide)="close()"
>
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
<app-input label="نام کاربری" [control]="form.controls.username" name="username" />
<app-enum-select [control]="form.controls.type" name="type" type="accountType" />
<field-username [control]="form.controls.username" />
<app-enum-select [control]="form.controls.role" name="role" type="partnerRole" />
<shared-password-input
[passwordControl]="form.controls.password"
[confirmPasswordControl]="form.controls.confirmPassword"
/>
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
</form>
</p-dialog>
</shared-dialog>
@@ -2,21 +2,22 @@ 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 { 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 { IPartnerAccountRequest, IPartnerAccountResponse } from '../../models';
import { AdminPartnerAccountsService } from '../../services/accounts.service';
import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component';
@Component({
selector: 'superAdmin-partner-account-form',
templateUrl: './form.component.html',
imports: [
ReactiveFormsModule,
Dialog,
InputComponent,
SharedDialogComponent,
UsernameComponent,
FormFooterActionsComponent,
SharedPasswordInputComponent,
EnumSelectComponent,
@@ -34,8 +35,8 @@ export class PartnerAccountFormComponent extends AbstractFormDialog<
initForm = () => {
return this.fb.group(
{
username: [this.initialValues?.username || '', [Validators.required]],
type: ['', [Validators.required]],
username: fieldControl.username(this.initialValues?.account?.username || ''),
role: [this.initialValues?.role || '', [Validators.required]],
password: ['', [Validators.required, password()]],
confirmPassword: ['', [Validators.required]],
},
@@ -1,4 +1,4 @@
<p-dialog
<shared-dialog
header="شارژ لایسنس"
[(visible)]="visible"
[modal]="true"
@@ -16,4 +16,4 @@
/>
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
</form>
</p-dialog>
</shared-dialog>
@@ -5,15 +5,15 @@ import { UikitFlatpickrJalaliComponent } from '@/uikit';
import { nowJalali } from '@/utils';
import { Component, inject, Input } from '@angular/core';
import { ReactiveFormsModule, Validators } from '@angular/forms';
import { Dialog } from 'primeng/dialog';
import { IPartnerChargeLicenseTransactionRequest } from '../models/chargeLicenseTransactions_io';
import { AdminPartnerChargeLicenseTransactionsService } from '../services/chargeLicenseTransactions.service';
import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component';
@Component({
selector: 'partner-charge-license-form-dialog',
templateUrl: './charge-license-form-dialog.component.html',
imports: [
Dialog,
SharedDialogComponent,
ReactiveFormsModule,
InputComponent,
FormFooterActionsComponent,
@@ -1,4 +1,4 @@
<p-dialog
<shared-dialog
header="شارژ کاربر"
[(visible)]="visible"
[modal]="true"
@@ -16,4 +16,4 @@
/>
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
</form>
</p-dialog>
</shared-dialog>
@@ -5,15 +5,15 @@ import { UikitFlatpickrJalaliComponent } from '@/uikit';
import { nowJalali } from '@/utils';
import { Component, inject, Input } from '@angular/core';
import { ReactiveFormsModule, Validators } from '@angular/forms';
import { Dialog } from 'primeng/dialog';
import { IAdminPartnerChargeAccountRequest } from '../../models/chargeAccount_io';
import { AdminPartnerChargeAccountService } from '../../services/chargeAccount.service';
import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component';
@Component({
selector: 'admin-partner-charge-account-form-dialog',
templateUrl: './charge-account-form-dialog.component.html',
imports: [
Dialog,
SharedDialogComponent,
ReactiveFormsModule,
InputComponent,
FormFooterActionsComponent,
@@ -1,4 +1,4 @@
<p-dialog
<shared-dialog
[header]="preparedTitle()"
[(visible)]="visible"
[modal]="true"
@@ -21,4 +21,4 @@
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
</form>
</p-dialog>
</shared-dialog>
@@ -4,17 +4,17 @@ import { InputComponent, SharedPasswordInputComponent } from '@/shared/component
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
import { Component, computed, inject, Input } from '@angular/core';
import { ReactiveFormsModule, Validators } from '@angular/forms';
import { Dialog } from 'primeng/dialog';
import { Divider } from 'primeng/divider';
import { IPartnerRequest, IPartnerResponse } from '../models';
import { PartnersService } from '../services/main.service';
import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component';
@Component({
selector: 'partner-form',
templateUrl: './form.component.html',
imports: [
ReactiveFormsModule,
Dialog,
SharedDialogComponent,
InputComponent,
FormFooterActionsComponent,
Divider,
@@ -1,13 +1,23 @@
import { TAccountType } from '@/core/constants/accountTypes.const';
export interface IPartnerAccountRawResponse {
username: string;
id: string;
role: string;
created_at: string;
account: AccountInfo;
}
export interface IPartnerAccountResponse extends IPartnerAccountRawResponse {}
export interface IPartnerAccountRequest {
username: string;
password?: string;
type: TAccountType;
role?: string;
status?: string;
// Keep type optional for current form compatibility.
type?: TAccountType;
}
interface AccountInfo {
username: string;
status: string;
}
@@ -4,7 +4,7 @@ export interface IAdminPartnerChargeAccountRawResponse {
tracking_code: string;
activation_expires_at: string;
charged_license_count: number;
activated_license_count: number;
activation_count: number;
remained_license_count: number;
}
@@ -4,7 +4,7 @@ export interface IPartnerChargeLicenseTransactionRawResponse {
tracking_code: string;
activation_expires_at: string;
charged_license_count: number;
activated_license_count: number;
activation_count: number;
remained_license_count: number;
}
export interface IPartnerChargeLicenseTransactionResponse extends IPartnerChargeLicenseTransactionRawResponse {}
@@ -17,8 +17,8 @@ export class AdminPartnerChargeLicenseTransactionsService {
getAll(
partnerId: string,
): Observable<IPaginatedResponse<IPartnerChargeLicenseTransactionRawResponse>> {
return this.http.get<IPaginatedResponse<IPartnerChargeLicenseTransactionResponse>>(
): Observable<IPaginatedResponse<IPartnerChargeLicenseTransactionResponse>> {
return this.http.get<IPaginatedResponse<IPartnerChargeLicenseTransactionRawResponse>>(
this.apiRoutes.list(partnerId),
);
}
@@ -26,8 +26,8 @@ export class AdminPartnerChargeLicenseTransactionsService {
charge(
partnerId: string,
data: IPartnerChargeLicenseTransactionRequest,
): Observable<IPartnerChargeLicenseTransactionRawResponse> {
return this.http.post<IPartnerChargeLicenseTransactionResponse>(
): Observable<IPartnerChargeLicenseTransactionResponse> {
return this.http.post<IPartnerChargeLicenseTransactionRawResponse>(
this.apiRoutes.list(partnerId),
data,
);