flit-modulo-exportacoes 2.0.57 → 2.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
+ import { TipoEventoExportacao } from './general-models';
1
2
  export declare class SourceEventosExportacao {
2
3
  forma_envio_faltas: string;
3
4
  eventos: {
4
- [key: string]: string;
5
+ [key in TipoEventoExportacao]: string;
5
6
  };
6
7
  constructor(eventoExportacao: Partial<SourceEventosExportacao>);
7
8
  }
@@ -91,6 +91,24 @@ export interface PayloadExportacaoPadrao {
91
91
  departamentos_ids?: Array<string>;
92
92
  tipos_eventos: Array<TiposEventosExportar>;
93
93
  }
94
+ /**
95
+ * Enum da forma de exportação da Alterdata.
96
+ *
97
+ * @interface EnumFormaExportacaoAlterdata
98
+ */
99
+ export declare enum EnumFormaExportacaoAlterdata {
100
+ ECONTADOR = "ECONTADOR",
101
+ ARQUIVO_TEXTO = "ARQUIVO_TEXTO"
102
+ }
103
+ /**
104
+ * Interface do modelo do payload da função de exportação da Alterdata.
105
+ *
106
+ * @interface PayloadExportacaoAlterdata
107
+ */
108
+ export interface PayloadExportacaoAlterdata extends PayloadExportacaoPadrao {
109
+ tipo_movimento_econtador_id?: string;
110
+ forma_exportacao_alterdata?: EnumFormaExportacaoAlterdata;
111
+ }
94
112
  /**
95
113
  * Interface do modelo do payload das funções de exportação.
96
114
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TipoFolhaExportacao = exports.TiposEventosExportar = exports.TipoEventoExportacao = void 0;
3
+ exports.EnumFormaExportacaoAlterdata = exports.TipoFolhaExportacao = exports.TiposEventosExportar = exports.TipoEventoExportacao = void 0;
4
4
  /**
5
5
  * Enum com a declaração dos campos do objeto "eventos" da coleção "eventos_exportacoes".
6
6
  *
@@ -79,3 +79,13 @@ var TipoFolhaExportacao;
79
79
  TipoFolhaExportacao["NORMAL"] = "NORMAL";
80
80
  TipoFolhaExportacao["COMPLEMENTAR"] = "COMPLEMENTAR";
81
81
  })(TipoFolhaExportacao = exports.TipoFolhaExportacao || (exports.TipoFolhaExportacao = {}));
82
+ /**
83
+ * Enum da forma de exportação da Alterdata.
84
+ *
85
+ * @interface EnumFormaExportacaoAlterdata
86
+ */
87
+ var EnumFormaExportacaoAlterdata;
88
+ (function (EnumFormaExportacaoAlterdata) {
89
+ EnumFormaExportacaoAlterdata["ECONTADOR"] = "ECONTADOR";
90
+ EnumFormaExportacaoAlterdata["ARQUIVO_TEXTO"] = "ARQUIVO_TEXTO";
91
+ })(EnumFormaExportacaoAlterdata = exports.EnumFormaExportacaoAlterdata || (exports.EnumFormaExportacaoAlterdata = {}));
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export declare function calcularValoresExportacao({ contaId, dataFinal, dataInic
17
17
  jornadas: Array<SearchHit<SourceJornada>>;
18
18
  eventosExportacao: Array<TipoEventoExportacao>;
19
19
  parametrosIntegracao: {
20
- [key: string]: string;
20
+ [key in TipoEventoExportacao]: string;
21
21
  };
22
22
  }): Promise<ValoresEventosExportacao>;
23
23
  export declare function retornaValorEvento(tipoEvento: TipoEventoExportacao, valoresEventos: ValoresEventosExportacao): ValorEventoExportacao | ValorEventoExportacaoFalta;
package/dist/index.js CHANGED
@@ -172,10 +172,7 @@ function aplicarFatorConversaoValoresEventos(valoresEventos) {
172
172
  };
173
173
  }
174
174
  function exportarHorasExtrasEvento({ tipoEventoExportacao, eventosExportacao, parametrosIntegracao }) {
175
- if ((parametrosIntegracao ?? {})[tipoEventoExportacao]) {
176
- return eventosExportacao.includes(tipoEventoExportacao);
177
- }
178
- return false;
175
+ return Boolean((parametrosIntegracao ?? {})[tipoEventoExportacao]) && eventosExportacao.includes(tipoEventoExportacao);
179
176
  }
180
177
  async function calcularValoresExportacao({ contaId, dataFinal, dataInicial, elasticClient, empresas, jornadas, eventosExportacao, parametrosIntegracao }) {
181
178
  const feriados = await new feriados_elastic_1.FeriadosElastic(elasticClient).getFeriadosElastic({
@@ -1,10 +1,12 @@
1
- import { ValoresEventosExportacao } from './dao/model/general-models';
1
+ import { TipoEventoExportacao, ValoresEventosExportacao } from './dao/model/general-models';
2
2
  export declare class UnificacaoEventosRepetidos {
3
3
  private adicionarEvento;
4
4
  private agruparArray;
5
5
  private processarValoresCodigosRepetidos;
6
- unificarEventosComCodigosRepetidos({ parametrosIntegracao, valoresEventos }: {
7
- parametrosIntegracao: any;
6
+ unificarEventosComCodigosRepetidos({ valoresEventos, parametrosIntegracao }: {
8
7
  valoresEventos: ValoresEventosExportacao;
8
+ parametrosIntegracao: {
9
+ [key in TipoEventoExportacao]: string;
10
+ };
9
11
  }): void;
10
12
  }
@@ -18,7 +18,7 @@ class UnificacaoEventosRepetidos {
18
18
  [item[campo]]: [...(acc[item[campo]] ?? []), item]
19
19
  }), {});
20
20
  }
21
- processarValoresCodigosRepetidos({ valoresEventos, eventosAgrupados }) {
21
+ processarValoresCodigosRepetidos({ eventosAgrupados, valoresEventos }) {
22
22
  let somatorioHoras = 0;
23
23
  let somatorioMinutos = 0;
24
24
  for (let index = 0; index < eventosAgrupados.length; index++) {
@@ -308,7 +308,7 @@ class UnificacaoEventosRepetidos {
308
308
  break;
309
309
  }
310
310
  }
311
- unificarEventosComCodigosRepetidos({ parametrosIntegracao, valoresEventos }) {
311
+ unificarEventosComCodigosRepetidos({ valoresEventos, parametrosIntegracao }) {
312
312
  const codigosEventos = new Array();
313
313
  for (const tipoEvento of Object.values(Object.freeze(general_models_1.TipoEventoExportacao))) {
314
314
  this.adicionarEvento({
package/dist/utils.d.ts CHANGED
@@ -40,4 +40,5 @@ export declare function getDadosCadastraisExportacao({ usuarioId, empresaId, jor
40
40
  codigoExternoFuncionario: string;
41
41
  integracao_empresa?: DadosIntegracao;
42
42
  integracao_usuario?: DadosIntegracao;
43
+ integracao_departamento?: DadosIntegracao;
43
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-modulo-exportacoes",
3
- "version": "2.0.57",
3
+ "version": "2.0.59",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": {