mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 17:04:49 +01:00
feat(tui): TUI für Produktionsauftrag-Freigabe, Bestandsreservierung und Reservierungs-Freigabe
- ProductionOrderCreateScreen: Nach Anlage Freigabe per [F] mit Statusanzeige - StockDetailScreen: Reservierungen-Tabelle, Menü für Reservieren/Freigeben - ReserveStockScreen: Neues Formular (Referenztyp, Referenz-ID, Menge, Einheit, Priorität) - API-Client: release(), reserveStock(), releaseReservation() Methoden - Hooks: releaseProductionOrder(), reserveStock(), releaseReservation() - Types: ReservationDTO, StockBatchAllocationDTO, ReserveStockRequest exportiert - DB: Migration 027 erweitert chk_production_order_status um RELEASED
This commit is contained in:
parent
fb8387c10e
commit
376557925a
15 changed files with 585 additions and 13 deletions
|
|
@ -108,6 +108,9 @@ export type {
|
|||
RemoveStockBatchRequest,
|
||||
BlockStockBatchRequest,
|
||||
MinimumLevelDTO,
|
||||
ReservationDTO,
|
||||
StockBatchAllocationDTO,
|
||||
ReserveStockRequest,
|
||||
} from '@effigenix/types';
|
||||
|
||||
// Resource types (runtime, stay in resource files)
|
||||
|
|
@ -137,8 +140,8 @@ export type { BatchesResource, BatchStatus } from './resources/batches.js';
|
|||
export { BATCH_STATUS_LABELS } from './resources/batches.js';
|
||||
export type { ProductionOrdersResource, Priority } from './resources/production-orders.js';
|
||||
export { PRIORITY_LABELS } from './resources/production-orders.js';
|
||||
export type { StocksResource, BatchType, StockBatchStatus, StockFilter } from './resources/stocks.js';
|
||||
export { BATCH_TYPE_LABELS, STOCK_BATCH_STATUS_LABELS } from './resources/stocks.js';
|
||||
export type { StocksResource, BatchType, StockBatchStatus, StockFilter, ReferenceType, ReservationPriority } from './resources/stocks.js';
|
||||
export { BATCH_TYPE_LABELS, STOCK_BATCH_STATUS_LABELS, REFERENCE_TYPE_LABELS, RESERVATION_PRIORITY_LABELS } from './resources/stocks.js';
|
||||
|
||||
import { createApiClient } from './client.js';
|
||||
import { createAuthResource } from './resources/auth.js';
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ export function createProductionOrdersResource(client: AxiosInstance) {
|
|||
const res = await client.post<ProductionOrderDTO>(BASE, request);
|
||||
return res.data;
|
||||
},
|
||||
|
||||
async release(id: string): Promise<ProductionOrderDTO> {
|
||||
const res = await client.post<ProductionOrderDTO>(`${BASE}/${id}/release`);
|
||||
return res.data;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import type {
|
|||
UpdateStockRequest,
|
||||
RemoveStockBatchRequest,
|
||||
BlockStockBatchRequest,
|
||||
ReservationDTO,
|
||||
ReserveStockRequest,
|
||||
} from '@effigenix/types';
|
||||
|
||||
export type BatchType = 'PURCHASED' | 'PRODUCED';
|
||||
|
|
@ -28,6 +30,23 @@ export const STOCK_BATCH_STATUS_LABELS: Record<StockBatchStatus, string> = {
|
|||
BLOCKED: 'Gesperrt',
|
||||
};
|
||||
|
||||
export type ReferenceType = 'PRODUCTION_ORDER' | 'SALES_ORDER' | 'TRANSFER';
|
||||
|
||||
export const REFERENCE_TYPE_LABELS: Record<ReferenceType, string> = {
|
||||
PRODUCTION_ORDER: 'Produktionsauftrag',
|
||||
SALES_ORDER: 'Kundenauftrag',
|
||||
TRANSFER: 'Umlagerung',
|
||||
};
|
||||
|
||||
export type ReservationPriority = 'LOW' | 'NORMAL' | 'HIGH' | 'URGENT';
|
||||
|
||||
export const RESERVATION_PRIORITY_LABELS: Record<ReservationPriority, string> = {
|
||||
LOW: 'Niedrig',
|
||||
NORMAL: 'Normal',
|
||||
HIGH: 'Hoch',
|
||||
URGENT: 'Dringend',
|
||||
};
|
||||
|
||||
export type {
|
||||
StockDTO,
|
||||
StockBatchDTO,
|
||||
|
|
@ -37,6 +56,8 @@ export type {
|
|||
UpdateStockRequest,
|
||||
RemoveStockBatchRequest,
|
||||
BlockStockBatchRequest,
|
||||
ReservationDTO,
|
||||
ReserveStockRequest,
|
||||
};
|
||||
|
||||
export interface StockFilter {
|
||||
|
|
@ -89,6 +110,15 @@ export function createStocksResource(client: AxiosInstance) {
|
|||
async unblockBatch(stockId: string, batchId: string): Promise<void> {
|
||||
await client.post(`${BASE}/${stockId}/batches/${batchId}/unblock`);
|
||||
},
|
||||
|
||||
async reserveStock(stockId: string, request: ReserveStockRequest): Promise<ReservationDTO> {
|
||||
const res = await client.post<ReservationDTO>(`${BASE}/${stockId}/reservations`, request);
|
||||
return res.data;
|
||||
},
|
||||
|
||||
async releaseReservation(stockId: string, reservationId: string): Promise<void> {
|
||||
await client.delete(`${BASE}/${stockId}/reservations/${reservationId}`);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue