flit-models 2.1.16 → 2.1.19

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.
@@ -60,11 +60,19 @@ var LancamentoFireConvert = /** @class */ (function () {
60
60
  var _a;
61
61
  var lancamentoFire = {
62
62
  data_inicial: timestampfromDate
63
- ? timestampfromDate(lancamento.data_inicial)
64
- : firestore_1.Timestamp.fromDate(lancamento.data_inicial),
63
+ ? lancamento.data_inicial
64
+ ? timestampfromDate(lancamento.data_inicial)
65
+ : null
66
+ : lancamento.data_inicial
67
+ ? firestore_1.Timestamp.fromDate(lancamento.data_inicial)
68
+ : null,
65
69
  data_final: timestampfromDate
66
- ? timestampfromDate(lancamento.data_final)
67
- : firestore_1.Timestamp.fromDate(lancamento.data_final),
70
+ ? lancamento.data_final
71
+ ? timestampfromDate(lancamento.data_final)
72
+ : null
73
+ : lancamento.data_final
74
+ ? firestore_1.Timestamp.fromDate(lancamento.data_final)
75
+ : null,
68
76
  data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
69
77
  descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
70
78
  excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
@@ -72,9 +80,9 @@ var LancamentoFireConvert = /** @class */ (function () {
72
80
  status: string_helper_1.StringHelper.trim(lancamento.status, null),
73
81
  empresa: {
74
82
  ref: documentReferenceFromPath(lancamento.empresa.path),
75
- documento: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
76
- fantasia: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
77
- razao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
83
+ documento: string_helper_1.StringHelper.trim(lancamento.empresa.documento, null),
84
+ fantasia: string_helper_1.StringHelper.trim(lancamento.empresa.fantasia, null),
85
+ razao: string_helper_1.StringHelper.trim(lancamento.empresa.razao, null),
78
86
  },
79
87
  ocorrencia: lancamento.ocorrencia
80
88
  ? {
@@ -86,11 +94,19 @@ var LancamentoFireConvert = /** @class */ (function () {
86
94
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, true),
87
95
  periodos: ((_a = lancamento.periodos) === null || _a === void 0 ? void 0 : _a.length) ? lancamento.periodos : null,
88
96
  data_atualizacao: timestampfromDate
89
- ? timestampfromDate(lancamento.data_atualizacao)
90
- : firestore_1.Timestamp.fromDate(lancamento.data_atualizacao),
97
+ ? lancamento.data_atualizacao
98
+ ? timestampfromDate(lancamento.data_atualizacao)
99
+ : null
100
+ : lancamento.data_atualizacao
101
+ ? firestore_1.Timestamp.fromDate(lancamento.data_atualizacao)
102
+ : null,
91
103
  data_criacao: timestampfromDate
92
- ? timestampfromDate(lancamento.data_criacao)
93
- : firestore_1.Timestamp.fromDate(lancamento.data_criacao),
104
+ ? lancamento.data_criacao
105
+ ? timestampfromDate(lancamento.data_criacao)
106
+ : null
107
+ : lancamento.data_criacao
108
+ ? firestore_1.Timestamp.fromDate(lancamento.data_criacao)
109
+ : null,
94
110
  };
95
111
  return (0, lodash_1.omitBy)(lancamentoFire, lodash_1.isUndefined);
96
112
  };
@@ -17,7 +17,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
17
17
  function LancamentoJsonConvert() {
18
18
  }
19
19
  LancamentoJsonConvert.fromJson = function (obj) {
20
- var _a, _b;
20
+ var _a, _b, _c;
21
21
  return new _1.Lancamento({
22
22
  _id: (_a = obj._id) !== null && _a !== void 0 ? _a : null,
23
23
  _path: (_b = obj._path) !== null && _b !== void 0 ? _b : null,
@@ -41,14 +41,14 @@ var LancamentoJsonConvert = /** @class */ (function () {
41
41
  }
42
42
  : null,
43
43
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(obj.excluido, true),
44
- periodos: obj.periodos.length ? obj.periodos : null,
44
+ periodos: ((_c = obj.periodos) === null || _c === void 0 ? void 0 : _c.length) ? obj.periodos : null,
45
45
  data_atualizacao: date_helper_1.DateHelper.fromString(obj.data_atualizacao, null),
46
46
  data_criacao: date_helper_1.DateHelper.fromString(obj.data_criacao, null),
47
47
  data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(obj.data_intervalo, null),
48
48
  });
49
49
  };
50
50
  LancamentoJsonConvert.toJson = function (lancamento) {
51
- var _a, _b, _c, _d;
51
+ var _a, _b, _c, _d, _e;
52
52
  var lancamentoJson = {
53
53
  _id: (_a = lancamento._id) !== null && _a !== void 0 ? _a : null,
54
54
  _path: (_b = lancamento._path) !== null && _b !== void 0 ? _b : null,
@@ -72,9 +72,9 @@ var LancamentoJsonConvert = /** @class */ (function () {
72
72
  }
73
73
  : null,
74
74
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, false),
75
- periodos: lancamento.periodos.length ? lancamento.periodos : null,
76
- data_criacao: (_c = lancamento.data_criacao) === null || _c === void 0 ? void 0 : _c.toISOString(),
77
- data_atualizacao: (_d = lancamento.data_atualizacao) === null || _d === void 0 ? void 0 : _d.toISOString(),
75
+ periodos: ((_c = lancamento.periodos) === null || _c === void 0 ? void 0 : _c.length) ? lancamento.periodos : null,
76
+ data_criacao: (_d = lancamento.data_criacao) === null || _d === void 0 ? void 0 : _d.toISOString(),
77
+ data_atualizacao: (_e = lancamento.data_atualizacao) === null || _e === void 0 ? void 0 : _e.toISOString(),
78
78
  data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
79
79
  };
80
80
  return (0, lodash_1.omitBy)(lancamentoJson, lodash_1.isUndefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-models",
3
- "version": "2.1.16",
3
+ "version": "2.1.19",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",