{% extends 'base/module.twig' %}

{% block content %}

  <div class="container-fluid">
    <div class="row">
      <div class="col-xs-12">
        <div>
          <div class="row">
            <div class="col-xs-12 col-sm-8">
              <base-card class="padding-large">
                <validation-provider
                  tag="div"
                  rules="required|max:100"
                  class="top-margin-large"
                  name="intelipost_descricao"
                  v-slot="{ errors, valid }">
                  <base-input
                    :label="entry_intelipost_descricao"
                    name="intelipost_descricao"
                    v-model="configurations.intelipost_descricao"
                    maxlength="100"
                    :error="errors[0]"
                    :valid="valid"
                    required>
                  </base-input>
                </validation-provider>

                <validation-provider
                  tag="div"
                  rules="required"
                  class="top-margin-large"
                  name="intelipost_api_key"
                  v-slot="{ errors, valid }">
                  <base-input
                    :label="entry_intelipost_api_key"
                    name="intelipost_api_key"
                    v-model="configurations.intelipost_api_key"
                    {# mask="api_key" #}
                    :error="errors[0]"
                    :valid="valid"
                    required>
                  </base-input>
                </validation-provider>

                <validation-provider
                  tag="div"
                  rules="required"
                  class="top-margin-large"
                  name="intelipost_cep_origem"
                  v-slot="{ errors, valid }">
                  <base-input
                    :label="entry_intelipost_cep_origem"
                    name="intelipost_cep_origem"
                    v-model="configurations.intelipost_cep_origem"
                    mask="cep"
                    :error="errors[0]"
                    :valid="valid"
                    required>
                  </base-input>
                </validation-provider>

                <div class="row no-space-xs bottom-xs top-margin-large">
                      <div class="col-xs-12">
                        <label class="required field-label"> { entry_intelipost_valor_extra }</label>
                      </div>
                      <div class="col-xs right-padding-small">
                        <base-select
                          name="intelipost_tipo_valor_extra"
                          v-model="configurations.intelipost_tipo_valor_extra"
                          required>
                          <option
                          v-for="(value, key) in Type_AcrescimoDesconto"
                          :key="key"
                          :value="key">
                          { value }
                          </option>
                        </base-select>
                      </div>

                    <div class="col-xs left-padding-small">
                      <validation-provider
                        rules="required"
                        name="intelipost_valor_extra"
                        v-slot="{ errors, valid }">
                        <base-input
                          name="intelipost_valor_extra"
                          v-model="configurations.intelipost_valor_extra"
                          :mask="valorextraMask"
                          :error="errors[0]"
                          :valid="valid"
                          required>
                        </base-input>
                      </validation-provider>
                    </div>
                </div>
              
                  <validation-provider
                    tag="div"
                    rules="required|numeric"
                    class="top-margin-large"
                    name="intelipost_prazo_extra"
                    v-slot="{ errors, valid }">
                    <base-input
                      :label="entry_intelipost_prazo_extra"
                      name="intelipost_prazo_extra"
                      v-model="configurations.intelipost_prazo_extra"
                      :error="errors[0]"
                      :valid="valid"
                      mask="integer"
                      maxlength="2"
                      required>
                    </base-input>
                  </validation-provider>

                  <validation-provider
                    tag="div"
                    rules="required"
                    class="top-margin-large"
                    name="intelipost_tipo_cotacao"
                    v-slot="{ errors, valid }">
                    <base-select
                      :label="entry_intelipost_tipo_cotacao"
                      name="intelipost_tipo_cotacao"
                      v-model="configurations.intelipost_tipo_cotacao"
                      :error="errors[0]"
                      :valid="valid"
                      required>
                      <option
                        v-for="(tipo_cotacao, key) in Type_TipoCotacao"
                        :key="key"
                        :value="key">
                        { tipo_cotacao }
                      </option>
                    </base-select>
                  </validation-provider>                  

                  <validation-provider
                    tag="div"
                    class="top-margin-large"
                    rules="numeric"
                    name="intelipost_sort_order"
                    v-slot="{ errors, valid }">
                    <base-input
                      :label="entry_intelipost_sort_order"
                      name="intelipost_sort_order"
                      v-model="configurations.intelipost_sort_order"
                      mask="integer"
                      maxlength="2"
                      :error="errors[0]"
                      :valid="valid">
                    </base-input>
                  </validation-provider>

                  <validation-provider
                    tag="div"
                    rules="required"
                    class="top-margin-large"
                    name="intelipost_geo_zone_id"
                    v-slot="{ errors, valid }">
                    <base-select
                      :label="entry_intelipost_geo_zone_id"
                      name="intelipost_geo_zone_id"
                      v-model="configurations.intelipost_geo_zone_id"
                      :error="errors[0]"
                      :valid="valid"
                      required>
                      <option value="0">{ text_all_zones }</option>
                      <option
                        v-for="(geo_zone, key) in geo_zones"
                        :key="geo_zone.geo_zone_id"
                        :value="geo_zone.geo_zone_id">
                        { geo_zone.name }
                      </option>
                    </base-select>
                  </validation-provider>

                  <validation-provider
                    tag="div"
                    class="top-margin-large"
                    rules="required"
                    name="intelipost_status"
                    v-slot="{ errors, valid }">
                    <base-select
                      :label="entry_intelipost_status"
                      name="intelipost_status"
                      v-model="configurations.intelipost_status"
                      :error="errors[0]"
                      :valid="valid">
                      <option
                        v-for="(value, key) in Type_Status"
                        :key="key"
                        :value="key">
                        { value }
                      </option>
                    </base-select>
                  </validation-provider>                  
              </base-card>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
{% endblock %}
