feat: implement fiscal ID validation; replace fiscal code validator and update related components

This commit is contained in:
2026-05-19 20:34:20 +03:30
parent c135e1a85f
commit 2e1ad77946
26 changed files with 108 additions and 76 deletions
@@ -3,11 +3,12 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { InputComponent } from '../input/input.component';
@Component({
selector: 'field-fiscal-code',
selector: 'field-fiscal-id',
template: `<app-input
label="کد مالیاتی"
label="شناسه یکتا"
[control]="control"
[name]="name"
[length]="6"
[isLtrInput]="true"
/>`,
imports: [ReactiveFormsModule, InputComponent],
@@ -10,6 +10,7 @@ import { InputComponent } from '../input/input.component';
[name]="name"
type="number"
[min]="min"
[maxLength]="9"
/>`,
imports: [ReactiveFormsModule, InputComponent],
})
@@ -4,12 +4,7 @@ import { InputComponent } from '../input/input.component';
@Component({
selector: 'field-partner-token',
template: `<app-input
label="توکن پارتنر"
[control]="control"
[name]="name"
[isLtrInput]="true"
/>`,
template: `<app-input label="توکن" [control]="control" [name]="name" [isLtrInput]="true" />`,
imports: [ReactiveFormsModule, InputComponent],
})
export class PartnerTokenComponent {
@@ -4,7 +4,7 @@ import { InputComponent } from '../input/input.component';
@Component({
selector: 'field-terminal',
template: `<app-input label="پرداخت با پایانه" [control]="control" [name]="name" type="price" />`,
template: `<app-input label="پرداخت با پوز" [control]="control" [name]="name" type="price" />`,
imports: [ReactiveFormsModule, InputComponent],
})
export class TerminalComponent {
@@ -66,6 +66,7 @@ export class InputComponent {
@Input() isLtrInput = false;
@Input() suffix: string = '';
@Input() maxLength?: number;
@Input() length?: number;
@Input() min?: number;
@Input() max?: number;
@Input() fixed?: number;
@@ -132,6 +133,8 @@ export class InputComponent {
}
get preparedMaxLength(): number | null {
const length = this.length || this.maxLength;
if (length) return length;
switch (this.type) {
case 'mobile':
return 11;
@@ -33,7 +33,7 @@
<app-key-value label="مجموع قابل پرداخت" [value]="invoice.total_amount" type="price" />
@for (payment of invoice.payments; track $index) {
<app-key-value
[label]="`${payment.payment_method === 'SET_OFF' ? 'تهاتر' : payment.payment_method === 'TERMINAL' ? 'پایانه' : 'نقدی'}`"
[label]="`${payment.payment_method === 'SET_OFF' ? 'تهاتر' : payment.payment_method === 'TERMINAL' ? 'پوز' : 'نقدی/ کارت‌خوان دیگر/ کارت به کارت'}`"
[value]="payment.amount"
type="price"
/>
@@ -11,8 +11,7 @@ import { Password } from 'primeng/password';
export class SharedPasswordInputComponent {
@Input({ required: true }) passwordControl = new FormControl<string>('');
@Input({ required: true }) confirmPasswordControl = new FormControl<string>('');
@Input() hint: string =
'رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.';
@Input() hint: string = 'رمز باید حداقل ۶ کاراکتر باشد.';
@Input() fluid: boolean = true;
@Input() size: 'small' | 'large' = 'large';
}