flit-modulo-exportacoes 2.0.37 → 2.0.39

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.
@@ -2,12 +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, departamentoId }: {
5
+ getJornadasElastic({ contaId, dataFinal, empresaId, dataInicial, usuariosIds, departamentosIds }: {
6
6
  contaId: string;
7
7
  dataFinal: Date;
8
8
  empresaId: string;
9
- usuarioId?: string;
10
9
  dataInicial: Date;
11
- departamentoId?: string;
10
+ usuariosIds?: Array<string>;
11
+ departamentosIds?: Array<string>;
12
12
  }): Promise<Array<SearchHit<any>>>;
13
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, departamentoId }) {
10
+ async internalGetJornadasElastic({ fim, inicio, contaId, empresaId, usuariosIds, departamentosIds }) {
11
11
  const queryMust = new Array();
12
12
  queryMust.push({
13
13
  match: {
@@ -19,17 +19,17 @@ class JornadasElastic extends elastic_base_1.ElasticBase {
19
19
  'usuario.empresa.uid': empresaId
20
20
  }
21
21
  });
22
- if (usuarioId) {
22
+ if ((usuariosIds ?? []).length > 0) {
23
23
  queryMust.push({
24
- match: {
25
- 'usuario.uid': usuarioId
24
+ terms: {
25
+ 'usuario.uid': usuariosIds ?? []
26
26
  }
27
27
  });
28
28
  }
29
- if (departamentoId) {
29
+ if ((departamentosIds ?? []).length > 0) {
30
30
  queryMust.push({
31
- match: {
32
- 'usuario.departamento.uid': departamentoId
31
+ terms: {
32
+ 'usuario.departamento.uid': departamentosIds ?? []
33
33
  }
34
34
  });
35
35
  }
@@ -71,7 +71,12 @@ class JornadasElastic extends elastic_base_1.ElasticBase {
71
71
  ],
72
72
  query: {
73
73
  bool: {
74
- must: queryMust
74
+ must: queryMust,
75
+ must_not: [{
76
+ match: {
77
+ ocultado_por_desligamento: true
78
+ }
79
+ }]
75
80
  }
76
81
  },
77
82
  sort: [{
@@ -79,14 +84,14 @@ class JornadasElastic extends elastic_base_1.ElasticBase {
79
84
  }]
80
85
  });
81
86
  }
82
- async getJornadasElastic({ contaId, dataFinal, usuarioId, empresaId, dataInicial, departamentoId }) {
87
+ async getJornadasElastic({ contaId, dataFinal, empresaId, dataInicial, usuariosIds, departamentosIds }) {
83
88
  return await this.retornaTodosDadosPaginacaoElastic(await this.internalGetJornadasElastic({
84
89
  fim: dataFinal,
85
90
  contaId: contaId,
86
91
  inicio: dataInicial,
87
92
  empresaId: empresaId,
88
- usuarioId: usuarioId,
89
- departamentoId: departamentoId
93
+ usuariosIds: usuariosIds,
94
+ departamentosIds: departamentosIds
90
95
  }));
91
96
  }
92
97
  }
package/dist/index.js CHANGED
@@ -328,7 +328,7 @@ async function calcularValoresExportacao({ contaId, dataFinal, dataInicial, elas
328
328
  ufEmpresaUsuarioJornada: jornada.usuario.empresa.uf,
329
329
  idEmpresaUsuarioJornada: jornada.usuario.empresa.uid,
330
330
  cidadeEmpresaUsuarioJornada: jornada.usuario.empresa.cidade,
331
- tipoOcorrenciaFrequenciaJornadaPrevista: jornada.jornada_prevista.ocorrencia_frequencia.tipo
331
+ tipoOcorrenciaFrequenciaJornadaPrevista: jornada.jornada_prevista?.ocorrencia_frequencia?.tipo ?? ''
332
332
  })) {
333
333
  valoresEventos.ValorExtraFeriado.Horas += jornada.horas_extras ?? 0;
334
334
  valoresEventos.ValorExtraFeriado.Minutos += (jornada.horas_extras ?? 0) * 60;
package/dist/models.d.ts CHANGED
@@ -75,12 +75,12 @@ export interface PayloadExportacaoPadrao {
75
75
  timezone?: string;
76
76
  data_final: string;
77
77
  empresa_id: string;
78
- usuario_id?: string;
79
78
  referencia?: string;
80
79
  data_inicial: string;
81
- departamento_id?: string;
82
80
  tabela_eventos_id: string;
81
+ usuarios_ids?: Array<string>;
83
82
  tipo_folha: TipoFolhaExportacao;
83
+ departamentos_ids?: Array<string>;
84
84
  tipos_eventos: Array<TiposEventosExportar>;
85
85
  }
86
86
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-modulo-exportacoes",
3
- "version": "2.0.37",
3
+ "version": "2.0.39",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": {
@@ -15,7 +15,7 @@
15
15
  "moment": "^2.29.4"
16
16
  },
17
17
  "devDependencies": {
18
- "@elastic/elasticsearch": "^8.9.0",
18
+ "@elastic/elasticsearch": "^8.10.0",
19
19
  "@types/luxon": "^3.3.2",
20
20
  "flit-calcular-jornada": "^2.1.20",
21
21
  "prettier": "^3.0.3",