flit-models 2.1.13 → 2.1.16
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 +1 -1
- package/lib/index.js +4 -2
- package/lib/models/contas/lancamento/index.d.ts +1 -1
- package/lib/models/contas/lancamento/index.js +2 -2
- package/lib/models/contas/lancamento/lancamento-fire-convert.js +17 -12
- package/lib/models/contas/lancamento/lancamento-json-convert.js +20 -16
- package/package.json +4 -4
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, TipoAcaoLancamentoEnum
|
|
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.
|
|
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, "
|
|
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; } });
|
|
@@ -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
|
-
|
|
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["
|
|
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", "
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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'))
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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),
|
|
@@ -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;
|
|
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,
|
|
@@ -33,20 +33,22 @@ 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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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:
|
|
44
|
+
periodos: obj.periodos.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),
|
|
46
48
|
});
|
|
47
49
|
};
|
|
48
50
|
LancamentoJsonConvert.toJson = function (lancamento) {
|
|
49
|
-
var _a, _b, _c, _d
|
|
51
|
+
var _a, _b, _c, _d;
|
|
50
52
|
var lancamentoJson = {
|
|
51
53
|
_id: (_a = lancamento._id) !== null && _a !== void 0 ? _a : null,
|
|
52
54
|
_path: (_b = lancamento._path) !== null && _b !== void 0 ? _b : null,
|
|
@@ -62,15 +64,17 @@ 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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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:
|
|
72
|
-
data_criacao: (
|
|
73
|
-
data_atualizacao: (
|
|
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(),
|
|
74
78
|
data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
|
|
75
79
|
};
|
|
76
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.
|
|
3
|
+
"version": "2.1.16",
|
|
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.
|
|
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.
|
|
39
|
+
"eslint-plugin-jest": "^26.1.2",
|
|
40
40
|
"eslint-plugin-prettier": "^4.0.0",
|
|
41
41
|
"jest": "^27.5.1",
|
|
42
|
-
"prettier": "^2.
|
|
42
|
+
"prettier": "^2.6.0",
|
|
43
43
|
"ts-jest": "^27.1.3",
|
|
44
44
|
"ttypescript": "^1.5.13",
|
|
45
45
|
"typescript": "^4.6.2"
|