flit-models 2.1.26 → 2.1.29
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 +5 -6
- package/lib/models/contas/lancamento/index.d.ts +2 -2
- package/lib/models/contas/lancamento/index.js +2 -2
- package/lib/models/contas/lancamento/logs/log-lancamento.d.ts +2 -2
- package/lib/models/contas/lancamento/verificacoes/verificacao-lancamento-fire-convert.d.ts +24 -0
- package/lib/models/contas/lancamento/verificacoes/verificacao-lancamento-fire-convert.js +78 -0
- package/lib/models/contas/lancamento/verificacoes/verificacao-lancamento.d.ts +55 -0
- package/lib/models/contas/lancamento/verificacoes/verificacao-lancamento.js +33 -0
- package/lib/models/utils/string-helper.d.ts +1 -0
- package/lib/models/utils/string-helper.js +8 -0
- package/package.json +1 -1
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,
|
|
1
|
+
export { EmpresaFeriado, EmpresaFeriadoBase, EmpresaFeriadoFireConvert, EmpresaFeriadoFirestoreData, EnumExcecaoStatus, EnumExcecaoTipo, Excecao, Feriado, FeriadoBase, FeriadoFireConvert, FeriadoFirestoreData, FeriadoJsonConvert, FeriadoJsonData, FeriadoTipoEnum, IExcecao, Lancamento, LancamentoBase, LancamentoFireConvert, LancamentoFirestoreData, LancamentoJsonConvert, LancamentoJsonData, LancamentoStatusEnum, VerificacaoLancamentoFireConvert, VerificacaoLancamentoFirestoreData, TipoAcaoLancamentoEnum, TipoOcorrenciaFrequenciaEnum, TipoReferenciaUsuarioLancamento, UsuarioLancamento, UsuarioLancamentoBase, UsuarioLancamentoFireConvert, UsuarioLancamentoFirestoreData, VerificacaoLancamento, VerificacaoLancamentoBase, } 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.VerificacaoLancamento = exports.UsuarioLancamentoFirestoreData = exports.UsuarioLancamentoFireConvert = exports.UsuarioLancamento = exports.TipoReferenciaUsuarioLancamento = exports.TipoOcorrenciaFrequenciaEnum = exports.TipoAcaoLancamentoEnum = exports.VerificacaoLancamentoFirestoreData = exports.VerificacaoLancamentoFireConvert = 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; } });
|
|
@@ -20,13 +20,12 @@ Object.defineProperty(exports, "LancamentoFirestoreData", { enumerable: true, ge
|
|
|
20
20
|
Object.defineProperty(exports, "LancamentoJsonConvert", { enumerable: true, get: function () { return index_1.LancamentoJsonConvert; } });
|
|
21
21
|
Object.defineProperty(exports, "LancamentoJsonData", { enumerable: true, get: function () { return index_1.LancamentoJsonData; } });
|
|
22
22
|
Object.defineProperty(exports, "LancamentoStatusEnum", { enumerable: true, get: function () { return index_1.LancamentoStatusEnum; } });
|
|
23
|
-
Object.defineProperty(exports, "
|
|
24
|
-
Object.defineProperty(exports, "
|
|
25
|
-
Object.defineProperty(exports, "LogLancamentoFirestoreData", { enumerable: true, get: function () { return index_1.LogLancamentoFirestoreData; } });
|
|
26
|
-
Object.defineProperty(exports, "LogLancamentoStatusEnum", { enumerable: true, get: function () { return index_1.LogLancamentoStatusEnum; } });
|
|
23
|
+
Object.defineProperty(exports, "VerificacaoLancamentoFireConvert", { enumerable: true, get: function () { return index_1.VerificacaoLancamentoFireConvert; } });
|
|
24
|
+
Object.defineProperty(exports, "VerificacaoLancamentoFirestoreData", { enumerable: true, get: function () { return index_1.VerificacaoLancamentoFirestoreData; } });
|
|
27
25
|
Object.defineProperty(exports, "TipoAcaoLancamentoEnum", { enumerable: true, get: function () { return index_1.TipoAcaoLancamentoEnum; } });
|
|
28
26
|
Object.defineProperty(exports, "TipoOcorrenciaFrequenciaEnum", { enumerable: true, get: function () { return index_1.TipoOcorrenciaFrequenciaEnum; } });
|
|
29
|
-
Object.defineProperty(exports, "
|
|
27
|
+
Object.defineProperty(exports, "TipoReferenciaUsuarioLancamento", { enumerable: true, get: function () { return index_1.TipoReferenciaUsuarioLancamento; } });
|
|
30
28
|
Object.defineProperty(exports, "UsuarioLancamento", { enumerable: true, get: function () { return index_1.UsuarioLancamento; } });
|
|
31
29
|
Object.defineProperty(exports, "UsuarioLancamentoFireConvert", { enumerable: true, get: function () { return index_1.UsuarioLancamentoFireConvert; } });
|
|
32
30
|
Object.defineProperty(exports, "UsuarioLancamentoFirestoreData", { enumerable: true, get: function () { return index_1.UsuarioLancamentoFirestoreData; } });
|
|
31
|
+
Object.defineProperty(exports, "VerificacaoLancamento", { enumerable: true, get: function () { return index_1.VerificacaoLancamento; } });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TipoOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
|
|
2
2
|
export * from './lancamento-fire-convert';
|
|
3
3
|
export * from './lancamento-json-convert';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
4
|
+
export * from './verificacoes/verificacao-lancamento-fire-convert';
|
|
5
|
+
export * from './verificacoes/verificacao-lancamento';
|
|
6
6
|
export * from './usuarios/usuario-lancamento-fire-convert';
|
|
7
7
|
export * from './usuarios/usuario-lancamento';
|
|
8
8
|
export declare enum LancamentoStatusEnum {
|
|
@@ -17,8 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
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
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./
|
|
20
|
+
__exportStar(require("./verificacoes/verificacao-lancamento-fire-convert"), exports);
|
|
21
|
+
__exportStar(require("./verificacoes/verificacao-lancamento"), exports);
|
|
22
22
|
__exportStar(require("./usuarios/usuario-lancamento-fire-convert"), exports);
|
|
23
23
|
__exportStar(require("./usuarios/usuario-lancamento"), exports);
|
|
24
24
|
var LancamentoStatusEnum;
|
|
@@ -39,8 +39,8 @@ export declare class LogLancamento implements LogLancamentoBase {
|
|
|
39
39
|
visto: boolean;
|
|
40
40
|
referencia: {
|
|
41
41
|
tipo: TipoReferenciaLogLancamento;
|
|
42
|
-
data?:
|
|
43
|
-
ref:
|
|
42
|
+
data?: Date;
|
|
43
|
+
ref: string;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* Creates an instance of UsuarioLancamento.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
2
|
+
import { VerificacaoLancamento, VerificacaoLancamentoBase, TipoReferenciaUsuarioLancamento } from './verificacao-lancamento';
|
|
3
|
+
export declare class VerificacaoLancamentoFirestoreData implements VerificacaoLancamentoBase {
|
|
4
|
+
detalhes?: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
usuario?: {
|
|
7
|
+
documento: string;
|
|
8
|
+
nome: string;
|
|
9
|
+
ref: DocumentReference;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
referencia: {
|
|
13
|
+
tipo: TipoReferenciaUsuarioLancamento;
|
|
14
|
+
data?: Timestamp;
|
|
15
|
+
ref: DocumentReference;
|
|
16
|
+
};
|
|
17
|
+
visto: boolean;
|
|
18
|
+
data_criacao: Timestamp;
|
|
19
|
+
mensagem: string;
|
|
20
|
+
}
|
|
21
|
+
export declare abstract class VerificacaoLancamentoFireConvert {
|
|
22
|
+
static fromFirestore(doc: DocumentSnapshot<VerificacaoLancamentoFirestoreData> | QueryDocumentSnapshot<VerificacaoLancamentoFirestoreData>): VerificacaoLancamento;
|
|
23
|
+
static toFirestore(logLancamento: VerificacaoLancamento, timestampfromDate: (date: Date) => any, documentReferenceFromPath: (path: string) => DocumentReference<any>): Partial<VerificacaoLancamentoFirestoreData>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificacaoLancamentoFireConvert = exports.VerificacaoLancamentoFirestoreData = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var boolean_helper_1 = require("../../../utils/boolean-helper");
|
|
6
|
+
var string_helper_1 = require("../../../utils/string-helper");
|
|
7
|
+
var type_guards_1 = require("../../../utils/type-guards");
|
|
8
|
+
var verificacao_lancamento_1 = require("./verificacao-lancamento");
|
|
9
|
+
var VerificacaoLancamentoFirestoreData = /** @class */ (function () {
|
|
10
|
+
function VerificacaoLancamentoFirestoreData() {
|
|
11
|
+
}
|
|
12
|
+
return VerificacaoLancamentoFirestoreData;
|
|
13
|
+
}());
|
|
14
|
+
exports.VerificacaoLancamentoFirestoreData = VerificacaoLancamentoFirestoreData;
|
|
15
|
+
var VerificacaoLancamentoFireConvert = /** @class */ (function () {
|
|
16
|
+
function VerificacaoLancamentoFireConvert() {
|
|
17
|
+
}
|
|
18
|
+
VerificacaoLancamentoFireConvert.fromFirestore = function (doc) {
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
20
|
+
var fireDocument = doc.data();
|
|
21
|
+
return new verificacao_lancamento_1.VerificacaoLancamento({
|
|
22
|
+
_id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
23
|
+
_path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
24
|
+
data_criacao: (0, type_guards_1.TipoTimestampFirestore)(fireDocument === null || fireDocument === void 0 ? void 0 : fireDocument.data_criacao)
|
|
25
|
+
? (fireDocument === null || fireDocument === void 0 ? void 0 : fireDocument.data_criacao).toDate()
|
|
26
|
+
: null,
|
|
27
|
+
referencia: {
|
|
28
|
+
ref: (0, type_guards_1.TipoDocumentReference)((_c = fireDocument === null || fireDocument === void 0 ? void 0 : fireDocument.referencia) === null || _c === void 0 ? void 0 : _c.ref)
|
|
29
|
+
? fireDocument.referencia.ref.path
|
|
30
|
+
: null,
|
|
31
|
+
data: (0, type_guards_1.TipoTimestampFirestore)((_d = fireDocument === null || fireDocument === void 0 ? void 0 : fireDocument.referencia) === null || _d === void 0 ? void 0 : _d.data)
|
|
32
|
+
? fireDocument.referencia.data.toDate()
|
|
33
|
+
: null,
|
|
34
|
+
tipo: string_helper_1.StringHelper.check(fireDocument.referencia.tipo, null),
|
|
35
|
+
},
|
|
36
|
+
mensagem: string_helper_1.StringHelper.trim(fireDocument === null || fireDocument === void 0 ? void 0 : fireDocument.mensagem, null),
|
|
37
|
+
detalhes: (fireDocument === null || fireDocument === void 0 ? void 0 : fireDocument.detalhes)
|
|
38
|
+
? {
|
|
39
|
+
usuario: ((_e = fireDocument.detalhes) === null || _e === void 0 ? void 0 : _e.usuario)
|
|
40
|
+
? {
|
|
41
|
+
documento: string_helper_1.StringHelper.check(fireDocument.detalhes.usuario.documento, null),
|
|
42
|
+
nome: string_helper_1.StringHelper.check(fireDocument.detalhes.usuario.nome, null),
|
|
43
|
+
ref: string_helper_1.StringHelper.check((_f = fireDocument.detalhes.usuario.ref) === null || _f === void 0 ? void 0 : _f.path, null),
|
|
44
|
+
}
|
|
45
|
+
: null,
|
|
46
|
+
}
|
|
47
|
+
: null,
|
|
48
|
+
visto: (_g = fireDocument === null || fireDocument === void 0 ? void 0 : fireDocument.visto) !== null && _g !== void 0 ? _g : false,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
VerificacaoLancamentoFireConvert.toFirestore = function (logLancamento, timestampfromDate, documentReferenceFromPath) {
|
|
52
|
+
var _a;
|
|
53
|
+
var logLancamentoFirestore = {
|
|
54
|
+
mensagem: logLancamento.mensagem,
|
|
55
|
+
detalhes: (logLancamento === null || logLancamento === void 0 ? void 0 : logLancamento.detalhes)
|
|
56
|
+
? {
|
|
57
|
+
usuario: ((_a = logLancamento.detalhes) === null || _a === void 0 ? void 0 : _a.usuario)
|
|
58
|
+
? {
|
|
59
|
+
documento: string_helper_1.StringHelper.check(logLancamento.detalhes.usuario.documento, null),
|
|
60
|
+
nome: string_helper_1.StringHelper.check(logLancamento.detalhes.usuario.nome, null),
|
|
61
|
+
ref: documentReferenceFromPath(logLancamento.detalhes.usuario.ref),
|
|
62
|
+
}
|
|
63
|
+
: null,
|
|
64
|
+
}
|
|
65
|
+
: null,
|
|
66
|
+
data_criacao: timestampfromDate(logLancamento.data_criacao),
|
|
67
|
+
referencia: {
|
|
68
|
+
data: timestampfromDate(logLancamento.referencia.data),
|
|
69
|
+
ref: documentReferenceFromPath(logLancamento.referencia.ref),
|
|
70
|
+
tipo: string_helper_1.StringHelper.trim(logLancamento.referencia.tipo, null),
|
|
71
|
+
},
|
|
72
|
+
visto: boolean_helper_1.BooleanHelper.check(logLancamento.visto, false),
|
|
73
|
+
};
|
|
74
|
+
return (0, lodash_1.omitBy)(logLancamentoFirestore, lodash_1.isUndefined);
|
|
75
|
+
};
|
|
76
|
+
return VerificacaoLancamentoFireConvert;
|
|
77
|
+
}());
|
|
78
|
+
exports.VerificacaoLancamentoFireConvert = VerificacaoLancamentoFireConvert;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare enum TipoReferenciaUsuarioLancamento {
|
|
2
|
+
JORNADA = "JORNADA",
|
|
3
|
+
USUARIO = "USUARIO"
|
|
4
|
+
}
|
|
5
|
+
export interface VerificacaoLancamentoBase {
|
|
6
|
+
data_criacao: any;
|
|
7
|
+
mensagem: any;
|
|
8
|
+
detalhes?: {
|
|
9
|
+
usuario?: {
|
|
10
|
+
documento: any;
|
|
11
|
+
nome: any;
|
|
12
|
+
ref: any;
|
|
13
|
+
};
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
referencia: {
|
|
17
|
+
tipo: any;
|
|
18
|
+
data?: any;
|
|
19
|
+
ref: any;
|
|
20
|
+
};
|
|
21
|
+
visto: any;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Internal class col contas/${contaId}/lancamentos/${lancamentoId}/verificacoes_lancamentos/${usuarioId}.
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @class UsuarioLancamento
|
|
28
|
+
* @implements {VerificacaoLancamentoBase}
|
|
29
|
+
*/
|
|
30
|
+
export declare class VerificacaoLancamento implements VerificacaoLancamentoBase {
|
|
31
|
+
_id: string;
|
|
32
|
+
_path: string;
|
|
33
|
+
data_criacao: Date;
|
|
34
|
+
mensagem: string;
|
|
35
|
+
detalhes?: {
|
|
36
|
+
usuario?: {
|
|
37
|
+
documento: string;
|
|
38
|
+
nome: string;
|
|
39
|
+
ref: string;
|
|
40
|
+
};
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
visto: boolean;
|
|
44
|
+
referencia: {
|
|
45
|
+
tipo: TipoReferenciaUsuarioLancamento;
|
|
46
|
+
data?: Date;
|
|
47
|
+
ref: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Creates an instance of UsuarioLancamento.
|
|
51
|
+
* @param {Partial<VerificacaoLancamento>} usuarioLancamentoPayload
|
|
52
|
+
* @memberof Lancamento
|
|
53
|
+
*/
|
|
54
|
+
constructor(usuarioLancamentoPayload: Partial<VerificacaoLancamento>);
|
|
55
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificacaoLancamento = exports.TipoReferenciaUsuarioLancamento = void 0;
|
|
4
|
+
var TipoReferenciaUsuarioLancamento;
|
|
5
|
+
(function (TipoReferenciaUsuarioLancamento) {
|
|
6
|
+
TipoReferenciaUsuarioLancamento["JORNADA"] = "JORNADA";
|
|
7
|
+
TipoReferenciaUsuarioLancamento["USUARIO"] = "USUARIO";
|
|
8
|
+
})(TipoReferenciaUsuarioLancamento = exports.TipoReferenciaUsuarioLancamento || (exports.TipoReferenciaUsuarioLancamento = {}));
|
|
9
|
+
/**
|
|
10
|
+
* Internal class col contas/${contaId}/lancamentos/${lancamentoId}/verificacoes_lancamentos/${usuarioId}.
|
|
11
|
+
*
|
|
12
|
+
* @export
|
|
13
|
+
* @class UsuarioLancamento
|
|
14
|
+
* @implements {VerificacaoLancamentoBase}
|
|
15
|
+
*/
|
|
16
|
+
var VerificacaoLancamento = /** @class */ (function () {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of UsuarioLancamento.
|
|
19
|
+
* @param {Partial<VerificacaoLancamento>} usuarioLancamentoPayload
|
|
20
|
+
* @memberof Lancamento
|
|
21
|
+
*/
|
|
22
|
+
function VerificacaoLancamento(usuarioLancamentoPayload) {
|
|
23
|
+
var _this = this;
|
|
24
|
+
var keysOfProps = ["data_criacao", "_id", "_path", "mensagem", "detalhes", "visto", "referencia"];
|
|
25
|
+
keysOfProps.forEach(function (key) {
|
|
26
|
+
_this[key] = usuarioLancamentoPayload
|
|
27
|
+
? usuarioLancamentoPayload[key]
|
|
28
|
+
: undefined;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return VerificacaoLancamento;
|
|
32
|
+
}());
|
|
33
|
+
exports.VerificacaoLancamento = VerificacaoLancamento;
|
|
@@ -4,6 +4,14 @@ exports.StringHelper = void 0;
|
|
|
4
4
|
var StringHelper = /** @class */ (function () {
|
|
5
5
|
function StringHelper() {
|
|
6
6
|
}
|
|
7
|
+
StringHelper.check = function (str, def) {
|
|
8
|
+
if (typeof str === 'string') {
|
|
9
|
+
return String(str);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return def;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
7
15
|
StringHelper.trim = function (str, def) {
|
|
8
16
|
if (typeof str === 'string') {
|
|
9
17
|
return str.trim();
|