task-d complate
This commit is contained in:
@@ -188,3 +188,61 @@ export const crmCustomerContacts = pgTable('crm_customer_contacts', {
|
||||
createdBy: text('created_by').notNull(),
|
||||
updatedBy: text('updated_by').notNull()
|
||||
});
|
||||
|
||||
export const crmEnquiries = pgTable(
|
||||
'crm_enquiries',
|
||||
{
|
||||
id: text('id').primaryKey(),
|
||||
organizationId: text('organization_id').notNull(),
|
||||
branchId: text('branch_id'),
|
||||
code: text('code').notNull(),
|
||||
customerId: text('customer_id').notNull(),
|
||||
contactId: text('contact_id'),
|
||||
title: text('title').notNull(),
|
||||
description: text('description'),
|
||||
requirement: text('requirement'),
|
||||
projectName: text('project_name'),
|
||||
projectLocation: text('project_location'),
|
||||
productType: text('product_type').notNull(),
|
||||
status: text('status').notNull(),
|
||||
priority: text('priority').notNull(),
|
||||
leadChannel: text('lead_channel'),
|
||||
estimatedValue: doublePrecision('estimated_value'),
|
||||
chancePercent: integer('chance_percent'),
|
||||
expectedCloseDate: timestamp('expected_close_date', { withTimezone: true }),
|
||||
competitor: text('competitor'),
|
||||
source: text('source'),
|
||||
notes: text('notes'),
|
||||
isHotProject: boolean('is_hot_project').default(false).notNull(),
|
||||
isActive: boolean('is_active').default(true).notNull(),
|
||||
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
deletedAt: timestamp('deleted_at', { withTimezone: true }),
|
||||
createdBy: text('created_by').notNull(),
|
||||
updatedBy: text('updated_by').notNull()
|
||||
},
|
||||
(table) => ({
|
||||
organizationCodeIdx: uniqueIndex('crm_enquiries_org_code_idx').on(
|
||||
table.organizationId,
|
||||
table.code
|
||||
)
|
||||
})
|
||||
);
|
||||
|
||||
export const crmEnquiryFollowups = pgTable('crm_enquiry_followups', {
|
||||
id: text('id').primaryKey(),
|
||||
organizationId: text('organization_id').notNull(),
|
||||
enquiryId: text('enquiry_id').notNull(),
|
||||
followupDate: timestamp('followup_date', { withTimezone: true }).notNull(),
|
||||
followupType: text('followup_type').notNull(),
|
||||
contactId: text('contact_id'),
|
||||
outcome: text('outcome'),
|
||||
notes: text('notes'),
|
||||
nextFollowupDate: timestamp('next_followup_date', { withTimezone: true }),
|
||||
nextAction: text('next_action'),
|
||||
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
deletedAt: timestamp('deleted_at', { withTimezone: true }),
|
||||
createdBy: text('created_by').notNull(),
|
||||
updatedBy: text('updated_by').notNull()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user