2022-05-31 14:06:07 +02:00
|
|
|
<?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
|
|
|
|
|
*
|
2022-08-30 13:21:07 +00:00
|
|
|
* @param \App\Models\Credit\Estimation $model
|
2022-05-31 14:06:07 +02:00
|
|
|
* @return boolean
|
|
|
|
|
*/
|
|
|
|
|
protected static function estimateIsPending(Estimation $model): bool
|
|
|
|
|
{
|
|
|
|
|
return $model->status->equals(EstimationStatus::pending());
|
|
|
|
|
}
|
|
|
|
|
}
|