new features
This commit is contained in:
156
frontend/src/types/bestellung.types.ts
Normal file
156
frontend/src/types/bestellung.types.ts
Normal file
@@ -0,0 +1,156 @@
|
||||
// Bestellungen (Vendor Orders) types
|
||||
|
||||
// ── Vendors ──
|
||||
|
||||
export interface Lieferant {
|
||||
id: number;
|
||||
name: string;
|
||||
kontakt_name?: string;
|
||||
email?: string;
|
||||
telefon?: string;
|
||||
adresse?: string;
|
||||
website?: string;
|
||||
notizen?: string;
|
||||
erstellt_von?: string;
|
||||
erstellt_am: string;
|
||||
aktualisiert_am: string;
|
||||
}
|
||||
|
||||
export interface LieferantFormData {
|
||||
name: string;
|
||||
kontakt_name?: string;
|
||||
email?: string;
|
||||
telefon?: string;
|
||||
adresse?: string;
|
||||
website?: string;
|
||||
notizen?: string;
|
||||
}
|
||||
|
||||
// ── Orders ──
|
||||
|
||||
export type BestellungStatus = 'entwurf' | 'erstellt' | 'bestellt' | 'teillieferung' | 'vollstaendig' | 'abgeschlossen';
|
||||
|
||||
export const BESTELLUNG_STATUS_LABELS: Record<BestellungStatus, string> = {
|
||||
entwurf: 'Entwurf',
|
||||
erstellt: 'Erstellt',
|
||||
bestellt: 'Bestellt',
|
||||
teillieferung: 'Teillieferung',
|
||||
vollstaendig: 'Vollständig',
|
||||
abgeschlossen: 'Abgeschlossen',
|
||||
};
|
||||
|
||||
export const BESTELLUNG_STATUS_COLORS: Record<BestellungStatus, 'default' | 'info' | 'primary' | 'warning' | 'success'> = {
|
||||
entwurf: 'default',
|
||||
erstellt: 'info',
|
||||
bestellt: 'primary',
|
||||
teillieferung: 'warning',
|
||||
vollstaendig: 'success',
|
||||
abgeschlossen: 'success',
|
||||
};
|
||||
|
||||
export interface Bestellung {
|
||||
id: number;
|
||||
bezeichnung: string;
|
||||
lieferant_id?: number;
|
||||
lieferant_name?: string;
|
||||
besteller_id?: string;
|
||||
besteller_name?: string;
|
||||
status: BestellungStatus;
|
||||
budget?: number;
|
||||
notizen?: string;
|
||||
erstellt_von?: string;
|
||||
erstellt_am: string;
|
||||
aktualisiert_am: string;
|
||||
bestellt_am?: string;
|
||||
abgeschlossen_am?: string;
|
||||
// Computed
|
||||
total_cost?: number;
|
||||
items_count?: number;
|
||||
}
|
||||
|
||||
export interface BestellungFormData {
|
||||
bezeichnung: string;
|
||||
lieferant_id?: number;
|
||||
besteller_id?: string;
|
||||
status?: BestellungStatus;
|
||||
budget?: number;
|
||||
notizen?: string;
|
||||
}
|
||||
|
||||
// ── Line Items ──
|
||||
|
||||
export interface Bestellposition {
|
||||
id: number;
|
||||
bestellung_id: number;
|
||||
bezeichnung: string;
|
||||
artikelnummer?: string;
|
||||
menge: number;
|
||||
einheit: string;
|
||||
einzelpreis?: number;
|
||||
erhalten_menge: number;
|
||||
notizen?: string;
|
||||
erstellt_am: string;
|
||||
aktualisiert_am: string;
|
||||
}
|
||||
|
||||
export interface BestellpositionFormData {
|
||||
bezeichnung: string;
|
||||
artikelnummer?: string;
|
||||
menge: number;
|
||||
einheit?: string;
|
||||
einzelpreis?: number;
|
||||
notizen?: string;
|
||||
}
|
||||
|
||||
// ── File Attachments ──
|
||||
|
||||
export interface BestellungDatei {
|
||||
id: number;
|
||||
bestellung_id: number;
|
||||
dateiname: string;
|
||||
dateipfad: string;
|
||||
dateityp: string;
|
||||
dateigroesse?: number;
|
||||
thumbnail_pfad?: string;
|
||||
hochgeladen_von?: string;
|
||||
hochgeladen_am: string;
|
||||
}
|
||||
|
||||
// ── Reminders ──
|
||||
|
||||
export interface BestellungErinnerung {
|
||||
id: number;
|
||||
bestellung_id: number;
|
||||
faellig_am: string;
|
||||
nachricht?: string;
|
||||
erledigt: boolean;
|
||||
erstellt_von?: string;
|
||||
erstellt_am: string;
|
||||
}
|
||||
|
||||
export interface ErinnerungFormData {
|
||||
faellig_am: string;
|
||||
nachricht?: string;
|
||||
}
|
||||
|
||||
// ── Audit Trail ──
|
||||
|
||||
export interface BestellungHistorie {
|
||||
id: number;
|
||||
bestellung_id: number;
|
||||
aktion: string;
|
||||
details?: Record<string, unknown>;
|
||||
erstellt_von?: string;
|
||||
erstellt_von_name?: string;
|
||||
erstellt_am: string;
|
||||
}
|
||||
|
||||
// ── API Response Types ──
|
||||
|
||||
export interface BestellungDetailResponse {
|
||||
bestellung: Bestellung;
|
||||
positionen: Bestellposition[];
|
||||
dateien: BestellungDatei[];
|
||||
erinnerungen: BestellungErinnerung[];
|
||||
historie: BestellungHistorie[];
|
||||
}
|
||||
83
frontend/src/types/shop.types.ts
Normal file
83
frontend/src/types/shop.types.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
// Shop (Internal Ordering) types
|
||||
|
||||
// ── Catalog Items ──
|
||||
|
||||
export interface ShopArtikel {
|
||||
id: number;
|
||||
bezeichnung: string;
|
||||
beschreibung?: string;
|
||||
kategorie?: string;
|
||||
bild_pfad?: string;
|
||||
geschaetzter_preis?: number;
|
||||
aktiv: boolean;
|
||||
erstellt_von?: string;
|
||||
erstellt_am: string;
|
||||
aktualisiert_am: string;
|
||||
}
|
||||
|
||||
export interface ShopArtikelFormData {
|
||||
bezeichnung: string;
|
||||
beschreibung?: string;
|
||||
kategorie?: string;
|
||||
geschaetzter_preis?: number;
|
||||
aktiv?: boolean;
|
||||
}
|
||||
|
||||
// ── Requests ──
|
||||
|
||||
export type ShopAnfrageStatus = 'offen' | 'genehmigt' | 'abgelehnt' | 'bestellt' | 'erledigt';
|
||||
|
||||
export const SHOP_STATUS_LABELS: Record<ShopAnfrageStatus, string> = {
|
||||
offen: 'Offen',
|
||||
genehmigt: 'Genehmigt',
|
||||
abgelehnt: 'Abgelehnt',
|
||||
bestellt: 'Bestellt',
|
||||
erledigt: 'Erledigt',
|
||||
};
|
||||
|
||||
export const SHOP_STATUS_COLORS: Record<ShopAnfrageStatus, 'default' | 'info' | 'error' | 'primary' | 'success'> = {
|
||||
offen: 'default',
|
||||
genehmigt: 'info',
|
||||
abgelehnt: 'error',
|
||||
bestellt: 'primary',
|
||||
erledigt: 'success',
|
||||
};
|
||||
|
||||
export interface ShopAnfrage {
|
||||
id: number;
|
||||
anfrager_id: string;
|
||||
anfrager_name?: string;
|
||||
status: ShopAnfrageStatus;
|
||||
notizen?: string;
|
||||
admin_notizen?: string;
|
||||
bearbeitet_von?: string;
|
||||
bearbeitet_von_name?: string;
|
||||
erstellt_am: string;
|
||||
aktualisiert_am: string;
|
||||
items_count?: number;
|
||||
}
|
||||
|
||||
export interface ShopAnfragePosition {
|
||||
id: number;
|
||||
anfrage_id: number;
|
||||
artikel_id?: number;
|
||||
bezeichnung: string;
|
||||
menge: number;
|
||||
notizen?: string;
|
||||
erstellt_am: string;
|
||||
}
|
||||
|
||||
export interface ShopAnfrageFormItem {
|
||||
artikel_id?: number;
|
||||
bezeichnung: string;
|
||||
menge: number;
|
||||
notizen?: string;
|
||||
}
|
||||
|
||||
// ── API Response Types ──
|
||||
|
||||
export interface ShopAnfrageDetailResponse {
|
||||
anfrage: ShopAnfrage;
|
||||
positionen: ShopAnfragePosition[];
|
||||
linked_bestellungen?: { id: number; bezeichnung: string; status: string }[];
|
||||
}
|
||||
Reference in New Issue
Block a user