<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class Partner extends BaseModel
{
    use SoftDeletes;

    protected function casts(): array
    {
        return [
            'is_super_partner' => 'boolean', 'verification_docs' => 'array',
            'verified_at' => 'datetime', 'commission_rate' => 'decimal:2',
            'total_earnings' => 'decimal:2', 'pending_payouts' => 'decimal:2',
            'average_rating' => 'decimal:2',
        ];
    }

    public function user(): BelongsTo { return $this->belongsTo(User::class); }
    public function listings(): HasMany { return $this->hasMany(Listing::class); }
    public function payouts(): HasMany { return $this->hasMany(Payout::class); }
}