init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Rules\Sigtap\Procedimento;
use App\Models\Sigtap\Procedimento;
use App\Services\Sigtap\ProcedimentoValidationService;
use Illuminate\Contracts\Validation\Rule;
class Quantidade implements Rule
{
private Procedimento $procedimento;
private ?int $quantidade;
public function __construct(Procedimento $procedimento, ?int $quantidade = null)
{
$this->procedimento = $procedimento;
$this->quantidade = $quantidade;
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
$validation = new ProcedimentoValidationService($this->procedimento);
return $validation->isQuantidadeValid($this->quantidade ?? $value);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return "Quantidade máxima atingida para o :attribute";
}
}