<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.esocial.gov.br/schema/evt/evtConvInterm/v02_04_01" targetNamespace="http://www.esocial.gov.br/schema/evt/evtConvInterm/v02_04_01" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
  <xs:element name="eSocial">
    <xs:annotation>
      <xs:documentation>eSocial</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="evtConvInterm">
          <xs:annotation>
            <xs:documentation>Evento Convocação para Trabalho Intermitente</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ideEvento" type="TIdeEveTrab">
                <xs:annotation>
                  <xs:documentation>Informações de Identificação do Evento</xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:element name="ideEmpregador" type="TEmpregador">
                <xs:annotation>
                  <xs:documentation>Informações de identificação do empregador</xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:element name="ideVinculo" type="TIdeVinculoNisObrig">
                <xs:annotation>
                  <xs:documentation>Informações de Identificação do Trabalhador e do Vínculo</xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:element name="infoConvInterm">
                <xs:annotation>
                  <xs:documentation>Informações da convocação para trabalho intermitente</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="codConv">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Código que identifica a convocação para trabalho intermitente</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="1"/>
                          <xs:maxLength value="30"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="dtInicio">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Data de Início</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:date">
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="dtFim">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Data Fim</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:date">
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="jornada">
                      <xs:annotation>
                        <xs:documentation>Informações da(s) jornada(s) diária(s) da prestação de trabalho intermitente</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="codHorContrat" minOccurs="0">
                            <xs:simpleType>
                              <xs:annotation>
                                <xs:documentation>Código do Horário Contratual</xs:documentation>
                              </xs:annotation>
                              <xs:restriction base="xs:string">
                                <xs:minLength value="1"/>
                                <xs:maxLength value="30"/>
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                          <xs:element name="dscJornada" minOccurs="0">
                            <xs:simpleType>
                              <xs:annotation>
                                <xs:documentation>Descrição das jornadas e dos dias da prestação de trabalho intermitente.</xs:documentation>
                              </xs:annotation>
                              <xs:restriction base="xs:string">
                                <xs:minLength value="3"/>
                                <xs:maxLength value="999"/>
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="localTrab">
                      <xs:annotation>
                        <xs:documentation>Informações do local da prestação de trabalho intermitente</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="indLocal">
                            <xs:simpleType>
                              <xs:annotation>
                                <xs:documentation>Indicativo do local da prestação de trabalho intermitente</xs:documentation>
                              </xs:annotation>
                              <xs:restriction base="xs:byte">
                                <xs:pattern value="\d"/>
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                          <xs:element name="localTrabInterm" minOccurs="0">
                            <xs:annotation>
                              <xs:documentation>Informações do local de trabalho intermitente, quando prestado em apenas um local e fora do estabelecimento do empregador cadastrado no S-2200/S-2206</xs:documentation>
                            </xs:annotation>
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="tpLograd">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Tipo de Logradouro</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:string">
                                      <xs:minLength value="1"/>
                                      <xs:maxLength value="4"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="dscLograd">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Descrição do logradouro</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:string">
                                      <xs:minLength value="1"/>
                                      <xs:maxLength value="80"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="nrLograd">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Número do logradouro</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:string">
                                      <xs:minLength value="1"/>
                                      <xs:maxLength value="10"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="complem" minOccurs="0">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Complemento</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:string">
                                      <xs:maxLength value="30"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="bairro" minOccurs="0">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Nome do bairro/distrito.</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:string">
                                      <xs:minLength value="1"/>
                                      <xs:maxLength value="60"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="cep">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Código de Endereçamento Postal - CEP</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:string">
                                      <xs:pattern value="\d{8}"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="codMunic">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Código do Município</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:integer">
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="uf">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Sigla da UF</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:string">
                                      <xs:enumeration value="AC"/>
                                      <xs:enumeration value="AL"/>
                                      <xs:enumeration value="AP"/>
                                      <xs:enumeration value="AM"/>
                                      <xs:enumeration value="BA"/>
                                      <xs:enumeration value="CE"/>
                                      <xs:enumeration value="DF"/>
                                      <xs:enumeration value="ES"/>
                                      <xs:enumeration value="GO"/>
                                      <xs:enumeration value="MA"/>
                                      <xs:enumeration value="MT"/>
                                      <xs:enumeration value="MS"/>
                                      <xs:enumeration value="MG"/>
                                      <xs:enumeration value="PA"/>
                                      <xs:enumeration value="PB"/>
                                      <xs:enumeration value="PR"/>
                                      <xs:enumeration value="PE"/>
                                      <xs:enumeration value="PI"/>
                                      <xs:enumeration value="RJ"/>
                                      <xs:enumeration value="RN"/>
                                      <xs:enumeration value="RS"/>
                                      <xs:enumeration value="RO"/>
                                      <xs:enumeration value="RR"/>
                                      <xs:enumeration value="SC"/>
                                      <xs:enumeration value="SP"/>
                                      <xs:enumeration value="SE"/>
                                      <xs:enumeration value="TO"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="Id" type="xs:ID" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element ref="ds:Signature"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="TIdeEveTrab">
    <xs:annotation>
      <xs:documentation>Identificação do evento</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="indRetif">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Indicativo de Retificação</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="nrRecibo" minOccurs="0">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Recibo arquivo a ser retificado</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="40"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="tpAmb">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Tipo de ambiente</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="procEmi">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Processo de emissão do evento</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="verProc">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Versão do processo de emissão do evento. </xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="20"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TEmpregador">
    <xs:sequence>
      <xs:element name="tpInsc">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Tipo de Inscrição, conforme tabela 5.</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="nrInsc">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Número de Inscrição</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:pattern value="\d{8,15}"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TIdeVinculoNisObrig">
    <xs:annotation>
      <xs:documentation>Informações do Vínculo</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="cpfTrab">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>CPF do trabalhador</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:length value="11"/>
            <xs:pattern value="\d{11}"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="nisTrab">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>NIS</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="11"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="matricula">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Matricula</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="30"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>
