This commit is contained in:
phaichayon
2026-06-26 11:03:25 +07:00
parent 42c8c59947
commit 052677fa2c
16 changed files with 1604 additions and 68 deletions

View File

@@ -680,6 +680,27 @@ export const crmApprovalSteps = pgTable(
})
);
export const crmApprovalMatrices = pgTable('crm_approval_matrices', {
id: text('id').primaryKey(),
organizationId: text('organization_id').notNull(),
entityType: text('entity_type').notNull(),
workflowId: text('workflow_id').notNull(),
branchId: text('branch_id'),
productType: text('product_type'),
minAmount: doublePrecision('min_amount'),
maxAmount: doublePrecision('max_amount'),
currency: text('currency'),
priority: integer('priority').default(100).notNull(),
isDefault: boolean('is_default').default(false).notNull(),
isActive: boolean('is_active').default(true).notNull(),
description: text('description'),
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()
});
export const crmApprovalRequests = pgTable('crm_approval_requests', {
id: text('id').primaryKey(),
organizationId: text('organization_id').notNull(),