<?php

namespace App\Traits\Purchase;

trait WithCalculateTotal
{
    public function getTotal()
    {
        return $this->purchaseItems->sum(fn ($item) => $item->unit_price * $item->quantity);
    }
}
