feat: Schwarmkontrolle-Protokoll
Neues SwarmControlCheck-Modul: strukturierte Weiselzellenkontrollen pro Volk mit Zahl/Verdeckelungsstatus der Zellen, Schwarmstimmung, ergriffener Maßnahme und optionalem naechsten Kontrolltermin. Frontend: neue Karte auf der Volk-Detailseite, Erfassungsformular unter /swarm-control/new sowie Quick-Add-Eintrag.
This commit is contained in:
1 parent
4609a0f9ec
commit
1a7331b6b2
19 files changed
+1076
No files matched your search
+31
@@ -0,0 +1,31 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "SwarmMood" AS ENUM ('NONE', 'LOW', 'HIGH');
|
||||
|
||||
-- CreateEnum
|
||||
CREATE TYPE "SwarmControlAction" AS ENUM ('NONE', 'QUEEN_CELLS_REMOVED', 'ARTIFICIAL_SWARM', 'COLONY_DIVIDED', 'OTHER');
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "SwarmControlCheck" (
|
||||
"id" TEXT NOT NULL,
|
||||
"colonyId" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"date" TIMESTAMP(3) NOT NULL,
|
||||
"queenCellsFound" INTEGER,
|
||||
"queenCellsCapped" BOOLEAN NOT NULL DEFAULT false,
|
||||
"swarmMood" "SwarmMood" NOT NULL DEFAULT 'NONE',
|
||||
"actionTaken" "SwarmControlAction" NOT NULL DEFAULT 'NONE',
|
||||
"notes" TEXT,
|
||||
"nextCheckDate" TIMESTAMP(3),
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "SwarmControlCheck_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "SwarmControlCheck_colonyId_date_idx" ON "SwarmControlCheck"("colonyId", "date");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "SwarmControlCheck" ADD CONSTRAINT "SwarmControlCheck_colonyId_fkey" FOREIGN KEY ("colonyId") REFERENCES "Colony"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "SwarmControlCheck" ADD CONSTRAINT "SwarmControlCheck_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -39,6 +39,7 @@ model User {
|
||||
|
||||
inspections Inspection[]
|
||||
varroaMeasurements VarroaMeasurement[]
|
||||
swarmControlChecks SwarmControlCheck[]
|
||||
treatments Treatment[]
|
||||
feedings Feeding[]
|
||||
harvests Harvest[]
|
||||
@@ -175,6 +176,7 @@ model Colony {
|
||||
lineageAsResult ColonyLineage[] @relation("LineageTo")
|
||||
inspections Inspection[]
|
||||
varroaMeasurements VarroaMeasurement[]
|
||||
swarmControlChecks SwarmControlCheck[]
|
||||
treatments Treatment[]
|
||||
feedings Feeding[]
|
||||
harvests HarvestColony[]
|
||||
@@ -457,6 +459,43 @@ model VarroaMeasurement {
|
||||
@@index([colonyId, date])
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Schwarmkontrolle (jenseits Lastenheft: strukturiertes Protokoll für
|
||||
// Weiselzellenkontrollen während der Schwarmzeit)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
enum SwarmMood {
|
||||
NONE
|
||||
LOW
|
||||
HIGH
|
||||
}
|
||||
|
||||
enum SwarmControlAction {
|
||||
NONE
|
||||
QUEEN_CELLS_REMOVED
|
||||
ARTIFICIAL_SWARM
|
||||
COLONY_DIVIDED
|
||||
OTHER
|
||||
}
|
||||
|
||||
model SwarmControlCheck {
|
||||
id String @id @default(cuid())
|
||||
colonyId String
|
||||
colony Colony @relation(fields: [colonyId], references: [id])
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
date DateTime
|
||||
queenCellsFound Int?
|
||||
queenCellsCapped Boolean @default(false)
|
||||
swarmMood SwarmMood @default(NONE)
|
||||
actionTaken SwarmControlAction @default(NONE)
|
||||
notes String?
|
||||
nextCheckDate DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([colonyId, date])
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Behandlung / Tierarzneimittel (Abschnitt 4.11)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user