-- CreateEnum
CREATE TYPE "OutageStatus" AS ENUM ('PENDING_CONFIRMATION', 'CONFIRMED', 'REJECTED', 'APPLIED', 'FAILED');

-- CreateTable
CREATE TABLE "ServiceOutage" (
    "id" TEXT NOT NULL,
    "detectedAt" TIMESTAMP(3) NOT NULL,
    "confirmationDeadline" TIMESTAMP(3) NOT NULL,
    "confirmedAt" TIMESTAMP(3),
    "confirmationSource" TEXT,
    "reconnectedAt" TIMESTAMP(3),
    "status" "OutageStatus" NOT NULL DEFAULT 'PENDING_CONFIRMATION',
    "appliedAt" TIMESTAMP(3),
    "notifiedAdminTelegramId" TEXT,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

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

-- CreateIndex
CREATE INDEX "ServiceOutage_status_idx" ON "ServiceOutage"("status");
