flit-modulo-exportacoes 2.0.35 → 2.0.37

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,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/models.d.ts CHANGED
@@ -78,6 +78,7 @@ export interface PayloadExportacaoPadrao {
78
78
  usuario_id?: string;
79
79
  referencia?: string;
80
80
  data_inicial: string;
81
+ departamento_id?: string;
81
82
  tabela_eventos_id: string;
82
83
  tipo_folha: TipoFolhaExportacao;
83
84
  tipos_eventos: Array<TiposEventosExportar>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-modulo-exportacoes",
3
- "version": "2.0.35",
3
+ "version": "2.0.37",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": {