flit-models 2.1.14 → 2.1.17

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.
@@ -7,7 +7,7 @@ export * from './usuarios/usuario-lancamento-fire-convert';
7
7
  export * from './usuarios/usuario-lancamento';
8
8
  export declare enum LancamentoStatusEnum {
9
9
  COMPLETO = "COMPLETO",
10
- PENDENTE = "PENDENTE",
10
+ PROCESSANDO = "PROCESSANDO",
11
11
  VERIFICAR = "VERIFICAR"
12
12
  }
13
13
  export declare enum TipoAcaoLancamentoEnum {
@@ -24,7 +24,7 @@ __exportStar(require("./usuarios/usuario-lancamento"), exports);
24
24
  var LancamentoStatusEnum;
25
25
  (function (LancamentoStatusEnum) {
26
26
  LancamentoStatusEnum["COMPLETO"] = "COMPLETO";
27
- LancamentoStatusEnum["PENDENTE"] = "PENDENTE";
27
+ LancamentoStatusEnum["PROCESSANDO"] = "PROCESSANDO";
28
28
  LancamentoStatusEnum["VERIFICAR"] = "VERIFICAR";
29
29
  })(LancamentoStatusEnum = exports.LancamentoStatusEnum || (exports.LancamentoStatusEnum = {}));
30
30
  var TipoAcaoLancamentoEnum;
@@ -56,7 +56,7 @@ var Lancamento = /** @class */ (function () {
56
56
  */
57
57
  function Lancamento(lancamentoPayload) {
58
58
  var _this = this;
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"];
59
+ var keysOfProps = ["data_criacao", "status", "_id", "_path", "descricao", "excluido", "data_inicial", "data_final", "ocorrencia", "todos_colaboradores", "periodos", "data_atualizacao", "data_intervalo", "acao_tipo", "empresa"];
60
60
  keysOfProps.forEach(function (key) {
61
61
  _this[key] = lancamentoPayload
62
62
  ? lancamentoPayload[key]
@@ -38,13 +38,15 @@ var LancamentoFireConvert = /** @class */ (function () {
38
38
  razao: string_helper_1.StringHelper.trim(doc.get('empresa.razao'), null),
39
39
  path: string_helper_1.StringHelper.trim((_c = doc.ref) === null || _c === void 0 ? void 0 : _c.path, null),
40
40
  },
41
- ocorrencia: {
42
- descricao: string_helper_1.StringHelper.trim(doc.get('ocorrencia.descricao'), null),
43
- path: string_helper_1.StringHelper.trim(doc.get('ocorrencia.path'), null),
44
- tipo: string_helper_1.StringHelper.trim(doc.get('ocorrencia.tipo'), null),
45
- },
41
+ ocorrencia: doc.get('ocorrencia')
42
+ ? {
43
+ descricao: string_helper_1.StringHelper.trim(doc.get('ocorrencia.descricao'), null),
44
+ path: string_helper_1.StringHelper.trim(doc.get('ocorrencia.path'), null),
45
+ tipo: string_helper_1.StringHelper.trim(doc.get('ocorrencia.tipo'), null),
46
+ }
47
+ : null,
46
48
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(doc.get('todos_colaboradores'), true),
47
- periodos: (_d = doc.get('periodos')) !== null && _d !== void 0 ? _d : undefined,
49
+ periodos: ((_d = doc.get('periodos')) === null || _d === void 0 ? void 0 : _d.length) ? doc.get('periodos') : null,
48
50
  data_atualizacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_atualizacao'))
49
51
  ? doc.get('data_atualizacao').toDate()
50
52
  : null,
@@ -55,6 +57,7 @@ var LancamentoFireConvert = /** @class */ (function () {
55
57
  });
56
58
  };
57
59
  LancamentoFireConvert.toFirestore = function (lancamento, documentReferenceFromPath, timestampfromDate) {
60
+ var _a;
58
61
  var lancamentoFire = {
59
62
  data_inicial: timestampfromDate
60
63
  ? timestampfromDate(lancamento.data_inicial)
@@ -73,13 +76,15 @@ var LancamentoFireConvert = /** @class */ (function () {
73
76
  fantasia: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
74
77
  razao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
75
78
  },
76
- ocorrencia: {
77
- ref: documentReferenceFromPath(lancamento.ocorrencia.path),
78
- descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
79
- tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
80
- },
79
+ ocorrencia: lancamento.ocorrencia
80
+ ? {
81
+ ref: documentReferenceFromPath(lancamento.ocorrencia.path),
82
+ descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
83
+ tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
84
+ }
85
+ : null,
81
86
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, true),
82
- periodos: lancamento.periodos,
87
+ periodos: ((_a = lancamento.periodos) === null || _a === void 0 ? void 0 : _a.length) ? lancamento.periodos : null,
83
88
  data_atualizacao: timestampfromDate
84
89
  ? timestampfromDate(lancamento.data_atualizacao)
85
90
  : firestore_1.Timestamp.fromDate(lancamento.data_atualizacao),
@@ -33,13 +33,15 @@ var LancamentoJsonConvert = /** @class */ (function () {
33
33
  razao: string_helper_1.StringHelper.trim(obj.empresa.razao, null),
34
34
  path: string_helper_1.StringHelper.trim(obj.empresa.path, null),
35
35
  },
36
- ocorrencia: {
37
- descricao: string_helper_1.StringHelper.trim(obj.ocorrencia.descricao, null),
38
- path: string_helper_1.StringHelper.trim(obj.ocorrencia.path, null),
39
- tipo: string_helper_1.StringHelper.trim(obj.ocorrencia.tipo, null),
40
- },
36
+ ocorrencia: obj.ocorrencia
37
+ ? {
38
+ descricao: string_helper_1.StringHelper.trim(obj.ocorrencia.descricao, null),
39
+ path: string_helper_1.StringHelper.trim(obj.ocorrencia.path, null),
40
+ tipo: string_helper_1.StringHelper.trim(obj.ocorrencia.tipo, null),
41
+ }
42
+ : null,
41
43
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(obj.excluido, true),
42
- periodos: (_c = obj.periodos) !== null && _c !== void 0 ? _c : undefined,
44
+ periodos: ((_c = obj.periodos) === null || _c === void 0 ? void 0 : _c.length) ? obj.periodos : null,
43
45
  data_atualizacao: date_helper_1.DateHelper.fromString(obj.data_atualizacao, null),
44
46
  data_criacao: date_helper_1.DateHelper.fromString(obj.data_criacao, null),
45
47
  data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(obj.data_intervalo, null),
@@ -62,13 +64,15 @@ var LancamentoJsonConvert = /** @class */ (function () {
62
64
  razao: string_helper_1.StringHelper.trim(lancamento.empresa.razao, null),
63
65
  path: string_helper_1.StringHelper.trim(lancamento.empresa.path, null),
64
66
  },
65
- ocorrencia: {
66
- descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
67
- path: string_helper_1.StringHelper.trim(lancamento.ocorrencia.path, null),
68
- tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia.tipo, null),
69
- },
67
+ ocorrencia: lancamento.ocorrencia
68
+ ? {
69
+ descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
70
+ path: string_helper_1.StringHelper.trim(lancamento.ocorrencia.path, null),
71
+ tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia.tipo, null),
72
+ }
73
+ : null,
70
74
  todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, false),
71
- periodos: (_c = lancamento.periodos) !== null && _c !== void 0 ? _c : undefined,
75
+ periodos: ((_c = lancamento.periodos) === null || _c === void 0 ? void 0 : _c.length) ? lancamento.periodos : null,
72
76
  data_criacao: (_d = lancamento.data_criacao) === null || _d === void 0 ? void 0 : _d.toISOString(),
73
77
  data_atualizacao: (_e = lancamento.data_atualizacao) === null || _e === void 0 ? void 0 : _e.toISOString(),
74
78
  data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-models",
3
- "version": "2.1.14",
3
+ "version": "2.1.17",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "author": "gustavo_damazio",
24
24
  "license": "ISC",
25
25
  "dependencies": {
26
- "firebase": "^9.6.8",
26
+ "firebase": "^9.6.9",
27
27
  "lodash": "^4.17.21",
28
28
  "ts-transformer-keys": "^0.4.3"
29
29
  },
@@ -36,10 +36,10 @@
36
36
  "eslint-config-google": "^0.14.0",
37
37
  "eslint-config-prettier": "^8.5.0",
38
38
  "eslint-plugin-import": "^2.25.4",
39
- "eslint-plugin-jest": "^26.1.1",
39
+ "eslint-plugin-jest": "^26.1.2",
40
40
  "eslint-plugin-prettier": "^4.0.0",
41
41
  "jest": "^27.5.1",
42
- "prettier": "^2.5.1",
42
+ "prettier": "^2.6.0",
43
43
  "ts-jest": "^27.1.3",
44
44
  "ttypescript": "^1.5.13",
45
45
  "typescript": "^4.6.2"