Skip to content

open-nfse / DetalheEvento

Type Alias: DetalheEvento

ts
type DetalheEvento = 
  | {
  e101101: {
     cMotivo: JustificativaCancelamento;
     xDesc: string;
     xMotivo: string;
  };
}
  | {
  e105102: {
     chSubstituta: string;
     cMotivo: JustificativaSubstituicao;
     xDesc: string;
     xMotivo?: string;
  };
}
  | {
  e101103: {
     cMotivo: JustificativaAnaliseFiscalCancelamento;
     xDesc: string;
     xMotivo: string;
  };
}
  | {
  e105104: {
     cMotivo: JustificativaAnaliseFiscalCancelamentoDeferido;
     CPFAgTrib: string;
     nProcAdm?: string;
     xDesc: string;
     xMotivo: string;
  };
}
  | {
  e105105: {
     cMotivo: JustificativaAnaliseFiscalCancelamentoIndeferido;
     CPFAgTrib: string;
     nProcAdm?: string;
     xDesc: string;
     xMotivo: string;
  };
}
  | {
  e202201: {
     xDesc: string;
  };
}
  | {
  e203202: {
     xDesc: string;
  };
}
  | {
  e204203: {
     xDesc: string;
  };
}
  | {
  e205204: {
     xDesc: string;
  };
}
  | {
  e202205: {
     infRej: InfoEventoRejeicao;
     xDesc: string;
  };
}
  | {
  e203206: {
     infRej: InfoEventoRejeicao;
     xDesc: string;
  };
}
  | {
  e204207: {
     infRej: InfoEventoRejeicao;
     xDesc: string;
  };
}
  | {
  e205208: {
     infAnRej: InfoEventoAnulacaoRejeicao;
     xDesc: string;
  };
}
  | {
  e305101: {
     CPFAgTrib: string;
     nProcAdm: string;
     xDesc: string;
     xProcAdm: string;
  };
}
  | {
  e305102: {
     codEvento: string;
     CPFAgTrib: string;
     xDesc: string;
     xMotivo: string;
  };
}
  | {
  e305103: {
     CPFAgTrib: string;
     idBloqOfic: string;
     xDesc: string;
  };
}
  | {
  unknown: {
     elementName: string;
     raw: XmlObject;
     tipoEvento: string;
  };
};

Defined in: src/eventos/parse-event.ts:70

Detalhe do evento — discriminated union cobrindo todos os 16 tipos definidos em tiposEventos_v1.01.xsd + uma variante unknown que preserva o nó XML bruto para variantes que a lib ainda não modelou (defensivo — a Receita pode adicionar novos tipos por Nota Técnica).

Narrow via in operator:

ts
if ('e101101' in detalhe) { ... detalhe.e101101.xMotivo ... }

Licença MIT — biblioteca não oficial, sem vínculo com a Receita Federal.