feat: add professor import support, user account creation, and IBAN/card fields

This commit is contained in:
2026-08-21 12:56:15 +03:30
parent 22b57eeae2
commit 7c74950c95
8 changed files with 344 additions and 9 deletions
+9 -3
View File
@@ -2,7 +2,7 @@
const { toEnglishDigits } = require('../../utils/jalaliDate');
const TITLE_PREFIX = /^(آقای|اقای|خانم|آقا)\s+/;
const TITLE_PREFIX = /^(آقای|اقای|خانم|آقا|سرکار\s+خانم|سرکار)\s+/;
const HONORIFIC_MIDDLE = /\s+خ\s+/g;
const normalizePersonName = (value) => {
@@ -28,14 +28,20 @@ const namesMatch = (left, right) => {
const normalizePhone = (raw) => {
if (raw == null || raw === '') return '';
let digits = toEnglishDigits(raw).replace(/\D/g, '');
if (digits.startsWith('98') && digits.length === 12) digits = `0${digits.slice(2)}`;
if (digits.startsWith('98') && digits.length >= 12) digits = `0${digits.slice(2)}`;
if (digits.length === 10 && digits.startsWith('9')) digits = `0${digits}`;
if (digits.length === 11 && digits.startsWith('9')) digits = `0${digits.slice(0, 10)}`;
if (digits.length > 11 && digits.startsWith('09')) digits = digits.slice(0, 11);
return digits;
};
const normalizeNationalId = (raw) => {
if (raw == null || raw === '') return '';
return toEnglishDigits(raw).replace(/\D/g, '');
let digits = toEnglishDigits(raw).replace(/\D/g, '');
if (digits && digits.length < 10 && /^\d+$/.test(digits)) {
digits = digits.padStart(10, '0');
}
return digits;
};
const mapAttendanceStatus = (raw) => {