public function toArray()
    {
        return [
            'id' => $this->id,
            'items' => array_map(function (CartItem $item) {
                return $item->toArray();
            }, $this->items),
        ];
    }