fix: expose every backend-supported field in all edit forms

Audit requested by the user after finding queens couldn't set
hatchYear: many edit dialogs (and some create forms) were missing
fields the backend DTOs already accept, so that data could never be
entered or corrected anywhere in the UI. Fixes per entity:

- Colony: status (WEAK/QUEENLESS/CONSPICUOUS) was never settable
  anywhere, so the COLONY_ATTENTION dashboard alert could never fire.
  Added as a dropdown restricted to the non-terminal statuses;
  DISSOLVED/SOLD/DECEASED/MERGED stay on their dedicated confirm
  actions, which also set deactivatedAt.
- Apiary: description was missing from the edit form.
- Inspection: 10 fields (weather, temperature, broodAmount,
  broodPattern, openBroodPresent, cappedBroodPresent,
  queenCellsPresent, swarmMood, gentleness, combBehavior,
  honeySuperStatus) existed in the schema/DTOs but nowhere in the UI -
  added to both the create and edit forms.
- Varroa measurement: durationMinutes was on the create form but
  missing from edit.
- Feeding: batchNumber missing from both create and edit.
- Treatment: startDate, endDate, activeIngredient, batchNumber
  missing from both create and edit.
- Task: assignedUserId had no UI anywhere; added to create/edit,
  degrading gracefully if the current user's role lacks users:read.
- Extraction (honey-batch traceability variant): amount was missing,
  while the other edit dialog for the same entity already had it.
- Bottling: productId missing from edit.
- Harvest: grossWeight missing from edit; grossWeight and
  honeySuperCount missing from create.
- Queen: breeder, matingType, matingStatus, inseminationData,
  motherLine, fatherLine added to the edit form (hatchYear/
  markingColor/markingNumber were already fixed in a prior commit).

Left alone deliberately: fields the backend DTO itself excludes via
PickType (e.g. HoneyBatch's jarSize/jarCount/totalAmount, Bottling's
quantities) since mutating those post-hoc would desync inventory
deduction, and Colony's terminal statuses/code which have dedicated
lifecycle actions.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Sonnet 5 committed 2026-09-07 12:20:18 +02:00
1 parent 792806b967
commit 1dddc387ba
20 files changed
+682 -4

No files matched your search

@@ -19,6 +19,18 @@ export const COLONY_TYPE_LABELS: Record<ColonyType, string> = {
RESERVE_COLONY: "Reservevolk",
};
// The non-terminal statuses a beekeeper can freely switch between while
// caring for a colony. DISSOLVED/SOLD/DECEASED/MERGED are lifecycle-ending
// transitions handled by their own dedicated confirm actions (colony-actions.tsx),
// which also set deactivatedAt - exposing them in a free dropdown here would
// let status and deactivatedAt drift out of sync.
export const COLONY_EDITABLE_STATUSES: ColonyStatus[] = [
"ACTIVE",
"WEAK",
"QUEENLESS",
"CONSPICUOUS",
];
export const COLONY_STATUS_LABELS: Record<ColonyStatus, string> = {
ACTIVE: "Aktiv",
WEAK: "Schwach",
@@ -31,10 +31,18 @@ export interface CreateInspectionInput {
weather?: string;
temperature?: number;
colonyStrength?: number;
broodAmount?: string;
broodPattern?: number;
openBroodPresent?: boolean;
cappedBroodPresent?: boolean;
queenSeen?: boolean;
eggsPresent?: boolean;
queenCellsPresent?: boolean;
swarmMood?: number;
gentleness?: number;
combBehavior?: number;
feedStatus?: string;
honeySuperStatus?: string;
healthIssues?: string;
varroaIssues?: string;
measures?: string;
@@ -46,10 +54,18 @@ export interface UpdateInspectionInput {
weather?: string;
temperature?: number;
colonyStrength?: number;
broodAmount?: string;
broodPattern?: number;
openBroodPresent?: boolean;
cappedBroodPresent?: boolean;
queenSeen?: boolean;
eggsPresent?: boolean;
queenCellsPresent?: boolean;
swarmMood?: number;
gentleness?: number;
combBehavior?: number;
feedStatus?: string;
honeySuperStatus?: string;
healthIssues?: string;
varroaIssues?: string;
measures?: string;
+12
View File
@@ -35,8 +35,14 @@ export interface CreateQueenInput {
hatchYear?: number;
breed?: string;
origin?: string;
breeder?: string;
markingColor?: string;
markingNumber?: string;
matingType?: string;
matingStatus?: string;
inseminationData?: string;
motherLine?: string;
fatherLine?: string;
motherQueenId?: string;
notes?: string;
}
@@ -45,8 +51,14 @@ export interface UpdateQueenInput {
hatchYear?: number;
breed?: string;
origin?: string;
breeder?: string;
markingColor?: string;
markingNumber?: string;
matingType?: string;
matingStatus?: string;
inseminationData?: string;
motherLine?: string;
fatherLine?: string;
motherQueenId?: string;
notes?: string;
status?: QueenStatus;
+2
View File
@@ -34,6 +34,7 @@ export interface CreateTaskInput {
description?: string;
priority?: TaskPriority;
dueDate?: string;
assignedUserId?: string;
}
export interface UpdateTaskInput {
@@ -41,5 +42,6 @@ export interface UpdateTaskInput {
description?: string;
priority?: TaskPriority;
dueDate?: string;
assignedUserId?: string;
status?: TaskStatus;
}