task-ep.1.1

This commit is contained in:
phaichayon
2026-07-10 10:33:45 +07:00
parent f47fea5d6f
commit 9ae4f31f28
33 changed files with 9680 additions and 22 deletions

View File

@@ -0,0 +1,41 @@
CREATE TABLE "crm_activities" (
"id" text PRIMARY KEY NOT NULL,
"organization_id" text NOT NULL,
"primary_entity_type" text NOT NULL,
"primary_entity_id" text,
"primary_record_label" text,
"related_records" jsonb DEFAULT '[]'::jsonb NOT NULL,
"customer_id" text,
"contact_id" text,
"lead_id" text,
"opportunity_id" text,
"quotation_id" text,
"activity_type" text NOT NULL,
"subject" text NOT NULL,
"description" text,
"owner_id" text NOT NULL,
"assigned_to_id" text,
"scheduled_start_at" timestamp with time zone,
"scheduled_end_at" timestamp with time zone,
"due_at" timestamp with time zone,
"completed_at" timestamp with time zone,
"cancelled_at" timestamp with time zone,
"skipped_at" timestamp with time zone,
"status" text NOT NULL,
"priority" text NOT NULL,
"outcome_summary" text,
"cancellation_reason" text,
"skip_reason" text,
"next_action" text,
"branch_id" text,
"product_type" text,
"is_internal_only" boolean DEFAULT false NOT NULL,
"is_pricing_sensitive" boolean DEFAULT false NOT NULL,
"parent_activity_id" text,
"metadata" jsonb,
"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
);