flit-models 2.1.11 → 2.1.14

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/lib/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { EmpresaFeriado, EmpresaFeriadoBase, EmpresaFeriadoFireConvert, EmpresaFeriadoFirestoreData, EnumExcecaoStatus, EnumExcecaoTipo, Excecao, Feriado, FeriadoBase, FeriadoFireConvert, FeriadoFirestoreData, FeriadoJsonConvert, FeriadoJsonData, FeriadoTipoEnum, IExcecao, Lancamento, LancamentoBase, LancamentoFireConvert, LancamentoFirestoreData, LancamentoJsonConvert, LancamentoJsonData, LancamentoStatusEnum, LogLancamento, LogLancamentoBase, LogLancamentoFireConvert, LogLancamentoFirestoreData, LogLancamentoStatusEnum, TiposOcorrenciaFrequenciaEnum, UsuarioLancamento, UsuarioLancamentoBase, UsuarioLancamentoFireConvert, UsuarioLancamentoFirestoreData, } from './models/index';
1
+ export { EmpresaFeriado, EmpresaFeriadoBase, EmpresaFeriadoFireConvert, EmpresaFeriadoFirestoreData, EnumExcecaoStatus, EnumExcecaoTipo, Excecao, Feriado, FeriadoBase, FeriadoFireConvert, FeriadoFirestoreData, FeriadoJsonConvert, FeriadoJsonData, FeriadoTipoEnum, IExcecao, Lancamento, LancamentoBase, LancamentoFireConvert, LancamentoFirestoreData, LancamentoJsonConvert, LancamentoJsonData, LancamentoStatusEnum, LogLancamento, LogLancamentoBase, LogLancamentoFireConvert, LogLancamentoFirestoreData, LogLancamentoStatusEnum, TipoAcaoLancamentoEnum, TipoOcorrenciaFrequenciaEnum, TipoReferenciaLogLancamento, UsuarioLancamento, UsuarioLancamentoBase, UsuarioLancamentoFireConvert, UsuarioLancamentoFirestoreData, } from './models/index';
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UsuarioLancamentoFirestoreData = exports.UsuarioLancamentoFireConvert = exports.UsuarioLancamento = exports.TiposOcorrenciaFrequenciaEnum = exports.LogLancamentoStatusEnum = exports.LogLancamentoFirestoreData = exports.LogLancamentoFireConvert = exports.LogLancamento = exports.LancamentoStatusEnum = exports.LancamentoJsonData = exports.LancamentoJsonConvert = exports.LancamentoFirestoreData = exports.LancamentoFireConvert = exports.Lancamento = exports.FeriadoTipoEnum = exports.FeriadoJsonData = exports.FeriadoJsonConvert = exports.FeriadoFirestoreData = exports.FeriadoFireConvert = exports.Feriado = exports.Excecao = exports.EnumExcecaoTipo = exports.EnumExcecaoStatus = exports.EmpresaFeriadoFirestoreData = exports.EmpresaFeriadoFireConvert = exports.EmpresaFeriado = void 0;
3
+ exports.UsuarioLancamentoFirestoreData = exports.UsuarioLancamentoFireConvert = exports.UsuarioLancamento = exports.TipoReferenciaLogLancamento = exports.TipoOcorrenciaFrequenciaEnum = exports.TipoAcaoLancamentoEnum = exports.LogLancamentoStatusEnum = exports.LogLancamentoFirestoreData = exports.LogLancamentoFireConvert = exports.LogLancamento = exports.LancamentoStatusEnum = exports.LancamentoJsonData = exports.LancamentoJsonConvert = exports.LancamentoFirestoreData = exports.LancamentoFireConvert = exports.Lancamento = exports.FeriadoTipoEnum = exports.FeriadoJsonData = exports.FeriadoJsonConvert = exports.FeriadoFirestoreData = exports.FeriadoFireConvert = exports.Feriado = exports.Excecao = exports.EnumExcecaoTipo = exports.EnumExcecaoStatus = exports.EmpresaFeriadoFirestoreData = exports.EmpresaFeriadoFireConvert = exports.EmpresaFeriado = void 0;
4
4
  var index_1 = require("./models/index");
5
5
  Object.defineProperty(exports, "EmpresaFeriado", { enumerable: true, get: function () { return index_1.EmpresaFeriado; } });
6
6
  Object.defineProperty(exports, "EmpresaFeriadoFireConvert", { enumerable: true, get: function () { return index_1.EmpresaFeriadoFireConvert; } });
@@ -24,7 +24,9 @@ Object.defineProperty(exports, "LogLancamento", { enumerable: true, get: functio
24
24
  Object.defineProperty(exports, "LogLancamentoFireConvert", { enumerable: true, get: function () { return index_1.LogLancamentoFireConvert; } });
25
25
  Object.defineProperty(exports, "LogLancamentoFirestoreData", { enumerable: true, get: function () { return index_1.LogLancamentoFirestoreData; } });
26
26
  Object.defineProperty(exports, "LogLancamentoStatusEnum", { enumerable: true, get: function () { return index_1.LogLancamentoStatusEnum; } });
27
- Object.defineProperty(exports, "TiposOcorrenciaFrequenciaEnum", { enumerable: true, get: function () { return index_1.TiposOcorrenciaFrequenciaEnum; } });
27
+ Object.defineProperty(exports, "TipoAcaoLancamentoEnum", { enumerable: true, get: function () { return index_1.TipoAcaoLancamentoEnum; } });
28
+ Object.defineProperty(exports, "TipoOcorrenciaFrequenciaEnum", { enumerable: true, get: function () { return index_1.TipoOcorrenciaFrequenciaEnum; } });
29
+ Object.defineProperty(exports, "TipoReferenciaLogLancamento", { enumerable: true, get: function () { return index_1.TipoReferenciaLogLancamento; } });
28
30
  Object.defineProperty(exports, "UsuarioLancamento", { enumerable: true, get: function () { return index_1.UsuarioLancamento; } });
29
31
  Object.defineProperty(exports, "UsuarioLancamentoFireConvert", { enumerable: true, get: function () { return index_1.UsuarioLancamentoFireConvert; } });
30
32
  Object.defineProperty(exports, "UsuarioLancamentoFirestoreData", { enumerable: true, get: function () { return index_1.UsuarioLancamentoFirestoreData; } });
@@ -1,4 +1,4 @@
1
- import { TiposOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
1
+ import { TipoOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
2
2
  export * from './lancamento-fire-convert';
3
3
  export * from './lancamento-json-convert';
4
4
  export * from './logs/log-lancamento-fire-convert';
@@ -10,12 +10,28 @@ export declare enum LancamentoStatusEnum {
10
10
  PENDENTE = "PENDENTE",
11
11
  VERIFICAR = "VERIFICAR"
12
12
  }
13
+ export declare enum TipoAcaoLancamentoEnum {
14
+ Abono = "Abono",
15
+ AbonoParcial = "Abono Parcial",
16
+ Afastado = "Afastado",
17
+ Atestado = "Atestado",
18
+ DiaTrabalhado = "Dia trabalhado",
19
+ Falta = "Falta",
20
+ FaltaBH = "Falta BH",
21
+ Ferias = "F\u00E9rias",
22
+ Folga = "Folga",
23
+ JornadaExterna = "Jornada externa",
24
+ Suspensao = "Suspens\u00E3o"
25
+ }
13
26
  export interface LancamentoBase {
27
+ data_criacao: any;
28
+ data_atualizacao: any;
14
29
  data_inicial: any;
15
30
  data_final: any;
31
+ data_intervalo: any[];
16
32
  descricao: any;
17
33
  excluido: any;
18
- ocorrencia_tipo: any;
34
+ acao_tipo: any;
19
35
  ocorrencia: {
20
36
  ref?: any;
21
37
  path?: any;
@@ -31,10 +47,19 @@ export interface LancamentoBase {
31
47
  };
32
48
  status: any;
33
49
  todos_colaboradores: any;
34
- ajustes_jornada_realizada: [{
35
- horasEMinutos: any;
36
- timezoneValue: any;
37
- }];
50
+ periodos: [
51
+ {
52
+ inicial: {
53
+ horas_minutos: any;
54
+ timezone_value: any;
55
+ };
56
+ final: {
57
+ horas_minutos: any;
58
+ timezone_value: any;
59
+ };
60
+ total_minutos: any;
61
+ }
62
+ ];
38
63
  }
39
64
  /**
40
65
  * Internal class col contas/${contaId}/lancamento/${lancamentoId}.
@@ -45,13 +70,12 @@ export interface LancamentoBase {
45
70
  export declare class Lancamento implements LancamentoBase {
46
71
  _id: string;
47
72
  _path: string;
48
- ajustes_jornada_realizada: [{
49
- horasEMinutos: string;
50
- timezoneValue: string;
51
- }];
52
- ocorrencia_tipo: TiposOcorrenciaFrequenciaEnum;
73
+ data_criacao: Date;
74
+ data_atualizacao: Date;
75
+ acao_tipo: TipoAcaoLancamentoEnum;
53
76
  data_final: Date;
54
77
  data_inicial: Date;
78
+ data_intervalo: string[];
55
79
  descricao: string;
56
80
  empresa: {
57
81
  path: string;
@@ -62,11 +86,24 @@ export declare class Lancamento implements LancamentoBase {
62
86
  excluido: boolean;
63
87
  ocorrencia: {
64
88
  path: string;
65
- tipo: TiposOcorrenciaFrequenciaEnum;
89
+ tipo: TipoOcorrenciaFrequenciaEnum;
66
90
  descricao: string;
67
91
  };
68
92
  status: LancamentoStatusEnum;
69
93
  todos_colaboradores: boolean;
94
+ periodos: [
95
+ {
96
+ inicial: {
97
+ horas_minutos: string;
98
+ timezone_value: string;
99
+ };
100
+ final: {
101
+ horas_minutos: string;
102
+ timezone_value: string;
103
+ };
104
+ total_minutos: number;
105
+ }
106
+ ];
70
107
  /**
71
108
  * Creates an instance of Lancamento.
72
109
  * @param {Partial<Lancamento>} lancamentoPayload
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Lancamento = exports.LancamentoStatusEnum = void 0;
17
+ exports.Lancamento = exports.TipoAcaoLancamentoEnum = exports.LancamentoStatusEnum = void 0;
18
18
  __exportStar(require("./lancamento-fire-convert"), exports);
19
19
  __exportStar(require("./lancamento-json-convert"), exports);
20
20
  __exportStar(require("./logs/log-lancamento-fire-convert"), exports);
@@ -27,6 +27,20 @@ var LancamentoStatusEnum;
27
27
  LancamentoStatusEnum["PENDENTE"] = "PENDENTE";
28
28
  LancamentoStatusEnum["VERIFICAR"] = "VERIFICAR";
29
29
  })(LancamentoStatusEnum = exports.LancamentoStatusEnum || (exports.LancamentoStatusEnum = {}));
30
+ var TipoAcaoLancamentoEnum;
31
+ (function (TipoAcaoLancamentoEnum) {
32
+ TipoAcaoLancamentoEnum["Abono"] = "Abono";
33
+ TipoAcaoLancamentoEnum["AbonoParcial"] = "Abono Parcial";
34
+ TipoAcaoLancamentoEnum["Afastado"] = "Afastado";
35
+ TipoAcaoLancamentoEnum["Atestado"] = "Atestado";
36
+ TipoAcaoLancamentoEnum["DiaTrabalhado"] = "Dia trabalhado";
37
+ TipoAcaoLancamentoEnum["Falta"] = "Falta";
38
+ TipoAcaoLancamentoEnum["FaltaBH"] = "Falta BH";
39
+ TipoAcaoLancamentoEnum["Ferias"] = "F\u00E9rias";
40
+ TipoAcaoLancamentoEnum["Folga"] = "Folga";
41
+ TipoAcaoLancamentoEnum["JornadaExterna"] = "Jornada externa";
42
+ TipoAcaoLancamentoEnum["Suspensao"] = "Suspens\u00E3o";
43
+ })(TipoAcaoLancamentoEnum = exports.TipoAcaoLancamentoEnum || (exports.TipoAcaoLancamentoEnum = {}));
30
44
  /**
31
45
  * Internal class col contas/${contaId}/lancamento/${lancamentoId}.
32
46
  *
@@ -42,7 +56,7 @@ var Lancamento = /** @class */ (function () {
42
56
  */
43
57
  function Lancamento(lancamentoPayload) {
44
58
  var _this = this;
45
- var keysOfProps = ["status", "_id", "_path", "descricao", "excluido", "data_inicial", "data_final", "todos_colaboradores", "ajustes_jornada_realizada", "ocorrencia_tipo", "ocorrencia", "empresa"];
59
+ var keysOfProps = ["data_criacao", "status", "_id", "_path", "descricao", "excluido", "data_inicial", "data_final", "todos_colaboradores", "periodos", "data_atualizacao", "data_intervalo", "acao_tipo", "ocorrencia", "empresa"];
46
60
  keysOfProps.forEach(function (key) {
47
61
  _this[key] = lancamentoPayload
48
62
  ? lancamentoPayload[key]
@@ -1,19 +1,31 @@
1
1
  import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
2
- import { Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
3
- import { TiposOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
2
+ import { TipoAcaoLancamentoEnum, Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
3
+ import { TipoOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
4
4
  export declare class LancamentoFirestoreData implements LancamentoBase {
5
- ajustes_jornada_realizada: [{
6
- horasEMinutos: string;
7
- timezoneValue: string;
8
- }];
5
+ data_criacao: Timestamp;
6
+ data_atualizacao: Timestamp;
7
+ data_intervalo: string[];
8
+ periodos: [
9
+ {
10
+ inicial: {
11
+ horas_minutos: string;
12
+ timezone_value: string;
13
+ };
14
+ final: {
15
+ horas_minutos: string;
16
+ timezone_value: string;
17
+ };
18
+ total_minutos: number;
19
+ }
20
+ ];
9
21
  data_inicial: Timestamp;
10
22
  data_final: Timestamp;
11
23
  descricao: string;
12
24
  excluido: boolean;
13
- ocorrencia_tipo: TiposOcorrenciaFrequenciaEnum;
25
+ acao_tipo: TipoAcaoLancamentoEnum;
14
26
  ocorrencia: {
15
27
  ref: DocumentReference;
16
- tipo: TiposOcorrenciaFrequenciaEnum;
28
+ tipo: TipoOcorrenciaFrequenciaEnum;
17
29
  descricao: string;
18
30
  };
19
31
  empresa: {
@@ -4,6 +4,7 @@ exports.LancamentoFireConvert = exports.LancamentoFirestoreData = void 0;
4
4
  var firestore_1 = require("firebase/firestore");
5
5
  var lodash_1 = require("lodash");
6
6
  var _1 = require(".");
7
+ var array_helpers_1 = require("../../utils/array-helpers");
7
8
  var boolean_helper_1 = require("../../utils/boolean-helper");
8
9
  var string_helper_1 = require("../../utils/string-helper");
9
10
  var type_guards_1 = require("../../utils/type-guards");
@@ -21,15 +22,15 @@ var LancamentoFireConvert = /** @class */ (function () {
21
22
  return new _1.Lancamento({
22
23
  _id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
23
24
  _path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
24
- data_inicial: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data'))
25
+ data_inicial: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_inicial'))
25
26
  ? doc.get('data_inicial').toDate()
26
27
  : null,
27
- data_final: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data'))
28
+ data_final: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_final'))
28
29
  ? doc.get('data_final').toDate()
29
30
  : null,
30
31
  descricao: string_helper_1.StringHelper.trim(doc.get('descricao'), null),
31
32
  excluido: boolean_helper_1.BooleanHelper.check(doc.get('excluido'), false),
32
- ocorrencia_tipo: string_helper_1.StringHelper.trim(doc.get('tipo'), null),
33
+ acao_tipo: string_helper_1.StringHelper.trim(doc.get('tipo'), null),
33
34
  status: string_helper_1.StringHelper.trim(doc.get('tipo'), null),
34
35
  empresa: {
35
36
  documento: string_helper_1.StringHelper.trim(doc.get('empresa.documento'), null),
@@ -43,7 +44,14 @@ var LancamentoFireConvert = /** @class */ (function () {
43
44
  tipo: string_helper_1.StringHelper.trim(doc.get('ocorrencia.tipo'), null),
44
45
  },
45
46
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(doc.get('todos_colaboradores'), true),
46
- ajustes_jornada_realizada: (_d = doc.get('ajustes_jornada_realizada')) !== null && _d !== void 0 ? _d : undefined,
47
+ periodos: (_d = doc.get('periodos')) !== null && _d !== void 0 ? _d : undefined,
48
+ data_atualizacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_atualizacao'))
49
+ ? doc.get('data_atualizacao').toDate()
50
+ : null,
51
+ data_criacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_criacao'))
52
+ ? doc.get('data_criacao').toDate()
53
+ : null,
54
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(doc.get('data_intervalo'), null),
47
55
  });
48
56
  };
49
57
  LancamentoFireConvert.toFirestore = function (lancamento, documentReferenceFromPath, timestampfromDate) {
@@ -54,9 +62,10 @@ var LancamentoFireConvert = /** @class */ (function () {
54
62
  data_final: timestampfromDate
55
63
  ? timestampfromDate(lancamento.data_final)
56
64
  : firestore_1.Timestamp.fromDate(lancamento.data_final),
65
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
57
66
  descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
58
67
  excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
59
- ocorrencia_tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia_tipo, null),
68
+ acao_tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
60
69
  status: string_helper_1.StringHelper.trim(lancamento.status, null),
61
70
  empresa: {
62
71
  ref: documentReferenceFromPath(lancamento.empresa.path),
@@ -67,10 +76,16 @@ var LancamentoFireConvert = /** @class */ (function () {
67
76
  ocorrencia: {
68
77
  ref: documentReferenceFromPath(lancamento.ocorrencia.path),
69
78
  descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
70
- tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia_tipo, null),
79
+ tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
71
80
  },
72
81
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, true),
73
- ajustes_jornada_realizada: lancamento.ajustes_jornada_realizada,
82
+ periodos: lancamento.periodos,
83
+ data_atualizacao: timestampfromDate
84
+ ? timestampfromDate(lancamento.data_atualizacao)
85
+ : firestore_1.Timestamp.fromDate(lancamento.data_atualizacao),
86
+ data_criacao: timestampfromDate
87
+ ? timestampfromDate(lancamento.data_criacao)
88
+ : firestore_1.Timestamp.fromDate(lancamento.data_criacao),
74
89
  };
75
90
  return (0, lodash_1.omitBy)(lancamentoFire, lodash_1.isUndefined);
76
91
  };
@@ -1,20 +1,32 @@
1
- import { Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
2
- import { TiposOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
1
+ import { TipoAcaoLancamentoEnum, Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
2
+ import { TipoOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
3
3
  export declare class LancamentoJsonData implements LancamentoBase {
4
+ data_intervalo: string[];
5
+ data_criacao: string;
6
+ data_atualizacao: string;
7
+ periodos: [
8
+ {
9
+ inicial: {
10
+ horas_minutos: any;
11
+ timezone_value: any;
12
+ };
13
+ final: {
14
+ horas_minutos: any;
15
+ timezone_value: any;
16
+ };
17
+ total_minutos: any;
18
+ }
19
+ ];
4
20
  _id: string;
5
21
  _path: string;
6
- ajustes_jornada_realizada: [{
7
- horasEMinutos: any;
8
- timezoneValue: any;
9
- }];
10
22
  data_inicial: string;
11
23
  data_final: string;
12
24
  descricao: string;
13
25
  excluido: boolean;
14
- ocorrencia_tipo: TiposOcorrenciaFrequenciaEnum;
26
+ acao_tipo: TipoAcaoLancamentoEnum;
15
27
  ocorrencia: {
16
28
  path?: string;
17
- tipo: TiposOcorrenciaFrequenciaEnum;
29
+ tipo: TipoOcorrenciaFrequenciaEnum;
18
30
  descricao: string;
19
31
  };
20
32
  empresa: {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LancamentoJsonConvert = exports.LancamentoJsonData = void 0;
4
4
  var lodash_1 = require("lodash");
5
5
  var _1 = require(".");
6
+ var array_helpers_1 = require("../../utils/array-helpers");
6
7
  var boolean_helper_1 = require("../../utils/boolean-helper");
7
8
  var date_helper_1 = require("../../utils/date-helper");
8
9
  var string_helper_1 = require("../../utils/string-helper");
@@ -25,7 +26,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
25
26
  descricao: string_helper_1.StringHelper.trim(obj.descricao, null),
26
27
  excluido: boolean_helper_1.BooleanHelper.check(obj.excluido, false),
27
28
  status: string_helper_1.StringHelper.trim(obj.status, null),
28
- ocorrencia_tipo: string_helper_1.StringHelper.trim(obj.ocorrencia_tipo, null),
29
+ acao_tipo: string_helper_1.StringHelper.trim(obj.acao_tipo, null),
29
30
  empresa: {
30
31
  documento: string_helper_1.StringHelper.trim(obj.empresa.documento, null),
31
32
  fantasia: string_helper_1.StringHelper.trim(obj.empresa.fantasia, null),
@@ -38,11 +39,14 @@ var LancamentoJsonConvert = /** @class */ (function () {
38
39
  tipo: string_helper_1.StringHelper.trim(obj.ocorrencia.tipo, null),
39
40
  },
40
41
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(obj.excluido, true),
41
- ajustes_jornada_realizada: (_c = obj.ajustes_jornada_realizada) !== null && _c !== void 0 ? _c : undefined,
42
+ periodos: (_c = obj.periodos) !== null && _c !== void 0 ? _c : undefined,
43
+ data_atualizacao: date_helper_1.DateHelper.fromString(obj.data_atualizacao, null),
44
+ data_criacao: date_helper_1.DateHelper.fromString(obj.data_criacao, null),
45
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(obj.data_intervalo, null),
42
46
  });
43
47
  };
44
48
  LancamentoJsonConvert.toJson = function (lancamento) {
45
- var _a, _b, _c;
49
+ var _a, _b, _c, _d, _e;
46
50
  var lancamentoJson = {
47
51
  _id: (_a = lancamento._id) !== null && _a !== void 0 ? _a : null,
48
52
  _path: (_b = lancamento._path) !== null && _b !== void 0 ? _b : null,
@@ -51,7 +55,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
51
55
  descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
52
56
  excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
53
57
  status: string_helper_1.StringHelper.trim(lancamento.status, null),
54
- ocorrencia_tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia_tipo, null),
58
+ acao_tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
55
59
  empresa: {
56
60
  documento: string_helper_1.StringHelper.trim(lancamento.empresa.documento, null),
57
61
  fantasia: string_helper_1.StringHelper.trim(lancamento.empresa.fantasia, null),
@@ -64,7 +68,10 @@ var LancamentoJsonConvert = /** @class */ (function () {
64
68
  tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia.tipo, null),
65
69
  },
66
70
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, false),
67
- ajustes_jornada_realizada: (_c = lancamento.ajustes_jornada_realizada) !== null && _c !== void 0 ? _c : undefined,
71
+ periodos: (_c = lancamento.periodos) !== null && _c !== void 0 ? _c : undefined,
72
+ data_criacao: (_d = lancamento.data_criacao) === null || _d === void 0 ? void 0 : _d.toISOString(),
73
+ data_atualizacao: (_e = lancamento.data_atualizacao) === null || _e === void 0 ? void 0 : _e.toISOString(),
74
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
68
75
  };
69
76
  return (0, lodash_1.omitBy)(lancamentoJson, lodash_1.isUndefined);
70
77
  };
@@ -1,16 +1,18 @@
1
1
  import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
2
- import { LogLancamento, LogLancamentoBase, LogLancamentoStatusEnum } from './log-lancamento';
2
+ import { LogLancamento, LogLancamentoBase, LogLancamentoStatusEnum, TipoReferenciaLogLancamento } from './log-lancamento';
3
3
  export declare class LogLancamentoFirestoreData implements LogLancamentoBase {
4
- data: Timestamp;
4
+ referencia: {
5
+ tipo: TipoReferenciaLogLancamento;
6
+ data?: Timestamp;
7
+ ref: DocumentReference;
8
+ };
9
+ visto: boolean;
10
+ data_criacao: Timestamp;
5
11
  mensagem: string;
6
12
  detalhes: {
7
13
  [key: string]: any;
8
14
  };
9
- status: LogLancamentoStatusEnum;
10
- jornada: {
11
- data: Timestamp;
12
- ref: DocumentReference;
13
- };
15
+ tipo: LogLancamentoStatusEnum;
14
16
  }
15
17
  export declare abstract class LogLancamentoFireConvert {
16
18
  static fromFirestore(doc: DocumentSnapshot<LogLancamentoFirestoreData> | QueryDocumentSnapshot<LogLancamentoFirestoreData>): LogLancamento;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LogLancamentoFireConvert = exports.LogLancamentoFirestoreData = void 0;
4
4
  var lodash_1 = require("lodash");
5
+ var boolean_helper_1 = require("../../../utils/boolean-helper");
5
6
  var string_helper_1 = require("../../../utils/string-helper");
6
7
  var type_guards_1 = require("../../../utils/type-guards");
7
8
  var log_lancamento_1 = require("./log-lancamento");
@@ -15,36 +16,40 @@ var LogLancamentoFireConvert = /** @class */ (function () {
15
16
  function LogLancamentoFireConvert() {
16
17
  }
17
18
  LogLancamentoFireConvert.fromFirestore = function (doc) {
18
- var _a, _b, _c;
19
+ var _a, _b, _c, _d;
19
20
  return new log_lancamento_1.LogLancamento({
20
21
  _id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
21
22
  _path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
22
- data: (0, type_guards_1.TipoTimestampFirestore)(doc.get('jornada.data'))
23
+ data_criacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('jornada.data'))
23
24
  ? doc.get('data_inicial').toDate()
24
25
  : null,
25
- jornada: {
26
+ referencia: {
26
27
  ref: (0, type_guards_1.TipoDocumentReference)(doc.get('ref'))
27
28
  ? doc.get('ref').path
28
29
  : null,
29
30
  data: (0, type_guards_1.TipoTimestampFirestore)(doc.get('jornada.data'))
30
31
  ? doc.get('data_inicial').toDate()
31
32
  : null,
33
+ tipo: string_helper_1.StringHelper.trim(doc.get('referencia.tipo'), null),
32
34
  },
33
35
  mensagem: string_helper_1.StringHelper.trim(doc.get('mensagem'), null),
34
- status: string_helper_1.StringHelper.trim(doc.get('status'), null),
36
+ tipo: string_helper_1.StringHelper.trim(doc.get('status'), null),
35
37
  detalhes: (_c = doc.get('detalhes')) !== null && _c !== void 0 ? _c : null,
38
+ visto: (_d = doc.get('visto')) !== null && _d !== void 0 ? _d : false,
36
39
  });
37
40
  };
38
41
  LogLancamentoFireConvert.toFirestore = function (logLancamento, timestampfromDate, documentReferenceFromPath) {
39
42
  var logLancamentoFirestore = {
40
43
  mensagem: logLancamento.mensagem,
41
44
  detalhes: logLancamento.detalhes,
42
- status: logLancamento.status,
43
- data: timestampfromDate(logLancamento.data),
44
- jornada: {
45
- data: timestampfromDate(logLancamento.jornada.data),
46
- ref: documentReferenceFromPath(logLancamento.jornada.ref),
45
+ tipo: logLancamento.tipo,
46
+ data_criacao: timestampfromDate(logLancamento.data_criacao),
47
+ referencia: {
48
+ data: timestampfromDate(logLancamento.referencia.data),
49
+ ref: documentReferenceFromPath(logLancamento.referencia.ref),
50
+ tipo: string_helper_1.StringHelper.trim(logLancamento.referencia.tipo, null),
47
51
  },
52
+ visto: boolean_helper_1.BooleanHelper.check(logLancamento.visto, false),
48
53
  };
49
54
  return (0, lodash_1.omitBy)(logLancamentoFirestore, lodash_1.isUndefined);
50
55
  };
@@ -1,19 +1,27 @@
1
1
  export declare enum LogLancamentoStatusEnum {
2
- SUCESSO = "SUCESSO",
3
- ERRO = "ERRO"
2
+ AVISO = "AVISO",
3
+ CRITICO = "CRITICO",
4
+ ERRO = "ERRO",
5
+ INFORMATIVO = "INFORMATIVO"
6
+ }
7
+ export declare enum TipoReferenciaLogLancamento {
8
+ JORNADA = "JORNADA",
9
+ USUARIO = "USUARIO"
4
10
  }
5
11
  export interface LogLancamentoBase {
6
- data: any;
12
+ data_criacao: any;
7
13
  mensagem: any;
8
14
  detalhes: any;
9
- status: any;
10
- jornada: {
11
- data: any;
15
+ tipo: any;
16
+ referencia: {
17
+ tipo: any;
18
+ data?: any;
12
19
  ref: any;
13
20
  };
21
+ visto: any;
14
22
  }
15
23
  /**
16
- * Internal class col contas/${contaId}/lancamento/${lancamentoId}/logs_lancamento/${usuarioId}.
24
+ * Internal class col contas/${contaId}/lancamentos/${lancamentoId}/logs_lancamentos/${usuarioId}.
17
25
  *
18
26
  * @export
19
27
  * @class UsuarioLancamento
@@ -22,15 +30,17 @@ export interface LogLancamentoBase {
22
30
  export declare class LogLancamento implements LogLancamentoBase {
23
31
  _id: string;
24
32
  _path: string;
25
- data: Date;
33
+ data_criacao: Date;
26
34
  mensagem: string;
27
35
  detalhes: {
28
36
  [key: string]: any;
29
37
  };
30
- status: LogLancamentoStatusEnum;
31
- jornada: {
32
- data: Date;
33
- ref: string;
38
+ tipo: LogLancamentoStatusEnum;
39
+ visto: boolean;
40
+ referencia: {
41
+ tipo: TipoReferenciaLogLancamento;
42
+ data?: any;
43
+ ref: any;
34
44
  };
35
45
  /**
36
46
  * Creates an instance of UsuarioLancamento.
@@ -1,13 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogLancamento = exports.LogLancamentoStatusEnum = void 0;
3
+ exports.LogLancamento = exports.TipoReferenciaLogLancamento = exports.LogLancamentoStatusEnum = void 0;
4
4
  var LogLancamentoStatusEnum;
5
5
  (function (LogLancamentoStatusEnum) {
6
- LogLancamentoStatusEnum["SUCESSO"] = "SUCESSO";
6
+ LogLancamentoStatusEnum["AVISO"] = "AVISO";
7
+ LogLancamentoStatusEnum["CRITICO"] = "CRITICO";
7
8
  LogLancamentoStatusEnum["ERRO"] = "ERRO";
9
+ LogLancamentoStatusEnum["INFORMATIVO"] = "INFORMATIVO";
8
10
  })(LogLancamentoStatusEnum = exports.LogLancamentoStatusEnum || (exports.LogLancamentoStatusEnum = {}));
11
+ var TipoReferenciaLogLancamento;
12
+ (function (TipoReferenciaLogLancamento) {
13
+ TipoReferenciaLogLancamento["JORNADA"] = "JORNADA";
14
+ TipoReferenciaLogLancamento["USUARIO"] = "USUARIO";
15
+ })(TipoReferenciaLogLancamento = exports.TipoReferenciaLogLancamento || (exports.TipoReferenciaLogLancamento = {}));
9
16
  /**
10
- * Internal class col contas/${contaId}/lancamento/${lancamentoId}/logs_lancamento/${usuarioId}.
17
+ * Internal class col contas/${contaId}/lancamentos/${lancamentoId}/logs_lancamentos/${usuarioId}.
11
18
  *
12
19
  * @export
13
20
  * @class UsuarioLancamento
@@ -21,7 +28,7 @@ var LogLancamento = /** @class */ (function () {
21
28
  */
22
29
  function LogLancamento(usuarioLancamentoPayload) {
23
30
  var _this = this;
24
- var keysOfProps = ["status", "_id", "_path", "data", "mensagem", "detalhes", "jornada"];
31
+ var keysOfProps = ["data_criacao", "tipo", "_id", "_path", "mensagem", "detalhes", "visto", "referencia"];
25
32
  keysOfProps.forEach(function (key) {
26
33
  _this[key] = usuarioLancamentoPayload
27
34
  ? usuarioLancamentoPayload[key]
@@ -5,7 +5,7 @@ export interface UsuarioLancamentoBase {
5
5
  ref: any;
6
6
  }
7
7
  /**
8
- * Internal class col contas/${contaId}/lancamento/${lancamentoId}/usuarios_lancamento/${usuarioId}.
8
+ * Internal class col contas/${contaId}/lancamentos/${lancamentoId}/usuarios_lancamentos/${usuarioId}.
9
9
  *
10
10
  * @export
11
11
  * @class UsuarioLancamento
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UsuarioLancamento = void 0;
4
4
  /**
5
- * Internal class col contas/${contaId}/lancamento/${lancamentoId}/usuarios_lancamento/${usuarioId}.
5
+ * Internal class col contas/${contaId}/lancamentos/${lancamentoId}/usuarios_lancamentos/${usuarioId}.
6
6
  *
7
7
  * @export
8
8
  * @class UsuarioLancamento
@@ -1,6 +1,5 @@
1
- export declare enum TiposOcorrenciaFrequenciaEnum {
1
+ export declare enum TipoOcorrenciaFrequenciaEnum {
2
2
  Abono = "Abono",
3
- AbonoParcial = "Abono Parcial",
4
3
  Afastado = "Afastado",
5
4
  Atestado = "Atestado",
6
5
  DiaTrabalhado = "Dia trabalhado",
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TiposOcorrenciaFrequenciaEnum = void 0;
4
- var TiposOcorrenciaFrequenciaEnum;
5
- (function (TiposOcorrenciaFrequenciaEnum) {
6
- TiposOcorrenciaFrequenciaEnum["Abono"] = "Abono";
7
- TiposOcorrenciaFrequenciaEnum["AbonoParcial"] = "Abono Parcial";
8
- TiposOcorrenciaFrequenciaEnum["Afastado"] = "Afastado";
9
- TiposOcorrenciaFrequenciaEnum["Atestado"] = "Atestado";
10
- TiposOcorrenciaFrequenciaEnum["DiaTrabalhado"] = "Dia trabalhado";
11
- TiposOcorrenciaFrequenciaEnum["Falta"] = "Falta";
12
- TiposOcorrenciaFrequenciaEnum["FaltaBH"] = "Falta BH";
13
- TiposOcorrenciaFrequenciaEnum["Ferias"] = "F\u00E9rias";
14
- TiposOcorrenciaFrequenciaEnum["Folga"] = "Folga";
15
- TiposOcorrenciaFrequenciaEnum["JornadaExterna"] = "Jornada externa";
16
- TiposOcorrenciaFrequenciaEnum["Suspensao"] = "Suspens\u00E3o";
17
- })(TiposOcorrenciaFrequenciaEnum = exports.TiposOcorrenciaFrequenciaEnum || (exports.TiposOcorrenciaFrequenciaEnum = {}));
3
+ exports.TipoOcorrenciaFrequenciaEnum = void 0;
4
+ var TipoOcorrenciaFrequenciaEnum;
5
+ (function (TipoOcorrenciaFrequenciaEnum) {
6
+ TipoOcorrenciaFrequenciaEnum["Abono"] = "Abono";
7
+ TipoOcorrenciaFrequenciaEnum["Afastado"] = "Afastado";
8
+ TipoOcorrenciaFrequenciaEnum["Atestado"] = "Atestado";
9
+ TipoOcorrenciaFrequenciaEnum["DiaTrabalhado"] = "Dia trabalhado";
10
+ TipoOcorrenciaFrequenciaEnum["Falta"] = "Falta";
11
+ TipoOcorrenciaFrequenciaEnum["FaltaBH"] = "Falta BH";
12
+ TipoOcorrenciaFrequenciaEnum["Ferias"] = "F\u00E9rias";
13
+ TipoOcorrenciaFrequenciaEnum["Folga"] = "Folga";
14
+ TipoOcorrenciaFrequenciaEnum["JornadaExterna"] = "Jornada externa";
15
+ TipoOcorrenciaFrequenciaEnum["Suspensao"] = "Suspens\u00E3o";
16
+ })(TipoOcorrenciaFrequenciaEnum = exports.TipoOcorrenciaFrequenciaEnum || (exports.TipoOcorrenciaFrequenciaEnum = {}));
@@ -0,0 +1,3 @@
1
+ export declare abstract class ArrayHelper {
2
+ static checkStringArray(arr: string[], def: null | undefined): string[];
3
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArrayHelper = void 0;
4
+ var ArrayHelper = /** @class */ (function () {
5
+ function ArrayHelper() {
6
+ }
7
+ ArrayHelper.checkStringArray = function (arr, def) {
8
+ if (Array.isArray(arr) && arr.every(function (e) { return typeof e === 'string'; })) {
9
+ return arr;
10
+ }
11
+ else {
12
+ return def;
13
+ }
14
+ };
15
+ return ArrayHelper;
16
+ }());
17
+ exports.ArrayHelper = ArrayHelper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-models",
3
- "version": "2.1.11",
3
+ "version": "2.1.14",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",