<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class ClientContributionSummary extends Model
{
    use HasFactory;



    protected $table = 'client_contribution_summaries';
    protected $primaryKey = 'id';

    protected $fillable = [
        'client_id', 'client_name', 'area_size', 'seed_id', 'seed_name', 
        'total_contribution', 'gross_total', 'net_total', 'order_id', 'visit_id', 
        'category', 'item_name', 'unit', 'quantity', 'unit_price', 'total_price', 'created_by'
    ];
  


    /**
     * Get the client that owns the contribution summary.
     */
    public function client(): BelongsTo
    {
        return $this->belongsTo(Client::class);
    }

    /**
     * Get the seed that owns the contribution summary.
     */
    public function seed(): BelongsTo
    {
        return $this->belongsTo(Seed::class);
    }

    /**
     * Get the order that owns the contribution summary.
     */
    public function order(): BelongsTo
    {
        return $this->belongsTo(Order::class);
    }

    /**
     * Get the visit that owns the contribution summary.
     */
    public function visit(): BelongsTo
    {
        return $this->belongsTo(Visit::class);
    }

   
    
}
