se supone que volvio
Some checks failed
build-and-deploy / filter (push) Successful in 2s
Sync to GitHub / sync (push) Failing after 1s
build-and-deploy / build (push) Successful in 54s
build-and-deploy / deploy (push) Successful in 15s

This commit is contained in:
2025-05-30 23:51:22 -06:00
parent 254beb897a
commit 32f2686f14
2108 changed files with 301539 additions and 19567 deletions

View File

@@ -0,0 +1,84 @@
-- CreateTable
CREATE TABLE "Cliente" (
"id" BIGSERIAL NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
"name" TEXT NOT NULL,
"cedula" BIGINT NOT NULL,
"ubicacion" TEXT NOT NULL DEFAULT '.',
"grupo_estudio" TEXT,
"empleado" BOOLEAN NOT NULL DEFAULT false,
"avatar_url" TEXT,
"telefono" TEXT,
"idciat" TEXT,
CONSTRAINT "Cliente_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Planilla" (
"id" BIGSERIAL NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
"fecha_desde" TIMESTAMP(3) NOT NULL,
"fecha_hasta" TIMESTAMP(3) NOT NULL,
"titulo" TEXT NOT NULL,
"total" DECIMAL(65,30),
"estado" TEXT NOT NULL DEFAULT 'pagado',
"fecha_anulado" TIMESTAMP(3),
"empleado_id" BIGINT NOT NULL,
"creador_id" UUID,
"anulador_id" UUID,
CONSTRAINT "Planilla_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "TareaRealizada" (
"id" BIGSERIAL NOT NULL,
"empleado_id" BIGINT NOT NULL,
"planilla_id" BIGINT,
"titulo" TEXT NOT NULL,
"precio" DOUBLE PRECISION,
"estado" TEXT NOT NULL DEFAULT 'pendiente',
"observacion" TEXT,
"fecha" TIMESTAMP(3) NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
"tipo" TEXT NOT NULL DEFAULT '',
"fecha_anulado" TIMESTAMP(3),
"creador_id" UUID NOT NULL,
"anulador_id" UUID,
CONSTRAINT "TareaRealizada_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Asistencia" (
"id" BIGSERIAL NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
"entrada" TIMESTAMP(3) DEFAULT (now() AT TIME ZONE 'utc'),
"salida" TIMESTAMP(3),
"historial" JSONB,
"observacion" TEXT,
"estado" TEXT DEFAULT 'pendiente',
"fecha_anulado" TIMESTAMP(3),
"empleado_id" BIGINT NOT NULL,
"creador_id" UUID NOT NULL,
"modificado_id" UUID,
"anulador_id" UUID,
CONSTRAINT "Asistencia_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Cliente_cedula_key" ON "Cliente"("cedula");
-- AddForeignKey
ALTER TABLE "Planilla" ADD CONSTRAINT "Planilla_empleado_id_fkey" FOREIGN KEY ("empleado_id") REFERENCES "Cliente"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "TareaRealizada" ADD CONSTRAINT "TareaRealizada_empleado_id_fkey" FOREIGN KEY ("empleado_id") REFERENCES "Cliente"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Asistencia" ADD CONSTRAINT "Asistencia_empleado_id_fkey" FOREIGN KEY ("empleado_id") REFERENCES "Cliente"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -0,0 +1,18 @@
-- AlterTable
ALTER TABLE "Asistencia" ALTER COLUMN "created_at" SET DEFAULT (now() AT TIME ZONE 'utc'),
ALTER COLUMN "updated_at" SET DEFAULT (now() AT TIME ZONE 'utc'),
ALTER COLUMN "entrada" SET DEFAULT (now() AT TIME ZONE 'utc');
-- AlterTable
ALTER TABLE "Cliente" ALTER COLUMN "created_at" SET DEFAULT (now() AT TIME ZONE 'utc'),
ALTER COLUMN "updated_at" SET DEFAULT (now() AT TIME ZONE 'utc');
-- AlterTable
ALTER TABLE "Planilla" ALTER COLUMN "created_at" SET DEFAULT (now() AT TIME ZONE 'utc'),
ALTER COLUMN "updated_at" SET DEFAULT (now() AT TIME ZONE 'utc');
-- AlterTable
ALTER TABLE "TareaRealizada" ALTER COLUMN "created_at" SET DEFAULT (now() AT TIME ZONE 'utc');
-- AddForeignKey
ALTER TABLE "TareaRealizada" ADD CONSTRAINT "TareaRealizada_planilla_id_fkey" FOREIGN KEY ("planilla_id") REFERENCES "Planilla"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"

88
api/prisma/schema.prisma Normal file
View File

@@ -0,0 +1,88 @@
generator client {
provider = "prisma-client-js"
output = "generated/client"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Cliente {
id BigInt @id @default(autoincrement())
created_at DateTime @default(dbgenerated("(now() AT TIME ZONE 'utc')"))
updated_at DateTime @default(dbgenerated("(now() AT TIME ZONE 'utc')")) @updatedAt
name String
cedula BigInt @unique
ubicacion String @default(".")
grupo_estudio String?
empleado Boolean @default(false)
avatar_url String?
telefono String?
idciat String?
asistencias Asistencia[]
tareasRealizadas TareaRealizada[]
planillas Planilla[]
}
model Planilla {
id BigInt @id @default(autoincrement())
created_at DateTime @default(dbgenerated("(now() AT TIME ZONE 'utc')"))
updated_at DateTime @default(dbgenerated("(now() AT TIME ZONE 'utc')")) @updatedAt
fecha_desde DateTime
fecha_hasta DateTime
titulo String
total Decimal?
estado String @default("pagado")
fecha_anulado DateTime?
tareasRealizadas TareaRealizada[]
empleado_id BigInt
empleado Cliente @relation(fields: [empleado_id], references: [id])
creador_id String? @default(uuid()) @db.Uuid
anulador_id String? @db.Uuid
}
model TareaRealizada {
id BigInt @id @default(autoincrement())
titulo String
precio Float?
estado String @default("pendiente")
observacion String?
fecha DateTime
created_at DateTime @default(dbgenerated("(now() AT TIME ZONE 'utc')"))
tipo String @default("")
fecha_anulado DateTime?
planilla_id BigInt?
planilla Planilla? @relation(fields: [planilla_id], references: [id])
empleado_id BigInt
empleado Cliente @relation(fields: [empleado_id], references: [id])
creador_id String @default(uuid()) @db.Uuid
anulador_id String? @db.Uuid
}
model Asistencia {
id BigInt @id @default(autoincrement())
created_at DateTime @default(dbgenerated("(now() AT TIME ZONE 'utc')"))
updated_at DateTime @default(dbgenerated("(now() AT TIME ZONE 'utc')")) @updatedAt
entrada DateTime? @default(dbgenerated("(now() AT TIME ZONE 'utc')"))
salida DateTime?
historial Json?
observacion String?
estado String? @default("pendiente")
fecha_anulado DateTime?
empleado_id BigInt
empleado Cliente @relation(fields: [empleado_id], references: [id])
creador_id String @default(uuid()) @db.Uuid
modificado_id String? @db.Uuid
anulador_id String? @db.Uuid
}