feat(CC-066): add actionPlans + scenarios to schema

This commit is contained in:
admin-valentin 2026-08-02 12:09:03 +00:00
parent f1cbe941e9
commit f3278d8264

View file

@ -787,3 +787,40 @@ export const pipelineDeals = pgTable('pipeline_deals', {
updatedAt: timestamp('updated_at').defaultNow().notNull(),
deletedAt: timestamp('deleted_at'),
});
// ——— CC-066 ———
export const actionPlans = pgTable('action_plans', {
id: uuid('id').defaultRandom().primaryKey().notNull(),
tenantId: uuid('tenant_id').notNull(),
workspaceId: uuid('workspace_id'),
title: text('title').notNull(),
description: text('description'),
status: text('status').default('draft').notNull(),
priority: text('priority').default('medium').notNull(),
owner: text('owner'),
dueDate: date('due_date'),
completedAt: timestamp('completed_at'),
decisionId: uuid('decision_id'),
goalId: uuid('goal_id'),
projectId: uuid('project_id'),
tags: text('tags').array().default([]).notNull(),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
deletedAt: timestamp('deleted_at'),
});
export const scenarios = pgTable('scenarios', {
id: uuid('id').defaultRandom().primaryKey().notNull(),
tenantId: uuid('tenant_id').notNull(),
decisionId: uuid('decision_id'),
title: text('title').notNull(),
description: text('description'),
probability: text('probability').default('medium').notNull(),
outcome: text('outcome'),
financialImpactMinorUnits: numeric('financial_impact_minor_units', { precision: 15, scale: 0 }),
financialImpactCurrency: text('financial_impact_currency').default('RON').notNull(),
impactDirection: text('impact_direction').default('neutral').notNull(),
status: text('status').default('hypothetical').notNull(),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
});