*/ final readonly class Stock implements AggregateRoot, HasTimestampIdentifier { private function __construct( public StockId $id, public StockAmount $stockAmount, public StockAdjustment $stockAdjustment, public CampaignCode $campaignCode, public ProcessingCode $processingCode, public ?\DateTimeInterface $updatedAt = null, ) { } public function id(): StockId { return $this->id; } public function createdAt(): \DateTimeInterface { return $this->id->toDateTime(); } public function updatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public static function hydrate( StockId $id, StockAmount $stockAmount, StockAdjustment $stockAdjustment, CampaignCode $campaignCode, ProcessingCode $processingCode, ?\DateTimeInterface $updatedAt = null, ): self { return new self( id: $id, stockAmount: $stockAmount, stockAdjustment: $stockAdjustment, campaignCode: $campaignCode, processingCode: $processingCode, updatedAt: $updatedAt, ); } }