--
-- PostgreSQL database dump
--

\restrict nUei8fvRoXoM4kdLGfaiNiVz3kYGOQwTlcEaOmNcjYWSdfchWvAx6kGxpMkfocc

-- Dumped from database version 13.23
-- Dumped by pg_dump version 13.23

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: AIInsightPeriodType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AIInsightPeriodType" AS ENUM (
    'WEEKLY',
    'MONTHLY',
    'YTD'
);


ALTER TYPE public."AIInsightPeriodType" OWNER TO "dispatchspot_1001-1";

--
-- Name: AIInsightScopeType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AIInsightScopeType" AS ENUM (
    'TRUCK'
);


ALTER TYPE public."AIInsightScopeType" OWNER TO "dispatchspot_1001-1";

--
-- Name: AIJobType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AIJobType" AS ENUM (
    'PARSE_LOAD_DOCUMENT',
    'PARSE_PASTED_LOAD_TEXT',
    'GENERATE_TRUCK_INSIGHT'
);


ALTER TYPE public."AIJobType" OWNER TO "dispatchspot_1001-1";

--
-- Name: AIReviewStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AIReviewStatus" AS ENUM (
    'PENDING_REVIEW',
    'ACCEPTED',
    'EDITED_THEN_ACCEPTED'
);


ALTER TYPE public."AIReviewStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: AISourceType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AISourceType" AS ENUM (
    'UPLOADED_DOCUMENT',
    'PASTED_TEXT'
);


ALTER TYPE public."AISourceType" OWNER TO "dispatchspot_1001-1";

--
-- Name: AIValidationStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AIValidationStatus" AS ENUM (
    'VALID',
    'PARTIAL',
    'INVALID'
);


ALTER TYPE public."AIValidationStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: AccessorialCategory; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AccessorialCategory" AS ENUM (
    'DETENTION',
    'LAYOVER',
    'TONU',
    'OTHER'
);


ALTER TYPE public."AccessorialCategory" OWNER TO "dispatchspot_1001-1";

--
-- Name: AssignmentPriority; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AssignmentPriority" AS ENUM (
    'LOW',
    'NORMAL',
    'HIGH',
    'URGENT'
);


ALTER TYPE public."AssignmentPriority" OWNER TO "dispatchspot_1001-1";

--
-- Name: AssignmentStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AssignmentStatus" AS ENUM (
    'ASSIGNED',
    'IN_PROGRESS',
    'WAITING',
    'COMPLETED',
    'CANCELED',
    'OVERDUE'
);


ALTER TYPE public."AssignmentStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: AssignmentTargetType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AssignmentTargetType" AS ENUM (
    'LOAD',
    'DRIVER',
    'BROKER',
    'COMPANY',
    'OWNER_OPERATOR',
    'SHIPPER'
);


ALTER TYPE public."AssignmentTargetType" OWNER TO "dispatchspot_1001-1";

--
-- Name: AuthEmailTokenType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."AuthEmailTokenType" AS ENUM (
    'EMAIL_VERIFICATION',
    'PASSWORD_RECOVERY',
    'LOGIN_CHALLENGE'
);


ALTER TYPE public."AuthEmailTokenType" OWNER TO "dispatchspot_1001-1";

--
-- Name: CRMActivityType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."CRMActivityType" AS ENUM (
    'NOTE',
    'CALL',
    'EMAIL',
    'MEETING',
    'TASK',
    'STATUS_CHANGE',
    'DOCUMENT',
    'OTHER'
);


ALTER TYPE public."CRMActivityType" OWNER TO "dispatchspot_1001-1";

--
-- Name: CRMEntityType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."CRMEntityType" AS ENUM (
    'DRIVER',
    'BROKER',
    'COMPANY',
    'OWNER_OPERATOR',
    'SHIPPER'
);


ALTER TYPE public."CRMEntityType" OWNER TO "dispatchspot_1001-1";

--
-- Name: CRMStage; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."CRMStage" AS ENUM (
    'LEAD',
    'CONTACTED',
    'WARM',
    'HOT',
    'ACTIVE',
    'PREMIUM',
    'INACTIVE',
    'LOST'
);


ALTER TYPE public."CRMStage" OWNER TO "dispatchspot_1001-1";

--
-- Name: DispatchFeeType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."DispatchFeeType" AS ENUM (
    'PERCENTAGE',
    'FLAT_RATE'
);


ALTER TYPE public."DispatchFeeType" OWNER TO "dispatchspot_1001-1";

--
-- Name: DocumentCategory; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."DocumentCategory" AS ENUM (
    'BOL',
    'POD',
    'RATE_CONFIRMATION',
    'RECEIPT',
    'SCALE_TICKET',
    'LUMPER_RECEIPT',
    'FUEL_RECEIPT',
    'GENERAL_ATTACHMENT',
    'OTHER'
);


ALTER TYPE public."DocumentCategory" OWNER TO "dispatchspot_1001-1";

--
-- Name: DocumentVisibilityScope; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."DocumentVisibilityScope" AS ENUM (
    'INTERNAL_ONLY',
    'FIELD_VISIBLE',
    'ACCOUNTING_ONLY',
    'CUSTOMER_VISIBLE'
);


ALTER TYPE public."DocumentVisibilityScope" OWNER TO "dispatchspot_1001-1";

--
-- Name: DomainEventStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."DomainEventStatus" AS ENUM (
    'PENDING',
    'PROCESSED',
    'FAILED'
);


ALTER TYPE public."DomainEventStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: DriverPayType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."DriverPayType" AS ENUM (
    'PERCENTAGE',
    'RATE_PER_MILE',
    'FLAT_RATE'
);


ALTER TYPE public."DriverPayType" OWNER TO "dispatchspot_1001-1";

--
-- Name: EquipmentType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."EquipmentType" AS ENUM (
    'DRY_VAN',
    'REEFER',
    'FLATBED'
);


ALTER TYPE public."EquipmentType" OWNER TO "dispatchspot_1001-1";

--
-- Name: ExpenseCategory; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."ExpenseCategory" AS ENUM (
    'FUEL',
    'REPAIR',
    'TOLL',
    'LUMPER',
    'OTHER'
);


ALTER TYPE public."ExpenseCategory" OWNER TO "dispatchspot_1001-1";

--
-- Name: FeatureFlagKey; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."FeatureFlagKey" AS ENUM (
    'AI_PARSING',
    'AI_INSIGHTS'
);


ALTER TYPE public."FeatureFlagKey" OWNER TO "dispatchspot_1001-1";

--
-- Name: JobStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."JobStatus" AS ENUM (
    'QUEUED',
    'PROCESSING',
    'COMPLETED',
    'FAILED'
);


ALTER TYPE public."JobStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: LoadStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."LoadStatus" AS ENUM (
    'DRAFT',
    'AVAILABLE',
    'ASSIGNED',
    'IN_TRANSIT',
    'DELIVERED',
    'INVOICED',
    'PAID_FULL',
    'CANCELLED'
);


ALTER TYPE public."LoadStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: NoteType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."NoteType" AS ENUM (
    'TRUCK',
    'LOAD',
    'WEEKLY_OPERATIONAL'
);


ALTER TYPE public."NoteType" OWNER TO "dispatchspot_1001-1";

--
-- Name: OutboundEmailStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."OutboundEmailStatus" AS ENUM (
    'PENDING',
    'SENT',
    'FAILED',
    'SKIPPED'
);


ALTER TYPE public."OutboundEmailStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: PaymentStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."PaymentStatus" AS ENUM (
    'UNPAID',
    'PARTIAL',
    'PAID'
);


ALTER TYPE public."PaymentStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: SystemUpdateStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."SystemUpdateStatus" AS ENUM (
    'PENDING',
    'PROCESSING',
    'COMPLETED',
    'FAILED'
);


ALTER TYPE public."SystemUpdateStatus" OWNER TO "dispatchspot_1001-1";

--
-- Name: SystemUpdateType; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."SystemUpdateType" AS ENUM (
    'CONFIG_UPDATE',
    'DATA_MIGRATION',
    'FEATURE_RELEASE',
    'PATCH'
);


ALTER TYPE public."SystemUpdateType" OWNER TO "dispatchspot_1001-1";

--
-- Name: UserRole; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."UserRole" AS ENUM (
    'ORG_ADMIN',
    'DISPATCHER',
    'ACCOUNTING',
    'OWNER_OPERATOR',
    'COMPANY_DRIVER'
);


ALTER TYPE public."UserRole" OWNER TO "dispatchspot_1001-1";

--
-- Name: VerifiedCustomDomainRequestStatus; Type: TYPE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TYPE public."VerifiedCustomDomainRequestStatus" AS ENUM (
    'SUBMITTED',
    'IN_REVIEW',
    'QUALIFIED',
    'APPROVED',
    'REJECTED',
    'PAUSED'
);


ALTER TYPE public."VerifiedCustomDomainRequestStatus" OWNER TO "dispatchspot_1001-1";

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: AIExtractionResult; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."AIExtractionResult" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "sourceType" public."AISourceType" NOT NULL,
    "sourceDocumentId" text,
    "sourceTextHash" text,
    "extractionType" text,
    "rawText" text NOT NULL,
    "extractedJson" jsonb NOT NULL,
    "normalizedJson" jsonb NOT NULL,
    "confidenceScore" numeric(8,2),
    "validationStatus" public."AIValidationStatus" NOT NULL,
    "reviewStatus" public."AIReviewStatus" NOT NULL,
    "reviewedByUserId" text,
    "reviewedAt" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."AIExtractionResult" OWNER TO "dispatchspot_1001-1";

--
-- Name: AIInsightSnapshot; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."AIInsightSnapshot" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "scopeType" public."AIInsightScopeType" NOT NULL,
    "scopeId" text NOT NULL,
    "periodType" public."AIInsightPeriodType" NOT NULL,
    "periodStart" timestamp(3) without time zone NOT NULL,
    "periodEnd" timestamp(3) without time zone NOT NULL,
    "inputMetricsJson" jsonb,
    "flagsJson" jsonb,
    "summaryBulletsJson" jsonb,
    "summaryText" text NOT NULL,
    "modelName" text,
    "promptVersion" text,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


ALTER TABLE public."AIInsightSnapshot" OWNER TO "dispatchspot_1001-1";

--
-- Name: AIJob; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."AIJob" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "createdByUserId" text,
    "jobType" public."AIJobType" NOT NULL,
    status public."JobStatus" NOT NULL,
    "relatedEntityType" text,
    "relatedEntityId" text,
    priority integer DEFAULT 100 NOT NULL,
    "inputPayloadJson" jsonb,
    "outputPayloadJson" jsonb,
    "errorMessage" text,
    "startedAt" timestamp(3) without time zone,
    "completedAt" timestamp(3) without time zone,
    "attemptCount" integer DEFAULT 0 NOT NULL,
    "maxAttempts" integer DEFAULT 3 NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."AIJob" OWNER TO "dispatchspot_1001-1";

--
-- Name: AIPromptTemplate; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."AIPromptTemplate" (
    id text NOT NULL,
    "organizationId" text,
    "featureName" text NOT NULL,
    "promptName" text NOT NULL,
    version text NOT NULL,
    "systemPrompt" text NOT NULL,
    "developerPrompt" text,
    "outputSchemaJson" jsonb,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."AIPromptTemplate" OWNER TO "dispatchspot_1001-1";

--
-- Name: Accessorial; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Accessorial" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "loadId" text NOT NULL,
    category public."AccessorialCategory" NOT NULL,
    description text,
    amount numeric(12,2) NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


ALTER TABLE public."Accessorial" OWNER TO "dispatchspot_1001-1";

--
-- Name: AuthEmailToken; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."AuthEmailToken" (
    id text NOT NULL,
    "userId" text NOT NULL,
    "organizationId" text,
    email text NOT NULL,
    type public."AuthEmailTokenType" NOT NULL,
    "tokenHash" text NOT NULL,
    "expiresAt" timestamp(3) without time zone NOT NULL,
    "usedAt" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL,
    "failedAttemptCount" integer DEFAULT 0 NOT NULL,
    "lastAttemptAt" timestamp(3) without time zone,
    "lastSentAt" timestamp(3) without time zone,
    "lockedAt" timestamp(3) without time zone,
    "resendCount" integer DEFAULT 0 NOT NULL
);


ALTER TABLE public."AuthEmailToken" OWNER TO "dispatchspot_1001-1";

--
-- Name: Broker; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Broker" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    name text NOT NULL,
    phone text,
    email text,
    "contactName" text,
    "billingNotes" text,
    "factoringNotes" text,
    "generalNotes" text,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL,
    "crmStage" public."CRMStage" DEFAULT 'LEAD'::public."CRMStage" NOT NULL,
    "lastContactedAt" timestamp(3) without time zone,
    "nextFollowUpAt" timestamp(3) without time zone,
    "paymentsOut" numeric(14,2),
    "revenueIn" numeric(14,2),
    "tagsText" text,
    website text
);


ALTER TABLE public."Broker" OWNER TO "dispatchspot_1001-1";

--
-- Name: CRMActivity; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."CRMActivity" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "createdByUserId" text,
    "entityType" public."CRMEntityType" NOT NULL,
    "entityId" text NOT NULL,
    "activityType" public."CRMActivityType" NOT NULL,
    subject text,
    content text,
    "dueAt" timestamp(3) without time zone,
    "completedAt" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL,
    "deletedAt" timestamp(3) without time zone,
    "deletedByUserId" text,
    "deletionReason" text,
    "editReason" text,
    "editedAt" timestamp(3) without time zone,
    "editedByUserId" text
);


ALTER TABLE public."CRMActivity" OWNER TO "dispatchspot_1001-1";

--
-- Name: Company; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Company" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    name text NOT NULL,
    "legalName" text,
    "mcNumber" text,
    "dotNumber" text,
    "contactName" text,
    phone text,
    email text,
    website text,
    "billingAddress" text,
    "notesText" text,
    "crmStage" public."CRMStage" DEFAULT 'LEAD'::public."CRMStage" NOT NULL,
    "revenueIn" numeric(14,2),
    "paymentsOut" numeric(14,2),
    "lastContactedAt" timestamp(3) without time zone,
    "nextFollowUpAt" timestamp(3) without time zone,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."Company" OWNER TO "dispatchspot_1001-1";

--
-- Name: Document; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Document" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "uploadedByUserId" text,
    "fileName" text NOT NULL,
    "mimeType" text,
    "storageKey" text,
    "fileSizeBytes" integer,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL,
    category public."DocumentCategory" DEFAULT 'GENERAL_ATTACHMENT'::public."DocumentCategory" NOT NULL,
    "driverId" text,
    "fieldLabel" text,
    "isFieldRequired" boolean DEFAULT false NOT NULL,
    "loadId" text,
    "truckId" text,
    "visibilityScope" public."DocumentVisibilityScope" DEFAULT 'INTERNAL_ONLY'::public."DocumentVisibilityScope" NOT NULL
);


ALTER TABLE public."Document" OWNER TO "dispatchspot_1001-1";

--
-- Name: DomainEvent; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."DomainEvent" (
    id text NOT NULL,
    "organizationId" text,
    "eventName" text NOT NULL,
    "entityType" text,
    "entityId" text,
    "payloadJson" jsonb NOT NULL,
    status public."DomainEventStatus" NOT NULL,
    "processedAt" timestamp(3) without time zone,
    "errorMessage" text,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


ALTER TABLE public."DomainEvent" OWNER TO "dispatchspot_1001-1";

--
-- Name: Driver; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Driver" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "truckId" text,
    "firstName" text NOT NULL,
    "lastName" text,
    phone text,
    email text,
    "licenseNumber" text,
    "licenseState" text,
    "payType" public."DriverPayType",
    "payRate" numeric(12,4),
    "notesText" text,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL,
    "companyName" text,
    "crmStage" public."CRMStage" DEFAULT 'LEAD'::public."CRMStage" NOT NULL,
    "lastContactedAt" timestamp(3) without time zone,
    "nextFollowUpAt" timestamp(3) without time zone,
    "paymentsOut" numeric(14,2),
    "revenueIn" numeric(14,2),
    "tagsText" text
);


ALTER TABLE public."Driver" OWNER TO "dispatchspot_1001-1";

--
-- Name: Expense; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Expense" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "truckId" text NOT NULL,
    "loadId" text,
    category public."ExpenseCategory" NOT NULL,
    description text,
    amount numeric(12,2) NOT NULL,
    "expenseDate" timestamp(3) without time zone NOT NULL,
    "vendorName" text,
    "notesText" text,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."Expense" OWNER TO "dispatchspot_1001-1";

--
-- Name: FeatureFlag; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."FeatureFlag" (
    id text NOT NULL,
    key public."FeatureFlagKey" NOT NULL,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."FeatureFlag" OWNER TO "dispatchspot_1001-1";

--
-- Name: Load; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Load" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "truckId" text,
    "driverId" text,
    "brokerId" text,
    status public."LoadStatus" DEFAULT 'DRAFT'::public."LoadStatus" NOT NULL,
    "rateConfirmationNumber" text,
    "pickupLocation" text NOT NULL,
    "deliveryLocation" text NOT NULL,
    "pickupDate" timestamp(3) without time zone,
    "deliveryDate" timestamp(3) without time zone,
    miles numeric(12,2),
    "invoiceAmount" numeric(12,2),
    "ratePerMile" numeric(12,4),
    "dispatchFeeType" public."DispatchFeeType",
    "dispatchFeeRate" numeric(12,4),
    "dispatchFeeAmount" numeric(12,2),
    "specialRequirements" text,
    "referenceNumber" text,
    "brokerPhoneSnapshot" text,
    "notesText" text,
    "isCancelled" boolean DEFAULT false NOT NULL,
    "weekStartDate" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL,
    "fieldInstructionsText" text,
    "internalNotesText" text
);


ALTER TABLE public."Load" OWNER TO "dispatchspot_1001-1";

--
-- Name: LoadPayment; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."LoadPayment" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "loadId" text NOT NULL,
    "paymentStatus" public."PaymentStatus" DEFAULT 'UNPAID'::public."PaymentStatus" NOT NULL,
    "invoiceNumber" text,
    "invoiceDate" timestamp(3) without time zone,
    "amountDue" numeric(12,2),
    "amountPaid" numeric(12,2),
    "paidAt" timestamp(3) without time zone,
    "paymentReference" text,
    "notesText" text,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."LoadPayment" OWNER TO "dispatchspot_1001-1";

--
-- Name: LoadStatusHistory; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."LoadStatusHistory" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "loadId" text NOT NULL,
    "fromStatus" public."LoadStatus",
    "toStatus" public."LoadStatus" NOT NULL,
    note text,
    "changedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


ALTER TABLE public."LoadStatusHistory" OWNER TO "dispatchspot_1001-1";

--
-- Name: Note; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Note" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "userId" text,
    "truckId" text,
    "loadId" text,
    "noteType" public."NoteType" NOT NULL,
    title text NOT NULL,
    content text NOT NULL,
    "weekStartDate" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."Note" OWNER TO "dispatchspot_1001-1";

--
-- Name: Organization; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Organization" (
    id text NOT NULL,
    name text NOT NULL,
    slug text NOT NULL,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."Organization" OWNER TO "dispatchspot_1001-1";

--
-- Name: OrganizationFeatureFlag; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."OrganizationFeatureFlag" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "featureFlagId" text NOT NULL,
    "isEnabled" boolean NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."OrganizationFeatureFlag" OWNER TO "dispatchspot_1001-1";

--
-- Name: OutboundEmailLog; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."OutboundEmailLog" (
    id text NOT NULL,
    "userId" text,
    "organizationId" text,
    email text NOT NULL,
    "templateKey" text NOT NULL,
    subject text NOT NULL,
    status public."OutboundEmailStatus" DEFAULT 'PENDING'::public."OutboundEmailStatus" NOT NULL,
    "errorMessage" text,
    "providerMessageId" text,
    "metadataJson" text,
    "sentAt" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."OutboundEmailLog" OWNER TO "dispatchspot_1001-1";

--
-- Name: OwnerOperator; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."OwnerOperator" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "companyId" text,
    "driverId" text,
    "truckId" text,
    "businessName" text NOT NULL,
    "firstName" text,
    "lastName" text,
    phone text,
    email text,
    "mcNumber" text,
    "dotNumber" text,
    "notesText" text,
    "crmStage" public."CRMStage" DEFAULT 'LEAD'::public."CRMStage" NOT NULL,
    "revenueIn" numeric(14,2),
    "paymentsOut" numeric(14,2),
    "lastContactedAt" timestamp(3) without time zone,
    "nextFollowUpAt" timestamp(3) without time zone,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."OwnerOperator" OWNER TO "dispatchspot_1001-1";

--
-- Name: Shipper; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Shipper" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "companyName" text NOT NULL,
    "contactName" text,
    phone text,
    email text,
    website text,
    "billingAddress" text,
    "shippingNotes" text,
    "billingNotes" text,
    "notesText" text,
    "crmStage" public."CRMStage" DEFAULT 'LEAD'::public."CRMStage" NOT NULL,
    "revenueIn" numeric(14,2),
    "paymentsOut" numeric(14,2),
    "lastContactedAt" timestamp(3) without time zone,
    "nextFollowUpAt" timestamp(3) without time zone,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."Shipper" OWNER TO "dispatchspot_1001-1";

--
-- Name: SystemUpdate; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."SystemUpdate" (
    id text NOT NULL,
    version text NOT NULL,
    "updateName" text NOT NULL,
    "updateType" public."SystemUpdateType" NOT NULL,
    status public."SystemUpdateStatus" NOT NULL,
    "notesJson" jsonb,
    "startedAt" timestamp(3) without time zone,
    "completedAt" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."SystemUpdate" OWNER TO "dispatchspot_1001-1";

--
-- Name: Truck; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."Truck" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "truckNumber" text NOT NULL,
    "plateNumber" text,
    "equipmentType" public."EquipmentType" NOT NULL,
    make text,
    model text,
    year integer,
    "trailerType" text,
    "trailerLength" integer,
    vin text,
    status text,
    "equipmentLengthFeet" numeric(10,2),
    "equipmentWidthFeet" numeric(10,2),
    "equipmentHeightFeet" numeric(10,2),
    "maxLoadLengthFeet" numeric(10,2),
    "maxLoadWidthFeet" numeric(10,2),
    "maxLoadHeightFeet" numeric(10,2),
    "maxLoadWeightLbs" numeric(12,2),
    "ownerContactName" text,
    "ownerContactPhone" text,
    "ownerContactEmail" text,
    "insuranceCompany" text,
    "insurancePhone" text,
    "insurancePolicyNumber" text,
    "insuranceAgent" text,
    "insuranceAgentPhone" text,
    "factoringCompany" text,
    "factoringAccountNumber" text,
    "factoringAgent" text,
    "factoringAgentPhone" text,
    "projectedCpm" numeric(10,4),
    "actualCpm" numeric(10,4),
    "notesText" text,
    "isActive" boolean DEFAULT true NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."Truck" OWNER TO "dispatchspot_1001-1";

--
-- Name: TruckFinancialSetting; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."TruckFinancialSetting" (
    "truckId" text NOT NULL,
    "organizationId" text NOT NULL,
    "dispatchFeeType" public."DispatchFeeType",
    "dispatchFeeRate" numeric(12,4),
    "driverPayType" public."DriverPayType",
    "driverPayRate" numeric(12,4),
    "projectedCpm" numeric(10,4),
    "actualCpm" numeric(10,4),
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL,
    "projectedRpm" numeric(10,4),
    "rpmCriticalThreshold" numeric(10,4),
    "rpmWarningThreshold" numeric(10,4)
);


ALTER TABLE public."TruckFinancialSetting" OWNER TO "dispatchspot_1001-1";

--
-- Name: TruckMetricSnapshot; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."TruckMetricSnapshot" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "truckId" text NOT NULL,
    "periodType" public."AIInsightPeriodType" NOT NULL,
    "periodStart" timestamp(3) without time zone NOT NULL,
    "periodEnd" timestamp(3) without time zone NOT NULL,
    "totalLoads" integer NOT NULL,
    "activeLoads" integer DEFAULT 0 NOT NULL,
    "deliveredLoads" integer DEFAULT 0 NOT NULL,
    "paidLoads" integer DEFAULT 0 NOT NULL,
    "cancelledLoads" integer DEFAULT 0 NOT NULL,
    "totalRevenue" numeric(14,2) NOT NULL,
    "outstandingRevenue" numeric(14,2) NOT NULL,
    "dispatchFeeEarned" numeric(14,2) NOT NULL,
    "totalMiles" numeric(14,2) NOT NULL,
    "averageRpm" numeric(12,4),
    "projectedCpm" numeric(10,4),
    "actualCpm" numeric(10,4),
    "totalAccessorials" numeric(14,2) NOT NULL,
    "totalExpenses" numeric(14,2) NOT NULL,
    "driverPayTotal" numeric(14,2) NOT NULL,
    "netRevenue" numeric(14,2) NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


ALTER TABLE public."TruckMetricSnapshot" OWNER TO "dispatchspot_1001-1";

--
-- Name: User; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."User" (
    id text NOT NULL,
    "organizationId" text,
    email text NOT NULL,
    "passwordHash" text NOT NULL,
    "firstName" text,
    "lastName" text,
    role public."UserRole" NOT NULL,
    "isActive" boolean DEFAULT true NOT NULL,
    "lastLoginAt" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL,
    "linkedDriverId" text,
    "emailVerifiedAt" timestamp(3) without time zone
);


ALTER TABLE public."User" OWNER TO "dispatchspot_1001-1";

--
-- Name: UserNotificationPreference; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."UserNotificationPreference" (
    id text NOT NULL,
    "userId" text NOT NULL,
    "organizationId" text,
    "inAppEnabled" boolean DEFAULT true NOT NULL,
    "emailDueToday" boolean DEFAULT true NOT NULL,
    "emailOverdue" boolean DEFAULT true NOT NULL,
    "emailUrgent" boolean DEFAULT true NOT NULL,
    "teamDigest" boolean DEFAULT false NOT NULL,
    "smsReserved" boolean DEFAULT false NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."UserNotificationPreference" OWNER TO "dispatchspot_1001-1";

--
-- Name: VerifiedCustomDomainRequest; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."VerifiedCustomDomainRequest" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "requestedByUserId" text NOT NULL,
    "reviewedByUserId" text,
    domain text NOT NULL,
    "businessJustification" text NOT NULL,
    "dnsOwnerContact" text NOT NULL,
    "replyHandlingPlan" text,
    status public."VerifiedCustomDomainRequestStatus" DEFAULT 'SUBMITTED'::public."VerifiedCustomDomainRequestStatus" NOT NULL,
    "reviewNotes" text,
    "submittedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "reviewedAt" timestamp(3) without time zone,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."VerifiedCustomDomainRequest" OWNER TO "dispatchspot_1001-1";

--
-- Name: WeeklyTruckSummary; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."WeeklyTruckSummary" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "truckId" text NOT NULL,
    "weekStartDate" timestamp(3) without time zone NOT NULL,
    "totalLoads" integer NOT NULL,
    "activeLoads" integer DEFAULT 0 NOT NULL,
    "deliveredLoads" integer DEFAULT 0 NOT NULL,
    "paidLoads" integer DEFAULT 0 NOT NULL,
    "cancelledLoads" integer DEFAULT 0 NOT NULL,
    "totalRevenue" numeric(14,2) NOT NULL,
    "outstandingRevenue" numeric(14,2) NOT NULL,
    "paidRevenue" numeric(14,2) NOT NULL,
    "dispatchFeeTotal" numeric(14,2) NOT NULL,
    "totalMiles" numeric(14,2) NOT NULL,
    "averageRpm" numeric(12,4),
    "totalExpenses" numeric(14,2) NOT NULL,
    "totalAccessorials" numeric(14,2) NOT NULL,
    "driverPayTotal" numeric(14,2) NOT NULL,
    "netRevenue" numeric(14,2) NOT NULL,
    "calculatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


ALTER TABLE public."WeeklyTruckSummary" OWNER TO "dispatchspot_1001-1";

--
-- Name: WorkAssignment; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."WorkAssignment" (
    id text NOT NULL,
    "organizationId" text NOT NULL,
    "targetType" public."AssignmentTargetType" NOT NULL,
    "targetId" text NOT NULL,
    "assignedByUserId" text,
    "primaryAssigneeUserId" text,
    instructions text,
    "expectedOutcome" text,
    "dueAt" timestamp(3) without time zone,
    priority public."AssignmentPriority" DEFAULT 'NORMAL'::public."AssignmentPriority" NOT NULL,
    status public."AssignmentStatus" DEFAULT 'ASSIGNED'::public."AssignmentStatus" NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    "updatedAt" timestamp(3) without time zone NOT NULL
);


ALTER TABLE public."WorkAssignment" OWNER TO "dispatchspot_1001-1";

--
-- Name: WorkAssignmentAssignee; Type: TABLE; Schema: public; Owner: dispatchspot_1001-1
--

CREATE TABLE public."WorkAssignmentAssignee" (
    id text NOT NULL,
    "assignmentId" text NOT NULL,
    "userId" text NOT NULL,
    "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


ALTER TABLE public."WorkAssignmentAssignee" OWNER TO "dispatchspot_1001-1";

--
-- Data for Name: AIExtractionResult; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."AIExtractionResult" (id, "organizationId", "sourceType", "sourceDocumentId", "sourceTextHash", "extractionType", "rawText", "extractedJson", "normalizedJson", "confidenceScore", "validationStatus", "reviewStatus", "reviewedByUserId", "reviewedAt", "createdAt", "updatedAt") FROM stdin;
5c4a090a-9764-4f56-95d9-0b581da4e343	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	UPLOADED_DOCUMENT	47d9bd2e-6bff-474f-b0ab-84e67b1422b5	47fcd1271d3baa0ebd0e1d44c5bfd1bd84bea03b4bc1d9d87f2fec063f2e4aec	load_document_extraction	TQL load offer. Pickup Houston TX 2026-04-10. Delivery Atlanta GA 2026-04-11. 820 miles. Rate 2100. Dry van.	{"miles": 820, "rate_total": 2100, "broker_name": "TQL", "pickup_date": "2026-04-10", "delivery_date": "2026-04-11", "pickup_location": "Houston, TX", "delivery_location": "Atlanta, GA", "special_requirements": "Dry van"}	{"miles": 820, "brokerName": "TQL", "pickupDate": "2026-04-10T08:00:00.000Z", "deliveryDate": "2026-04-11T18:00:00.000Z", "equipmentType": "DRY_VAN", "invoiceAmount": 2100, "pickupLocation": "Houston, TX", "deliveryLocation": "Atlanta, GA"}	94.50	VALID	ACCEPTED	8a6688d8-44cd-4c51-8785-2c671a2617a0	2026-04-09 09:10:00	2026-04-16 22:11:58.749	2026-04-16 22:11:58.749
\.


--
-- Data for Name: AIInsightSnapshot; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."AIInsightSnapshot" (id, "organizationId", "scopeType", "scopeId", "periodType", "periodStart", "periodEnd", "inputMetricsJson", "flagsJson", "summaryBulletsJson", "summaryText", "modelName", "promptVersion", "createdAt") FROM stdin;
dab2bd0f-69b3-4a8c-8e3c-ff9487587e1c	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	TRUCK	d89d40d0-6403-4fea-9640-d2cfa1a28411	WEEKLY	2026-04-16 22:11:58.716	2026-04-16 22:11:58.716	{"averageRpm": "2.6059", "netRevenue": "3975.75", "totalLoads": 3, "totalRevenue": "6110", "totalExpenses": "688"}	{"risk": [], "opportunity": []}	["Completed 3 seeded loads in the selected period.", "Generated total revenue of 6110.", "Net revenue tracked at 3975.75."]	Truck produced positive net revenue with stable seeded operational metrics.	seeded-rules-engine	1.0.0	2026-04-16 22:11:58.754
faf04776-7526-4b5d-9164-fab57823e9a7	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	TRUCK	35d98abf-bc25-4c9e-8993-79cb870120e6	WEEKLY	2026-04-16 22:11:58.725	2026-04-16 22:11:58.725	{"averageRpm": "3.3545", "netRevenue": "5422", "totalLoads": 4, "totalRevenue": "7655", "totalExpenses": "803"}	{"risk": [], "opportunity": ["High asset utilization"]}	["Completed 4 seeded loads in the selected period.", "Generated total revenue of 7655.", "Net revenue tracked at 5422."]	Truck produced positive net revenue with stable seeded operational metrics.	seeded-rules-engine	1.0.0	2026-04-16 22:11:58.757
27528d7b-f8c5-452e-ba50-8a4c516c276d	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	TRUCK	c2929736-5ee0-416d-b54e-c50821066804	WEEKLY	2026-04-16 22:11:58.733	2026-04-16 22:11:58.733	{"averageRpm": "5.5967", "netRevenue": "4241", "totalLoads": 4, "totalRevenue": "7025", "totalExpenses": "880"}	{"risk": [], "opportunity": ["High asset utilization"]}	["Completed 4 seeded loads in the selected period.", "Generated total revenue of 7025.", "Net revenue tracked at 4241."]	Truck produced positive net revenue with stable seeded operational metrics.	seeded-rules-engine	1.0.0	2026-04-16 22:11:58.758
\.


--
-- Data for Name: AIJob; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."AIJob" (id, "organizationId", "createdByUserId", "jobType", status, "relatedEntityType", "relatedEntityId", priority, "inputPayloadJson", "outputPayloadJson", "errorMessage", "startedAt", "completedAt", "attemptCount", "maxAttempts", "createdAt", "updatedAt") FROM stdin;
a5a49a5b-96e0-4840-8466-724172537358	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	8a6688d8-44cd-4c51-8785-2c671a2617a0	PARSE_LOAD_DOCUMENT	COMPLETED	Document	47d9bd2e-6bff-474f-b0ab-84e67b1422b5	50	{"fileName": "rate-confirmation-demo-101.pdf", "documentId": "47d9bd2e-6bff-474f-b0ab-84e67b1422b5"}	{"source": "seed", "extractionStored": true}	\N	2026-04-09 09:00:00	2026-04-09 09:00:05	0	3	2026-04-16 22:11:58.741	2026-04-16 22:11:58.741
22c366ca-39f2-4533-b8cd-81600811d0cd	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	1577a829-737e-44d7-9f7b-e03d9ed0ca92	GENERATE_TRUCK_INSIGHT	QUEUED	Truck	d89d40d0-6403-4fea-9640-d2cfa1a28411	100	{"truckId": "d89d40d0-6403-4fea-9640-d2cfa1a28411", "periodType": "WEEKLY"}	\N	\N	\N	\N	0	3	2026-04-16 22:11:58.744	2026-04-16 22:11:58.744
\.


--
-- Data for Name: AIPromptTemplate; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."AIPromptTemplate" (id, "organizationId", "featureName", "promptName", version, "systemPrompt", "developerPrompt", "outputSchemaJson", "isActive", "createdAt", "updatedAt") FROM stdin;
4f7cb851-59a9-4dac-9b4a-74df868b3141	\N	ai_parsing	load_document_extraction	1.0.0	Extract freight load details from the provided document or text. Return only structured JSON that matches the expected schema.	Map broker, pickup, delivery, dates, miles, revenue, and requirements into the extraction schema. Use null for missing values.	{"miles": "number|null", "rate_total": "number|null", "broker_name": "string|null", "pickup_date": "string|null", "delivery_date": "string|null", "pickup_location": "string|null", "delivery_location": "string|null", "special_requirements": "string|null"}	t	2026-04-16 22:11:58.701	2026-04-16 22:11:58.701
5d084d90-b380-4da5-820c-39abfea4776b	\N	ai_insights	truck_weekly_insight	1.0.0	Summarize truck weekly operational and financial performance from deterministic metrics.	Produce a concise summary with risks and opportunities. Do not invent numbers or facts not present in the input metrics.	{"risk_flags": ["string"], "summary_text": "string", "key_observations": ["string"], "opportunity_flags": ["string"]}	t	2026-04-16 22:11:58.703	2026-04-16 22:11:58.703
72b64005-6d01-48f1-81e5-a43c3ead7553	\N	ai_insights	truck_dashboard_insight	1.0.0	Summarize current truck dashboard performance in short operational language.	Highlight revenue, expenses, RPM, and any outlier conditions using only supplied metrics.	{"flags": {"risk": ["string"], "opportunity": ["string"]}, "summary_text": "string", "summary_bullets": ["string"]}	t	2026-04-16 22:11:58.705	2026-04-16 22:11:58.705
\.


--
-- Data for Name: Accessorial; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Accessorial" (id, "organizationId", "loadId", category, description, amount, "createdAt") FROM stdin;
d414845d-7fe0-498c-b3b4-60dd3e7dae5b	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	2d89f049-27a1-4647-89e3-acede133041e	DETENTION	Accessorial for REF-103-C	75.00	2026-04-16 22:11:58.679
518bcd9d-bdbe-4bbc-b3fd-2051283d49da	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	e1f058dc-9dcc-4df4-9cfd-3a0c7703778b	LAYOVER	Accessorial for REF-102-C	100.00	2026-04-16 22:11:58.681
0a58f439-b77c-4e32-8b8c-723952ffceb1	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	ea29b412-7194-4678-b1f9-6956e8b4902f	TONU	Accessorial for REF-101-B	125.00	2026-04-16 22:11:58.683
3c3d8618-917a-4233-ad73-dd01be38249f	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d4e125eb-88d2-47e1-a34c-7df6caa7e43c	OTHER	Accessorial for REF-103-A	150.00	2026-04-16 22:11:58.684
5e346368-3db3-461a-9fa0-0a2b0c699578	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	7b01534f-247f-4baf-9cf0-1e0ee17c6500	DETENTION	Accessorial for REF-102-A	175.00	2026-04-16 22:11:58.685
a3e2b361-d4e2-4ac5-9d32-f4d870b4ba06	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	776dae43-bad0-4177-a51f-5b47ee708ca2	LAYOVER	Accessorial for REF-101-A	200.00	2026-04-16 22:11:58.686
\.


--
-- Data for Name: AuthEmailToken; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."AuthEmailToken" (id, "userId", "organizationId", email, type, "tokenHash", "expiresAt", "usedAt", "createdAt", "updatedAt", "failedAttemptCount", "lastAttemptAt", "lastSentAt", "lockedAt", "resendCount") FROM stdin;
\.


--
-- Data for Name: Broker; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Broker" (id, "organizationId", name, phone, email, "contactName", "billingNotes", "factoringNotes", "generalNotes", "isActive", "createdAt", "updatedAt", "crmStage", "lastContactedAt", "nextFollowUpAt", "paymentsOut", "revenueIn", "tagsText", website) FROM stdin;
c62a6128-d54c-4df3-9109-a340c4c1898f	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	TQL	+18005551234	rep@tql-demo.com	Broker Rep	Invoice within 24 hours	Use factoring account FF-101	Check calls every 4 hours	t	2026-04-16 22:11:58.559	2026-04-16 22:11:58.559	LEAD	\N	\N	\N	\N	\N	\N
d7f33b1b-059b-4fbf-9f23-0c494775d599	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	CH Robinson	+18005550111	ops@chrobinson-demo.com	Rachel Broker	Submit POD with invoice	Standard factoring accepted	Email updates preferred	t	2026-04-16 22:11:58.562	2026-04-16 22:11:58.562	LEAD	\N	\N	\N	\N	\N	\N
f73d909e-8d9b-45b8-9415-be2b2694b6fb	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	Landstar	+18005550222	dispatch@landstar-demo.com	Marcus Lane	Carrier packet required	Factoring pre-approval needed	Higher value freight	t	2026-04-16 22:11:58.563	2026-04-16 22:11:58.563	LEAD	\N	\N	\N	\N	\N	\N
c892b9fb-b88b-44ab-b961-bb2e609ea4f3	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	JB Hunt	+18005550333	loads@jbhunt-demo.com	Dana Fields	Invoice through portal	Portal remittance only	Strict appointment times	t	2026-04-16 22:11:58.565	2026-04-16 22:11:58.565	LEAD	\N	\N	\N	\N	\N	\N
27885e58-4d5a-4831-8d15-8195c5608990	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	Echo Logistics	+18005550444	brokerdesk@echo-demo.com	Chris Porter	Standard billing cycle	ACH preferred	Blind shipment support available	t	2026-04-16 22:11:58.566	2026-04-16 22:11:58.566	LEAD	\N	\N	\N	\N	\N	\N
\.


--
-- Data for Name: CRMActivity; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."CRMActivity" (id, "organizationId", "createdByUserId", "entityType", "entityId", "activityType", subject, content, "dueAt", "completedAt", "createdAt", "updatedAt", "deletedAt", "deletedByUserId", "deletionReason", "editReason", "editedAt", "editedByUserId") FROM stdin;
\.


--
-- Data for Name: Company; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Company" (id, "organizationId", name, "legalName", "mcNumber", "dotNumber", "contactName", phone, email, website, "billingAddress", "notesText", "crmStage", "revenueIn", "paymentsOut", "lastContactedAt", "nextFollowUpAt", "isActive", "createdAt", "updatedAt") FROM stdin;
\.


--
-- Data for Name: Document; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Document" (id, "organizationId", "uploadedByUserId", "fileName", "mimeType", "storageKey", "fileSizeBytes", "createdAt", "updatedAt", category, "driverId", "fieldLabel", "isFieldRequired", "loadId", "truckId", "visibilityScope") FROM stdin;
47d9bd2e-6bff-474f-b0ab-84e67b1422b5	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	8a6688d8-44cd-4c51-8785-2c671a2617a0	rate-confirmation-demo-101.pdf	application/pdf	seed/rate-confirmation-demo-101.pdf	184320	2026-04-16 22:11:58.697	2026-04-16 22:11:58.697	GENERAL_ATTACHMENT	\N	\N	f	\N	\N	INTERNAL_ONLY
94cbb6aa-602b-4cc0-9c0d-c9e9677a0e6d	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	1577a829-737e-44d7-9f7b-e03d9ed0ca92	broker-email-load-102.txt	text/plain	seed/broker-email-load-102.txt	8192	2026-04-16 22:11:58.699	2026-04-16 22:11:58.699	GENERAL_ATTACHMENT	\N	\N	f	\N	\N	INTERNAL_ONLY
\.


--
-- Data for Name: DomainEvent; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."DomainEvent" (id, "organizationId", "eventName", "entityType", "entityId", "payloadJson", status, "processedAt", "errorMessage", "createdAt") FROM stdin;
3cab195a-09ec-4dfd-882d-6618ac4756c2	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	load.seeded	Load	776dae43-bad0-4177-a51f-5b47ee708ca2	{"seeded": true, "referenceNumber": "REF-101-A"}	PROCESSED	2026-04-09 09:15:00	\N	2026-04-16 22:11:58.763
60de857a-11b1-4adb-bfed-aef852b4ab9f	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	ai.job.completed	AIJob	a5a49a5b-96e0-4840-8466-724172537358	{"seeded": true, "jobType": "PARSE_LOAD_DOCUMENT"}	PROCESSED	2026-04-09 09:20:00	\N	2026-04-16 22:11:58.765
\.


--
-- Data for Name: Driver; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Driver" (id, "organizationId", "truckId", "firstName", "lastName", phone, email, "licenseNumber", "licenseState", "payType", "payRate", "notesText", "isActive", "createdAt", "updatedAt", "companyName", "crmStage", "lastContactedAt", "nextFollowUpAt", "paymentsOut", "revenueIn", "tagsText") FROM stdin;
c5697a9a-480b-4dc2-a930-e92f2755e607	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	John	Doe	+12680000201	john.doe.driver@dispatchspot.local	D1234567	TX	PERCENTAGE	25.0000	Primary driver for truck 101	t	2026-04-16 22:11:58.549	2026-04-16 22:11:58.549	\N	LEAD	\N	\N	\N	\N	\N
7c9deb00-5c84-4319-a31d-129f80669b8a	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	Maria	Lopez	+12680000202	maria.lopez.driver@dispatchspot.local	R7654321	FL	RATE_PER_MILE	0.6500	Reefer driver paid per mile	t	2026-04-16 22:11:58.553	2026-04-16 22:11:58.553	\N	LEAD	\N	\N	\N	\N	\N
7f4b8c0b-9343-4673-851c-4a32fe140a29	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	Sam	Carter	+12680000203	sam.carter.driver@dispatchspot.local	F9988776	GA	PERCENTAGE	28.0000	Flatbed specialist driver	t	2026-04-16 22:11:58.555	2026-04-16 22:11:58.555	\N	LEAD	\N	\N	\N	\N	\N
\.


--
-- Data for Name: Expense; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Expense" (id, "organizationId", "truckId", "loadId", category, description, amount, "expenseDate", "vendorName", "notesText", "createdAt", "updatedAt") FROM stdin;
8ddb022e-439a-4a27-8d94-c9ce58d9d696	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	e737fdb8-a3af-470e-b1b4-e30f75c6ab18	FUEL	Fuel purchase for truck 101	525.00	2026-04-01 06:00:00	Pilot Travel Center	Routine fuel stop recorded for seeded operations.	2026-04-16 22:11:58.66	2026-04-16 22:11:58.66
7bf7a7ee-612a-4a2c-abcb-71b37dd522f2	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	e737fdb8-a3af-470e-b1b4-e30f75c6ab18	TOLL	Tolls for truck 101	78.00	2026-04-01 06:00:00	State Toll Authority	Interstate toll charges linked to dispatched load.	2026-04-16 22:11:58.663	2026-04-16 22:11:58.663
71bd0626-45e0-4df5-95dc-53e21196ef94	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	\N	OTHER	Monthly truck wash and detailing	85.00	2026-04-06 12:00:00	Blue Beacon	Cosmetic maintenance and wash service.	2026-04-16 22:11:58.664	2026-04-16 22:11:58.664
4f6aa7db-146e-4211-8520-c04a1bd2f6fd	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	e1f058dc-9dcc-4df4-9cfd-3a0c7703778b	FUEL	Fuel purchase for truck 102	640.00	2026-04-02 08:15:00	Pilot Travel Center	Routine fuel stop recorded for seeded operations.	2026-04-16 22:11:58.666	2026-04-16 22:11:58.666
ce14fd74-ac8d-4ab0-8068-ad719dec6779	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	e1f058dc-9dcc-4df4-9cfd-3a0c7703778b	TOLL	Tolls for truck 102	78.00	2026-04-02 08:15:00	State Toll Authority	Interstate toll charges linked to dispatched load.	2026-04-16 22:11:58.668	2026-04-16 22:11:58.668
4d0076fa-648c-4e55-ab23-ccab2d3f128c	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	\N	OTHER	Monthly truck wash and detailing	85.00	2026-04-06 12:00:00	Blue Beacon	Cosmetic maintenance and wash service.	2026-04-16 22:11:58.669	2026-04-16 22:11:58.669
88fc8b26-0a2f-4e6f-89f7-90c9db973ba0	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	2d89f049-27a1-4647-89e3-acede133041e	FUEL	Fuel purchase for truck 103	525.00	2026-03-31 11:00:00	Pilot Travel Center	Routine fuel stop recorded for seeded operations.	2026-04-16 22:11:58.671	2026-04-16 22:11:58.671
714df927-f0bb-4846-a90a-2b54467d46cc	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	2d89f049-27a1-4647-89e3-acede133041e	TOLL	Tolls for truck 103	110.00	2026-03-31 11:00:00	State Toll Authority	Interstate toll charges linked to dispatched load.	2026-04-16 22:11:58.673	2026-04-16 22:11:58.673
c1eeda85-896f-40c5-a1a7-e2c0a1beca74	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	\N	REPAIR	Flatbed securement hardware replacement	245.00	2026-04-06 12:00:00	Fleet Repair Hub	Preventive repair before next assignment.	2026-04-16 22:11:58.675	2026-04-16 22:11:58.675
\.


--
-- Data for Name: FeatureFlag; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."FeatureFlag" (id, key, "isActive", "createdAt", "updatedAt") FROM stdin;
2b444a17-0e72-40c0-95c4-6f43d995ef73	AI_PARSING	t	2026-04-16 22:11:58.522	2026-04-16 22:11:58.522
c73b417e-586e-487e-9b48-2ef9ee73202f	AI_INSIGHTS	t	2026-04-16 22:11:58.525	2026-04-16 22:11:58.525
\.


--
-- Data for Name: Load; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Load" (id, "organizationId", "truckId", "driverId", "brokerId", status, "rateConfirmationNumber", "pickupLocation", "deliveryLocation", "pickupDate", "deliveryDate", miles, "invoiceAmount", "ratePerMile", "dispatchFeeType", "dispatchFeeRate", "dispatchFeeAmount", "specialRequirements", "referenceNumber", "brokerPhoneSnapshot", "notesText", "isCancelled", "weekStartDate", "createdAt", "updatedAt", "fieldInstructionsText", "internalNotesText") FROM stdin;
776dae43-bad0-4177-a51f-5b47ee708ca2	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	c5697a9a-480b-4dc2-a930-e92f2755e607	c62a6128-d54c-4df3-9109-a340c4c1898f	DELIVERED	RC-101-A	Houston, TX	Atlanta, GA	2026-04-07 08:00:00	2026-04-08 18:00:00	820.00	2100.00	2.5610	PERCENTAGE	10.0000	210.00	Dry van, palletized freight	REF-101-A	\N	Strong lane with stable broker relationship.	f	2026-04-06 00:00:00	2026-04-16 22:11:58.586	2026-04-16 22:11:58.586	\N	\N
ea29b412-7194-4678-b1f9-6956e8b4902f	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	c5697a9a-480b-4dc2-a930-e92f2755e607	d7f33b1b-059b-4fbf-9f23-0c494775d599	INVOICED	RC-101-B	Dallas, TX	Nashville, TN	2026-04-03 09:30:00	2026-04-04 19:00:00	760.00	1980.00	2.6053	PERCENTAGE	10.0000	198.00	\N	REF-101-B	\N	Submitted to broker portal for billing.	f	2026-03-30 00:00:00	2026-04-16 22:11:58.589	2026-04-16 22:11:58.589	\N	\N
565a4001-ca0a-4484-8599-c20242d140cf	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	c5697a9a-480b-4dc2-a930-e92f2755e607	f73d909e-8d9b-45b8-9415-be2b2694b6fb	ASSIGNED	RC-101-C	Memphis, TN	Savannah, GA	2026-04-10 12:00:00	2026-04-11 22:00:00	640.00	1705.00	2.6641	PERCENTAGE	10.0000	170.50	Tight pickup appointment window	REF-101-C	\N	Driver assigned and check-in confirmed.	f	2026-04-06 00:00:00	2026-04-16 22:11:58.592	2026-04-16 22:11:58.592	\N	\N
e737fdb8-a3af-470e-b1b4-e30f75c6ab18	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	c5697a9a-480b-4dc2-a930-e92f2755e607	27885e58-4d5a-4831-8d15-8195c5608990	CANCELLED	RC-101-D	Birmingham, AL	Charlotte, NC	2026-04-01 06:00:00	2026-04-02 17:00:00	430.00	995.00	2.3140	PERCENTAGE	10.0000	99.50	\N	REF-101-D	\N	Broker cancelled after pickup was rescheduled twice.	t	2026-03-30 00:00:00	2026-04-16 22:11:58.594	2026-04-16 22:11:58.594	\N	\N
7b01534f-247f-4baf-9cf0-1e0ee17c6500	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	7c9deb00-5c84-4319-a31d-129f80669b8a	d7f33b1b-059b-4fbf-9f23-0c494775d599	PAID_FULL	RC-102-A	Miami, FL	Charlotte, NC	2026-04-05 07:00:00	2026-04-06 20:00:00	730.00	2350.00	3.2192	FLAT_RATE	300.0000	300.00	Maintain 34°F throughout transit	REF-102-A	\N	Reefer temp logs delivered with POD.	f	2026-03-30 00:00:00	2026-04-16 22:11:58.595	2026-04-16 22:11:58.595	\N	\N
414e6268-b367-493c-8181-6eba82bf206d	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	7c9deb00-5c84-4319-a31d-129f80669b8a	c892b9fb-b88b-44ab-b961-bb2e609ea4f3	IN_TRANSIT	RC-102-B	Orlando, FL	Raleigh, NC	2026-04-09 05:00:00	2026-04-10 17:00:00	610.00	2050.00	3.3607	FLAT_RATE	300.0000	300.00	Fresh produce, reefer setpoint 36°F	REF-102-B	\N	In-transit reefer load with active temp monitoring.	f	2026-04-06 00:00:00	2026-04-16 22:11:58.597	2026-04-16 22:11:58.597	\N	\N
e1f058dc-9dcc-4df4-9cfd-3a0c7703778b	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	7c9deb00-5c84-4319-a31d-129f80669b8a	c62a6128-d54c-4df3-9109-a340c4c1898f	DELIVERED	RC-102-C	Atlanta, GA	Richmond, VA	2026-04-02 08:15:00	2026-04-03 18:45:00	540.00	1880.00	3.4815	FLAT_RATE	300.0000	300.00	\N	REF-102-C	\N	Delivered on time. Awaiting invoice processing.	f	2026-03-30 00:00:00	2026-04-16 22:11:58.599	2026-04-16 22:11:58.599	\N	\N
277b33be-3e0d-4c7c-997b-58fa344df6da	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	7c9deb00-5c84-4319-a31d-129f80669b8a	27885e58-4d5a-4831-8d15-8195c5608990	AVAILABLE	RC-102-D	Jacksonville, FL	Columbia, SC	2026-04-11 09:00:00	2026-04-11 23:00:00	320.00	1100.00	3.4375	FLAT_RATE	300.0000	300.00	\N	REF-102-D	\N	Open option if current route finishes early.	f	2026-04-06 00:00:00	2026-04-16 22:11:58.601	2026-04-16 22:11:58.601	\N	\N
d4e125eb-88d2-47e1-a34c-7df6caa7e43c	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	7f4b8c0b-9343-4673-851c-4a32fe140a29	f73d909e-8d9b-45b8-9415-be2b2694b6fb	DELIVERED	RC-103-A	Baton Rouge, LA	Mobile, AL	2026-04-04 10:00:00	2026-04-05 14:00:00	260.00	1650.00	6.3462	PERCENTAGE	12.0000	198.00	Tarps required	REF-103-A	\N	Flatbed delivery completed with signed POD.	f	2026-03-30 00:00:00	2026-04-16 22:11:58.603	2026-04-16 22:11:58.603	\N	\N
5d93e469-e422-4ae1-8bed-0b936daa409e	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	7f4b8c0b-9343-4673-851c-4a32fe140a29	c892b9fb-b88b-44ab-b961-bb2e609ea4f3	IN_TRANSIT	RC-103-B	Houston, TX	Shreveport, LA	2026-04-08 06:30:00	2026-04-09 15:00:00	310.00	1825.00	5.8871	PERCENTAGE	12.0000	219.00	Securement check every 150 miles	REF-103-B	\N	Current active flatbed movement.	f	2026-04-06 00:00:00	2026-04-16 22:11:58.604	2026-04-16 22:11:58.604	\N	\N
2d89f049-27a1-4647-89e3-acede133041e	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	7f4b8c0b-9343-4673-851c-4a32fe140a29	d7f33b1b-059b-4fbf-9f23-0c494775d599	PAID_FULL	RC-103-C	Little Rock, AR	Nashville, TN	2026-03-31 11:00:00	2026-04-01 21:00:00	365.00	1900.00	5.2055	PERCENTAGE	12.0000	228.00	\N	REF-103-C	\N	Paid cleanly with strong margin.	f	2026-03-30 00:00:00	2026-04-16 22:11:58.606	2026-04-16 22:11:58.606	\N	\N
8e2d5c40-3083-4ac8-837e-fe171542c1e7	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	7f4b8c0b-9343-4673-851c-4a32fe140a29	c62a6128-d54c-4df3-9109-a340c4c1898f	ASSIGNED	RC-103-D	Chattanooga, TN	Greenville, SC	2026-04-10 13:00:00	2026-04-11 20:00:00	280.00	1425.00	5.0893	PERCENTAGE	12.0000	171.00	\N	REF-103-D	\N	Assigned and staged for pickup.	f	2026-04-06 00:00:00	2026-04-16 22:11:58.608	2026-04-16 22:11:58.608	\N	\N
\.


--
-- Data for Name: LoadPayment; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."LoadPayment" (id, "organizationId", "loadId", "paymentStatus", "invoiceNumber", "invoiceDate", "amountDue", "amountPaid", "paidAt", "paymentReference", "notesText", "createdAt", "updatedAt") FROM stdin;
099db280-6c95-4c0b-8612-11c3bd13093a	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	2d89f049-27a1-4647-89e3-acede133041e	PAID	INV-REF-103-C	2026-04-01 21:00:00	1900.00	1900.00	2026-04-01 21:00:00	PMT-REF-103-C	Paid in full.	2026-04-16 22:11:58.638	2026-04-16 22:11:58.638
036a76af-eb16-4cea-aeac-34814e4be0af	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	e737fdb8-a3af-470e-b1b4-e30f75c6ab18	UNPAID	INV-REF-101-D	2026-04-02 17:00:00	995.00	0.00	\N	\N	Invoice not yet paid.	2026-04-16 22:11:58.641	2026-04-16 22:11:58.641
197f64be-1909-4f6a-a38b-8906c38166fa	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	e1f058dc-9dcc-4df4-9cfd-3a0c7703778b	PARTIAL	INV-REF-102-C	2026-04-03 18:45:00	1880.00	940.00	2026-04-03 18:45:00	PMT-REF-102-C	Partial remittance received.	2026-04-16 22:11:58.642	2026-04-16 22:11:58.642
b2a996f3-675d-4336-a596-9bd1788d5059	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	ea29b412-7194-4678-b1f9-6956e8b4902f	PARTIAL	INV-REF-101-B	2026-04-04 19:00:00	1980.00	990.00	2026-04-04 19:00:00	PMT-REF-101-B	Partial remittance received.	2026-04-16 22:11:58.644	2026-04-16 22:11:58.644
5ac202d0-83cd-4d87-af93-ae4c1aee0e2c	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d4e125eb-88d2-47e1-a34c-7df6caa7e43c	PARTIAL	INV-REF-103-A	2026-04-05 14:00:00	1650.00	825.00	2026-04-05 14:00:00	PMT-REF-103-A	Partial remittance received.	2026-04-16 22:11:58.645	2026-04-16 22:11:58.645
e0b8c4d8-9d03-4699-92a7-5dda26160857	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	7b01534f-247f-4baf-9cf0-1e0ee17c6500	PAID	INV-REF-102-A	2026-04-06 20:00:00	2350.00	2350.00	2026-04-06 20:00:00	PMT-REF-102-A	Paid in full.	2026-04-16 22:11:58.646	2026-04-16 22:11:58.646
d16aea49-7f5f-45e5-9970-e77347cc6d19	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	776dae43-bad0-4177-a51f-5b47ee708ca2	PARTIAL	INV-REF-101-A	2026-04-08 18:00:00	2100.00	1050.00	2026-04-08 18:00:00	PMT-REF-101-A	Partial remittance received.	2026-04-16 22:11:58.648	2026-04-16 22:11:58.648
1e9594bf-8ed8-4a35-807c-22902a7bb87d	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	5d93e469-e422-4ae1-8bed-0b936daa409e	UNPAID	INV-REF-103-B	2026-04-09 15:00:00	1825.00	0.00	\N	\N	Invoice not yet paid.	2026-04-16 22:11:58.649	2026-04-16 22:11:58.649
a461b104-7df4-4c84-a0c7-e548e3382998	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	414e6268-b367-493c-8181-6eba82bf206d	UNPAID	INV-REF-102-B	2026-04-10 17:00:00	2050.00	0.00	\N	\N	Invoice not yet paid.	2026-04-16 22:11:58.65	2026-04-16 22:11:58.65
2c96727b-6039-45ab-a02b-768550ff30d0	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	565a4001-ca0a-4484-8599-c20242d140cf	UNPAID	INV-REF-101-C	2026-04-11 22:00:00	1705.00	0.00	\N	\N	Invoice not yet paid.	2026-04-16 22:11:58.651	2026-04-16 22:11:58.651
7cbb1f30-eefd-4490-9f31-ef139e1fec0a	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	8e2d5c40-3083-4ac8-837e-fe171542c1e7	UNPAID	INV-REF-103-D	2026-04-11 20:00:00	1425.00	0.00	\N	\N	Invoice not yet paid.	2026-04-16 22:11:58.653	2026-04-16 22:11:58.653
df9b46a5-b62a-459c-a26b-45f0a10ebe0a	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	277b33be-3e0d-4c7c-997b-58fa344df6da	UNPAID	INV-REF-102-D	2026-04-11 23:00:00	1100.00	0.00	\N	\N	Invoice not yet paid.	2026-04-16 22:11:58.654	2026-04-16 22:11:58.654
\.


--
-- Data for Name: LoadStatusHistory; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."LoadStatusHistory" (id, "organizationId", "loadId", "fromStatus", "toStatus", note, "changedAt") FROM stdin;
e5e2ce3f-d9c2-4148-8100-c922a6eebc50	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	2d89f049-27a1-4647-89e3-acede133041e	\N	ASSIGNED	Status advanced to ASSIGNED	2026-03-31 11:00:00
ff8f90ab-b4e0-4996-a153-1e7be18d469d	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	2d89f049-27a1-4647-89e3-acede133041e	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-03-31 11:00:00
25562dc1-f6e7-4020-8b6b-1d0c728e61c8	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	2d89f049-27a1-4647-89e3-acede133041e	IN_TRANSIT	DELIVERED	Status advanced to DELIVERED	2026-04-01 21:00:00
025458a5-7469-4387-9314-794fcd53d0a0	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	2d89f049-27a1-4647-89e3-acede133041e	DELIVERED	INVOICED	Status advanced to INVOICED	2026-04-01 21:00:00
ebdc38fa-8f51-4661-b793-9db5d87c8b51	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	2d89f049-27a1-4647-89e3-acede133041e	INVOICED	PAID_FULL	Status advanced to PAID_FULL	2026-04-01 21:00:00
15a1d231-f46e-4b90-b0ca-a569bd1e395b	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	e737fdb8-a3af-470e-b1b4-e30f75c6ab18	\N	ASSIGNED	Load initially booked	2026-04-01 06:00:00
171460dd-06dc-4215-aa79-8c968a4a0dc4	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	e737fdb8-a3af-470e-b1b4-e30f75c6ab18	ASSIGNED	CANCELLED	Broker cancelled load REF-101-D	2026-04-01 06:00:00
d3ed2137-bec4-4b29-83b7-36af3f2fd824	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	e1f058dc-9dcc-4df4-9cfd-3a0c7703778b	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-02 08:15:00
1583bf1f-5c0d-4879-b407-66063e5a71a8	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	e1f058dc-9dcc-4df4-9cfd-3a0c7703778b	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-04-02 08:15:00
a9816c9e-bb41-467a-b741-add7730e81fd	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	e1f058dc-9dcc-4df4-9cfd-3a0c7703778b	IN_TRANSIT	DELIVERED	Status advanced to DELIVERED	2026-04-03 18:45:00
4e85f158-8994-4db2-a512-5c68e9000686	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	ea29b412-7194-4678-b1f9-6956e8b4902f	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-03 09:30:00
5363ebf4-f97a-49c7-a4b9-348c5bd2e719	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	ea29b412-7194-4678-b1f9-6956e8b4902f	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-04-03 09:30:00
b3bda724-bcf6-478f-a62d-4a423dbf5d58	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	ea29b412-7194-4678-b1f9-6956e8b4902f	IN_TRANSIT	DELIVERED	Status advanced to DELIVERED	2026-04-04 19:00:00
6b473eb1-b623-444f-b2d0-ebb68c9680cb	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	ea29b412-7194-4678-b1f9-6956e8b4902f	DELIVERED	INVOICED	Status advanced to INVOICED	2026-04-04 19:00:00
777fa48e-ca7c-4e3a-9779-ee35f92f3e40	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d4e125eb-88d2-47e1-a34c-7df6caa7e43c	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-04 10:00:00
54cf33ab-d298-478a-99ff-c693e6755761	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d4e125eb-88d2-47e1-a34c-7df6caa7e43c	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-04-04 10:00:00
fed96e4a-7ece-49ac-86d9-1cd9c6f30b10	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d4e125eb-88d2-47e1-a34c-7df6caa7e43c	IN_TRANSIT	DELIVERED	Status advanced to DELIVERED	2026-04-05 14:00:00
9e07e4dd-fde9-4531-930f-4527de2d1be5	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	7b01534f-247f-4baf-9cf0-1e0ee17c6500	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-05 07:00:00
cec08e7a-a426-4b3c-bc51-ee66ac14b921	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	7b01534f-247f-4baf-9cf0-1e0ee17c6500	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-04-05 07:00:00
afdd02a8-9986-48b3-8431-0ad005f1c36a	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	7b01534f-247f-4baf-9cf0-1e0ee17c6500	IN_TRANSIT	DELIVERED	Status advanced to DELIVERED	2026-04-06 20:00:00
1b2b06d4-f5c2-4bae-a9f4-81c8d15477c1	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	7b01534f-247f-4baf-9cf0-1e0ee17c6500	DELIVERED	INVOICED	Status advanced to INVOICED	2026-04-06 20:00:00
233eb5c3-3741-4d8b-91e1-d27433482de4	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	7b01534f-247f-4baf-9cf0-1e0ee17c6500	INVOICED	PAID_FULL	Status advanced to PAID_FULL	2026-04-06 20:00:00
66ff5e66-d329-4fb3-865c-25e02c1ea2f4	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	776dae43-bad0-4177-a51f-5b47ee708ca2	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-07 08:00:00
9cdb5714-dede-482a-a5fe-e8c000f11095	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	776dae43-bad0-4177-a51f-5b47ee708ca2	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-04-07 08:00:00
8458bdab-a1b5-4e55-9a03-873d83b8d53b	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	776dae43-bad0-4177-a51f-5b47ee708ca2	IN_TRANSIT	DELIVERED	Status advanced to DELIVERED	2026-04-08 18:00:00
ad63c85d-f271-4208-84bf-933d313eb5cc	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	5d93e469-e422-4ae1-8bed-0b936daa409e	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-08 06:30:00
9da0c001-66fe-4aa6-80ad-1f60b048ce97	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	5d93e469-e422-4ae1-8bed-0b936daa409e	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-04-08 06:30:00
6498f4d2-db81-4ecb-b4c6-494f107229cf	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	414e6268-b367-493c-8181-6eba82bf206d	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-09 05:00:00
a05cc703-b274-4bd0-9629-aaca2c321229	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	414e6268-b367-493c-8181-6eba82bf206d	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-04-09 05:00:00
c5488a43-465d-4bd8-8177-99d89ecd29ba	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	565a4001-ca0a-4484-8599-c20242d140cf	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-10 12:00:00
90d3bf4c-92fc-4f3b-9987-7df9b6f96b07	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	8e2d5c40-3083-4ac8-837e-fe171542c1e7	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-10 13:00:00
6b39298f-92c4-486f-9564-22724079cb6b	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	277b33be-3e0d-4c7c-997b-58fa344df6da	\N	ASSIGNED	Status advanced to ASSIGNED	2026-04-11 09:00:00
aceb9cf8-9ee1-4354-8b93-43c01c2f7258	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	277b33be-3e0d-4c7c-997b-58fa344df6da	ASSIGNED	IN_TRANSIT	Status advanced to IN_TRANSIT	2026-04-11 09:00:00
235b5472-ba90-4b1d-8931-2565260f7fec	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	277b33be-3e0d-4c7c-997b-58fa344df6da	IN_TRANSIT	DELIVERED	Status advanced to DELIVERED	2026-04-11 23:00:00
00ceab38-b47c-4d52-a0a8-e1a9062f422b	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	277b33be-3e0d-4c7c-997b-58fa344df6da	DELIVERED	INVOICED	Status advanced to INVOICED	2026-04-11 23:00:00
f934da19-3c92-4cb7-8680-7bfd2b4f6a04	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	277b33be-3e0d-4c7c-997b-58fa344df6da	INVOICED	PAID_FULL	Status advanced to PAID_FULL	2026-04-11 23:00:00
\.


--
-- Data for Name: Note; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Note" (id, "organizationId", "userId", "truckId", "loadId", "noteType", title, content, "weekStartDate", "createdAt", "updatedAt") FROM stdin;
7b619ff2-b4d2-44fa-827c-d2f57e3cc8e4	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	8a6688d8-44cd-4c51-8785-2c671a2617a0	d89d40d0-6403-4fea-9640-d2cfa1a28411	\N	TRUCK	Truck 101 note	Truck profile reviewed and confirmed ready for dispatch operations.	\N	2026-04-16 22:11:58.69	2026-04-16 22:11:58.69
ea60d168-fd48-4e08-a9a7-0b473791913d	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	8a6688d8-44cd-4c51-8785-2c671a2617a0	d89d40d0-6403-4fea-9640-d2cfa1a28411	\N	WEEKLY_OPERATIONAL	Weekly summary note	Strong week overall. Fuel costs should be monitored closely.	2026-04-16 22:11:58.692	2026-04-16 22:11:58.692	2026-04-16 22:11:58.692
0ad68d70-8e67-4ef6-8a76-0e7c34e95e59	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	1577a829-737e-44d7-9f7b-e03d9ed0ca92	\N	277b33be-3e0d-4c7c-997b-58fa344df6da	LOAD	Load handling note	Broker requested extra communication on ETA updates.	\N	2026-04-16 22:11:58.694	2026-04-16 22:11:58.694
\.


--
-- Data for Name: Organization; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Organization" (id, name, slug, "isActive", "createdAt", "updatedAt") FROM stdin;
a167ea4e-4ff6-4d96-b79c-99fdb613bea2	Dispatch Spot Demo	dispatch-spot-demo	t	2026-04-16 22:11:58.387	2026-04-16 22:11:58.387
\.


--
-- Data for Name: OrganizationFeatureFlag; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."OrganizationFeatureFlag" (id, "organizationId", "featureFlagId", "isEnabled", "createdAt", "updatedAt") FROM stdin;
c527250a-0717-4752-992f-0c7ac40d2f33	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	2b444a17-0e72-40c0-95c4-6f43d995ef73	t	2026-04-16 22:11:58.529	2026-04-16 22:11:58.529
1ac1ce92-0b35-45a9-b828-c7e293af56f4	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c73b417e-586e-487e-9b48-2ef9ee73202f	t	2026-04-16 22:11:58.532	2026-04-16 22:11:58.532
\.


--
-- Data for Name: OutboundEmailLog; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."OutboundEmailLog" (id, "userId", "organizationId", email, "templateKey", subject, status, "errorMessage", "providerMessageId", "metadataJson", "sentAt", "createdAt", "updatedAt") FROM stdin;
\.


--
-- Data for Name: OwnerOperator; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."OwnerOperator" (id, "organizationId", "companyId", "driverId", "truckId", "businessName", "firstName", "lastName", phone, email, "mcNumber", "dotNumber", "notesText", "crmStage", "revenueIn", "paymentsOut", "lastContactedAt", "nextFollowUpAt", "isActive", "createdAt", "updatedAt") FROM stdin;
\.


--
-- Data for Name: Shipper; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Shipper" (id, "organizationId", "companyName", "contactName", phone, email, website, "billingAddress", "shippingNotes", "billingNotes", "notesText", "crmStage", "revenueIn", "paymentsOut", "lastContactedAt", "nextFollowUpAt", "isActive", "createdAt", "updatedAt") FROM stdin;
\.


--
-- Data for Name: SystemUpdate; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."SystemUpdate" (id, version, "updateName", "updateType", status, "notesJson", "startedAt", "completedAt", "createdAt", "updatedAt") FROM stdin;
f308bccd-dc29-40b5-a503-98d18cbc594c	0.1.0	initial_bootstrap	CONFIG_UPDATE	COMPLETED	{"description": "Initial Dispatch Spot bootstrap seed scaffold applied."}	2026-04-16 22:11:58.766	2026-04-16 22:11:58.766	2026-04-16 22:11:58.767	2026-04-16 22:11:58.767
\.


--
-- Data for Name: Truck; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."Truck" (id, "organizationId", "truckNumber", "plateNumber", "equipmentType", make, model, year, "trailerType", "trailerLength", vin, status, "equipmentLengthFeet", "equipmentWidthFeet", "equipmentHeightFeet", "maxLoadLengthFeet", "maxLoadWidthFeet", "maxLoadHeightFeet", "maxLoadWeightLbs", "ownerContactName", "ownerContactPhone", "ownerContactEmail", "insuranceCompany", "insurancePhone", "insurancePolicyNumber", "insuranceAgent", "insuranceAgentPhone", "factoringCompany", "factoringAccountNumber", "factoringAgent", "factoringAgentPhone", "projectedCpm", "actualCpm", "notesText", "isActive", "createdAt", "updatedAt") FROM stdin;
d89d40d0-6403-4fea-9640-d2cfa1a28411	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	101	DV101AB	DRY_VAN	Freightliner	Cascadia	2022	Dry Van	53	1FUJGLD50NL000101	ACTIVE	53.00	8.50	13.50	53.00	8.50	8.00	45000.00	Michael Brown	+12680000101	michael.brown@example.com	Atlantic Insurance	+12680000111	AI-101-2026	Jane Agent	+12680000112	FastFactor	FF-101	Tom Factor	+12680000113	1.8500	1.9200	Primary dry van unit	t	2026-04-16 22:11:58.535	2026-04-16 22:11:58.535
35d98abf-bc25-4c9e-8993-79cb870120e6	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	102	RF102AB	REEFER	Volvo	VNL 760	2023	Reefer	53	4V4NC9EH0PN000102	ACTIVE	53.00	8.50	13.50	53.00	8.50	8.00	43000.00	Rachel Green	+12680000102	rachel.green@example.com	Cold Chain Insurance	+12680000121	CCI-102-2026	Paul Frost	+12680000122	FastFactor	FF-102	Tom Factor	+12680000123	2.1500	2.2800	Reefer unit with higher operating cost	t	2026-04-16 22:11:58.54	2026-04-16 22:11:58.54
c2929736-5ee0-416d-b54e-c50821066804	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	103	FB103AB	FLATBED	Peterbilt	579	2021	Flatbed	48	1XPBD49X1MD000103	ACTIVE	48.00	8.50	0.00	48.00	8.50	10.00	48000.00	Carlos James	+12680000103	carlos.james@example.com	Heavy Haul Mutual	+12680000131	HHM-103-2026	Mira Stone	+12680000132	FastFactor	FF-103	Tom Factor	+12680000133	1.9500	2.0100	Flatbed unit suited for dimensional freight	t	2026-04-16 22:11:58.544	2026-04-16 22:11:58.544
\.


--
-- Data for Name: TruckFinancialSetting; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."TruckFinancialSetting" ("truckId", "organizationId", "dispatchFeeType", "dispatchFeeRate", "driverPayType", "driverPayRate", "projectedCpm", "actualCpm", "createdAt", "updatedAt", "projectedRpm", "rpmCriticalThreshold", "rpmWarningThreshold") FROM stdin;
d89d40d0-6403-4fea-9640-d2cfa1a28411	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	PERCENTAGE	10.0000	PERCENTAGE	25.0000	1.8500	1.9200	2026-04-16 22:11:58.57	2026-04-16 22:11:58.57	\N	\N	\N
35d98abf-bc25-4c9e-8993-79cb870120e6	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	FLAT_RATE	300.0000	RATE_PER_MILE	0.6500	2.1500	2.2800	2026-04-16 22:11:58.572	2026-04-16 22:11:58.572	\N	\N	\N
c2929736-5ee0-416d-b54e-c50821066804	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	PERCENTAGE	12.0000	PERCENTAGE	28.0000	1.9500	2.0100	2026-04-16 22:11:58.574	2026-04-16 22:11:58.574	\N	\N	\N
\.


--
-- Data for Name: TruckMetricSnapshot; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."TruckMetricSnapshot" (id, "organizationId", "truckId", "periodType", "periodStart", "periodEnd", "totalLoads", "activeLoads", "deliveredLoads", "paidLoads", "cancelledLoads", "totalRevenue", "outstandingRevenue", "dispatchFeeEarned", "totalMiles", "averageRpm", "projectedCpm", "actualCpm", "totalAccessorials", "totalExpenses", "driverPayTotal", "netRevenue", "createdAt") FROM stdin;
7e5bdc05-0536-4042-ac6c-cf4555550638	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	WEEKLY	2026-04-16 22:11:58.716	2026-04-16 22:11:58.716	3	1	2	0	1	6110.00	3745.00	578.50	2220.00	2.6059	1.8500	0.3099	325.00	688.00	1446.25	3975.75	2026-04-16 22:11:58.72
9881de3d-c752-4d8e-8848-bf339073dcf0	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	WEEKLY	2026-04-16 22:11:58.725	2026-04-16 22:11:58.725	4	2	2	1	0	7655.00	4090.00	1200.00	2200.00	3.3545	2.1500	0.3650	275.00	803.00	1430.00	5422.00	2026-04-16 22:11:58.728
6ec8ac1b-69af-4a83-ba9c-4f1d6a53c5c0	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	WEEKLY	2026-04-16 22:11:58.733	2026-04-16 22:11:58.733	4	2	2	1	0	7025.00	4075.00	816.00	1215.00	5.5967	1.9500	0.7243	225.00	880.00	1904.00	4241.00	2026-04-16 22:11:58.735
\.


--
-- Data for Name: User; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."User" (id, "organizationId", email, "passwordHash", "firstName", "lastName", role, "isActive", "lastLoginAt", "createdAt", "updatedAt", "linkedDriverId", "emailVerifiedAt") FROM stdin;
1577a829-737e-44d7-9f7b-e03d9ed0ca92	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	dispatcher@dispatchspot.local	$2a$10$VRU7I7FIsPrm1BoLRymzUOsWBMtTFd6EpjaAFPGxWeYaFG0IPKqS6	Demo	Dispatcher	DISPATCHER	t	\N	2026-04-16 22:11:58.517	2026-04-16 22:11:58.517	\N	\N
8a6688d8-44cd-4c51-8785-2c671a2617a0	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	support@dispatchspot.com	$2a$10$605d17n.1uLgnjZIbueeyu4Y4e7OAtJhh3wvV5AjDNiKKSHZIHlBq	Demo	Admin	ORG_ADMIN	t	2026-04-18 16:53:02.128	2026-04-16 22:11:58.512	2026-04-18 16:53:02.129	\N	\N
a1954ff4-69f4-4651-b051-f308f023216a	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	jcampbell.faze@gmail.com	$2a$10$pYjn7silnOMTl.g9StDi7.FDgXbXP/nvCMUjwrRuQ.T3tTW8cHlK.	Demo	Owner	ORG_ADMIN	t	2026-04-21 01:09:30.461	2026-04-16 22:11:58.519	2026-04-21 01:09:30.462	\N	\N
\.


--
-- Data for Name: UserNotificationPreference; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."UserNotificationPreference" (id, "userId", "organizationId", "inAppEnabled", "emailDueToday", "emailOverdue", "emailUrgent", "teamDigest", "smsReserved", "createdAt", "updatedAt") FROM stdin;
6887b7cc-54c7-4847-9a02-b560fdfa7c40	a1954ff4-69f4-4651-b051-f308f023216a	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	t	t	t	t	f	f	2026-04-18 06:00:50.486	2026-04-18 06:00:50.486
\.


--
-- Data for Name: VerifiedCustomDomainRequest; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."VerifiedCustomDomainRequest" (id, "organizationId", "requestedByUserId", "reviewedByUserId", domain, "businessJustification", "dnsOwnerContact", "replyHandlingPlan", status, "reviewNotes", "submittedAt", "reviewedAt", "createdAt", "updatedAt") FROM stdin;
\.


--
-- Data for Name: WeeklyTruckSummary; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."WeeklyTruckSummary" (id, "organizationId", "truckId", "weekStartDate", "totalLoads", "activeLoads", "deliveredLoads", "paidLoads", "cancelledLoads", "totalRevenue", "outstandingRevenue", "paidRevenue", "dispatchFeeTotal", "totalMiles", "averageRpm", "totalExpenses", "totalAccessorials", "driverPayTotal", "netRevenue", "calculatedAt") FROM stdin;
2a7d9780-34ee-4553-b157-b84982d20fd1	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	d89d40d0-6403-4fea-9640-d2cfa1a28411	2026-04-16 22:11:58.716	3	1	2	0	1	6110.00	3745.00	2040.00	578.50	2220.00	2.6059	688.00	325.00	1446.25	3975.75	2026-04-16 22:11:58.717
4cb86d8b-410b-4d92-824f-0f64e4a90e89	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	35d98abf-bc25-4c9e-8993-79cb870120e6	2026-04-16 22:11:58.725	4	2	2	1	0	7655.00	4090.00	3290.00	1200.00	2200.00	3.3545	803.00	275.00	1430.00	5422.00	2026-04-16 22:11:58.726
66f4c53e-297f-405c-8000-6933718d4a3d	a167ea4e-4ff6-4d96-b79c-99fdb613bea2	c2929736-5ee0-416d-b54e-c50821066804	2026-04-16 22:11:58.733	4	2	2	1	0	7025.00	4075.00	2725.00	816.00	1215.00	5.5967	880.00	225.00	1904.00	4241.00	2026-04-16 22:11:58.733
\.


--
-- Data for Name: WorkAssignment; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."WorkAssignment" (id, "organizationId", "targetType", "targetId", "assignedByUserId", "primaryAssigneeUserId", instructions, "expectedOutcome", "dueAt", priority, status, "createdAt", "updatedAt") FROM stdin;
\.


--
-- Data for Name: WorkAssignmentAssignee; Type: TABLE DATA; Schema: public; Owner: dispatchspot_1001-1
--

COPY public."WorkAssignmentAssignee" (id, "assignmentId", "userId", "createdAt") FROM stdin;
\.


--
-- Name: AIExtractionResult AIExtractionResult_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIExtractionResult"
    ADD CONSTRAINT "AIExtractionResult_pkey" PRIMARY KEY (id);


--
-- Name: AIInsightSnapshot AIInsightSnapshot_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIInsightSnapshot"
    ADD CONSTRAINT "AIInsightSnapshot_pkey" PRIMARY KEY (id);


--
-- Name: AIJob AIJob_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIJob"
    ADD CONSTRAINT "AIJob_pkey" PRIMARY KEY (id);


--
-- Name: AIPromptTemplate AIPromptTemplate_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIPromptTemplate"
    ADD CONSTRAINT "AIPromptTemplate_pkey" PRIMARY KEY (id);


--
-- Name: Accessorial Accessorial_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Accessorial"
    ADD CONSTRAINT "Accessorial_pkey" PRIMARY KEY (id);


--
-- Name: AuthEmailToken AuthEmailToken_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AuthEmailToken"
    ADD CONSTRAINT "AuthEmailToken_pkey" PRIMARY KEY (id);


--
-- Name: Broker Broker_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Broker"
    ADD CONSTRAINT "Broker_pkey" PRIMARY KEY (id);


--
-- Name: CRMActivity CRMActivity_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."CRMActivity"
    ADD CONSTRAINT "CRMActivity_pkey" PRIMARY KEY (id);


--
-- Name: Company Company_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Company"
    ADD CONSTRAINT "Company_pkey" PRIMARY KEY (id);


--
-- Name: Document Document_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Document"
    ADD CONSTRAINT "Document_pkey" PRIMARY KEY (id);


--
-- Name: DomainEvent DomainEvent_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."DomainEvent"
    ADD CONSTRAINT "DomainEvent_pkey" PRIMARY KEY (id);


--
-- Name: Driver Driver_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Driver"
    ADD CONSTRAINT "Driver_pkey" PRIMARY KEY (id);


--
-- Name: Expense Expense_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Expense"
    ADD CONSTRAINT "Expense_pkey" PRIMARY KEY (id);


--
-- Name: FeatureFlag FeatureFlag_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."FeatureFlag"
    ADD CONSTRAINT "FeatureFlag_pkey" PRIMARY KEY (id);


--
-- Name: LoadPayment LoadPayment_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."LoadPayment"
    ADD CONSTRAINT "LoadPayment_pkey" PRIMARY KEY (id);


--
-- Name: LoadStatusHistory LoadStatusHistory_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."LoadStatusHistory"
    ADD CONSTRAINT "LoadStatusHistory_pkey" PRIMARY KEY (id);


--
-- Name: Load Load_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Load"
    ADD CONSTRAINT "Load_pkey" PRIMARY KEY (id);


--
-- Name: Note Note_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Note"
    ADD CONSTRAINT "Note_pkey" PRIMARY KEY (id);


--
-- Name: OrganizationFeatureFlag OrganizationFeatureFlag_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OrganizationFeatureFlag"
    ADD CONSTRAINT "OrganizationFeatureFlag_pkey" PRIMARY KEY (id);


--
-- Name: Organization Organization_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Organization"
    ADD CONSTRAINT "Organization_pkey" PRIMARY KEY (id);


--
-- Name: OutboundEmailLog OutboundEmailLog_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OutboundEmailLog"
    ADD CONSTRAINT "OutboundEmailLog_pkey" PRIMARY KEY (id);


--
-- Name: OwnerOperator OwnerOperator_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OwnerOperator"
    ADD CONSTRAINT "OwnerOperator_pkey" PRIMARY KEY (id);


--
-- Name: Shipper Shipper_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Shipper"
    ADD CONSTRAINT "Shipper_pkey" PRIMARY KEY (id);


--
-- Name: SystemUpdate SystemUpdate_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."SystemUpdate"
    ADD CONSTRAINT "SystemUpdate_pkey" PRIMARY KEY (id);


--
-- Name: TruckFinancialSetting TruckFinancialSetting_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."TruckFinancialSetting"
    ADD CONSTRAINT "TruckFinancialSetting_pkey" PRIMARY KEY ("truckId");


--
-- Name: TruckMetricSnapshot TruckMetricSnapshot_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."TruckMetricSnapshot"
    ADD CONSTRAINT "TruckMetricSnapshot_pkey" PRIMARY KEY (id);


--
-- Name: Truck Truck_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Truck"
    ADD CONSTRAINT "Truck_pkey" PRIMARY KEY (id);


--
-- Name: UserNotificationPreference UserNotificationPreference_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."UserNotificationPreference"
    ADD CONSTRAINT "UserNotificationPreference_pkey" PRIMARY KEY (id);


--
-- Name: User User_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."User"
    ADD CONSTRAINT "User_pkey" PRIMARY KEY (id);


--
-- Name: VerifiedCustomDomainRequest VerifiedCustomDomainRequest_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."VerifiedCustomDomainRequest"
    ADD CONSTRAINT "VerifiedCustomDomainRequest_pkey" PRIMARY KEY (id);


--
-- Name: WeeklyTruckSummary WeeklyTruckSummary_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WeeklyTruckSummary"
    ADD CONSTRAINT "WeeklyTruckSummary_pkey" PRIMARY KEY (id);


--
-- Name: WorkAssignmentAssignee WorkAssignmentAssignee_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WorkAssignmentAssignee"
    ADD CONSTRAINT "WorkAssignmentAssignee_pkey" PRIMARY KEY (id);


--
-- Name: WorkAssignment WorkAssignment_pkey; Type: CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WorkAssignment"
    ADD CONSTRAINT "WorkAssignment_pkey" PRIMARY KEY (id);


--
-- Name: AIExtractionResult_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIExtractionResult_organizationId_idx" ON public."AIExtractionResult" USING btree ("organizationId");


--
-- Name: AIExtractionResult_reviewStatus_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIExtractionResult_reviewStatus_idx" ON public."AIExtractionResult" USING btree ("reviewStatus");


--
-- Name: AIExtractionResult_sourceDocumentId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIExtractionResult_sourceDocumentId_idx" ON public."AIExtractionResult" USING btree ("sourceDocumentId");


--
-- Name: AIExtractionResult_validationStatus_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIExtractionResult_validationStatus_idx" ON public."AIExtractionResult" USING btree ("validationStatus");


--
-- Name: AIInsightSnapshot_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIInsightSnapshot_organizationId_idx" ON public."AIInsightSnapshot" USING btree ("organizationId");


--
-- Name: AIInsightSnapshot_periodType_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIInsightSnapshot_periodType_idx" ON public."AIInsightSnapshot" USING btree ("periodType");


--
-- Name: AIInsightSnapshot_scopeType_scopeId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIInsightSnapshot_scopeType_scopeId_idx" ON public."AIInsightSnapshot" USING btree ("scopeType", "scopeId");


--
-- Name: AIJob_jobType_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIJob_jobType_idx" ON public."AIJob" USING btree ("jobType");


--
-- Name: AIJob_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIJob_organizationId_idx" ON public."AIJob" USING btree ("organizationId");


--
-- Name: AIJob_priority_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIJob_priority_idx" ON public."AIJob" USING btree (priority);


--
-- Name: AIJob_status_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIJob_status_idx" ON public."AIJob" USING btree (status);


--
-- Name: AIPromptTemplate_featureName_promptName_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIPromptTemplate_featureName_promptName_idx" ON public."AIPromptTemplate" USING btree ("featureName", "promptName");


--
-- Name: AIPromptTemplate_featureName_promptName_version_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "AIPromptTemplate_featureName_promptName_version_key" ON public."AIPromptTemplate" USING btree ("featureName", "promptName", version);


--
-- Name: AIPromptTemplate_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AIPromptTemplate_organizationId_idx" ON public."AIPromptTemplate" USING btree ("organizationId");


--
-- Name: Accessorial_loadId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Accessorial_loadId_idx" ON public."Accessorial" USING btree ("loadId");


--
-- Name: Accessorial_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Accessorial_organizationId_idx" ON public."Accessorial" USING btree ("organizationId");


--
-- Name: AuthEmailToken_email_type_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AuthEmailToken_email_type_idx" ON public."AuthEmailToken" USING btree (email, type);


--
-- Name: AuthEmailToken_expiresAt_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AuthEmailToken_expiresAt_idx" ON public."AuthEmailToken" USING btree ("expiresAt");


--
-- Name: AuthEmailToken_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AuthEmailToken_organizationId_idx" ON public."AuthEmailToken" USING btree ("organizationId");


--
-- Name: AuthEmailToken_userId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "AuthEmailToken_userId_idx" ON public."AuthEmailToken" USING btree ("userId");


--
-- Name: Broker_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Broker_organizationId_idx" ON public."Broker" USING btree ("organizationId");


--
-- Name: Broker_organizationId_name_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "Broker_organizationId_name_key" ON public."Broker" USING btree ("organizationId", name);


--
-- Name: CRMActivity_activityType_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "CRMActivity_activityType_idx" ON public."CRMActivity" USING btree ("activityType");


--
-- Name: CRMActivity_deletedAt_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "CRMActivity_deletedAt_idx" ON public."CRMActivity" USING btree ("deletedAt");


--
-- Name: CRMActivity_dueAt_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "CRMActivity_dueAt_idx" ON public."CRMActivity" USING btree ("dueAt");


--
-- Name: CRMActivity_entityType_entityId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "CRMActivity_entityType_entityId_idx" ON public."CRMActivity" USING btree ("entityType", "entityId");


--
-- Name: CRMActivity_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "CRMActivity_organizationId_idx" ON public."CRMActivity" USING btree ("organizationId");


--
-- Name: Company_crmStage_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Company_crmStage_idx" ON public."Company" USING btree ("crmStage");


--
-- Name: Company_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Company_organizationId_idx" ON public."Company" USING btree ("organizationId");


--
-- Name: Company_organizationId_name_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "Company_organizationId_name_key" ON public."Company" USING btree ("organizationId", name);


--
-- Name: Document_category_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Document_category_idx" ON public."Document" USING btree (category);


--
-- Name: Document_driverId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Document_driverId_idx" ON public."Document" USING btree ("driverId");


--
-- Name: Document_loadId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Document_loadId_idx" ON public."Document" USING btree ("loadId");


--
-- Name: Document_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Document_organizationId_idx" ON public."Document" USING btree ("organizationId");


--
-- Name: Document_truckId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Document_truckId_idx" ON public."Document" USING btree ("truckId");


--
-- Name: Document_visibilityScope_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Document_visibilityScope_idx" ON public."Document" USING btree ("visibilityScope");


--
-- Name: DomainEvent_entityType_entityId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "DomainEvent_entityType_entityId_idx" ON public."DomainEvent" USING btree ("entityType", "entityId");


--
-- Name: DomainEvent_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "DomainEvent_organizationId_idx" ON public."DomainEvent" USING btree ("organizationId");


--
-- Name: DomainEvent_status_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "DomainEvent_status_idx" ON public."DomainEvent" USING btree (status);


--
-- Name: Driver_email_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "Driver_email_key" ON public."Driver" USING btree (email);


--
-- Name: Driver_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Driver_organizationId_idx" ON public."Driver" USING btree ("organizationId");


--
-- Name: Driver_truckId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Driver_truckId_idx" ON public."Driver" USING btree ("truckId");


--
-- Name: Expense_expenseDate_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Expense_expenseDate_idx" ON public."Expense" USING btree ("expenseDate");


--
-- Name: Expense_loadId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Expense_loadId_idx" ON public."Expense" USING btree ("loadId");


--
-- Name: Expense_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Expense_organizationId_idx" ON public."Expense" USING btree ("organizationId");


--
-- Name: Expense_truckId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Expense_truckId_idx" ON public."Expense" USING btree ("truckId");


--
-- Name: FeatureFlag_key_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "FeatureFlag_key_key" ON public."FeatureFlag" USING btree (key);


--
-- Name: LoadPayment_loadId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "LoadPayment_loadId_idx" ON public."LoadPayment" USING btree ("loadId");


--
-- Name: LoadPayment_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "LoadPayment_organizationId_idx" ON public."LoadPayment" USING btree ("organizationId");


--
-- Name: LoadPayment_paymentStatus_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "LoadPayment_paymentStatus_idx" ON public."LoadPayment" USING btree ("paymentStatus");


--
-- Name: LoadStatusHistory_changedAt_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "LoadStatusHistory_changedAt_idx" ON public."LoadStatusHistory" USING btree ("changedAt");


--
-- Name: LoadStatusHistory_loadId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "LoadStatusHistory_loadId_idx" ON public."LoadStatusHistory" USING btree ("loadId");


--
-- Name: LoadStatusHistory_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "LoadStatusHistory_organizationId_idx" ON public."LoadStatusHistory" USING btree ("organizationId");


--
-- Name: Load_brokerId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Load_brokerId_idx" ON public."Load" USING btree ("brokerId");


--
-- Name: Load_driverId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Load_driverId_idx" ON public."Load" USING btree ("driverId");


--
-- Name: Load_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Load_organizationId_idx" ON public."Load" USING btree ("organizationId");


--
-- Name: Load_status_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Load_status_idx" ON public."Load" USING btree (status);


--
-- Name: Load_truckId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Load_truckId_idx" ON public."Load" USING btree ("truckId");


--
-- Name: Load_weekStartDate_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Load_weekStartDate_idx" ON public."Load" USING btree ("weekStartDate");


--
-- Name: Note_loadId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Note_loadId_idx" ON public."Note" USING btree ("loadId");


--
-- Name: Note_noteType_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Note_noteType_idx" ON public."Note" USING btree ("noteType");


--
-- Name: Note_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Note_organizationId_idx" ON public."Note" USING btree ("organizationId");


--
-- Name: Note_truckId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Note_truckId_idx" ON public."Note" USING btree ("truckId");


--
-- Name: OrganizationFeatureFlag_organizationId_featureFlagId_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "OrganizationFeatureFlag_organizationId_featureFlagId_key" ON public."OrganizationFeatureFlag" USING btree ("organizationId", "featureFlagId");


--
-- Name: OrganizationFeatureFlag_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OrganizationFeatureFlag_organizationId_idx" ON public."OrganizationFeatureFlag" USING btree ("organizationId");


--
-- Name: Organization_slug_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "Organization_slug_key" ON public."Organization" USING btree (slug);


--
-- Name: OutboundEmailLog_createdAt_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OutboundEmailLog_createdAt_idx" ON public."OutboundEmailLog" USING btree ("createdAt");


--
-- Name: OutboundEmailLog_email_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OutboundEmailLog_email_idx" ON public."OutboundEmailLog" USING btree (email);


--
-- Name: OutboundEmailLog_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OutboundEmailLog_organizationId_idx" ON public."OutboundEmailLog" USING btree ("organizationId");


--
-- Name: OutboundEmailLog_status_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OutboundEmailLog_status_idx" ON public."OutboundEmailLog" USING btree (status);


--
-- Name: OutboundEmailLog_userId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OutboundEmailLog_userId_idx" ON public."OutboundEmailLog" USING btree ("userId");


--
-- Name: OwnerOperator_companyId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OwnerOperator_companyId_idx" ON public."OwnerOperator" USING btree ("companyId");


--
-- Name: OwnerOperator_crmStage_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OwnerOperator_crmStage_idx" ON public."OwnerOperator" USING btree ("crmStage");


--
-- Name: OwnerOperator_driverId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OwnerOperator_driverId_idx" ON public."OwnerOperator" USING btree ("driverId");


--
-- Name: OwnerOperator_organizationId_businessName_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "OwnerOperator_organizationId_businessName_key" ON public."OwnerOperator" USING btree ("organizationId", "businessName");


--
-- Name: OwnerOperator_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OwnerOperator_organizationId_idx" ON public."OwnerOperator" USING btree ("organizationId");


--
-- Name: OwnerOperator_truckId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "OwnerOperator_truckId_idx" ON public."OwnerOperator" USING btree ("truckId");


--
-- Name: Shipper_crmStage_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Shipper_crmStage_idx" ON public."Shipper" USING btree ("crmStage");


--
-- Name: Shipper_organizationId_companyName_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "Shipper_organizationId_companyName_key" ON public."Shipper" USING btree ("organizationId", "companyName");


--
-- Name: Shipper_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Shipper_organizationId_idx" ON public."Shipper" USING btree ("organizationId");


--
-- Name: SystemUpdate_version_updateName_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "SystemUpdate_version_updateName_key" ON public."SystemUpdate" USING btree (version, "updateName");


--
-- Name: TruckFinancialSetting_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "TruckFinancialSetting_organizationId_idx" ON public."TruckFinancialSetting" USING btree ("organizationId");


--
-- Name: TruckMetricSnapshot_createdAt_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "TruckMetricSnapshot_createdAt_idx" ON public."TruckMetricSnapshot" USING btree ("createdAt");


--
-- Name: TruckMetricSnapshot_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "TruckMetricSnapshot_organizationId_idx" ON public."TruckMetricSnapshot" USING btree ("organizationId");


--
-- Name: TruckMetricSnapshot_periodType_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "TruckMetricSnapshot_periodType_idx" ON public."TruckMetricSnapshot" USING btree ("periodType");


--
-- Name: TruckMetricSnapshot_truckId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "TruckMetricSnapshot_truckId_idx" ON public."TruckMetricSnapshot" USING btree ("truckId");


--
-- Name: Truck_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Truck_organizationId_idx" ON public."Truck" USING btree ("organizationId");


--
-- Name: Truck_organizationId_truckNumber_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "Truck_organizationId_truckNumber_key" ON public."Truck" USING btree ("organizationId", "truckNumber");


--
-- Name: Truck_status_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "Truck_status_idx" ON public."Truck" USING btree (status);


--
-- Name: UserNotificationPreference_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "UserNotificationPreference_organizationId_idx" ON public."UserNotificationPreference" USING btree ("organizationId");


--
-- Name: UserNotificationPreference_userId_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "UserNotificationPreference_userId_key" ON public."UserNotificationPreference" USING btree ("userId");


--
-- Name: User_email_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "User_email_key" ON public."User" USING btree (email);


--
-- Name: User_linkedDriverId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "User_linkedDriverId_idx" ON public."User" USING btree ("linkedDriverId");


--
-- Name: User_linkedDriverId_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "User_linkedDriverId_key" ON public."User" USING btree ("linkedDriverId");


--
-- Name: User_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "User_organizationId_idx" ON public."User" USING btree ("organizationId");


--
-- Name: VerifiedCustomDomainRequest_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "VerifiedCustomDomainRequest_organizationId_idx" ON public."VerifiedCustomDomainRequest" USING btree ("organizationId");


--
-- Name: VerifiedCustomDomainRequest_requestedByUserId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "VerifiedCustomDomainRequest_requestedByUserId_idx" ON public."VerifiedCustomDomainRequest" USING btree ("requestedByUserId");


--
-- Name: VerifiedCustomDomainRequest_reviewedByUserId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "VerifiedCustomDomainRequest_reviewedByUserId_idx" ON public."VerifiedCustomDomainRequest" USING btree ("reviewedByUserId");


--
-- Name: VerifiedCustomDomainRequest_status_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "VerifiedCustomDomainRequest_status_idx" ON public."VerifiedCustomDomainRequest" USING btree (status);


--
-- Name: VerifiedCustomDomainRequest_submittedAt_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "VerifiedCustomDomainRequest_submittedAt_idx" ON public."VerifiedCustomDomainRequest" USING btree ("submittedAt");


--
-- Name: WeeklyTruckSummary_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "WeeklyTruckSummary_organizationId_idx" ON public."WeeklyTruckSummary" USING btree ("organizationId");


--
-- Name: WeeklyTruckSummary_truckId_weekStartDate_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "WeeklyTruckSummary_truckId_weekStartDate_key" ON public."WeeklyTruckSummary" USING btree ("truckId", "weekStartDate");


--
-- Name: WorkAssignmentAssignee_assignmentId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "WorkAssignmentAssignee_assignmentId_idx" ON public."WorkAssignmentAssignee" USING btree ("assignmentId");


--
-- Name: WorkAssignmentAssignee_assignmentId_userId_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "WorkAssignmentAssignee_assignmentId_userId_key" ON public."WorkAssignmentAssignee" USING btree ("assignmentId", "userId");


--
-- Name: WorkAssignmentAssignee_userId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "WorkAssignmentAssignee_userId_idx" ON public."WorkAssignmentAssignee" USING btree ("userId");


--
-- Name: WorkAssignment_organizationId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "WorkAssignment_organizationId_idx" ON public."WorkAssignment" USING btree ("organizationId");


--
-- Name: WorkAssignment_organizationId_targetType_targetId_key; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE UNIQUE INDEX "WorkAssignment_organizationId_targetType_targetId_key" ON public."WorkAssignment" USING btree ("organizationId", "targetType", "targetId");


--
-- Name: WorkAssignment_primaryAssigneeUserId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "WorkAssignment_primaryAssigneeUserId_idx" ON public."WorkAssignment" USING btree ("primaryAssigneeUserId");


--
-- Name: WorkAssignment_status_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "WorkAssignment_status_idx" ON public."WorkAssignment" USING btree (status);


--
-- Name: WorkAssignment_targetType_targetId_idx; Type: INDEX; Schema: public; Owner: dispatchspot_1001-1
--

CREATE INDEX "WorkAssignment_targetType_targetId_idx" ON public."WorkAssignment" USING btree ("targetType", "targetId");


--
-- Name: AIExtractionResult AIExtractionResult_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIExtractionResult"
    ADD CONSTRAINT "AIExtractionResult_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: AIExtractionResult AIExtractionResult_reviewedByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIExtractionResult"
    ADD CONSTRAINT "AIExtractionResult_reviewedByUserId_fkey" FOREIGN KEY ("reviewedByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: AIExtractionResult AIExtractionResult_sourceDocumentId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIExtractionResult"
    ADD CONSTRAINT "AIExtractionResult_sourceDocumentId_fkey" FOREIGN KEY ("sourceDocumentId") REFERENCES public."Document"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: AIInsightSnapshot AIInsightSnapshot_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIInsightSnapshot"
    ADD CONSTRAINT "AIInsightSnapshot_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: AIJob AIJob_createdByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIJob"
    ADD CONSTRAINT "AIJob_createdByUserId_fkey" FOREIGN KEY ("createdByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: AIJob AIJob_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AIJob"
    ADD CONSTRAINT "AIJob_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Accessorial Accessorial_loadId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Accessorial"
    ADD CONSTRAINT "Accessorial_loadId_fkey" FOREIGN KEY ("loadId") REFERENCES public."Load"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Accessorial Accessorial_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Accessorial"
    ADD CONSTRAINT "Accessorial_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: AuthEmailToken AuthEmailToken_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AuthEmailToken"
    ADD CONSTRAINT "AuthEmailToken_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: AuthEmailToken AuthEmailToken_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."AuthEmailToken"
    ADD CONSTRAINT "AuthEmailToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: Broker Broker_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Broker"
    ADD CONSTRAINT "Broker_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: CRMActivity CRMActivity_createdByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."CRMActivity"
    ADD CONSTRAINT "CRMActivity_createdByUserId_fkey" FOREIGN KEY ("createdByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: CRMActivity CRMActivity_deletedByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."CRMActivity"
    ADD CONSTRAINT "CRMActivity_deletedByUserId_fkey" FOREIGN KEY ("deletedByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: CRMActivity CRMActivity_editedByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."CRMActivity"
    ADD CONSTRAINT "CRMActivity_editedByUserId_fkey" FOREIGN KEY ("editedByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: CRMActivity CRMActivity_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."CRMActivity"
    ADD CONSTRAINT "CRMActivity_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Company Company_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Company"
    ADD CONSTRAINT "Company_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Document Document_driverId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Document"
    ADD CONSTRAINT "Document_driverId_fkey" FOREIGN KEY ("driverId") REFERENCES public."Driver"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Document Document_loadId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Document"
    ADD CONSTRAINT "Document_loadId_fkey" FOREIGN KEY ("loadId") REFERENCES public."Load"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Document Document_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Document"
    ADD CONSTRAINT "Document_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Document Document_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Document"
    ADD CONSTRAINT "Document_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Document Document_uploadedByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Document"
    ADD CONSTRAINT "Document_uploadedByUserId_fkey" FOREIGN KEY ("uploadedByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: DomainEvent DomainEvent_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."DomainEvent"
    ADD CONSTRAINT "DomainEvent_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Driver Driver_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Driver"
    ADD CONSTRAINT "Driver_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Driver Driver_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Driver"
    ADD CONSTRAINT "Driver_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Expense Expense_loadId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Expense"
    ADD CONSTRAINT "Expense_loadId_fkey" FOREIGN KEY ("loadId") REFERENCES public."Load"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Expense Expense_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Expense"
    ADD CONSTRAINT "Expense_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Expense Expense_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Expense"
    ADD CONSTRAINT "Expense_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: LoadPayment LoadPayment_loadId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."LoadPayment"
    ADD CONSTRAINT "LoadPayment_loadId_fkey" FOREIGN KEY ("loadId") REFERENCES public."Load"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: LoadPayment LoadPayment_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."LoadPayment"
    ADD CONSTRAINT "LoadPayment_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: LoadStatusHistory LoadStatusHistory_loadId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."LoadStatusHistory"
    ADD CONSTRAINT "LoadStatusHistory_loadId_fkey" FOREIGN KEY ("loadId") REFERENCES public."Load"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: LoadStatusHistory LoadStatusHistory_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."LoadStatusHistory"
    ADD CONSTRAINT "LoadStatusHistory_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Load Load_brokerId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Load"
    ADD CONSTRAINT "Load_brokerId_fkey" FOREIGN KEY ("brokerId") REFERENCES public."Broker"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Load Load_driverId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Load"
    ADD CONSTRAINT "Load_driverId_fkey" FOREIGN KEY ("driverId") REFERENCES public."Driver"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Load Load_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Load"
    ADD CONSTRAINT "Load_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Load Load_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Load"
    ADD CONSTRAINT "Load_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Note Note_loadId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Note"
    ADD CONSTRAINT "Note_loadId_fkey" FOREIGN KEY ("loadId") REFERENCES public."Load"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Note Note_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Note"
    ADD CONSTRAINT "Note_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Note Note_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Note"
    ADD CONSTRAINT "Note_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Note Note_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Note"
    ADD CONSTRAINT "Note_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: OrganizationFeatureFlag OrganizationFeatureFlag_featureFlagId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OrganizationFeatureFlag"
    ADD CONSTRAINT "OrganizationFeatureFlag_featureFlagId_fkey" FOREIGN KEY ("featureFlagId") REFERENCES public."FeatureFlag"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: OrganizationFeatureFlag OrganizationFeatureFlag_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OrganizationFeatureFlag"
    ADD CONSTRAINT "OrganizationFeatureFlag_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: OutboundEmailLog OutboundEmailLog_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OutboundEmailLog"
    ADD CONSTRAINT "OutboundEmailLog_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: OutboundEmailLog OutboundEmailLog_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OutboundEmailLog"
    ADD CONSTRAINT "OutboundEmailLog_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: OwnerOperator OwnerOperator_companyId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OwnerOperator"
    ADD CONSTRAINT "OwnerOperator_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES public."Company"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: OwnerOperator OwnerOperator_driverId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OwnerOperator"
    ADD CONSTRAINT "OwnerOperator_driverId_fkey" FOREIGN KEY ("driverId") REFERENCES public."Driver"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: OwnerOperator OwnerOperator_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OwnerOperator"
    ADD CONSTRAINT "OwnerOperator_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: OwnerOperator OwnerOperator_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."OwnerOperator"
    ADD CONSTRAINT "OwnerOperator_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: Shipper Shipper_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Shipper"
    ADD CONSTRAINT "Shipper_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: TruckFinancialSetting TruckFinancialSetting_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."TruckFinancialSetting"
    ADD CONSTRAINT "TruckFinancialSetting_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: TruckFinancialSetting TruckFinancialSetting_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."TruckFinancialSetting"
    ADD CONSTRAINT "TruckFinancialSetting_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: TruckMetricSnapshot TruckMetricSnapshot_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."TruckMetricSnapshot"
    ADD CONSTRAINT "TruckMetricSnapshot_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: TruckMetricSnapshot TruckMetricSnapshot_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."TruckMetricSnapshot"
    ADD CONSTRAINT "TruckMetricSnapshot_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: Truck Truck_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."Truck"
    ADD CONSTRAINT "Truck_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: UserNotificationPreference UserNotificationPreference_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."UserNotificationPreference"
    ADD CONSTRAINT "UserNotificationPreference_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: UserNotificationPreference UserNotificationPreference_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."UserNotificationPreference"
    ADD CONSTRAINT "UserNotificationPreference_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: User User_linkedDriverId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."User"
    ADD CONSTRAINT "User_linkedDriverId_fkey" FOREIGN KEY ("linkedDriverId") REFERENCES public."Driver"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: User User_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."User"
    ADD CONSTRAINT "User_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: VerifiedCustomDomainRequest VerifiedCustomDomainRequest_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."VerifiedCustomDomainRequest"
    ADD CONSTRAINT "VerifiedCustomDomainRequest_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: VerifiedCustomDomainRequest VerifiedCustomDomainRequest_requestedByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."VerifiedCustomDomainRequest"
    ADD CONSTRAINT "VerifiedCustomDomainRequest_requestedByUserId_fkey" FOREIGN KEY ("requestedByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: VerifiedCustomDomainRequest VerifiedCustomDomainRequest_reviewedByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."VerifiedCustomDomainRequest"
    ADD CONSTRAINT "VerifiedCustomDomainRequest_reviewedByUserId_fkey" FOREIGN KEY ("reviewedByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: WeeklyTruckSummary WeeklyTruckSummary_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WeeklyTruckSummary"
    ADD CONSTRAINT "WeeklyTruckSummary_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: WeeklyTruckSummary WeeklyTruckSummary_truckId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WeeklyTruckSummary"
    ADD CONSTRAINT "WeeklyTruckSummary_truckId_fkey" FOREIGN KEY ("truckId") REFERENCES public."Truck"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: WorkAssignmentAssignee WorkAssignmentAssignee_assignmentId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WorkAssignmentAssignee"
    ADD CONSTRAINT "WorkAssignmentAssignee_assignmentId_fkey" FOREIGN KEY ("assignmentId") REFERENCES public."WorkAssignment"(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: WorkAssignmentAssignee WorkAssignmentAssignee_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WorkAssignmentAssignee"
    ADD CONSTRAINT "WorkAssignmentAssignee_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: WorkAssignment WorkAssignment_assignedByUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WorkAssignment"
    ADD CONSTRAINT "WorkAssignment_assignedByUserId_fkey" FOREIGN KEY ("assignedByUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: WorkAssignment WorkAssignment_organizationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WorkAssignment"
    ADD CONSTRAINT "WorkAssignment_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES public."Organization"(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: WorkAssignment WorkAssignment_primaryAssigneeUserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dispatchspot_1001-1
--

ALTER TABLE ONLY public."WorkAssignment"
    ADD CONSTRAINT "WorkAssignment_primaryAssigneeUserId_fkey" FOREIGN KEY ("primaryAssigneeUserId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: TABLE "AIExtractionResult"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."AIExtractionResult" TO dispatchspot_1001;


--
-- Name: TABLE "AIInsightSnapshot"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."AIInsightSnapshot" TO dispatchspot_1001;


--
-- Name: TABLE "AIJob"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."AIJob" TO dispatchspot_1001;


--
-- Name: TABLE "AIPromptTemplate"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."AIPromptTemplate" TO dispatchspot_1001;


--
-- Name: TABLE "Accessorial"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Accessorial" TO dispatchspot_1001;


--
-- Name: TABLE "Broker"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Broker" TO dispatchspot_1001;


--
-- Name: TABLE "Document"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Document" TO dispatchspot_1001;


--
-- Name: TABLE "DomainEvent"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."DomainEvent" TO dispatchspot_1001;


--
-- Name: TABLE "Driver"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Driver" TO dispatchspot_1001;


--
-- Name: TABLE "Expense"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Expense" TO dispatchspot_1001;


--
-- Name: TABLE "FeatureFlag"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."FeatureFlag" TO dispatchspot_1001;


--
-- Name: TABLE "Load"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Load" TO dispatchspot_1001;


--
-- Name: TABLE "LoadPayment"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."LoadPayment" TO dispatchspot_1001;


--
-- Name: TABLE "LoadStatusHistory"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."LoadStatusHistory" TO dispatchspot_1001;


--
-- Name: TABLE "Note"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Note" TO dispatchspot_1001;


--
-- Name: TABLE "Organization"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Organization" TO dispatchspot_1001;


--
-- Name: TABLE "OrganizationFeatureFlag"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."OrganizationFeatureFlag" TO dispatchspot_1001;


--
-- Name: TABLE "SystemUpdate"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."SystemUpdate" TO dispatchspot_1001;


--
-- Name: TABLE "Truck"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."Truck" TO dispatchspot_1001;


--
-- Name: TABLE "TruckFinancialSetting"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."TruckFinancialSetting" TO dispatchspot_1001;


--
-- Name: TABLE "TruckMetricSnapshot"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."TruckMetricSnapshot" TO dispatchspot_1001;


--
-- Name: TABLE "User"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."User" TO dispatchspot_1001;


--
-- Name: TABLE "WeeklyTruckSummary"; Type: ACL; Schema: public; Owner: dispatchspot_1001-1
--

GRANT ALL ON TABLE public."WeeklyTruckSummary" TO dispatchspot_1001;


--
-- PostgreSQL database dump complete
--

\unrestrict nUei8fvRoXoM4kdLGfaiNiVz3kYGOQwTlcEaOmNcjYWSdfchWvAx6kGxpMkfocc

