<?php

namespace App\Policies;

use App\Models\Dsar\Dsar;
use App\Models\Dsar\DsarTranche;
use App\Models\User\User;

class DsarPolicy {

    public function viewAny(User $user): bool {
        return $user->can('dsars.view');
    }

    public function view(User $user, Dsar $dsar): bool {
        return $user->can('dsars.view');
    }

    public function logResponse(User $user, Dsar $dsar): bool {
        return $user->can('dsars.responses.log');
    }

    public function edit(User $user, Dsar $dsar): bool {
        return $user->can('dsars.responses.log');
    }

    public function viewTranche(User $user, DsarTranche $tranche): bool {
        return $user->can('dsars.tranche.view');
    }

    public function sendBatch(User $user, DsarTranche $tranche): bool {
        return $user->can('dsars.batch.send');
    }

    public function create(User $user): bool {
        return $user->can('dsars.create');
    }

    public function markPosted(User $user, Dsar $dsar): bool {
        return $user->can('dsars.mark-posted');
    }

    public function delete(User $user, Dsar $dsar): bool {
        return $user->can('dsars.delete');
    }
}
