-- CreateTable
CREATE TABLE "configuraciones_tributarias" (
    "id" TEXT NOT NULL PRIMARY KEY,
    "ambiente" TEXT NOT NULL,
    "tipoEmision" TEXT NOT NULL,
    "razonSocial" TEXT NOT NULL,
    "nombreComercial" TEXT NOT NULL,
    "ruc" TEXT NOT NULL,
    "dirMatriz" TEXT NOT NULL,
    "estab" TEXT NOT NULL,
    "ptoEmi" TEXT NOT NULL,
    "secuencial" TEXT NOT NULL,
    "obligadoContabilidad" TEXT NOT NULL DEFAULT 'NO',
    "activo" BOOLEAN NOT NULL DEFAULT true,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" DATETIME NOT NULL
);

-- CreateTable
CREATE TABLE "clientes" (
    "id" TEXT NOT NULL PRIMARY KEY,
    "tipoIdentificacion" TEXT NOT NULL,
    "identificacion" TEXT NOT NULL,
    "razonSocial" TEXT NOT NULL,
    "direccion" TEXT NOT NULL,
    "email" TEXT,
    "telefono" TEXT,
    "activo" BOOLEAN NOT NULL DEFAULT true,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" DATETIME NOT NULL
);

-- CreateIndex
CREATE UNIQUE INDEX "configuraciones_tributarias_ruc_key" ON "configuraciones_tributarias"("ruc");

-- CreateIndex
CREATE UNIQUE INDEX "clientes_tipoIdentificacion_identificacion_key" ON "clientes"("tipoIdentificacion", "identificacion");
