<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;

class DailyProductSummary extends BasePosModel
{
    protected $table = 'daily_product_summary';

    protected function casts(): array
    {
        return [
            'summary_date' => 'date',
            'quantity_sold' => 'decimal:4',
            'quantity_returned' => 'decimal:4',
            'gross_revenue' => 'decimal:4',
            'total_cost' => 'decimal:4',
            'gross_profit' => 'decimal:4',
        ];
    }

    public function branch(): BelongsTo
    {
        return $this->belongsTo(Branch::class);
    }

    public function product(): BelongsTo
    {
        return $this->belongsTo(Product::class);
    }
}
