<?php

namespace App\Policies;

use App\Models\User;
use App\Models\ManualPayment;

class ManualPaymentPolicy
{
    public function before(User $user, $ability)
    {
        if ($user->isAdmin()) return true;
    }

    public function view(User $user, ManualPayment $payment)
    {
        return $user->id === $payment->subscription->user_id;
    }

    public function create(User $user)
    {
        return true; // Any logged-in member/leasing can pay for their sub
    }
}
