-- CreateEnum
CREATE TYPE "STATUS" AS ENUM ('INITIATED', 'CONFIRMED', 'ONGOING', 'DELIVERED', 'CANCELLED');

-- CreateEnum
CREATE TYPE "PAYMENT_TYPE" AS ENUM ('COD');

-- CreateTable
CREATE TABLE "Order" (
    "id" TEXT NOT NULL,
    "shopAccountId" TEXT NOT NULL,
    "productPrice" INTEGER NOT NULL,
    "productQuantity" INTEGER NOT NULL,
    "productName" TEXT NOT NULL,
    "status" "STATUS" NOT NULL,
    "customerName" TEXT NOT NULL,
    "customerPhone" TEXT NOT NULL,
    "customerAddress" TEXT NOT NULL,
    "customerNote" TEXT NOT NULL,
    "paymentType" "PAYMENT_TYPE" NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

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

-- AddForeignKey
ALTER TABLE "Order" ADD CONSTRAINT "Order_shopAccountId_fkey" FOREIGN KEY ("shopAccountId") REFERENCES "Profile"("id") ON DELETE CASCADE ON UPDATE CASCADE;
