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.
- package/dist/dao/model/eventos-exportacao-model.d.ts +2 -1
- package/dist/dao/model/general-models.d.ts +18 -0
- package/dist/dao/model/general-models.js +11 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -4
- package/dist/unificacao-eventos-repetidos.d.ts +5 -3
- package/dist/unificacao-eventos-repetidos.js +2 -2
- package/dist/utils.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
-
|
|
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({
|
|
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({
|
|
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({
|
|
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