<?php

namespace App\Helpers\Validations;

class AuditHelper
{
    public static function getAuditStatus($is_concluded, $is_approved, $rejection_reason, $auditor)
    {
        $has_rejection_reason = !in_array($rejection_reason, [null, ""]);
        $has_rejection_auditor = !in_array($auditor, [null, ""]);

        if ($is_concluded && $is_approved && !$has_rejection_reason && $has_rejection_auditor)
            return __('neutral_words')['approved'];

        if ($is_concluded && !$is_approved && $has_rejection_reason && $has_rejection_auditor)
            return __('neutral_words')['rejected'];

        return __('neutral_words')['pending'];
    }
}
