mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 10:09:35 +01:00
feat(inventory): Bestandsbewegungen abfragen mit Zeitraum- und Chargen-Filter – Issue #16
Erweitert die StockMovement-Abfrage um batchReference- und from/to-Filter mit Filter-Priorität stockId > articleId > batchReference > movementType > from/to. Inkl. DB-Index auf batch_id, Unit-/Integrationstests und Lasttest-Szenarien.
This commit is contained in:
parent
fa6c0c2d70
commit
0e5d8f7025
13 changed files with 416 additions and 26 deletions
|
|
@ -93,6 +93,27 @@ public final class InventoryScenario {
|
|||
);
|
||||
}
|
||||
|
||||
public static ChainBuilder listStockMovementsByBatch() {
|
||||
return exec(session -> {
|
||||
int idx = ThreadLocalRandom.current().nextInt(50);
|
||||
return session.set("filterBatchRef", "CHARGE-%05d".formatted(idx));
|
||||
}).exec(
|
||||
http("Bestandsbewegungen nach Charge")
|
||||
.get("/api/inventory/stock-movements?batchReference=#{filterBatchRef}")
|
||||
.header("Authorization", "Bearer #{accessToken}")
|
||||
.check(status().is(200))
|
||||
);
|
||||
}
|
||||
|
||||
public static ChainBuilder listStockMovementsByDateRange() {
|
||||
return exec(
|
||||
http("Bestandsbewegungen nach Zeitraum")
|
||||
.get("/api/inventory/stock-movements?from=2020-01-01T00:00:00Z&to=2030-12-31T23:59:59Z")
|
||||
.header("Authorization", "Bearer #{accessToken}")
|
||||
.check(status().is(200))
|
||||
);
|
||||
}
|
||||
|
||||
public static ChainBuilder recordStockMovement() {
|
||||
return exec(session -> {
|
||||
var rnd = ThreadLocalRandom.current();
|
||||
|
|
@ -127,14 +148,16 @@ public final class InventoryScenario {
|
|||
.exec(AuthenticationScenario.login("admin", "admin123"))
|
||||
.repeat(15).on(
|
||||
randomSwitch().on(
|
||||
percent(20.0).then(listStocks()),
|
||||
percent(15.0).then(listStorageLocations()),
|
||||
percent(15.0).then(getRandomStorageLocation()),
|
||||
percent(15.0).then(listStocksByLocation()),
|
||||
percent(10.0).then(listStocksBelowMinimum()),
|
||||
percent(10.0).then(listStockMovements()),
|
||||
percent(18.0).then(listStocks()),
|
||||
percent(12.0).then(listStorageLocations()),
|
||||
percent(12.0).then(getRandomStorageLocation()),
|
||||
percent(12.0).then(listStocksByLocation()),
|
||||
percent(8.0).then(listStocksBelowMinimum()),
|
||||
percent(8.0).then(listStockMovements()),
|
||||
percent(5.0).then(listStockMovementsByStock()),
|
||||
percent(10.0).then(recordStockMovement())
|
||||
percent(5.0).then(listStockMovementsByBatch()),
|
||||
percent(5.0).then(listStockMovementsByDateRange()),
|
||||
percent(15.0).then(recordStockMovement())
|
||||
).pause(1, 3)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ public class FullWorkloadSimulation extends Simulation {
|
|||
details("Kategorien auflisten").responseTime().mean().lt(35),
|
||||
details("Bestandsbewegungen auflisten").responseTime().mean().lt(35),
|
||||
details("Bestandsbewegungen nach Bestand").responseTime().mean().lt(35),
|
||||
details("Bestandsbewegungen nach Charge").responseTime().mean().lt(35),
|
||||
details("Bestandsbewegungen nach Zeitraum").responseTime().mean().lt(35),
|
||||
|
||||
// Listen mit viel Daten (50-300 Einträge): mean < 75ms
|
||||
details("Chargen auflisten").responseTime().mean().lt(75),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue