This commit is contained in:
phaichayon
2026-06-22 20:07:51 +07:00
parent ffa5de8311
commit 5c28080e9b
25 changed files with 1726 additions and 269 deletions

View File

@@ -394,6 +394,28 @@ export const crmEnquiryAttachments = pgTable('crm_enquiry_attachments', {
deletedAt: timestamp('deleted_at', { withTimezone: true })
});
export const crmReportDefinitions = pgTable(
'crm_report_definitions',
{
id: text('id').primaryKey(),
organizationId: text('organization_id').notNull(),
code: text('code').notNull(),
name: text('name').notNull(),
description: text('description'),
category: text('category').notNull(),
isSystem: boolean('is_system').default(true).notNull(),
isActive: boolean('is_active').default(true).notNull(),
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull()
},
(table) => ({
organizationCodeIdx: uniqueIndex('crm_report_definitions_org_code_idx').on(
table.organizationId,
table.code
)
})
);
export const crmQuotations = pgTable(
'crm_quotations',
{