<?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.reinf.esocial.gov.br/schemas/evtFechamento/v1_03_02" targetNamespace="http://www.reinf.esocial.gov.br/schemas/evtFechamento/v1_03_02" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="./xmldsig-core-schema.xsd"/>
  <xs:element name="Reinf">
    <xs:annotation>
      <xs:documentation>EFD-Reinf</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="evtFechaEvPer" minOccurs="1" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>Evento de informações do Contribuinte</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ideEvento" minOccurs="1" maxOccurs="1">
                <xs:annotation>
                  <xs:documentation>Informações de identificação do evento</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="perApur" minOccurs="1" maxOccurs="1">
                      <xs:annotation>
                        <xs:documentation>Informar o ano/mês (formato AAAA-MM) de referência das informações</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:gYearMonth">
                          <xs:pattern value="20([0-9][0-9])-(0[1-9]|1[0-2])"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="tpAmb" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Identificação do ambiente:
                            1 - Produção;
                            2 - Produção restrita;
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:unsignedInt">
                          <xs:pattern value="[1|2]"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="procEmi" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Processo de emissão do evento:
                            1 - Aplicativo do contribuinte.
                            2 - Aplicativo governamental.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:unsignedInt">
                          <xs:pattern value="[1|2]{1}"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="verProc" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Versão do processo de emissão do evento.  Informar a versão do aplicativo emissor 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:element>
              <xs:element name="ideContri" minOccurs="1" maxOccurs="1">
                <xs:complexType>
                  <xs:annotation>
                    <xs:documentation>Informações de identificação do contribuinte</xs:documentation>
                  </xs:annotation>
                  <xs:sequence>
                    <xs:element name="tpInsc" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Preencher com o código correspondente ao tipo de inscrição.
                            Deve ser igual a [1] (CNPJ) ou [2] (CPF)
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:unsignedByte">
                          <xs:pattern value="1|2"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="nrInsc" minOccurs="1" maxOccurs="1">
                      <xs:annotation>
                        <xs:documentation>
                          Informar o número de inscrição do contribuinte de acordo com o tipo de inscrição indicado no campo {tpInsc}.
                          Se for um CNPJ deve ser informada apenas a Raiz/Base de oito posições,
                          exceto se natureza jurídica de administração pública direta federal ([101-5], [104-0], [107-4], [116-3],
                          situação em que o campo deve ser preenchido com o CNPJ completo (14 posições).
                        </xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="8"/>
                          <xs:maxLength value="14"/>
                          <xs:pattern value="[0-9]{11}|[0-9]{8}|[0-9]{14}"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="ideRespInf" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:annotation>
                    <xs:documentation>Responsável pelas informações</xs:documentation>
                  </xs:annotation>
                  <xs:sequence>
                    <xs:element name="nmResp" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Nome do responsável pelas informações.</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="1"/>
                          <xs:maxLength value="70"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="cpfResp" minOccurs="1" maxOccurs="1">
                      <xs:annotation>
                        <xs:documentation>Preencher com o CPF do responsável</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:length value="11"/>
                          <xs:pattern value="[0-9]{11}"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="telefone" minOccurs="0" maxOccurs="1">
                      <xs:annotation>
                        <xs:documentation>Informar o número do telefone, com DDD.</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:maxLength value="13"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="email" minOccurs="0" maxOccurs="1">
                      <xs:annotation>
                        <xs:documentation>Endereço eletrônico</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:maxLength value="60"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="infoFech" minOccurs="1" maxOccurs="1">
                <xs:complexType>
                  <xs:annotation>
                    <xs:documentation>Responsável pelas informações</xs:documentation>
                  </xs:annotation>
                  <xs:sequence>
                    <xs:element name="evtServTm" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Contratou serviços sujeitos à retenção de contribuição previdenciária?
                            S - Sim;
                            N - Não.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:length value="1"/>
                          <xs:enumeration value="S"/>
                          <xs:enumeration value="N"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="evtServPr" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Prestou serviços sujeitos à retenção de contribuição previdenciária?
                            S - Sim;
                            N - Não.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:length value="1"/>
                          <xs:enumeration value="S"/>
                          <xs:enumeration value="N"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="evtAssDespRec" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            A associação desportiva que mantém equipe de futebol profissional,
                            possui informações sobre recursos recebidos?
                            S - Sim;
                            N - Não.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:length value="1"/>
                          <xs:enumeration value="S"/>
                          <xs:enumeration value="N"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="evtAssDespRep" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Possui informações sobre repasses efetuados à associação desportiva que
                            mantém equipe de futebol profissional?
                            S - Sim;
                            N - Não.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:length value="1"/>
                          <xs:enumeration value="S"/>
                          <xs:enumeration value="N"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="evtComProd" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            O produtor rural PJ/Agroindústria possui informações de comercialização de produção?
                            S - Sim;
                            N - Não.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:length value="1"/>
                          <xs:enumeration value="S"/>
                          <xs:enumeration value="N"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="evtCPRB" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Possui informações sobre a apuração da Contribuição Previdenciária sobre a Receita Bruta?
                            S - Sim;
                            N - Não
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:length value="1"/>
                          <xs:enumeration value="S"/>
                          <xs:enumeration value="N"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="evtPgtos" minOccurs="1" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Possui informações de pagamento diversos  no período de apuração?
                            S - Sim;
                            N - Não.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:length value="1"/>
                          <xs:enumeration value="S"/>
                          <xs:enumeration value="N"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="compSemMovto" minOccurs="0" maxOccurs="1">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>
                            Informar a primeira competência a partir da qual não houve movimento,
                            cuja situação perdura até a competência atual.
                          </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:gYearMonth">
                          <xs:pattern value="20([0-9][0-9])-(0[1-9]|1[0-2])"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="id" use="required" >
              <xs:annotation>
                <xs:documentation>Identificador do Evento</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:ID" >
                  <xs:length value="36" />
                  <xs:pattern value="I{1}D{1}[0-9]{34}" />
                </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
        <xs:element ref="ds:Signature"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
