mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 10:09:35 +01:00
feat(production): Produktionsauftrag abschließen und stornieren (US-P16)
Complete: IN_PROGRESS → COMPLETED (nur wenn Batch COMPLETED) Cancel: PLANNED/RELEASED → CANCELLED (nicht aus IN_PROGRESS) Domain-, UseCase-, Integration- und Lasttests ergänzt.
This commit is contained in:
parent
14b59722f7
commit
72d59b4948
17 changed files with 1216 additions and 2 deletions
|
|
@ -127,6 +127,26 @@ public final class ProductionScenario {
|
|||
);
|
||||
}
|
||||
|
||||
public static ChainBuilder completeProductionOrder() {
|
||||
return exec(
|
||||
http("Produktionsauftrag abschließen")
|
||||
.post("/api/production/production-orders/#{productionOrderId}/complete")
|
||||
.header("Authorization", "Bearer #{accessToken}")
|
||||
.check(status().in(200, 400, 409, 500))
|
||||
);
|
||||
}
|
||||
|
||||
public static ChainBuilder cancelProductionOrder() {
|
||||
return exec(
|
||||
http("Produktionsauftrag stornieren")
|
||||
.post("/api/production/production-orders/#{productionOrderId}/cancel")
|
||||
.header("Authorization", "Bearer #{accessToken}")
|
||||
.header("Content-Type", "application/json")
|
||||
.body(StringBody(JsonBodyBuilder.cancelProductionOrderBody()))
|
||||
.check(status().in(200, 400, 409, 500))
|
||||
);
|
||||
}
|
||||
|
||||
// ---- Zusammengesetztes Szenario ----
|
||||
|
||||
/**
|
||||
|
|
@ -191,6 +211,18 @@ public final class ProductionScenario {
|
|||
.exec(completeBatch())
|
||||
)
|
||||
.pause(1, 2)
|
||||
// Produktionsauftrag abschließen (nutzt den zuvor gestarteten Order)
|
||||
.doIf(session -> session.contains("productionOrderId")).then(
|
||||
exec(completeProductionOrder())
|
||||
)
|
||||
.pause(1, 2)
|
||||
// Neuen Auftrag anlegen und direkt stornieren
|
||||
.exec(createProductionOrder())
|
||||
.pause(1, 2)
|
||||
.doIf(session -> session.contains("productionOrderId")).then(
|
||||
exec(cancelProductionOrder())
|
||||
)
|
||||
.pause(1, 2)
|
||||
// Nochmal Chargen-Liste prüfen
|
||||
.exec(listBatches());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@ public class FullWorkloadSimulation extends Simulation {
|
|||
details("Charge abschließen").responseTime().mean().lt(50),
|
||||
details("Produktionsauftrag anlegen").responseTime().mean().lt(50),
|
||||
details("Produktionsauftrag freigeben").responseTime().mean().lt(50),
|
||||
details("Produktionsauftrag abschließen").responseTime().mean().lt(50),
|
||||
details("Produktionsauftrag stornieren").responseTime().mean().lt(50),
|
||||
details("Bestandsbewegung erfassen").responseTime().mean().lt(50)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,6 +89,11 @@ public final class JsonBodyBuilder {
|
|||
{"actualQuantity":"9.5","actualQuantityUnit":"KG","waste":"0.5","wasteUnit":"KG","remarks":"Lasttest"}""";
|
||||
}
|
||||
|
||||
public static String cancelProductionOrderBody() {
|
||||
return """
|
||||
{"reason":"Lasttest-Stornierung"}""";
|
||||
}
|
||||
|
||||
public static String createProductionOrderBody(String recipeId) {
|
||||
return """
|
||||
{"recipeId":"%s","plannedQuantity":"20","plannedQuantityUnit":"KG","plannedDate":"%s","priority":"NORMAL"}"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue