forked from Yara724/api
claim request management change
This commit is contained in:
@@ -3644,10 +3644,22 @@ export class ClaimRequestManagementService {
|
||||
}
|
||||
|
||||
private parseJalaliBirthday(
|
||||
birthday: string | null | undefined,
|
||||
birthday: string | number | null | undefined,
|
||||
): { year: number; month: number; day: number } | null {
|
||||
if (!birthday) return null;
|
||||
const parts = String(birthday).split(/[/\-]/);
|
||||
if (birthday == null) return null;
|
||||
const str = String(birthday).trim();
|
||||
|
||||
// Compact format: "13640610" → year=1364, month=06, day=10
|
||||
if (/^\d{8}$/.test(str)) {
|
||||
const year = parseInt(str.slice(0, 4), 10);
|
||||
const month = parseInt(str.slice(4, 6), 10);
|
||||
const day = parseInt(str.slice(6, 8), 10);
|
||||
if (isNaN(year) || isNaN(month) || isNaN(day)) return null;
|
||||
return { year, month, day };
|
||||
}
|
||||
|
||||
// Delimited formats: "1364/06/10" or "1364-06-10"
|
||||
const parts = str.split(/[/\-]/);
|
||||
if (parts.length < 3) return null;
|
||||
const year = parseInt(parts[0], 10);
|
||||
const month = parseInt(parts[1], 10);
|
||||
@@ -3797,7 +3809,7 @@ export class ClaimRequestManagementService {
|
||||
DmgHistoryStatus: input.defaults.DmgHistoryStatus,
|
||||
Desc: this.formatFanavaranSelectedPartsDesc(input.selectedParts),
|
||||
DmgCaseTypeId: input.defaults.DmgCaseTypeId,
|
||||
DriverId: driverFanavaranId ?? person.nationalCodeOfDriver ?? null,
|
||||
DriverId: driverFanavaranId ?? null,
|
||||
EndDate: insurance.endDate ?? null,
|
||||
EstimateAmount: FANAVARAN_PROVISIONAL_ESTIMATE_AMOUNT,
|
||||
FaultPercent: input.defaults.FaultPercent,
|
||||
|
||||
Reference in New Issue
Block a user