mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 08:29:36 +01:00
feat(production): Produktion über Auftrag starten (US-P15)
RELEASED ProductionOrder kann mit einer PLANNED Batch verknüpft und
in Produktion gestartet werden. Dabei wechselt der Order auf IN_PROGRESS
und die Batch auf IN_PRODUCTION. Neuer REST-Endpoint POST /{id}/start,
StartOrderProduction Use Case, BatchAlreadyAssigned Error, Liquibase-
Migration für batch_id FK auf production_orders.
This commit is contained in:
parent
a8bbe3a951
commit
bfae3eff73
19 changed files with 985 additions and 17 deletions
|
|
@ -116,10 +116,21 @@ public final class ProductionScenario {
|
|||
);
|
||||
}
|
||||
|
||||
public static ChainBuilder startOrderProduction() {
|
||||
return exec(
|
||||
http("Produktionsauftrag starten")
|
||||
.post("/api/production/production-orders/#{productionOrderId}/start")
|
||||
.header("Authorization", "Bearer #{accessToken}")
|
||||
.header("Content-Type", "application/json")
|
||||
.body(StringBody("{\"batchId\":\"#{orderBatchId}\"}"))
|
||||
.check(status().in(200, 400, 409, 500))
|
||||
);
|
||||
}
|
||||
|
||||
// ---- Zusammengesetztes Szenario ----
|
||||
|
||||
/**
|
||||
* Produktions-Workflow: Rezepte lesen → Charge planen → starten → abschließen.
|
||||
* Produktions-Workflow: Rezepte lesen → Charge planen → Auftrag anlegen → freigeben → mit Charge starten.
|
||||
*/
|
||||
public static ScenarioBuilder productionWorkflow() {
|
||||
return scenario("Produktions-Workflow")
|
||||
|
|
@ -128,7 +139,20 @@ public final class ProductionScenario {
|
|||
.pause(1, 2)
|
||||
.exec(getRandomRecipe())
|
||||
.pause(1, 2)
|
||||
// Charge planen und durchlaufen (nur wenn planBatch erfolgreich)
|
||||
// Charge planen für Order-Start (separate Batch, wird nicht direkt gestartet)
|
||||
.exec(planBatch())
|
||||
.pause(1, 2)
|
||||
// Produktionsauftrag anlegen, freigeben und mit Charge starten
|
||||
.exec(createProductionOrder())
|
||||
.pause(1, 2)
|
||||
.doIf(session -> session.contains("productionOrderId") && session.contains("batchId")).then(
|
||||
exec(releaseProductionOrder())
|
||||
.pause(1, 2)
|
||||
.exec(session -> session.set("orderBatchId", session.getString("batchId")))
|
||||
.exec(startOrderProduction())
|
||||
)
|
||||
.pause(1, 2)
|
||||
// Separate Charge planen → starten → abschließen (unabhängiger Workflow)
|
||||
.exec(planBatch())
|
||||
.pause(1, 2)
|
||||
.doIf(session -> session.contains("batchId")).then(
|
||||
|
|
@ -137,13 +161,6 @@ public final class ProductionScenario {
|
|||
.exec(completeBatch())
|
||||
)
|
||||
.pause(1, 2)
|
||||
// Produktionsauftrag anlegen und freigeben
|
||||
.exec(createProductionOrder())
|
||||
.pause(1, 2)
|
||||
.doIf(session -> session.contains("productionOrderId")).then(
|
||||
exec(releaseProductionOrder())
|
||||
)
|
||||
.pause(1, 2)
|
||||
// Nochmal Chargen-Liste prüfen
|
||||
.exec(listBatches());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue