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:
@@ -0,0 +1,12 @@
|
||||
import { ValidatorFn } from '@angular/forms';
|
||||
|
||||
export function fiscalCodeValidator(): ValidatorFn {
|
||||
return (control) => {
|
||||
if (control.value === null || control.value === undefined || control.value === '') {
|
||||
return null;
|
||||
}
|
||||
return control.value.length === 11 && /^[0-9]{11}$/.test(control.value)
|
||||
? null
|
||||
: { fiscalCode: 'معتبر نیست' };
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './fiscal-code.validator';
|
||||
export * from './iban.validator';
|
||||
export * from './mobile.validator';
|
||||
export * from './must-match.validator';
|
||||
|
||||
@@ -21,7 +21,7 @@ export function mobileValidator(): ValidatorFn {
|
||||
}
|
||||
|
||||
if (typeof v !== 'string') {
|
||||
return { invalidMobile: true };
|
||||
return { invalidMobile: 'معتبر نیست' };
|
||||
}
|
||||
|
||||
const trimmed = v.trim();
|
||||
|
||||
@@ -7,6 +7,6 @@ export function nationalIdValidator(): ValidatorFn {
|
||||
}
|
||||
return control.value.length === 10 && /^[0-9]{10}$/.test(control.value)
|
||||
? null
|
||||
: { nationalId: true };
|
||||
: { nationalId: 'معتبر نیست' };
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ export function postalCodeValidator(): ValidatorFn {
|
||||
}
|
||||
return control.value.length === 10 && /^[0-9]{10}$/.test(control.value)
|
||||
? null
|
||||
: { postalCode: true };
|
||||
: { postalCode: 'معتبر نیست' };
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user