Added Entity Wiki
This commit is contained in:
@@ -4,22 +4,51 @@ import { and, eq, isNull, asc, inArray } from "drizzle-orm"
|
||||
import {
|
||||
wikiPages,
|
||||
authUsers,
|
||||
// Bereits vorhanden
|
||||
customers,
|
||||
projects,
|
||||
plants,
|
||||
products,
|
||||
inventoryitems,
|
||||
// ... weitere Schemas hier importieren
|
||||
// NEU HINZUGEFÜGT (Basierend auf deinem DataStore)
|
||||
tasks,
|
||||
contacts,
|
||||
contracts,
|
||||
vehicles,
|
||||
vendors,
|
||||
spaces,
|
||||
inventoryitemgroups,
|
||||
services,
|
||||
hourrates,
|
||||
events,
|
||||
productcategories,
|
||||
servicecategories,
|
||||
ownaccounts
|
||||
} from "../../db/schema/"
|
||||
|
||||
// Konfiguration: Welche Entitäten sollen im Wiki auftauchen?
|
||||
const ENTITY_CONFIG: Record<string, { table: any, labelField: any, rootLabel: string, idField: 'id' | 'uuid' }> = {
|
||||
// --- BEREITS VORHANDEN ---
|
||||
'customers': { table: customers, labelField: customers.name, rootLabel: 'Kunden', idField: 'id' },
|
||||
'projects': { table: projects, labelField: projects.name, rootLabel: 'Projekte', idField: 'id' },
|
||||
'plants': { table: plants, labelField: plants.name, rootLabel: 'Objekte', idField: 'id' },
|
||||
'products': { table: products, labelField: products.name, rootLabel: 'Artikel', idField: 'id' },
|
||||
'inventoryitems': { table: inventoryitems, labelField: inventoryitems.name, rootLabel: 'Inventarartikel', idField: 'id' },
|
||||
// Hier weitere hinzufügen (z.B. vehicles, products...)
|
||||
|
||||
// --- NEU BASIEREND AUF DATASTORE ---
|
||||
'tasks': { table: tasks, labelField: tasks.name, rootLabel: 'Aufgaben', idField: 'id' },
|
||||
'contacts': { table: contacts, labelField: contacts.fullName, rootLabel: 'Kontakte', idField: 'id' },
|
||||
'contracts': { table: contracts, labelField: contracts.name, rootLabel: 'Verträge', idField: 'id' },
|
||||
'vehicles': { table: vehicles, labelField: vehicles.license_plate, rootLabel: 'Fahrzeuge', idField: 'id' },
|
||||
'vendors': { table: vendors, labelField: vendors.name, rootLabel: 'Lieferanten', idField: 'id' },
|
||||
'spaces': { table: spaces, labelField: spaces.name, rootLabel: 'Lagerplätze', idField: 'id' },
|
||||
'inventoryitemgroups': { table: inventoryitemgroups, labelField: inventoryitemgroups.name, rootLabel: 'Inventarartikelgruppen', idField: 'id' },
|
||||
'services': { table: services, labelField: services.name, rootLabel: 'Leistungen', idField: 'id' },
|
||||
'hourrates': { table: hourrates, labelField: hourrates.name, rootLabel: 'Stundensätze', idField: 'id' },
|
||||
'events': { table: events, labelField: events.name, rootLabel: 'Termine', idField: 'id' },
|
||||
'productcategories': { table: productcategories, labelField: productcategories.name, rootLabel: 'Artikelkategorien', idField: 'id' },
|
||||
'servicecategories': { table: servicecategories, labelField: servicecategories.name, rootLabel: 'Leistungskategorien', idField: 'id' },
|
||||
'ownaccounts': { table: ownaccounts, labelField: ownaccounts.name, rootLabel: 'Zusätzliche Buchungskonten', idField: 'id' },
|
||||
}
|
||||
|
||||
// Types
|
||||
|
||||
Reference in New Issue
Block a user