task-d complate

This commit is contained in:
phaichayon
2026-06-15 13:46:33 +07:00
parent 8148850fda
commit 1d2406483e
32 changed files with 4812 additions and 39 deletions

View File

@@ -0,0 +1,50 @@
CREATE TABLE "crm_enquiries" (
"id" text PRIMARY KEY NOT NULL,
"organization_id" text NOT NULL,
"branch_id" text,
"code" text NOT NULL,
"customer_id" text NOT NULL,
"contact_id" text,
"title" text NOT NULL,
"description" text,
"requirement" text,
"project_name" text,
"project_location" text,
"product_type" text NOT NULL,
"status" text NOT NULL,
"priority" text NOT NULL,
"lead_channel" text,
"estimated_value" double precision,
"chance_percent" integer,
"expected_close_date" timestamp with time zone,
"competitor" text,
"source" text,
"notes" text,
"is_hot_project" boolean DEFAULT false NOT NULL,
"is_active" boolean DEFAULT true NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
"deleted_at" timestamp with time zone,
"created_by" text NOT NULL,
"updated_by" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE "crm_enquiry_followups" (
"id" text PRIMARY KEY NOT NULL,
"organization_id" text NOT NULL,
"enquiry_id" text NOT NULL,
"followup_date" timestamp with time zone NOT NULL,
"followup_type" text NOT NULL,
"contact_id" text,
"outcome" text,
"notes" text,
"next_followup_date" timestamp with time zone,
"next_action" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
"deleted_at" timestamp with time zone,
"created_by" text NOT NULL,
"updated_by" text NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX "crm_enquiries_org_code_idx" ON "crm_enquiries" USING btree ("organization_id","code");

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,13 @@
"when": 1781498575433,
"tag": "0002_plain_anthem",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1781505431077,
"tag": "0003_blushing_bruce_banner",
"breakpoints": true
}
]
}