mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 10:39: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
|
|
@ -25,6 +25,7 @@ export { createCustomersResource } from './resources/customers.js';
|
|||
export { createStorageLocationsResource } from './resources/storage-locations.js';
|
||||
export { createRecipesResource } from './resources/recipes.js';
|
||||
export { createBatchesResource } from './resources/batches.js';
|
||||
export { createProductionOrdersResource } from './resources/production-orders.js';
|
||||
export { createStocksResource } from './resources/stocks.js';
|
||||
export {
|
||||
ApiError,
|
||||
|
|
@ -98,6 +99,8 @@ export type {
|
|||
CompleteBatchRequest,
|
||||
RecordConsumptionRequest,
|
||||
CancelBatchRequest,
|
||||
ProductionOrderDTO,
|
||||
CreateProductionOrderRequest,
|
||||
StockDTO,
|
||||
CreateStockRequest,
|
||||
CreateStockResponse,
|
||||
|
|
@ -132,6 +135,8 @@ export type { RecipesResource, RecipeType, RecipeStatus, UoM } from './resources
|
|||
export { RECIPE_TYPE_LABELS, UOM_VALUES, UOM_LABELS } from './resources/recipes.js';
|
||||
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';
|
||||
|
||||
|
|
@ -146,6 +151,7 @@ import { createCustomersResource } from './resources/customers.js';
|
|||
import { createStorageLocationsResource } from './resources/storage-locations.js';
|
||||
import { createRecipesResource } from './resources/recipes.js';
|
||||
import { createBatchesResource } from './resources/batches.js';
|
||||
import { createProductionOrdersResource } from './resources/production-orders.js';
|
||||
import { createStocksResource } from './resources/stocks.js';
|
||||
import type { TokenProvider } from './token-provider.js';
|
||||
import type { ApiConfig } from '@effigenix/config';
|
||||
|
|
@ -171,6 +177,7 @@ export function createEffigenixClient(
|
|||
storageLocations: createStorageLocationsResource(axiosClient),
|
||||
recipes: createRecipesResource(axiosClient),
|
||||
batches: createBatchesResource(axiosClient),
|
||||
productionOrders: createProductionOrdersResource(axiosClient),
|
||||
stocks: createStocksResource(axiosClient),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
|
|
@ -436,6 +436,22 @@ export interface paths {
|
|||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/production/production-orders": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
get?: never;
|
||||
put?: never;
|
||||
post: operations["createProductionOrder"];
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/production/batches": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
|
|
@ -1459,6 +1475,30 @@ export interface components {
|
|||
subRecipeId?: string;
|
||||
substitutable?: boolean;
|
||||
};
|
||||
CreateProductionOrderRequest: {
|
||||
recipeId: string;
|
||||
plannedQuantity: string;
|
||||
plannedQuantityUnit: string;
|
||||
/** Format: date */
|
||||
plannedDate: string;
|
||||
priority: string;
|
||||
notes?: string;
|
||||
};
|
||||
ProductionOrderResponse: {
|
||||
id?: string;
|
||||
recipeId?: string;
|
||||
status?: string;
|
||||
plannedQuantity?: string;
|
||||
plannedQuantityUnit?: string;
|
||||
/** Format: date */
|
||||
plannedDate?: string;
|
||||
priority?: string;
|
||||
notes?: string;
|
||||
/** Format: date-time */
|
||||
createdAt?: string;
|
||||
/** Format: date-time */
|
||||
updatedAt?: string;
|
||||
};
|
||||
PlanBatchRequest: {
|
||||
recipeId: string;
|
||||
plannedQuantity: string;
|
||||
|
|
@ -2755,6 +2795,30 @@ export interface operations {
|
|||
};
|
||||
};
|
||||
};
|
||||
createProductionOrder: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["CreateProductionOrderRequest"];
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description OK */
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"*/*": components["schemas"]["ProductionOrderResponse"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
listBatches: {
|
||||
parameters: {
|
||||
query?: {
|
||||
|
|
|
|||
|
|
@ -26,3 +26,7 @@ export type PlanBatchRequest = components['schemas']['PlanBatchRequest'];
|
|||
export type CompleteBatchRequest = components['schemas']['CompleteBatchRequest'];
|
||||
export type RecordConsumptionRequest = components['schemas']['RecordConsumptionRequest'];
|
||||
export type CancelBatchRequest = components['schemas']['CancelBatchRequest'];
|
||||
|
||||
// Production Order types
|
||||
export type ProductionOrderDTO = components['schemas']['ProductionOrderResponse'];
|
||||
export type CreateProductionOrderRequest = components['schemas']['CreateProductionOrderRequest'];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue