fix: keep birthdays and show Shamsi dates

Imported customers keep their birthday, and assistant text plus remaining calendars use the Jalali date.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-13 18:04:53 +03:30
co-authored by Cursor
parent 5f4cc47c41
commit cf326d1ed9
34 changed files with 637 additions and 105 deletions
@@ -4,6 +4,7 @@ import { Prisma } from '@prisma/client';
import type { LeadImportJobDto } from '@mento/shared';
import { PrismaService } from '../prisma/prisma.service';
import {
parseBirthDate,
parseExcelMapping,
parseJalaliDateTime,
previewExcel,
@@ -55,6 +56,12 @@ const LEAD_ALIASES: Record<string, string> = {
اینستاگرام: 'instagram',
پیجاینستاگرام: 'instagram',
آیدیاینستاگرام: 'instagram',
birthdate: 'birthDate',
dateofbirth: 'birthDate',
bdate: 'birthDate',
تاریختولد: 'birthDate',
تاریختولدمشتری: 'birthDate',
تاریختولدشمسی: 'birthDate',
registeredat: 'registeredAt',
تاریخثبت: 'registeredAt',
تاریخثبتمشتری: 'registeredAt',
@@ -81,6 +88,7 @@ const LEAD_FIELDS: ExcelFieldOption[] = [
{ key: 'homeAddress', label: 'آدرس منزل' },
{ key: 'instagram', label: 'اینستاگرام' },
{ key: 'registeredAt', label: 'تاریخ ثبت' },
{ key: 'birthDate', label: 'تاریخ تولد' },
{ key: 'trade', label: 'صنف' },
{ key: 'source', label: 'منبع' },
{ key: 'notes', label: 'توضیحات' },
@@ -284,6 +292,9 @@ export class LeadsImportService {
address2: get('address2', 'آدرس ۲', 'آدرس2', 'آدرس دوم'),
homeAddress: get('homeAddress', 'آدرس منزل', 'آدرس خانه'),
instagram: get('instagram', 'اینستاگرام', 'پیج اینستاگرام', 'آی دی اینستاگرام'),
birthDate: parseBirthDate(
get('birthDate', 'تاریخ تولد', 'تاریخ تولد مشتری', 'تاریخ تولد شمسی', 'birthdate'),
)?.toISOString() ?? '',
registeredAt,
trade: get('trade', 'صنف', 'رسته'),
source: get('source', 'منبع', 'منبع لید'),