From 133edcd5ba71e43b0ecf5639e3c9df9ecfa9e4a3 Mon Sep 17 00:00:00 2001 From: Nick Szaunig Date: Thu, 27 Aug 2026 10:51:07 +0200 Subject: [PATCH] fix: fehlende Dateien fuer Volk-Ueberarbeitung nachreichen labels.ts und die ColonyCondition-Migration waren untracked und fehlten im letzten Commit, dadurch schlug der Docker-Build mit "Module not found: @/lib/colonies/labels" fehl. --- .../migration.sql | 8 +++ ApiCore-Frontend/src/lib/colonies/labels.ts | 60 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 ApiCore-Backend/prisma/migrations/20260827070028_add_colony_condition/migration.sql create mode 100644 ApiCore-Frontend/src/lib/colonies/labels.ts diff --git a/ApiCore-Backend/prisma/migrations/20260827070028_add_colony_condition/migration.sql b/ApiCore-Backend/prisma/migrations/20260827070028_add_colony_condition/migration.sql new file mode 100644 index 0000000..882f356 --- /dev/null +++ b/ApiCore-Backend/prisma/migrations/20260827070028_add_colony_condition/migration.sql @@ -0,0 +1,8 @@ +-- CreateEnum +CREATE TYPE "ColonyCondition" AS ENUM ('EXCELLENT', 'GOOD', 'AVERAGE', 'WEAK', 'CRITICAL'); + +-- AlterTable +ALTER TABLE "Colony" + ALTER COLUMN "broodStatus" TYPE "ColonyCondition" USING ("broodStatus"::"ColonyCondition"), + ALTER COLUMN "feedStatus" TYPE "ColonyCondition" USING ("feedStatus"::"ColonyCondition"), + ALTER COLUMN "healthStatus" TYPE "ColonyCondition" USING ("healthStatus"::"ColonyCondition"); diff --git a/ApiCore-Frontend/src/lib/colonies/labels.ts b/ApiCore-Frontend/src/lib/colonies/labels.ts new file mode 100644 index 0000000..c1ec9df --- /dev/null +++ b/ApiCore-Frontend/src/lib/colonies/labels.ts @@ -0,0 +1,60 @@ +import { ColonyCondition, ColonyStatus, ColonyType } from "./types"; + +// Werte und Reihenfolge aus docs/lastenheft.md Abschnitt 4.3 ("Moegliche Volkstypen"/"Moegliche Status"). +export const COLONY_TYPES: ColonyType[] = [ + "PRODUCTION_COLONY", + "NUCLEUS_COLONY", + "YOUNG_COLONY", + "CARETAKER_COLONY", + "MATING_NUCLEUS", + "RESERVE_COLONY", +]; + +export const COLONY_TYPE_LABELS: Record = { + PRODUCTION_COLONY: "Wirtschaftsvolk", + NUCLEUS_COLONY: "Ableger", + YOUNG_COLONY: "Jungvolk", + CARETAKER_COLONY: "Pflegevolk", + MATING_NUCLEUS: "Begattungseinheit", + RESERVE_COLONY: "Reservevolk", +}; + +export const COLONY_STATUS_LABELS: Record = { + ACTIVE: "Aktiv", + WEAK: "Schwach", + CONSPICUOUS: "Auffällig", + QUEENLESS: "Weisellos", + DISSOLVED: "Aufgelöst", + SOLD: "Verkauft", + DECEASED: "Eingegangen", + MERGED: "Vereinigt", +}; + +// Gemeinsame fuenfstufige Skala fuer Brut-, Futter- und Gesundheitsstatus, +// bester bis schlechtester Zustand. +export const COLONY_CONDITIONS: ColonyCondition[] = [ + "EXCELLENT", + "GOOD", + "AVERAGE", + "WEAK", + "CRITICAL", +]; + +export const COLONY_CONDITION_LABELS: Record = { + EXCELLENT: "Sehr gut", + GOOD: "Gut", + AVERAGE: "Mittel", + WEAK: "Schwach", + CRITICAL: "Kritisch", +}; + +// Tailwind-Klassen auf Basis der --condition-* Tokens aus globals.css (hell/dunkel-faehig). +export const COLONY_CONDITION_TONE_CLASS: Record = { + EXCELLENT: "border-transparent bg-condition-excellent/15 text-condition-excellent-foreground", + GOOD: "border-transparent bg-condition-good/15 text-condition-good-foreground", + AVERAGE: "border-transparent bg-condition-average/15 text-condition-average-foreground", + WEAK: "border-transparent bg-condition-weak/15 text-condition-weak-foreground", + CRITICAL: "border-transparent bg-condition-critical/15 text-condition-critical-foreground", +}; + +export const COLONY_STRENGTH_OPTIONS: number[] = Array.from({ length: 10 }, (_, index) => index + 1);