diff --git a/labman/prisma/migrations/20260309105825_add_statuses/migration.sql b/labman/prisma/migrations/20260309105825_add_statuses/migration.sql new file mode 100644 index 0000000..2bbf039 --- /dev/null +++ b/labman/prisma/migrations/20260309105825_add_statuses/migration.sql @@ -0,0 +1,14 @@ +-- AlterTable +ALTER TABLE "Borrower" ADD COLUMN "status" TEXT; + +-- AlterTable +ALTER TABLE "Equipment" ADD COLUMN "status" TEXT; + +-- AlterTable +ALTER TABLE "Item" ALTER COLUMN "status" DROP NOT NULL; + +-- AlterTable +ALTER TABLE "Loan" ALTER COLUMN "status" DROP NOT NULL; + +-- AlterTable +ALTER TABLE "User" ADD COLUMN "status" TEXT; diff --git a/labman/prisma/migrations/20260309142105_status_correction/migration.sql b/labman/prisma/migrations/20260309142105_status_correction/migration.sql new file mode 100644 index 0000000..965fcac --- /dev/null +++ b/labman/prisma/migrations/20260309142105_status_correction/migration.sql @@ -0,0 +1,23 @@ +/* + Warnings: + + - Made the column `status` on table `Borrower` required. This step will fail if there are existing NULL values in that column. + - Made the column `status` on table `Equipment` required. This step will fail if there are existing NULL values in that column. + - Made the column `status` on table `Item` required. This step will fail if there are existing NULL values in that column. + - Made the column `status` on table `Loan` required. This step will fail if there are existing NULL values in that column. + +*/ +UPDATE "Borrower" SET "status" = 'Active' WHERE "status" IS NULL; +UPDATE "Equipment" SET "status" = 'Active' WHERE "status" IS NULL; + +-- AlterTable +ALTER TABLE "Borrower" ALTER COLUMN "status" SET NOT NULL; + +-- AlterTable +ALTER TABLE "Equipment" ALTER COLUMN "status" SET NOT NULL; + +-- AlterTable +ALTER TABLE "Item" ALTER COLUMN "status" SET NOT NULL; + +-- AlterTable +ALTER TABLE "Loan" ALTER COLUMN "status" SET NOT NULL; diff --git a/labman/prisma/schema.prisma b/labman/prisma/schema.prisma index cdbca87..fba02de 100644 --- a/labman/prisma/schema.prisma +++ b/labman/prisma/schema.prisma @@ -27,6 +27,7 @@ model Equipment { name String @unique image String? createdAt DateTime @default(now()) + status String items Item[] category EquipmentCategory @relation(fields: [categoryId], references: [id]) } @@ -60,6 +61,7 @@ model User { username String @unique createdAt DateTime @default(now()) latestActivity DateTime @default(now()) + status String? sessions Session[] loans Loan[] } @@ -70,6 +72,7 @@ model Borrower { phone String? @unique email String? @unique note String? + status String creationDate DateTime @default(now()) loans Loan[] } diff --git a/labman/src/app/(main)/globals.css b/labman/src/app/(main)/globals.css index ed354b4..093271e 100644 --- a/labman/src/app/(main)/globals.css +++ b/labman/src/app/(main)/globals.css @@ -83,7 +83,7 @@ html { } .item-view { - @apply bg-brand-950 rounded-md p-3 h-180 overflow-y-auto + @apply bg-brand-950 rounded-md p-3 h-149 overflow-y-auto } .side-form-label { diff --git a/labman/src/app/(main)/layout.tsx b/labman/src/app/(main)/layout.tsx index 1fe817c..c3fd74b 100644 --- a/labman/src/app/(main)/layout.tsx +++ b/labman/src/app/(main)/layout.tsx @@ -5,6 +5,7 @@ import NavBar from "@/components/core/NavBar"; //import {PopupProvider} from "./popupProvider" import {getUser} from "@/lib/actions"; import SideBar from "@/components/core/SideBar"; +import {SideViewProvider} from "@/app/sideViewContext"; const spartan = League_Spartan({ subsets: ["latin"], @@ -27,20 +28,20 @@ export default async function RootLayout({ return ( -
- -Unit {loan.item?.id}
} {loan &&