1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-29 01:13:40 +01:00

feat: TUI-Screens für Inventar und Produktion + API-Client Typ-Migration

Neue TUI-Features:
- Inventar: Lageorte auflisten, anlegen, bearbeiten, (de-)aktivieren
- Produktion: Rezepte auflisten, anlegen, Detail-Ansicht
- Navigation erweitert (Hauptmenü, Routing)

API-Client auf generierte OpenAPI-Typen umgestellt:
- 6 neue Alias-Dateien in @effigenix/types (supplier, category, article,
  customer, inventory, production)
- api-client Re-Exports direkt von @effigenix/types statt via Resources
- Backend: @Schema(requiredProperties) auf 16 Response-Records
- Backend: OpenApiCustomizer für application-layer DTOs (UserDTO, RoleDTO)

Hinweis: Backend-Endpoints für GET /api/recipes und
GET /api/inventory/storage-locations/{id} fehlen noch (separate Issues).
This commit is contained in:
Sebastian Frick 2026-02-19 13:45:35 +01:00
parent bee3f28b5f
commit c26d72fbe7
48 changed files with 2090 additions and 474 deletions

View file

@ -12,7 +12,16 @@
*/
import type { AxiosInstance } from 'axios';
import type { AddressDTO, ContactInfoDTO, PaymentTermsDTO } from './suppliers.js';
import type {
CustomerDTO,
DeliveryAddressDTO,
FrameContractDTO,
ContractLineItemDTO,
CreateCustomerRequest,
UpdateCustomerRequest,
AddDeliveryAddressRequest,
SetFrameContractRequest,
} from '@effigenix/types';
export type CustomerType = 'B2B' | 'B2C';
export type CustomerStatus = 'ACTIVE' | 'INACTIVE';
@ -44,96 +53,16 @@ export const DELIVERY_RHYTHM_LABELS: Record<DeliveryRhythm, string> = {
ON_DEMAND: 'Nach Bedarf',
};
export interface DeliveryAddressDTO {
label: string;
address: AddressDTO;
contactPerson: string | null;
deliveryNotes: string | null;
}
export interface ContractLineItemDTO {
articleId: string;
agreedPrice: number;
agreedQuantity: number | null;
unit: string | null;
}
export interface FrameContractDTO {
id: string;
validFrom: string | null;
validUntil: string | null;
deliveryRhythm: DeliveryRhythm;
lineItems: ContractLineItemDTO[];
}
export interface CustomerDTO {
id: string;
name: string;
type: CustomerType;
status: CustomerStatus;
billingAddress: AddressDTO;
contactInfo: ContactInfoDTO;
paymentTerms: PaymentTermsDTO | null;
deliveryAddresses: DeliveryAddressDTO[];
frameContract: FrameContractDTO | null;
preferences: CustomerPreference[];
createdAt: string;
updatedAt: string;
}
export interface CreateCustomerRequest {
name: string;
type: CustomerType;
phone: string;
street: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
email?: string;
contactPerson?: string;
paymentDueDays?: number;
paymentDescription?: string;
}
export interface UpdateCustomerRequest {
name?: string;
phone?: string;
email?: string | null;
contactPerson?: string | null;
street?: string;
houseNumber?: string;
postalCode?: string;
city?: string;
country?: string;
paymentDueDays?: number | null;
paymentDescription?: string | null;
}
export interface AddDeliveryAddressRequest {
label: string;
street: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
contactPerson?: string;
deliveryNotes?: string;
}
export interface SetFrameContractLineItem {
articleId: string;
agreedPrice: number;
agreedQuantity?: number;
unit?: string;
}
export interface SetFrameContractRequest {
validFrom?: string;
validUntil?: string;
rhythm: DeliveryRhythm;
lineItems: SetFrameContractLineItem[];
}
export type {
CustomerDTO,
DeliveryAddressDTO,
FrameContractDTO,
ContractLineItemDTO,
CreateCustomerRequest,
UpdateCustomerRequest,
AddDeliveryAddressRequest,
SetFrameContractRequest,
};
// ── Resource factory ─────────────────────────────────────────────────────────