Skip to content

112 — Update weighted average after price edit and reflect in subsequent withdrawals

Description

After a price edit on a restock, subsequent withdrawals use the updated weighted average; earlier withdrawals retain their original price.

Preconditions

  • Clean database
  • User logged in with ADMIN and WAREHOUSEMAN roles
  • Three storage categories pre-created (Nářadí, Materiál, Ochranné pomůcky)
  • Storage items and contract pre-created via API (per scenario)

Steps

  1. Restock 10 @ 300; withdraw 2 at 300 — Expected: First withdrawal at 300
  2. Edit restock to 200/unit; withdraw 3 more — Expected: Second withdrawal at 200
  3. Two withdrawal rows with different prices — Expected: Correct
  • Spec: tests/e2e/tests/storage.spec.ts