flit-models 2.1.21 → 2.1.24

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.
@@ -36,12 +36,12 @@ var LancamentoFireConvert = /** @class */ (function () {
36
36
  documento: string_helper_1.StringHelper.trim(doc.get('empresa.documento'), null),
37
37
  fantasia: string_helper_1.StringHelper.trim(doc.get('empresa.fantasia'), null),
38
38
  razao: string_helper_1.StringHelper.trim(doc.get('empresa.razao'), null),
39
- path: string_helper_1.StringHelper.trim((_c = doc.ref) === null || _c === void 0 ? void 0 : _c.path, null),
39
+ path: string_helper_1.StringHelper.trim(doc.get('empresa.ref').path, null),
40
40
  },
41
41
  ocorrencia: doc.get('ocorrencia')
42
42
  ? {
43
43
  descricao: string_helper_1.StringHelper.trim(doc.get('ocorrencia.descricao'), null),
44
- path: string_helper_1.StringHelper.trim(doc.get('ocorrencia.path'), null),
44
+ path: string_helper_1.StringHelper.trim((_c = doc.get('ocorrencia.ref')) === null || _c === void 0 ? void 0 : _c.path, null),
45
45
  tipo: string_helper_1.StringHelper.trim(doc.get('ocorrencia.tipo'), null),
46
46
  }
47
47
  : null,
@@ -49,11 +49,11 @@ var LancamentoFireConvert = /** @class */ (function () {
49
49
  periodos: ((_d = doc.get('periodos')) === null || _d === void 0 ? void 0 : _d.length) ? doc.get('periodos') : null,
50
50
  data_atualizacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_atualizacao'))
51
51
  ? doc.get('data_atualizacao').toDate()
52
- : null,
52
+ : undefined,
53
53
  data_criacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_criacao'))
54
54
  ? doc.get('data_criacao').toDate()
55
- : null,
56
- data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(doc.get('data_intervalo'), null),
55
+ : undefined,
56
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(doc.get('data_intervalo'), undefined),
57
57
  });
58
58
  };
59
59
  LancamentoFireConvert.toFirestore = function (lancamento, documentReferenceFromPath, timestampfromDate) {
@@ -73,7 +73,7 @@ var LancamentoFireConvert = /** @class */ (function () {
73
73
  : lancamento.data_final
74
74
  ? firestore_1.Timestamp.fromDate(lancamento.data_final)
75
75
  : null,
76
- data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
76
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, undefined),
77
77
  descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
78
78
  excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
79
79
  acao_tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
@@ -96,17 +96,17 @@ var LancamentoFireConvert = /** @class */ (function () {
96
96
  data_atualizacao: timestampfromDate
97
97
  ? lancamento.data_atualizacao
98
98
  ? timestampfromDate(lancamento.data_atualizacao)
99
- : null
99
+ : undefined
100
100
  : lancamento.data_atualizacao
101
101
  ? firestore_1.Timestamp.fromDate(lancamento.data_atualizacao)
102
- : null,
102
+ : undefined,
103
103
  data_criacao: timestampfromDate
104
104
  ? lancamento.data_criacao
105
105
  ? timestampfromDate(lancamento.data_criacao)
106
- : null
106
+ : undefined
107
107
  : lancamento.data_criacao
108
108
  ? firestore_1.Timestamp.fromDate(lancamento.data_criacao)
109
- : null,
109
+ : undefined,
110
110
  };
111
111
  return (0, lodash_1.omitBy)(lancamentoFire, lodash_1.isUndefined);
112
112
  };
@@ -25,12 +25,12 @@ export declare class LancamentoJsonData implements LancamentoBase {
25
25
  excluido: boolean;
26
26
  acao_tipo: TipoAcaoLancamentoEnum;
27
27
  ocorrencia: {
28
- path?: string;
28
+ path: string;
29
29
  tipo: TipoOcorrenciaFrequenciaEnum;
30
30
  descricao: string;
31
31
  };
32
32
  empresa: {
33
- path?: string;
33
+ path: string;
34
34
  razao: string;
35
35
  fantasia: string;
36
36
  documento: string;
@@ -40,7 +40,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
40
40
  tipo: string_helper_1.StringHelper.trim(obj.ocorrencia.tipo, null),
41
41
  }
42
42
  : null,
43
- todos_colaboradores: boolean_helper_1.BooleanHelper.check(obj.excluido, true),
43
+ todos_colaboradores: boolean_helper_1.BooleanHelper.check(obj.todos_colaboradores, true),
44
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),
@@ -48,12 +48,12 @@ var LancamentoJsonConvert = /** @class */ (function () {
48
48
  });
49
49
  };
50
50
  LancamentoJsonConvert.toJson = function (lancamento) {
51
- var _a, _b, _c, _d, _e;
51
+ var _a, _b, _c, _d, _e, _f, _g;
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,
55
- data_inicial: lancamento.data_inicial.toISOString(),
56
- data_final: lancamento.data_final.toISOString(),
55
+ data_inicial: (_c = lancamento.data_inicial) === null || _c === void 0 ? void 0 : _c.toISOString(),
56
+ data_final: (_d = lancamento.data_final) === null || _d === void 0 ? void 0 : _d.toISOString(),
57
57
  descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
58
58
  excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
59
59
  status: string_helper_1.StringHelper.trim(lancamento.status, null),
@@ -72,10 +72,10 @@ var LancamentoJsonConvert = /** @class */ (function () {
72
72
  }
73
73
  : null,
74
74
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, false),
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
- data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
75
+ periodos: ((_e = lancamento.periodos) === null || _e === void 0 ? void 0 : _e.length) ? lancamento.periodos : null,
76
+ data_criacao: (_f = lancamento.data_criacao) === null || _f === void 0 ? void 0 : _f.toISOString(),
77
+ data_atualizacao: (_g = lancamento.data_atualizacao) === null || _g === void 0 ? void 0 : _g.toISOString(),
78
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, undefined),
79
79
  };
80
80
  return (0, lodash_1.omitBy)(lancamentoJson, lodash_1.isUndefined);
81
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-models",
3
- "version": "2.1.21",
3
+ "version": "2.1.24",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",