fix: Bug fixed für alle Seiten und das Profil und label
This commit is contained in:
1 parent
133edcd5ba
commit
0a52b29c57
52 files changed
+1290
-129
No files matched your search
@@ -0,0 +1,53 @@
|
||||
const AUDIT_ACTION_LABELS: Record<string, string> = {
|
||||
CREATE: "Erstellt",
|
||||
UPDATE: "Aktualisiert",
|
||||
DEACTIVATE: "Deaktiviert",
|
||||
DELETE: "Gelöscht",
|
||||
LOGIN: "Angemeldet",
|
||||
LOGIN_FAILED: "Anmeldung fehlgeschlagen",
|
||||
LOGOUT: "Abgemeldet",
|
||||
TOKEN_REFRESHED: "Token erneuert",
|
||||
MFA_ENABLED: "MFA aktiviert",
|
||||
MFA_DISABLED: "MFA deaktiviert",
|
||||
};
|
||||
|
||||
export function auditActionLabel(action: string): string {
|
||||
return AUDIT_ACTION_LABELS[action] ?? action;
|
||||
}
|
||||
|
||||
const AUDIT_ENTITY_TYPE_LABELS: Record<string, string> = {
|
||||
Apiary: "Bienenstand",
|
||||
AuthSession: "Sitzung",
|
||||
AutomationRule: "Automatisierungsregel",
|
||||
BottlingBatch: "Abfüllung",
|
||||
Colony: "Volk",
|
||||
COLONY: "Volk",
|
||||
Document: "Dokument",
|
||||
Equipment: "Ausrüstung",
|
||||
Extraction: "Schleuderung",
|
||||
Feeding: "Fütterung",
|
||||
Harvest: "Ernte",
|
||||
HoneyBatch: "Honigcharge",
|
||||
HoneyBatchRelocation: "Honigcharge-Umlagerung",
|
||||
HoneyMeasurement: "Honigmessung",
|
||||
Import: "Import",
|
||||
Inspection: "Durchsicht",
|
||||
Product: "Produkt",
|
||||
Queen: "Königin",
|
||||
QueenEvaluation: "Königinnenbewertung",
|
||||
Role: "Rolle",
|
||||
StockItem: "Lagerartikel",
|
||||
StockMovement: "Bestandsbewegung",
|
||||
StorageContainer: "Lagerbehälter",
|
||||
SwarmControlCheck: "Schwarmkontrolle",
|
||||
Task: "Aufgabe",
|
||||
TaskTemplate: "Aufgabenvorlage",
|
||||
Treatment: "Behandlung",
|
||||
User: "Benutzer",
|
||||
VarroaMeasurement: "Varroamessung",
|
||||
WebhookSubscription: "Webhook",
|
||||
};
|
||||
|
||||
export function auditEntityTypeLabel(entityType: string): string {
|
||||
return AUDIT_ENTITY_TYPE_LABELS[entityType] ?? entityType;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { EquipmentCondition } from "./types";
|
||||
|
||||
export const EQUIPMENT_CONDITIONS: EquipmentCondition[] = ["NEW", "GOOD", "WORN", "DEFECTIVE"];
|
||||
|
||||
export const EQUIPMENT_CONDITION_LABELS: Record<EquipmentCondition, string> = {
|
||||
NEW: "Neu",
|
||||
GOOD: "Gut",
|
||||
WORN: "Abgenutzt",
|
||||
DEFECTIVE: "Defekt",
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import { FeedType } from "./types";
|
||||
|
||||
export const FEED_TYPES: FeedType[] = [
|
||||
"SUGAR_WATER",
|
||||
"FEED_SYRUP",
|
||||
"FEED_PASTE",
|
||||
"OWN_HONEY",
|
||||
"OTHER",
|
||||
];
|
||||
|
||||
export const FEED_TYPE_LABELS: Record<FeedType, string> = {
|
||||
SUGAR_WATER: "Zuckerwasser",
|
||||
FEED_SYRUP: "Futtersirup",
|
||||
FEED_PASTE: "Futterteig",
|
||||
OWN_HONEY: "Eigener Honig",
|
||||
OTHER: "Sonstiges",
|
||||
};
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
HoneyBatchStatus,
|
||||
RelocateHoneyBatchInput,
|
||||
Traceability,
|
||||
UpdateHoneyBatchInput,
|
||||
} from "./types";
|
||||
|
||||
export interface HoneyBatchFilter {
|
||||
@@ -35,6 +36,16 @@ export function createHoneyBatch(input: CreateHoneyBatchInput): Promise<HoneyBat
|
||||
});
|
||||
}
|
||||
|
||||
export function updateHoneyBatch(
|
||||
id: string,
|
||||
input: UpdateHoneyBatchInput,
|
||||
): Promise<HoneyBatch> {
|
||||
return apiFetch<HoneyBatch>(`/honey-batches/${id}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
|
||||
export function addHoneyMeasurement(
|
||||
id: string,
|
||||
input: CreateHoneyMeasurementInput,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { HoneyBatchStatus } from "./types";
|
||||
|
||||
export const HONEY_BATCH_STATUS_LABELS: Record<HoneyBatchStatus, string> = {
|
||||
RAW: "Roh",
|
||||
EXTRACTED: "Geschleudert",
|
||||
CLARIFIED: "Geklärt",
|
||||
CREAMED: "Cremehonig",
|
||||
STORED: "Gelagert",
|
||||
BOTTLED: "Abgefüllt",
|
||||
SOLD: "Verkauft",
|
||||
CONSUMED: "Verbraucht",
|
||||
};
|
||||
@@ -81,6 +81,12 @@ export interface CreateHoneyBatchInput {
|
||||
waterContent?: number;
|
||||
}
|
||||
|
||||
export interface UpdateHoneyBatchInput {
|
||||
honeyType?: string;
|
||||
amount?: number;
|
||||
waterContent?: number;
|
||||
}
|
||||
|
||||
export interface CreateHoneyMeasurementInput {
|
||||
waterContent: number;
|
||||
measuredAt: string;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { ProductStatus } from "./types";
|
||||
|
||||
export const PRODUCT_STATUS_LABELS: Record<ProductStatus, string> = {
|
||||
ACTIVE: "Aktiv",
|
||||
DISCONTINUED: "Eingestellt",
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import { QueenStatus } from "./types";
|
||||
|
||||
// Werte und Reihenfolge aus docs/lastenheft.md Abschnitt 4.5 ("Moegliche Status").
|
||||
export const QUEEN_STATUSES: QueenStatus[] = [
|
||||
"ACTIVE",
|
||||
"RESERVE",
|
||||
"UNMATED",
|
||||
"MATED",
|
||||
"LOST",
|
||||
"REPLACED",
|
||||
"SOLD",
|
||||
"DECEASED",
|
||||
];
|
||||
|
||||
export const QUEEN_STATUS_LABELS: Record<QueenStatus, string> = {
|
||||
ACTIVE: "Aktiv",
|
||||
RESERVE: "Reserve",
|
||||
UNMATED: "Unbegattet",
|
||||
MATED: "Begattet",
|
||||
LOST: "Verloren",
|
||||
REPLACED: "Ersetzt",
|
||||
SOLD: "Verkauft",
|
||||
DECEASED: "Verstorben",
|
||||
};
|
||||
@@ -5,6 +5,8 @@ import {
|
||||
CreateStorageContainerInput,
|
||||
StockItem,
|
||||
StorageContainer,
|
||||
UpdateStockItemInput,
|
||||
UpdateStorageContainerInput,
|
||||
} from "./types";
|
||||
|
||||
export function fetchStorageContainers(): Promise<StorageContainer[]> {
|
||||
@@ -20,6 +22,16 @@ export function createStorageContainer(
|
||||
});
|
||||
}
|
||||
|
||||
export function updateStorageContainer(
|
||||
id: string,
|
||||
input: UpdateStorageContainerInput,
|
||||
): Promise<StorageContainer> {
|
||||
return apiFetch<StorageContainer>(`/storage-containers/${id}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
|
||||
export function fetchStockItems(): Promise<StockItem[]> {
|
||||
return apiFetch<StockItem[]>("/stock-items");
|
||||
}
|
||||
@@ -31,6 +43,16 @@ export function createStockItem(input: CreateStockItemInput): Promise<StockItem>
|
||||
});
|
||||
}
|
||||
|
||||
export function updateStockItem(
|
||||
id: string,
|
||||
input: UpdateStockItemInput,
|
||||
): Promise<StockItem> {
|
||||
return apiFetch<StockItem>(`/stock-items/${id}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
|
||||
export function addStockMovement(
|
||||
id: string,
|
||||
input: CreateStockMovementInput,
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { StockCategory, StockMovementType, StorageContainerStatus } from "./types";
|
||||
|
||||
export const STORAGE_CONTAINER_STATUS_LABELS: Record<StorageContainerStatus, string> = {
|
||||
EMPTY: "Leer",
|
||||
FILLED: "Gefüllt",
|
||||
CLEANING: "Reinigung",
|
||||
OUT_OF_SERVICE: "Außer Betrieb",
|
||||
};
|
||||
|
||||
export const STOCK_CATEGORIES: StockCategory[] = ["HONEY", "CONSUMABLE", "EQUIPMENT_MATERIAL"];
|
||||
|
||||
export const STOCK_CATEGORY_LABELS: Record<StockCategory, string> = {
|
||||
HONEY: "Honig",
|
||||
CONSUMABLE: "Verbrauchsmaterial",
|
||||
EQUIPMENT_MATERIAL: "Ausrüstungsmaterial",
|
||||
};
|
||||
|
||||
export const STOCK_MOVEMENT_TYPES: StockMovementType[] = ["IN", "OUT", "TRANSFER", "ADJUSTMENT"];
|
||||
|
||||
export const STOCK_MOVEMENT_TYPE_LABELS: Record<StockMovementType, string> = {
|
||||
IN: "Eingang",
|
||||
OUT: "Ausgang",
|
||||
TRANSFER: "Umlagerung",
|
||||
ADJUSTMENT: "Korrektur",
|
||||
};
|
||||
@@ -41,6 +41,12 @@ export interface CreateStorageContainerInput {
|
||||
location?: string;
|
||||
}
|
||||
|
||||
export interface UpdateStorageContainerInput {
|
||||
containerType?: string;
|
||||
capacity?: number;
|
||||
location?: string;
|
||||
}
|
||||
|
||||
export interface CreateStockItemInput {
|
||||
name: string;
|
||||
category: StockCategory;
|
||||
@@ -50,6 +56,14 @@ export interface CreateStockItemInput {
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export interface UpdateStockItemInput {
|
||||
name?: string;
|
||||
category?: StockCategory;
|
||||
unit?: string;
|
||||
minThreshold?: number;
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export interface CreateStockMovementInput {
|
||||
type: StockMovementType;
|
||||
quantity: number;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { TaskPriority, TaskStatus } from "./types";
|
||||
|
||||
export const TASK_STATUSES: TaskStatus[] = ["OPEN", "IN_PROGRESS", "DONE", "CANCELLED"];
|
||||
|
||||
export const TASK_STATUS_LABELS: Record<TaskStatus, string> = {
|
||||
OPEN: "Offen",
|
||||
IN_PROGRESS: "In Bearbeitung",
|
||||
DONE: "Erledigt",
|
||||
CANCELLED: "Abgebrochen",
|
||||
};
|
||||
|
||||
export const TASK_PRIORITIES: TaskPriority[] = ["LOW", "NORMAL", "HIGH", "URGENT"];
|
||||
|
||||
export const TASK_PRIORITY_LABELS: Record<TaskPriority, string> = {
|
||||
LOW: "Niedrig",
|
||||
NORMAL: "Normal",
|
||||
HIGH: "Hoch",
|
||||
URGENT: "Dringend",
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import { VarroaMethod } from "./types";
|
||||
|
||||
export const VARROA_METHODS: VarroaMethod[] = [
|
||||
"NATURAL_MITE_FALL",
|
||||
"POWDERED_SUGAR",
|
||||
"WASHING_METHOD",
|
||||
"DRONE_BROOD_CONTROL",
|
||||
];
|
||||
|
||||
export const VARROA_METHOD_LABELS: Record<VarroaMethod, string> = {
|
||||
NATURAL_MITE_FALL: "Natürlicher Milbenfall",
|
||||
POWDERED_SUGAR: "Puderzuckermethode",
|
||||
WASHING_METHOD: "Waschmethode",
|
||||
DRONE_BROOD_CONTROL: "Drohnenbrutentnahme",
|
||||
};
|
||||
Reference in new issue
Block a user