Adding two fields to the mesh form
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Person" ADD COLUMN "website" TEXT;
|
||||||
|
ALTER TABLE "Person" ADD COLUMN "referrer" TEXT;
|
||||||
@@ -362,6 +362,10 @@ model Person {
|
|||||||
phone String?
|
phone String?
|
||||||
mobile String?
|
mobile String?
|
||||||
position String?
|
position String?
|
||||||
|
/// آدرس وبسایت
|
||||||
|
website String?
|
||||||
|
/// نام معرف
|
||||||
|
referrer String?
|
||||||
notes String?
|
notes String?
|
||||||
mood PersonMood @default(newcomer)
|
mood PersonMood @default(newcomer)
|
||||||
customFields Json @default("{}")
|
customFields Json @default("{}")
|
||||||
|
|||||||
@@ -165,6 +165,16 @@ export class CreatePersonDto {
|
|||||||
@MaxLength(120)
|
@MaxLength(120)
|
||||||
position?: string;
|
position?: string;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@MaxLength(300)
|
||||||
|
website?: string;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@MaxLength(120)
|
||||||
|
referrer?: string;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
@MaxLength(2000)
|
@MaxLength(2000)
|
||||||
@@ -220,6 +230,16 @@ export class UpdatePersonDto {
|
|||||||
@MaxLength(120)
|
@MaxLength(120)
|
||||||
position?: string;
|
position?: string;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@MaxLength(300)
|
||||||
|
website?: string;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@MaxLength(120)
|
||||||
|
referrer?: string;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
@MaxLength(2000)
|
@MaxLength(2000)
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ type PersonRow = {
|
|||||||
phone: string | null;
|
phone: string | null;
|
||||||
mobile: string | null;
|
mobile: string | null;
|
||||||
position: string | null;
|
position: string | null;
|
||||||
|
website: string | null;
|
||||||
|
referrer: string | null;
|
||||||
notes: string | null;
|
notes: string | null;
|
||||||
mood: PersonMood;
|
mood: PersonMood;
|
||||||
customFields: unknown;
|
customFields: unknown;
|
||||||
@@ -140,6 +142,8 @@ export class PeopleService {
|
|||||||
phone: normalizePhone(dto.phone),
|
phone: normalizePhone(dto.phone),
|
||||||
mobile: normalizePhone(dto.mobile),
|
mobile: normalizePhone(dto.mobile),
|
||||||
position: emptyToNull(dto.position),
|
position: emptyToNull(dto.position),
|
||||||
|
website: emptyToNull(dto.website),
|
||||||
|
referrer: emptyToNull(dto.referrer),
|
||||||
notes: emptyToNull(dto.notes),
|
notes: emptyToNull(dto.notes),
|
||||||
mood: dto.mood ?? 'newcomer',
|
mood: dto.mood ?? 'newcomer',
|
||||||
companyId,
|
companyId,
|
||||||
@@ -185,6 +189,8 @@ export class PeopleService {
|
|||||||
if ('phone' in dto) data.phone = normalizePhone(dto.phone);
|
if ('phone' in dto) data.phone = normalizePhone(dto.phone);
|
||||||
if ('mobile' in dto) data.mobile = normalizePhone(dto.mobile);
|
if ('mobile' in dto) data.mobile = normalizePhone(dto.mobile);
|
||||||
if ('position' in dto) data.position = emptyToNull(dto.position);
|
if ('position' in dto) data.position = emptyToNull(dto.position);
|
||||||
|
if ('website' in dto) data.website = emptyToNull(dto.website);
|
||||||
|
if ('referrer' in dto) data.referrer = emptyToNull(dto.referrer);
|
||||||
if ('notes' in dto) data.notes = emptyToNull(dto.notes);
|
if ('notes' in dto) data.notes = emptyToNull(dto.notes);
|
||||||
if (dto.mood !== undefined) data.mood = dto.mood;
|
if (dto.mood !== undefined) data.mood = dto.mood;
|
||||||
if ('customFields' in dto) {
|
if ('customFields' in dto) {
|
||||||
@@ -268,6 +274,8 @@ export class PeopleService {
|
|||||||
phone: row.phone,
|
phone: row.phone,
|
||||||
mobile: row.mobile,
|
mobile: row.mobile,
|
||||||
position: row.position,
|
position: row.position,
|
||||||
|
website: row.website,
|
||||||
|
referrer: row.referrer,
|
||||||
notes: row.notes,
|
notes: row.notes,
|
||||||
mood: row.mood,
|
mood: row.mood,
|
||||||
customFields: asCustomFields(row.customFields),
|
customFields: asCustomFields(row.customFields),
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ const email = ref('');
|
|||||||
const phone = ref('');
|
const phone = ref('');
|
||||||
const mobile = ref('');
|
const mobile = ref('');
|
||||||
const position = ref('');
|
const position = ref('');
|
||||||
|
const website = ref('');
|
||||||
|
const referrer = ref('');
|
||||||
const notes = ref('');
|
const notes = ref('');
|
||||||
const companyId = ref('');
|
const companyId = ref('');
|
||||||
const mood = ref<PersonMood>('newcomer');
|
const mood = ref<PersonMood>('newcomer');
|
||||||
@@ -200,6 +202,8 @@ function fill(p: PersonDto) {
|
|||||||
phone.value = p.phone ?? '';
|
phone.value = p.phone ?? '';
|
||||||
mobile.value = p.mobile ?? '';
|
mobile.value = p.mobile ?? '';
|
||||||
position.value = p.position ?? '';
|
position.value = p.position ?? '';
|
||||||
|
website.value = p.website ?? '';
|
||||||
|
referrer.value = p.referrer ?? '';
|
||||||
notes.value = p.notes ?? '';
|
notes.value = p.notes ?? '';
|
||||||
companyId.value = p.company?.id ?? '';
|
companyId.value = p.company?.id ?? '';
|
||||||
mood.value = p.mood || 'newcomer';
|
mood.value = p.mood || 'newcomer';
|
||||||
@@ -235,6 +239,8 @@ function payload(): CreatePersonRequest {
|
|||||||
phone: phone.value || undefined,
|
phone: phone.value || undefined,
|
||||||
mobile: mobile.value || undefined,
|
mobile: mobile.value || undefined,
|
||||||
position: position.value || undefined,
|
position: position.value || undefined,
|
||||||
|
website: website.value || undefined,
|
||||||
|
referrer: referrer.value || undefined,
|
||||||
notes: notes.value || undefined,
|
notes: notes.value || undefined,
|
||||||
companyId: companyId.value || null,
|
companyId: companyId.value || null,
|
||||||
mood: mood.value,
|
mood: mood.value,
|
||||||
@@ -422,6 +428,14 @@ onMounted(load);
|
|||||||
<UiInput id="position" v-model="position" />
|
<UiInput id="position" v-model="position" />
|
||||||
</UiField>
|
</UiField>
|
||||||
|
|
||||||
|
<UiField label="آدرس وبسایت" for-id="website">
|
||||||
|
<UiInput id="website" v-model="website" dir="ltr" placeholder="https://example.com" />
|
||||||
|
</UiField>
|
||||||
|
|
||||||
|
<UiField label="معرف" for-id="referrer">
|
||||||
|
<UiInput id="referrer" v-model="referrer" placeholder="نام معرف" />
|
||||||
|
</UiField>
|
||||||
|
|
||||||
<div class="crm-col-span-full">
|
<div class="crm-col-span-full">
|
||||||
<UiField label="وضعیت مشتری">
|
<UiField label="وضعیت مشتری">
|
||||||
<div class="moods">
|
<div class="moods">
|
||||||
|
|||||||
@@ -331,6 +331,8 @@ const infoEmpty = computed(() => {
|
|||||||
!p.phone &&
|
!p.phone &&
|
||||||
!p.email &&
|
!p.email &&
|
||||||
!p.position &&
|
!p.position &&
|
||||||
|
!p.website &&
|
||||||
|
!p.referrer &&
|
||||||
!p.company &&
|
!p.company &&
|
||||||
!p.notes?.trim() &&
|
!p.notes?.trim() &&
|
||||||
!tickets.value.length
|
!tickets.value.length
|
||||||
@@ -603,6 +605,8 @@ watch(() => route.query.tab, readTab, { immediate: true });
|
|||||||
</div>
|
</div>
|
||||||
<dl class="facts">
|
<dl class="facts">
|
||||||
<div><dt>سمت</dt><dd>{{ person.position || '—' }}</dd></div>
|
<div><dt>سمت</dt><dd>{{ person.position || '—' }}</dd></div>
|
||||||
|
<div><dt>وبسایت</dt><dd>{{ person.website || '—' }}</dd></div>
|
||||||
|
<div><dt>معرف</dt><dd>{{ person.referrer || '—' }}</dd></div>
|
||||||
<div><dt>شرکت</dt><dd>{{ person.company?.name || '—' }}</dd></div>
|
<div><dt>شرکت</dt><dd>{{ person.company?.name || '—' }}</dd></div>
|
||||||
<div><dt>تلفن</dt><dd>{{ phoneDisplay }}</dd></div>
|
<div><dt>تلفن</dt><dd>{{ phoneDisplay }}</dd></div>
|
||||||
<div><dt>ایمیل</dt><dd>{{ emailDisplay }}</dd></div>
|
<div><dt>ایمیل</dt><dd>{{ emailDisplay }}</dd></div>
|
||||||
@@ -876,6 +880,8 @@ watch(() => route.query.tab, readTab, { immediate: true });
|
|||||||
<div><dt>تلفن</dt><dd>{{ person.phone ? toFaDigits(person.phone) : '—' }}</dd></div>
|
<div><dt>تلفن</dt><dd>{{ person.phone ? toFaDigits(person.phone) : '—' }}</dd></div>
|
||||||
<div><dt>ایمیل</dt><dd>{{ person.email || '—' }}</dd></div>
|
<div><dt>ایمیل</dt><dd>{{ person.email || '—' }}</dd></div>
|
||||||
<div><dt>سمت</dt><dd>{{ person.position || '—' }}</dd></div>
|
<div><dt>سمت</dt><dd>{{ person.position || '—' }}</dd></div>
|
||||||
|
<div><dt>وبسایت</dt><dd>{{ person.website || '—' }}</dd></div>
|
||||||
|
<div><dt>معرف</dt><dd>{{ person.referrer || '—' }}</dd></div>
|
||||||
<div><dt>شرکت</dt><dd>{{ person.company?.name || '—' }}</dd></div>
|
<div><dt>شرکت</dt><dd>{{ person.company?.name || '—' }}</dd></div>
|
||||||
<div><dt>مسئول</dt><dd>{{ person.owner?.fullName || '—' }}</dd></div>
|
<div><dt>مسئول</dt><dd>{{ person.owner?.fullName || '—' }}</dd></div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -629,6 +629,8 @@ export interface PersonDto {
|
|||||||
phone: string | null;
|
phone: string | null;
|
||||||
mobile: string | null;
|
mobile: string | null;
|
||||||
position: string | null;
|
position: string | null;
|
||||||
|
website: string | null;
|
||||||
|
referrer: string | null;
|
||||||
notes: string | null;
|
notes: string | null;
|
||||||
mood: PersonMood;
|
mood: PersonMood;
|
||||||
customFields: Record<string, unknown>;
|
customFields: Record<string, unknown>;
|
||||||
@@ -647,6 +649,8 @@ export interface CreatePersonRequest {
|
|||||||
phone?: string;
|
phone?: string;
|
||||||
mobile?: string;
|
mobile?: string;
|
||||||
position?: string;
|
position?: string;
|
||||||
|
website?: string;
|
||||||
|
referrer?: string;
|
||||||
notes?: string;
|
notes?: string;
|
||||||
mood?: PersonMood;
|
mood?: PersonMood;
|
||||||
companyId?: string | null;
|
companyId?: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user