25 lines
572 B
PHP
25 lines
572 B
PHP
<?php
|
|
|
|
namespace App\Policies\Rules;
|
|
|
|
use App\Enums\Credit\EstimationStatus;
|
|
use App\Models\Credit\Estimation;
|
|
use Kwaadpepper\CrudPolicies\Policies\Rules\StaticRules;
|
|
|
|
/**
|
|
* Estimation Policiy Static Rules
|
|
* ! Rules has to return boolean value
|
|
*/
|
|
abstract class EstimationStaticRules extends StaticRules
|
|
{
|
|
/**
|
|
* Estimation is pending
|
|
*
|
|
* @param Estimation $model
|
|
* @return boolean
|
|
*/
|
|
protected static function estimateIsPending(Estimation $model): bool
|
|
{
|
|
return $model->status->equals(EstimationStatus::pending());
|
|
}
|
|
}
|