flit-modulo-exportacoes 2.0.34 → 2.0.36
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/jornadas-elastic.d.ts +2 -1
- package/dist/dao/jornadas-elastic.js +11 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +78 -27
- package/dist/models.d.ts +0 -29
- package/package.json +5 -5
|
@@ -2,11 +2,12 @@ import { ElasticBase } from './elastic-base';
|
|
|
2
2
|
import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
|
|
3
3
|
export declare class JornadasElastic extends ElasticBase {
|
|
4
4
|
private internalGetJornadasElastic;
|
|
5
|
-
getJornadasElastic({ contaId, dataFinal, usuarioId, empresaId, dataInicial }: {
|
|
5
|
+
getJornadasElastic({ contaId, dataFinal, usuarioId, empresaId, dataInicial, departamentoId }: {
|
|
6
6
|
contaId: string;
|
|
7
7
|
dataFinal: Date;
|
|
8
8
|
empresaId: string;
|
|
9
9
|
usuarioId?: string;
|
|
10
10
|
dataInicial: Date;
|
|
11
|
+
departamentoId?: string;
|
|
11
12
|
}): Promise<Array<SearchHit<any>>>;
|
|
12
13
|
}
|
|
@@ -7,7 +7,7 @@ exports.JornadasElastic = void 0;
|
|
|
7
7
|
const moment_1 = __importDefault(require("moment"));
|
|
8
8
|
const elastic_base_1 = require("./elastic-base");
|
|
9
9
|
class JornadasElastic extends elastic_base_1.ElasticBase {
|
|
10
|
-
async internalGetJornadasElastic({ fim, inicio, contaId, empresaId, usuarioId }) {
|
|
10
|
+
async internalGetJornadasElastic({ fim, inicio, contaId, empresaId, usuarioId, departamentoId }) {
|
|
11
11
|
const queryMust = new Array();
|
|
12
12
|
queryMust.push({
|
|
13
13
|
match: {
|
|
@@ -26,6 +26,13 @@ class JornadasElastic extends elastic_base_1.ElasticBase {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
if (departamentoId) {
|
|
30
|
+
queryMust.push({
|
|
31
|
+
match: {
|
|
32
|
+
'usuario.departamento.uid': departamentoId
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
29
36
|
queryMust.push({
|
|
30
37
|
range: {
|
|
31
38
|
data_hora: {
|
|
@@ -72,13 +79,14 @@ class JornadasElastic extends elastic_base_1.ElasticBase {
|
|
|
72
79
|
}]
|
|
73
80
|
});
|
|
74
81
|
}
|
|
75
|
-
async getJornadasElastic({ contaId, dataFinal, usuarioId, empresaId, dataInicial }) {
|
|
82
|
+
async getJornadasElastic({ contaId, dataFinal, usuarioId, empresaId, dataInicial, departamentoId }) {
|
|
76
83
|
return await this.retornaTodosDadosPaginacaoElastic(await this.internalGetJornadasElastic({
|
|
77
84
|
fim: dataFinal,
|
|
78
85
|
contaId: contaId,
|
|
79
86
|
inicio: dataInicial,
|
|
80
87
|
empresaId: empresaId,
|
|
81
|
-
usuarioId: usuarioId
|
|
88
|
+
usuarioId: usuarioId,
|
|
89
|
+
departamentoId: departamentoId
|
|
82
90
|
}));
|
|
83
91
|
}
|
|
84
92
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from '@elastic/elasticsearch';
|
|
2
2
|
import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
|
|
3
|
-
import { PayloadExportacaoPadrao, TipoEventoExportacao,
|
|
3
|
+
import { PayloadExportacaoPadrao, TipoEventoExportacao, TiposEventosExportar, ValoresEventosExportacao, ValorEventoExportacao, ValorEventoExportacaoFalta } from './models';
|
|
4
4
|
export declare function validarDadosPayload({ fn, data, validarCampoReferencia }: {
|
|
5
5
|
fn: () => Array<string>;
|
|
6
6
|
data: PayloadExportacaoPadrao;
|
|
@@ -16,4 +16,4 @@ export declare function calcularValoresExportacao({ contaId, dataFinal, dataInic
|
|
|
16
16
|
jornadas: Array<SearchHit<any>>;
|
|
17
17
|
}): Promise<ValoresEventosExportacao>;
|
|
18
18
|
export declare function retornaValorEvento(tipoEvento: TipoEventoExportacao, valoresEventos: ValoresEventosExportacao): ValorEventoExportacao | ValorEventoExportacaoFalta;
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function processarTiposEventosExportacao(tiposEventos: Array<TiposEventosExportar>): Array<TipoEventoExportacao>;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.processarTiposEventosExportacao = exports.retornaValorEvento = exports.calcularValoresExportacao = exports.validarDadosPayload = void 0;
|
|
4
4
|
const contas_elastic_1 = require("./dao/contas-elastic");
|
|
5
5
|
const feriados_elastic_1 = require("./dao/feriados-elastic");
|
|
6
6
|
const flit_calcular_jornada_1 = require("flit-calcular-jornada");
|
|
@@ -429,30 +429,81 @@ function retornaValorEvento(tipoEvento, valoresEventos) {
|
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
exports.retornaValorEvento = retornaValorEvento;
|
|
432
|
-
function
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
432
|
+
function processarTiposEventosExportacao(tiposEventos) {
|
|
433
|
+
const retorno = new Array();
|
|
434
|
+
if (tiposEventos.length <= 0) {
|
|
435
|
+
for (const tipoEvento of Object.values(Object.freeze(models_1.TipoEventoExportacao))) {
|
|
436
|
+
retorno.push(tipoEvento);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.FALTA)) {
|
|
441
|
+
retorno.push(models_1.TipoEventoExportacao.FALTA);
|
|
442
|
+
}
|
|
443
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.ATRASO)) {
|
|
444
|
+
retorno.push(models_1.TipoEventoExportacao.ATRASO);
|
|
445
|
+
}
|
|
446
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_NORMAL)) {
|
|
447
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_NORMAL);
|
|
448
|
+
}
|
|
449
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_NOTURNA)) {
|
|
450
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_NOTURNA);
|
|
451
|
+
}
|
|
452
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_SAB)) {
|
|
453
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_SAB);
|
|
454
|
+
}
|
|
455
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_DOM)) {
|
|
456
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_DOM);
|
|
457
|
+
}
|
|
458
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_FER)) {
|
|
459
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_FER);
|
|
460
|
+
}
|
|
461
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORAS_TRABALHADAS)) {
|
|
462
|
+
retorno.push(models_1.TipoEventoExportacao.HORAS_TRABALHADAS);
|
|
463
|
+
}
|
|
464
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_SEG_SEX)) {
|
|
465
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_SEG_SEX);
|
|
466
|
+
}
|
|
467
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORAS_NOTURNAS_TOTAIS)) {
|
|
468
|
+
retorno.push(models_1.TipoEventoExportacao.HORAS_NOTURNAS_TOTAIS);
|
|
469
|
+
}
|
|
470
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_NOTURNA_SAB)) {
|
|
471
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_NOTURNA_SAB);
|
|
472
|
+
}
|
|
473
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_NOTURNA_DOM)) {
|
|
474
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_NOTURNA_DOM);
|
|
475
|
+
}
|
|
476
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_NOTURNA_FER)) {
|
|
477
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_NOTURNA_FER);
|
|
478
|
+
}
|
|
479
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_INTRAJORNADA)) {
|
|
480
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_INTRAJORNADA);
|
|
481
|
+
}
|
|
482
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_NOTURNA_SEG_SEX)) {
|
|
483
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_NOTURNA_SEG_SEX);
|
|
484
|
+
}
|
|
485
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.FAIXA_HORA_EXTRA_SEMANAL_1)) {
|
|
486
|
+
retorno.push(models_1.TipoEventoExportacao.FAIXA_HORA_EXTRA_SEMANAL_1);
|
|
487
|
+
}
|
|
488
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.FAIXA_HORA_EXTRA_SEMANAL_2)) {
|
|
489
|
+
retorno.push(models_1.TipoEventoExportacao.FAIXA_HORA_EXTRA_SEMANAL_2);
|
|
490
|
+
}
|
|
491
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.FAIXA_HORA_EXTRA_SEMANAL_3)) {
|
|
492
|
+
retorno.push(models_1.TipoEventoExportacao.FAIXA_HORA_EXTRA_SEMANAL_3);
|
|
493
|
+
}
|
|
494
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.FAIXA_HORA_EXTRA_DIFERENCIADA_1)) {
|
|
495
|
+
retorno.push(models_1.TipoEventoExportacao.FAIXA_HORA_EXTRA_DIFERENCIADA_1);
|
|
496
|
+
}
|
|
497
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.FAIXA_HORA_EXTRA_DIFERENCIADA_2)) {
|
|
498
|
+
retorno.push(models_1.TipoEventoExportacao.FAIXA_HORA_EXTRA_DIFERENCIADA_2);
|
|
499
|
+
}
|
|
500
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.FAIXA_HORA_EXTRA_DIFERENCIADA_3)) {
|
|
501
|
+
retorno.push(models_1.TipoEventoExportacao.FAIXA_HORA_EXTRA_DIFERENCIADA_3);
|
|
502
|
+
}
|
|
503
|
+
if (tiposEventos.includes(models_1.TiposEventosExportar.HORA_EXTRA_INTRAJORNADA_COM_REDUCAO)) {
|
|
504
|
+
retorno.push(models_1.TipoEventoExportacao.HORA_EXTRA_INTRAJORNADA_COM_REDUCAO);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
return retorno;
|
|
457
508
|
}
|
|
458
|
-
exports.
|
|
509
|
+
exports.processarTiposEventosExportacao = processarTiposEventosExportacao;
|
package/dist/models.d.ts
CHANGED
|
@@ -27,35 +27,6 @@ export declare enum TipoEventoExportacao {
|
|
|
27
27
|
FAIXA_HORA_EXTRA_DIFERENCIADA_3 = "faixa_hora_extra_diferenciada_3",
|
|
28
28
|
HORA_EXTRA_INTRAJORNADA_COM_REDUCAO = "hora_extra_intrajornada_com_reducao"
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Interface com a declaração dos campos do objeto que será retornado para o manager saber quais campos serão exportados.
|
|
32
|
-
*
|
|
33
|
-
* @interface TipoEventoExportacao
|
|
34
|
-
*/
|
|
35
|
-
export interface TiposEventosExportacaoArquivo {
|
|
36
|
-
enviarFaltas: boolean;
|
|
37
|
-
enviarAtrasos: boolean;
|
|
38
|
-
enviarMinutosNormais: boolean;
|
|
39
|
-
enviarMinutosNoturnos: boolean;
|
|
40
|
-
enviarMinutosExtrasSab: boolean;
|
|
41
|
-
enviarMinutosExtrasDom: boolean;
|
|
42
|
-
enviarMinutosExtrasFer: boolean;
|
|
43
|
-
enviarMinutosTrabalhados: boolean;
|
|
44
|
-
enviarMinutosExtrasSegSex: boolean;
|
|
45
|
-
enviarMinutosFaixaSemanal1: boolean;
|
|
46
|
-
enviarMinutosFaixaSemanal2: boolean;
|
|
47
|
-
enviarMinutosFaixaSemanal3: boolean;
|
|
48
|
-
enviarMinutosNoturnosTotais: boolean;
|
|
49
|
-
enviarMinutosExtrasNoturnosSab: boolean;
|
|
50
|
-
enviarMinutosExtrasNoturnosDom: boolean;
|
|
51
|
-
enviarMinutosExtrasNoturnosFer: boolean;
|
|
52
|
-
enviarMinutosExtrasIntrajornada: boolean;
|
|
53
|
-
enviarMinutosFaixaDiferenciada1: boolean;
|
|
54
|
-
enviarMinutosFaixaDiferenciada2: boolean;
|
|
55
|
-
enviarMinutosFaixaDiferenciada3: boolean;
|
|
56
|
-
enviarMinutosExtrasNoturnosSegSex: boolean;
|
|
57
|
-
enviarMinutosExtrasIntrajornadaComReducao: boolean;
|
|
58
|
-
}
|
|
59
30
|
/**
|
|
60
31
|
* Enum com a declaração dos tipos de eventos de exportação que o usuário seleciona no manager.
|
|
61
32
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flit-modulo-exportacoes",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.36",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"directories": {
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@elastic/elasticsearch": "^8.9.0",
|
|
19
|
-
"@types/luxon": "^3.3.
|
|
20
|
-
"flit-calcular-jornada": "^2.1.
|
|
21
|
-
"prettier": "^3.0.
|
|
22
|
-
"tsc-alias": "^1.8.
|
|
19
|
+
"@types/luxon": "^3.3.2",
|
|
20
|
+
"flit-calcular-jornada": "^2.1.20",
|
|
21
|
+
"prettier": "^3.0.3",
|
|
22
|
+
"tsc-alias": "^1.8.8",
|
|
23
23
|
"typescript": "^4.9.5"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|