task-d.5.3

This commit is contained in:
phaichayon
2026-06-24 14:23:15 +07:00
parent 350239b307
commit 0c28735c90
61 changed files with 11019 additions and 173 deletions

View File

@@ -275,14 +275,22 @@ export const crmLeads = pgTable(
code: text('code').notNull(),
customerId: text('customer_id'),
contactId: text('contact_id'),
description: text('description'),
projectName: text('project_name'),
projectLocation: text('project_location'),
productType: text('product_type'),
priority: text('priority'),
estimatedValue: doublePrecision('estimated_value'),
awarenessId: text('awareness_id'),
status: text('status').default('new_job').notNull(),
followupStatus: text('followup_status'),
lostReason: text('lost_reason'),
outcome: text('outcome').default('open').notNull(),
ownerMarketingUserId: text('owner_marketing_user_id'),
assignedSalesOwnerId: text('assigned_sales_owner_id'),
assignedAt: timestamp('assigned_at', { withTimezone: true }),
assignedBy: text('assigned_by'),
assignmentRemark: text('assignment_remark'),
createdBy: text('created_by').notNull(),
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),

View File

@@ -384,8 +384,9 @@ const FOUNDATION_OPTIONS = {
crm_lead_status: [
{ code: 'new_job', label: 'New Job', value: 'new_job', sortOrder: 1 },
{ code: 'follow_up', label: 'Follow Up', value: 'follow_up', sortOrder: 2 },
{ code: 'closed_lost', label: 'Closed Lost', value: 'closed_lost', sortOrder: 3 },
{ code: 'cancel', label: 'Cancel', value: 'cancel', sortOrder: 4 }
{ code: 'assigned', label: 'Assigned', value: 'assigned', sortOrder: 3 },
{ code: 'closed_lost', label: 'Closed Lost', value: 'closed_lost', sortOrder: 4 },
{ code: 'cancel', label: 'Cancel', value: 'cancel', sortOrder: 5 }
],
crm_lead_followup_status: [
{