mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 11:59:35 +01:00
feat(tui): Create-Screen für Produktionsaufträge
Types, API-Client Resource, Hook und TUI-Screen für den neuen POST /api/production/production-orders Endpoint. Menüeintrag im Produktionsmenü ergänzt.
This commit is contained in:
parent
2938628db4
commit
fb8387c10e
10 changed files with 381 additions and 2 deletions
|
|
@ -0,0 +1,28 @@
|
|||
/** Production Orders resource – Production BC. */
|
||||
|
||||
import type { AxiosInstance } from 'axios';
|
||||
import type { ProductionOrderDTO, CreateProductionOrderRequest } from '@effigenix/types';
|
||||
|
||||
export type Priority = 'LOW' | 'NORMAL' | 'HIGH' | 'URGENT';
|
||||
|
||||
export const PRIORITY_LABELS: Record<Priority, string> = {
|
||||
LOW: 'Niedrig',
|
||||
NORMAL: 'Normal',
|
||||
HIGH: 'Hoch',
|
||||
URGENT: 'Dringend',
|
||||
};
|
||||
|
||||
export type { ProductionOrderDTO, CreateProductionOrderRequest };
|
||||
|
||||
const BASE = '/api/production/production-orders';
|
||||
|
||||
export function createProductionOrdersResource(client: AxiosInstance) {
|
||||
return {
|
||||
async create(request: CreateProductionOrderRequest): Promise<ProductionOrderDTO> {
|
||||
const res = await client.post<ProductionOrderDTO>(BASE, request);
|
||||
return res.data;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export type ProductionOrdersResource = ReturnType<typeof createProductionOrdersResource>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue