Add stock items, groups and movements at a moving average cost

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 16:18:59 +02:00
co-authored by Claude Sonnet 5.5
parent 361a2974cf
commit 30132deb0e
81 changed files with 4968 additions and 115 deletions
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\Modules\Inventory\Domain\ValueObjects;
use App\Modules\Inventory\Domain\Exceptions\InvalidStockName;
/**
* Name of a stock item or an item group, e.g. "Valokuvapaperi 10×15".
*/
final readonly class StockName
{
public const int MAX_LENGTH = 150;
public string $value;
/**
* @throws InvalidStockName
*/
public function __construct(string $value)
{
$value = trim(preg_replace('/\s+/u', ' ', $value) ?? $value);
if ($value === '' || mb_strlen($value) > self::MAX_LENGTH) {
throw new InvalidStockName;
}
$this->value = $value;
}
}