<?php
declare(strict_types=1);

namespace App\Modules\SportsActivity\Models;

use App\Core\Model;
use App\Core\App;

class AcademyContract extends Model
{
    protected static string $table = 'sa_academy_contracts';
    protected static string $primaryKey = 'id';
    protected static bool $timestamps = true;
    protected static bool $softDelete = true;
    protected static bool $dispatchEvents = true;
    protected static bool $autoTrackAuthor = true;

    protected static array $fillable = [
        'contract_number',
        'academy_id',
        'contract_type',
        'start_date',
        'end_date',
        'club_commission_pct',
        'academy_share_pct',
        'fixed_monthly_rent',
        'minimum_revenue_guarantee',
        'deposit_amount',
        'deposit_status',
        'contract_pdf_path',
        'status',
        'approved_by',
        'approved_at',
        'terminated_by',
        'terminated_at',
        'termination_reason',
        'terms_json',
        'notes',
        'branch_id',
    ];

    /**
     * Get contract type options with Arabic labels.
     */
    public static function getContractTypeOptions(): array
    {
        return [
            'revenue_share' => 'نسبة من الإيرادات',
            'fixed_rent'    => 'إيجار ثابت',
            'hybrid'        => 'مختلط',
        ];
    }

    /**
     * Get contract status options with Arabic labels.
     */
    public static function getStatusOptions(): array
    {
        return [
            'draft'            => 'مسودة',
            'pending_approval' => 'قيد الاعتماد',
            'active'           => 'ساري',
            'suspended'        => 'موقوف',
            'expired'          => 'منتهي',
            'terminated'       => 'ملغى',
        ];
    }

    /**
     * Get deposit status options with Arabic labels.
     */
    public static function getDepositStatusOptions(): array
    {
        return [
            'pending'   => 'قيد السداد',
            'paid'      => 'مدفوع',
            'returned'  => 'مسترد',
            'forfeited' => 'مصادر',
        ];
    }
}
