<?php

class Seguro_Validator_CotacaoCompleta
{
    /**
     * @param array $parametros
     * @return bool
     * @throws Zend_Controller_Action_Exception
     */
    public static function temParametrosObrigatorios(array $parametros): bool
    {
        if (empty($parametros['estado']) || empty($parametros['municipio'])) {
            throw new Zend_Controller_Action_Exception('Estado e/ou Município não informado(s).', 400);
        }

        if (empty($parametros['unidades'])) {
            throw new Zend_Controller_Action_Exception('Unidades não informadas.', 400);
        }

        if (!Sistema_Enum_Estado::validarSigla($parametros['estado'])) {
            throw new Zend_Controller_Action_Exception('Sigla de estado inválida.', 400);
        }

        if (empty($parametros['id_produto'])) {
            throw new Zend_Controller_Action_Exception('Produto não informado.', 400);
        }

        return true;
    }
}