-- CreateEnum
CREATE TYPE "PaymentMethod" AS ENUM ('RAZOR_PAY', 'PHONE_PE');

-- CreateEnum
CREATE TYPE "Plan" AS ENUM ('STARTER_PLAN', 'PRO_PLAN');

-- CreateTable
CREATE TABLE "otp_verifications" (
    "id" SERIAL NOT NULL,
    "email" TEXT NOT NULL,
    "otp" TEXT NOT NULL,
    "isVerified" BOOLEAN NOT NULL DEFAULT false,
    "expiresAt" TIMESTAMP(3) NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "otp_verifications_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Subscription" (
    "id" SERIAL NOT NULL,
    "totalAmount" TEXT NOT NULL,
    "selectedPlan" TEXT NOT NULL,
    "number_of_agents" INTEGER NOT NULL,
    "addition_whatsapp_api" INTEGER NOT NULL,
    "additional_agent_seats_standard" INTEGER NOT NULL,
    "key_account_manager" INTEGER NOT NULL,
    "wa_blueTick_verification_addon" BOOLEAN NOT NULL,
    "tally_integration_addon" BOOLEAN NOT NULL,
    "leadSquare_integration_addon" BOOLEAN NOT NULL,
    "zoho_crm_integration_addon" BOOLEAN NOT NULL,
    "bitrix_integration_addon" BOOLEAN NOT NULL,
    "india_mart_integration_addon" BOOLEAN NOT NULL,
    "first_name" TEXT NOT NULL,
    "last_name" TEXT NOT NULL,
    "email" TEXT NOT NULL,
    "mobile_number" TEXT NOT NULL,
    "business_name" TEXT NOT NULL,
    "business_gst_number" TEXT NOT NULL DEFAULT '',
    "address" TEXT NOT NULL,
    "country" TEXT NOT NULL,
    "state" TEXT NOT NULL,
    "city" TEXT NOT NULL,
    "area_pincode" TEXT NOT NULL,
    "payment_method" TEXT NOT NULL,
    "payment_status" TEXT NOT NULL DEFAULT 'PENDING',
    "phonepeMUID" TEXT NOT NULL DEFAULT '',
    "orderDetails" JSONB NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "Subscription_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "otp_verifications_email_key" ON "otp_verifications"("email");

-- CreateIndex
CREATE UNIQUE INDEX "Subscription_phonepeMUID_key" ON "Subscription"("phonepeMUID");
