flit-models 2.1.5 → 2.1.8
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/models/contas/feriado/empresa-feriado-fire-convert.d.ts +3 -2
- package/lib/models/contas/feriado/empresa-feriado-fire-convert.js +9 -7
- package/lib/models/contas/feriado/empresa-feriado.d.ts +10 -8
- package/lib/models/contas/feriado/empresa-feriado.js +1 -1
- package/lib/models/contas/feriado/feriado-fire-convert.d.ts +1 -1
- package/lib/models/contas/feriado/feriado-fire-convert.js +6 -4
- package/lib/models/contas/feriado/feriado-json-convert.d.ts +2 -2
- package/lib/models/contas/feriado/feriado-json-convert.js +4 -4
- package/lib/models/contas/feriado/index.d.ts +2 -2
- package/lib/models/contas/feriado/index.js +6 -2
- package/lib/models/contas/lancamento/index.d.ts +66 -0
- package/lib/models/contas/lancamento/index.js +54 -0
- package/lib/models/contas/lancamento/lancamento-fire-convert.d.ts +26 -0
- package/lib/models/contas/lancamento/lancamento-fire-convert.js +75 -0
- package/lib/models/contas/lancamento/lancamento-json-convert.d.ts +27 -0
- package/lib/models/contas/lancamento/lancamento-json-convert.js +69 -0
- package/lib/models/contas/lancamento/logs/log-lancamento-fire-convert.d.ts +18 -0
- package/lib/models/contas/lancamento/logs/log-lancamento-fire-convert.js +53 -0
- package/lib/models/contas/lancamento/logs/log-lancamento.d.ts +41 -0
- package/lib/models/contas/lancamento/logs/log-lancamento.js +33 -0
- package/lib/models/contas/lancamento/usuarios/usuario-lancamento-fire-convert.d.ts +12 -0
- package/lib/models/contas/lancamento/usuarios/usuario-lancamento-fire-convert.js +41 -0
- package/lib/models/contas/lancamento/usuarios/usuario-lancamento.d.ts +27 -0
- package/lib/models/contas/lancamento/usuarios/usuario-lancamento.js +28 -0
- package/lib/models/contas/ocorrencia_frequencia/index.d.ts +12 -0
- package/lib/models/contas/ocorrencia_frequencia/index.js +16 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +6 -1
- package/lib/models/utils/type-guards.js +4 -6
- package/package.json +11 -11
- package/lib/models/contas/feriado/empresas-feriado-fire-convert.d.ts +0 -12
- package/lib/models/contas/feriado/empresas-feriado-fire-convert.js +0 -40
- package/lib/models/contas/feriado/empresas-feriado.d.ts +0 -27
- package/lib/models/contas/feriado/empresas-feriado.js +0 -28
|
@@ -3,8 +3,9 @@ import { EmpresaFeriado, EmpresaFeriadoBase } from './empresa-feriado';
|
|
|
3
3
|
export declare class EmpresaFeriadoFirestoreData implements EmpresaFeriadoBase {
|
|
4
4
|
ref: DocumentReference;
|
|
5
5
|
documento: string;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
municipio: string;
|
|
7
|
+
nome: string;
|
|
8
|
+
uf: string;
|
|
8
9
|
}
|
|
9
10
|
export declare abstract class EmpresaFeriadoFireConvert {
|
|
10
11
|
static fromFirestore(doc: DocumentSnapshot<EmpresaFeriadoFirestoreData> | QueryDocumentSnapshot<EmpresaFeriadoFirestoreData>): EmpresaFeriado;
|
|
@@ -17,22 +17,24 @@ var EmpresaFeriadoFireConvert = /** @class */ (function () {
|
|
|
17
17
|
EmpresaFeriadoFireConvert.fromFirestore = function (doc) {
|
|
18
18
|
var _a, _b;
|
|
19
19
|
return new empresa_feriado_1.EmpresaFeriado({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
documento: string_helper_1.StringHelper.trim(doc.get('documento'), null),
|
|
23
|
-
nome_fantasia: string_helper_1.StringHelper.trim(doc.get('nome_fantasia'), null),
|
|
24
|
-
razao_social: string_helper_1.StringHelper.trim(doc.get('razao_social'), null),
|
|
20
|
+
_id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
21
|
+
_path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
25
22
|
ref: (0, type_guards_1.TipoDocumentReference)(doc.get('ref'))
|
|
26
23
|
? doc.get('ref').path
|
|
27
24
|
: null,
|
|
25
|
+
documento: string_helper_1.StringHelper.trim(doc.get('documento'), null),
|
|
26
|
+
municipio: string_helper_1.StringHelper.trim(doc.get('municipio'), null),
|
|
27
|
+
nome: string_helper_1.StringHelper.trim(doc.get('nome'), null),
|
|
28
|
+
uf: string_helper_1.StringHelper.trim(doc.get('uf'), null),
|
|
28
29
|
});
|
|
29
30
|
};
|
|
30
31
|
EmpresaFeriadoFireConvert.toFirestore = function (empresaFeriado, docRefConstructor) {
|
|
31
32
|
return (0, lodash_1.omitBy)({
|
|
32
33
|
documento: empresaFeriado.documento,
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
municipio: empresaFeriado.municipio,
|
|
35
|
+
nome: empresaFeriado.nome,
|
|
35
36
|
ref: docRefConstructor(empresaFeriado.ref),
|
|
37
|
+
uf: empresaFeriado.uf,
|
|
36
38
|
}, lodash_1.isUndefined);
|
|
37
39
|
};
|
|
38
40
|
return EmpresaFeriadoFireConvert;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export interface EmpresaFeriadoBase {
|
|
2
|
-
ref: any;
|
|
3
2
|
documento: any;
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
municipio: any;
|
|
4
|
+
nome: any;
|
|
5
|
+
ref: any;
|
|
6
|
+
uf: any;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Internal class col contas/${contaId}/feriados/${feriadoId}/empresas_feriado/${empresaId}.
|
|
@@ -12,12 +13,13 @@ export interface EmpresaFeriadoBase {
|
|
|
12
13
|
* @implements {FeriadoFirestoreData}
|
|
13
14
|
*/
|
|
14
15
|
export declare class EmpresaFeriado implements EmpresaFeriadoBase {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
ref: string;
|
|
16
|
+
_id: string;
|
|
17
|
+
_path: string;
|
|
18
18
|
documento: string;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
municipio: string;
|
|
20
|
+
nome: string;
|
|
21
|
+
ref: string;
|
|
22
|
+
uf: string;
|
|
21
23
|
/**
|
|
22
24
|
* Creates an instance of FeriadoEmpresa.
|
|
23
25
|
* @param {Partial<EmpresaFeriado>} feriadoEmpresaPayload
|
|
@@ -16,7 +16,7 @@ var EmpresaFeriado = /** @class */ (function () {
|
|
|
16
16
|
*/
|
|
17
17
|
function EmpresaFeriado(feriadoEmpresaPayload) {
|
|
18
18
|
var _this = this;
|
|
19
|
-
var keysOfProps = ["
|
|
19
|
+
var keysOfProps = ["_id", "_path", "documento", "municipio", "nome", "ref", "uf"];
|
|
20
20
|
keysOfProps.forEach(function (key) {
|
|
21
21
|
_this[key] = feriadoEmpresaPayload
|
|
22
22
|
? feriadoEmpresaPayload[key]
|
|
@@ -12,5 +12,5 @@ export declare class FeriadoFirestoreData implements FeriadoBase {
|
|
|
12
12
|
}
|
|
13
13
|
export declare abstract class FeriadoFireConvert {
|
|
14
14
|
static fromFirestore(doc: DocumentSnapshot<FeriadoFirestoreData> | QueryDocumentSnapshot<FeriadoFirestoreData>): Feriado;
|
|
15
|
-
static toFirestore(feriado: Feriado): Partial<FeriadoFirestoreData>;
|
|
15
|
+
static toFirestore(feriado: Feriado, timestampfromDate?: (date: Date) => any): Partial<FeriadoFirestoreData>;
|
|
16
16
|
}
|
|
@@ -19,8 +19,8 @@ var FeriadoFireConvert = /** @class */ (function () {
|
|
|
19
19
|
FeriadoFireConvert.fromFirestore = function (doc) {
|
|
20
20
|
var _a, _b;
|
|
21
21
|
return new _1.Feriado({
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
_id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
23
|
+
_path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
24
24
|
data: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data'))
|
|
25
25
|
? doc.get('data').toDate()
|
|
26
26
|
: null,
|
|
@@ -33,9 +33,11 @@ var FeriadoFireConvert = /** @class */ (function () {
|
|
|
33
33
|
uf: string_helper_1.StringHelper.trim(doc.get('uf'), null),
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
FeriadoFireConvert.toFirestore = function (feriado) {
|
|
36
|
+
FeriadoFireConvert.toFirestore = function (feriado, timestampfromDate) {
|
|
37
37
|
return (0, lodash_1.omitBy)({
|
|
38
|
-
data:
|
|
38
|
+
data: timestampfromDate
|
|
39
|
+
? timestampfromDate(feriado.data)
|
|
40
|
+
: firestore_1.Timestamp.fromDate(feriado.data),
|
|
39
41
|
descricao: string_helper_1.StringHelper.trim(feriado.descricao, null),
|
|
40
42
|
excluido: boolean_helper_1.BooleanHelper.check(feriado.excluido, false),
|
|
41
43
|
importacao_id: string_helper_1.StringHelper.trim(feriado.importacao_id, null),
|
|
@@ -18,8 +18,8 @@ var FeriadoJsonConvert = /** @class */ (function () {
|
|
|
18
18
|
FeriadoJsonConvert.fromJson = function (obj) {
|
|
19
19
|
var _a, _b;
|
|
20
20
|
return new _1.Feriado({
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
_id: (_a = obj._id) !== null && _a !== void 0 ? _a : null,
|
|
22
|
+
_path: (_b = obj._path) !== null && _b !== void 0 ? _b : null,
|
|
23
23
|
data: date_helper_1.DateHelper.fromString(obj.data, null),
|
|
24
24
|
descricao: string_helper_1.StringHelper.trim(obj.descricao, null),
|
|
25
25
|
excluido: boolean_helper_1.BooleanHelper.check(obj.excluido, false),
|
|
@@ -33,8 +33,8 @@ var FeriadoJsonConvert = /** @class */ (function () {
|
|
|
33
33
|
FeriadoJsonConvert.toJson = function (feriado) {
|
|
34
34
|
var _a, _b;
|
|
35
35
|
return (0, lodash_1.omitBy)({
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
_id: (_a = feriado._id) !== null && _a !== void 0 ? _a : null,
|
|
37
|
+
_path: (_b = feriado._path) !== null && _b !== void 0 ? _b : null,
|
|
38
38
|
data: feriado.data.toISOString(),
|
|
39
39
|
descricao: string_helper_1.StringHelper.trim(feriado.descricao, null),
|
|
40
40
|
excluido: boolean_helper_1.BooleanHelper.check(feriado.excluido, false),
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -35,7 +39,7 @@ var Feriado = /** @class */ (function () {
|
|
|
35
39
|
*/
|
|
36
40
|
function Feriado(feriadoPayload) {
|
|
37
41
|
var _this = this;
|
|
38
|
-
var keysOfProps = ["
|
|
42
|
+
var keysOfProps = ["tipo", "_id", "_path", "municipio", "uf", "data", "descricao", "excluido", "importacao_id", "todas_empresas"];
|
|
39
43
|
keysOfProps.forEach(function (key) {
|
|
40
44
|
_this[key] = feriadoPayload ? feriadoPayload[key] : undefined;
|
|
41
45
|
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { TiposOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
|
|
2
|
+
export * from './lancamento-fire-convert';
|
|
3
|
+
export * from './lancamento-json-convert';
|
|
4
|
+
export * from './logs/log-lancamento-fire-convert';
|
|
5
|
+
export * from './logs/log-lancamento';
|
|
6
|
+
export * from './usuarios/usuario-lancamento-fire-convert';
|
|
7
|
+
export * from './usuarios/usuario-lancamento';
|
|
8
|
+
export declare enum LancamentoStatusEnum {
|
|
9
|
+
COMPLETO = "COMPLETO",
|
|
10
|
+
PENDENTE = "PENDENTE",
|
|
11
|
+
VERIFICAR = "VERIFICAR"
|
|
12
|
+
}
|
|
13
|
+
export interface LancamentoBase {
|
|
14
|
+
data_inicial: any;
|
|
15
|
+
data_final: any;
|
|
16
|
+
descricao: any;
|
|
17
|
+
excluido: any;
|
|
18
|
+
ocorrencia_tipo: any;
|
|
19
|
+
ocorrencia: {
|
|
20
|
+
ref?: any;
|
|
21
|
+
path?: any;
|
|
22
|
+
tipo: any;
|
|
23
|
+
descricao: any;
|
|
24
|
+
};
|
|
25
|
+
empresa: {
|
|
26
|
+
ref?: any;
|
|
27
|
+
path?: any;
|
|
28
|
+
razao: any;
|
|
29
|
+
fantasia: any;
|
|
30
|
+
documento: any;
|
|
31
|
+
};
|
|
32
|
+
status: any;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Internal class col contas/${contaId}/lancamento/${lancamentoId}.
|
|
36
|
+
*
|
|
37
|
+
* @export
|
|
38
|
+
* @class Lancamento
|
|
39
|
+
*/
|
|
40
|
+
export declare class Lancamento implements LancamentoBase {
|
|
41
|
+
_id: string;
|
|
42
|
+
_path: string;
|
|
43
|
+
ocorrencia_tipo: TiposOcorrenciaFrequenciaEnum;
|
|
44
|
+
data_final: Date;
|
|
45
|
+
data_inicial: Date;
|
|
46
|
+
descricao: string;
|
|
47
|
+
empresa: {
|
|
48
|
+
path: string;
|
|
49
|
+
razao: string;
|
|
50
|
+
fantasia: string;
|
|
51
|
+
documento: string;
|
|
52
|
+
};
|
|
53
|
+
excluido: boolean;
|
|
54
|
+
ocorrencia: {
|
|
55
|
+
path: string;
|
|
56
|
+
tipo: TiposOcorrenciaFrequenciaEnum;
|
|
57
|
+
descricao: string;
|
|
58
|
+
};
|
|
59
|
+
status: LancamentoStatusEnum;
|
|
60
|
+
/**
|
|
61
|
+
* Creates an instance of Lancamento.
|
|
62
|
+
* @param {Partial<Lancamento>} lancamentoPayload
|
|
63
|
+
* @memberof Lancamento
|
|
64
|
+
*/
|
|
65
|
+
constructor(lancamentoPayload: Partial<Lancamento>);
|
|
66
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Lancamento = exports.LancamentoStatusEnum = void 0;
|
|
18
|
+
__exportStar(require("./lancamento-fire-convert"), exports);
|
|
19
|
+
__exportStar(require("./lancamento-json-convert"), exports);
|
|
20
|
+
__exportStar(require("./logs/log-lancamento-fire-convert"), exports);
|
|
21
|
+
__exportStar(require("./logs/log-lancamento"), exports);
|
|
22
|
+
__exportStar(require("./usuarios/usuario-lancamento-fire-convert"), exports);
|
|
23
|
+
__exportStar(require("./usuarios/usuario-lancamento"), exports);
|
|
24
|
+
var LancamentoStatusEnum;
|
|
25
|
+
(function (LancamentoStatusEnum) {
|
|
26
|
+
LancamentoStatusEnum["COMPLETO"] = "COMPLETO";
|
|
27
|
+
LancamentoStatusEnum["PENDENTE"] = "PENDENTE";
|
|
28
|
+
LancamentoStatusEnum["VERIFICAR"] = "VERIFICAR";
|
|
29
|
+
})(LancamentoStatusEnum = exports.LancamentoStatusEnum || (exports.LancamentoStatusEnum = {}));
|
|
30
|
+
/**
|
|
31
|
+
* Internal class col contas/${contaId}/lancamento/${lancamentoId}.
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @class Lancamento
|
|
35
|
+
*/
|
|
36
|
+
var Lancamento = /** @class */ (function () {
|
|
37
|
+
// #endregion
|
|
38
|
+
/**
|
|
39
|
+
* Creates an instance of Lancamento.
|
|
40
|
+
* @param {Partial<Lancamento>} lancamentoPayload
|
|
41
|
+
* @memberof Lancamento
|
|
42
|
+
*/
|
|
43
|
+
function Lancamento(lancamentoPayload) {
|
|
44
|
+
var _this = this;
|
|
45
|
+
var keysOfProps = ["status", "_id", "_path", "descricao", "excluido", "data_inicial", "data_final", "ocorrencia_tipo", "ocorrencia", "empresa"];
|
|
46
|
+
keysOfProps.forEach(function (key) {
|
|
47
|
+
_this[key] = lancamentoPayload
|
|
48
|
+
? lancamentoPayload[key]
|
|
49
|
+
: undefined;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return Lancamento;
|
|
53
|
+
}());
|
|
54
|
+
exports.Lancamento = Lancamento;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
2
|
+
import { Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
|
|
3
|
+
import { TiposOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
|
|
4
|
+
export declare class LancamentoFirestoreData implements LancamentoBase {
|
|
5
|
+
data_inicial: Timestamp;
|
|
6
|
+
data_final: Timestamp;
|
|
7
|
+
descricao: string;
|
|
8
|
+
excluido: boolean;
|
|
9
|
+
ocorrencia_tipo: TiposOcorrenciaFrequenciaEnum;
|
|
10
|
+
ocorrencia: {
|
|
11
|
+
ref: DocumentReference;
|
|
12
|
+
tipo: TiposOcorrenciaFrequenciaEnum;
|
|
13
|
+
descricao: string;
|
|
14
|
+
};
|
|
15
|
+
empresa: {
|
|
16
|
+
ref: DocumentReference;
|
|
17
|
+
razao: string;
|
|
18
|
+
fantasia: string;
|
|
19
|
+
documento: string;
|
|
20
|
+
};
|
|
21
|
+
status: LancamentoStatusEnum;
|
|
22
|
+
}
|
|
23
|
+
export declare abstract class LancamentoFireConvert {
|
|
24
|
+
static fromFirestore(doc: DocumentSnapshot<LancamentoFirestoreData> | QueryDocumentSnapshot<LancamentoFirestoreData>): Lancamento;
|
|
25
|
+
static toFirestore(lancamento: Lancamento, documentReferenceFromPath: (path: string) => any, timestampfromDate?: (date: Date) => any): Partial<LancamentoFirestoreData>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LancamentoFireConvert = exports.LancamentoFirestoreData = void 0;
|
|
4
|
+
var firestore_1 = require("firebase/firestore");
|
|
5
|
+
var lodash_1 = require("lodash");
|
|
6
|
+
var _1 = require(".");
|
|
7
|
+
var boolean_helper_1 = require("../../utils/boolean-helper");
|
|
8
|
+
var string_helper_1 = require("../../utils/string-helper");
|
|
9
|
+
var type_guards_1 = require("../../utils/type-guards");
|
|
10
|
+
var LancamentoFirestoreData = /** @class */ (function () {
|
|
11
|
+
function LancamentoFirestoreData() {
|
|
12
|
+
}
|
|
13
|
+
return LancamentoFirestoreData;
|
|
14
|
+
}());
|
|
15
|
+
exports.LancamentoFirestoreData = LancamentoFirestoreData;
|
|
16
|
+
var LancamentoFireConvert = /** @class */ (function () {
|
|
17
|
+
function LancamentoFireConvert() {
|
|
18
|
+
}
|
|
19
|
+
LancamentoFireConvert.fromFirestore = function (doc) {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
return new _1.Lancamento({
|
|
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_inicial: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data'))
|
|
25
|
+
? doc.get('data_inicial').toDate()
|
|
26
|
+
: null,
|
|
27
|
+
data_final: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data'))
|
|
28
|
+
? doc.get('data_final').toDate()
|
|
29
|
+
: null,
|
|
30
|
+
descricao: string_helper_1.StringHelper.trim(doc.get('descricao'), null),
|
|
31
|
+
excluido: boolean_helper_1.BooleanHelper.check(doc.get('excluido'), false),
|
|
32
|
+
ocorrencia_tipo: string_helper_1.StringHelper.trim(doc.get('tipo'), null),
|
|
33
|
+
status: string_helper_1.StringHelper.trim(doc.get('tipo'), null),
|
|
34
|
+
empresa: {
|
|
35
|
+
documento: string_helper_1.StringHelper.trim(doc.get('empresa.documento'), null),
|
|
36
|
+
fantasia: string_helper_1.StringHelper.trim(doc.get('empresa.fantasia'), null),
|
|
37
|
+
razao: string_helper_1.StringHelper.trim(doc.get('empresa.razao'), null),
|
|
38
|
+
path: string_helper_1.StringHelper.trim((_c = doc.ref) === null || _c === void 0 ? void 0 : _c.path, null),
|
|
39
|
+
},
|
|
40
|
+
ocorrencia: {
|
|
41
|
+
descricao: string_helper_1.StringHelper.trim(doc.get('ocorrencia.descricao'), null),
|
|
42
|
+
path: string_helper_1.StringHelper.trim(doc.get('ocorrencia.path'), null),
|
|
43
|
+
tipo: string_helper_1.StringHelper.trim(doc.get('ocorrencia.tipo'), null),
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
LancamentoFireConvert.toFirestore = function (lancamento, documentReferenceFromPath, timestampfromDate) {
|
|
48
|
+
var lancamentoFire = {
|
|
49
|
+
data_inicial: timestampfromDate
|
|
50
|
+
? timestampfromDate(lancamento.data_inicial)
|
|
51
|
+
: firestore_1.Timestamp.fromDate(lancamento.data_inicial),
|
|
52
|
+
data_final: timestampfromDate
|
|
53
|
+
? timestampfromDate(lancamento.data_final)
|
|
54
|
+
: firestore_1.Timestamp.fromDate(lancamento.data_final),
|
|
55
|
+
descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
|
|
56
|
+
excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
|
|
57
|
+
ocorrencia_tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia_tipo, null),
|
|
58
|
+
status: string_helper_1.StringHelper.trim(lancamento.status, null),
|
|
59
|
+
empresa: {
|
|
60
|
+
ref: documentReferenceFromPath(lancamento.empresa.path),
|
|
61
|
+
documento: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
|
|
62
|
+
fantasia: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
|
|
63
|
+
razao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
|
|
64
|
+
},
|
|
65
|
+
ocorrencia: {
|
|
66
|
+
ref: documentReferenceFromPath(lancamento.ocorrencia.path),
|
|
67
|
+
descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
|
|
68
|
+
tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia_tipo, null),
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
return (0, lodash_1.omitBy)(lancamentoFire, lodash_1.isUndefined);
|
|
72
|
+
};
|
|
73
|
+
return LancamentoFireConvert;
|
|
74
|
+
}());
|
|
75
|
+
exports.LancamentoFireConvert = LancamentoFireConvert;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
|
|
2
|
+
import { TiposOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
|
|
3
|
+
export declare class LancamentoJsonData implements LancamentoBase {
|
|
4
|
+
_id: string;
|
|
5
|
+
_path: string;
|
|
6
|
+
data_inicial: string;
|
|
7
|
+
data_final: string;
|
|
8
|
+
descricao: string;
|
|
9
|
+
excluido: boolean;
|
|
10
|
+
ocorrencia_tipo: TiposOcorrenciaFrequenciaEnum;
|
|
11
|
+
ocorrencia: {
|
|
12
|
+
path?: string;
|
|
13
|
+
tipo: TiposOcorrenciaFrequenciaEnum;
|
|
14
|
+
descricao: string;
|
|
15
|
+
};
|
|
16
|
+
empresa: {
|
|
17
|
+
path?: string;
|
|
18
|
+
razao: string;
|
|
19
|
+
fantasia: string;
|
|
20
|
+
documento: string;
|
|
21
|
+
};
|
|
22
|
+
status: LancamentoStatusEnum;
|
|
23
|
+
}
|
|
24
|
+
export declare abstract class LancamentoJsonConvert {
|
|
25
|
+
static fromJson(obj: LancamentoJsonData): Lancamento;
|
|
26
|
+
static toJson(lancamento: Lancamento): Partial<LancamentoJsonData>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LancamentoJsonConvert = exports.LancamentoJsonData = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var _1 = require(".");
|
|
6
|
+
var boolean_helper_1 = require("../../utils/boolean-helper");
|
|
7
|
+
var date_helper_1 = require("../../utils/date-helper");
|
|
8
|
+
var string_helper_1 = require("../../utils/string-helper");
|
|
9
|
+
var LancamentoJsonData = /** @class */ (function () {
|
|
10
|
+
function LancamentoJsonData() {
|
|
11
|
+
}
|
|
12
|
+
return LancamentoJsonData;
|
|
13
|
+
}());
|
|
14
|
+
exports.LancamentoJsonData = LancamentoJsonData;
|
|
15
|
+
var LancamentoJsonConvert = /** @class */ (function () {
|
|
16
|
+
function LancamentoJsonConvert() {
|
|
17
|
+
}
|
|
18
|
+
LancamentoJsonConvert.fromJson = function (obj) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
return new _1.Lancamento({
|
|
21
|
+
_id: (_a = obj._id) !== null && _a !== void 0 ? _a : null,
|
|
22
|
+
_path: (_b = obj._path) !== null && _b !== void 0 ? _b : null,
|
|
23
|
+
data_inicial: date_helper_1.DateHelper.fromString(obj.data_inicial, null),
|
|
24
|
+
data_final: date_helper_1.DateHelper.fromString(obj.data_inicial, null),
|
|
25
|
+
descricao: string_helper_1.StringHelper.trim(obj.descricao, null),
|
|
26
|
+
excluido: boolean_helper_1.BooleanHelper.check(obj.excluido, false),
|
|
27
|
+
status: string_helper_1.StringHelper.trim(obj.status, null),
|
|
28
|
+
ocorrencia_tipo: string_helper_1.StringHelper.trim(obj.ocorrencia_tipo, null),
|
|
29
|
+
empresa: {
|
|
30
|
+
documento: string_helper_1.StringHelper.trim(obj.empresa.documento, null),
|
|
31
|
+
fantasia: string_helper_1.StringHelper.trim(obj.empresa.fantasia, null),
|
|
32
|
+
razao: string_helper_1.StringHelper.trim(obj.empresa.razao, null),
|
|
33
|
+
path: string_helper_1.StringHelper.trim(obj.empresa.path, null),
|
|
34
|
+
},
|
|
35
|
+
ocorrencia: {
|
|
36
|
+
descricao: string_helper_1.StringHelper.trim(obj.ocorrencia.descricao, null),
|
|
37
|
+
path: string_helper_1.StringHelper.trim(obj.ocorrencia.path, null),
|
|
38
|
+
tipo: string_helper_1.StringHelper.trim(obj.ocorrencia.tipo, null),
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
LancamentoJsonConvert.toJson = function (lancamento) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
var lancamentoJson = {
|
|
45
|
+
_id: (_a = lancamento._id) !== null && _a !== void 0 ? _a : null,
|
|
46
|
+
_path: (_b = lancamento._path) !== null && _b !== void 0 ? _b : null,
|
|
47
|
+
data_inicial: lancamento.data_inicial.toISOString(),
|
|
48
|
+
data_final: lancamento.data_final.toISOString(),
|
|
49
|
+
descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
|
|
50
|
+
excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
|
|
51
|
+
status: string_helper_1.StringHelper.trim(lancamento.status, null),
|
|
52
|
+
ocorrencia_tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia_tipo, null),
|
|
53
|
+
empresa: {
|
|
54
|
+
documento: string_helper_1.StringHelper.trim(lancamento.empresa.documento, null),
|
|
55
|
+
fantasia: string_helper_1.StringHelper.trim(lancamento.empresa.fantasia, null),
|
|
56
|
+
razao: string_helper_1.StringHelper.trim(lancamento.empresa.razao, null),
|
|
57
|
+
path: string_helper_1.StringHelper.trim(lancamento.empresa.path, null),
|
|
58
|
+
},
|
|
59
|
+
ocorrencia: {
|
|
60
|
+
descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
|
|
61
|
+
path: string_helper_1.StringHelper.trim(lancamento.ocorrencia.path, null),
|
|
62
|
+
tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia.tipo, null),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
return (0, lodash_1.omitBy)(lancamentoJson, lodash_1.isUndefined);
|
|
66
|
+
};
|
|
67
|
+
return LancamentoJsonConvert;
|
|
68
|
+
}());
|
|
69
|
+
exports.LancamentoJsonConvert = LancamentoJsonConvert;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
2
|
+
import { LogLancamento, LogLancamentoBase, LogLancamentoStatusEnum } from './log-lancamento';
|
|
3
|
+
export declare class LogLancamentoFirestoreData implements LogLancamentoBase {
|
|
4
|
+
data: Timestamp;
|
|
5
|
+
mensagem: string;
|
|
6
|
+
detalhes: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
status: LogLancamentoStatusEnum;
|
|
10
|
+
jornada: {
|
|
11
|
+
data: Timestamp;
|
|
12
|
+
ref: DocumentReference;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare abstract class LogLancamentoFireConvert {
|
|
16
|
+
static fromFirestore(doc: DocumentSnapshot<LogLancamentoFirestoreData> | QueryDocumentSnapshot<LogLancamentoFirestoreData>): LogLancamento;
|
|
17
|
+
static toFirestore(logLancamento: LogLancamento, timestampfromDate: (date: Date) => any, documentReferenceFromPath: (path: string) => DocumentReference<any>): Partial<LogLancamentoFirestoreData>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogLancamentoFireConvert = exports.LogLancamentoFirestoreData = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var string_helper_1 = require("../../../utils/string-helper");
|
|
6
|
+
var type_guards_1 = require("../../../utils/type-guards");
|
|
7
|
+
var log_lancamento_1 = require("./log-lancamento");
|
|
8
|
+
var LogLancamentoFirestoreData = /** @class */ (function () {
|
|
9
|
+
function LogLancamentoFirestoreData() {
|
|
10
|
+
}
|
|
11
|
+
return LogLancamentoFirestoreData;
|
|
12
|
+
}());
|
|
13
|
+
exports.LogLancamentoFirestoreData = LogLancamentoFirestoreData;
|
|
14
|
+
var LogLancamentoFireConvert = /** @class */ (function () {
|
|
15
|
+
function LogLancamentoFireConvert() {
|
|
16
|
+
}
|
|
17
|
+
LogLancamentoFireConvert.fromFirestore = function (doc) {
|
|
18
|
+
var _a, _b, _c;
|
|
19
|
+
return new log_lancamento_1.LogLancamento({
|
|
20
|
+
_id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
21
|
+
_path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
22
|
+
data: (0, type_guards_1.TipoTimestampFirestore)(doc.get('jornada.data'))
|
|
23
|
+
? doc.get('data_inicial').toDate()
|
|
24
|
+
: null,
|
|
25
|
+
jornada: {
|
|
26
|
+
ref: (0, type_guards_1.TipoDocumentReference)(doc.get('ref'))
|
|
27
|
+
? doc.get('ref').path
|
|
28
|
+
: null,
|
|
29
|
+
data: (0, type_guards_1.TipoTimestampFirestore)(doc.get('jornada.data'))
|
|
30
|
+
? doc.get('data_inicial').toDate()
|
|
31
|
+
: null,
|
|
32
|
+
},
|
|
33
|
+
mensagem: string_helper_1.StringHelper.trim(doc.get('mensagem'), null),
|
|
34
|
+
status: string_helper_1.StringHelper.trim(doc.get('status'), null),
|
|
35
|
+
detalhes: (_c = doc.get('detalhes')) !== null && _c !== void 0 ? _c : null,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
LogLancamentoFireConvert.toFirestore = function (logLancamento, timestampfromDate, documentReferenceFromPath) {
|
|
39
|
+
var logLancamentoFirestore = {
|
|
40
|
+
mensagem: logLancamento.mensagem,
|
|
41
|
+
detalhes: logLancamento.detalhes,
|
|
42
|
+
status: logLancamento.status,
|
|
43
|
+
data: timestampfromDate(logLancamento.data),
|
|
44
|
+
jornada: {
|
|
45
|
+
data: timestampfromDate(logLancamento.jornada.data),
|
|
46
|
+
ref: documentReferenceFromPath(logLancamento.jornada.ref),
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
return (0, lodash_1.omitBy)(logLancamentoFirestore, lodash_1.isUndefined);
|
|
50
|
+
};
|
|
51
|
+
return LogLancamentoFireConvert;
|
|
52
|
+
}());
|
|
53
|
+
exports.LogLancamentoFireConvert = LogLancamentoFireConvert;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare enum LogLancamentoStatusEnum {
|
|
2
|
+
SUCESSO = "SUCESSO",
|
|
3
|
+
ERRO = "ERRO"
|
|
4
|
+
}
|
|
5
|
+
export interface LogLancamentoBase {
|
|
6
|
+
data: any;
|
|
7
|
+
mensagem: any;
|
|
8
|
+
detalhes: any;
|
|
9
|
+
status: any;
|
|
10
|
+
jornada: {
|
|
11
|
+
data: any;
|
|
12
|
+
ref: any;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Internal class col contas/${contaId}/lancamento/${lancamentoId}/logs_lancamento/${usuarioId}.
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @class UsuarioLancamento
|
|
20
|
+
* @implements {LogLancamentoBase}
|
|
21
|
+
*/
|
|
22
|
+
export declare class LogLancamento implements LogLancamentoBase {
|
|
23
|
+
_id: string;
|
|
24
|
+
_path: string;
|
|
25
|
+
data: Date;
|
|
26
|
+
mensagem: string;
|
|
27
|
+
detalhes: {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
status: LogLancamentoStatusEnum;
|
|
31
|
+
jornada: {
|
|
32
|
+
data: Date;
|
|
33
|
+
ref: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Creates an instance of UsuarioLancamento.
|
|
37
|
+
* @param {Partial<LogLancamento>} usuarioLancamentoPayload
|
|
38
|
+
* @memberof Lancamento
|
|
39
|
+
*/
|
|
40
|
+
constructor(usuarioLancamentoPayload: Partial<LogLancamento>);
|
|
41
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogLancamento = exports.LogLancamentoStatusEnum = void 0;
|
|
4
|
+
var LogLancamentoStatusEnum;
|
|
5
|
+
(function (LogLancamentoStatusEnum) {
|
|
6
|
+
LogLancamentoStatusEnum["SUCESSO"] = "SUCESSO";
|
|
7
|
+
LogLancamentoStatusEnum["ERRO"] = "ERRO";
|
|
8
|
+
})(LogLancamentoStatusEnum = exports.LogLancamentoStatusEnum || (exports.LogLancamentoStatusEnum = {}));
|
|
9
|
+
/**
|
|
10
|
+
* Internal class col contas/${contaId}/lancamento/${lancamentoId}/logs_lancamento/${usuarioId}.
|
|
11
|
+
*
|
|
12
|
+
* @export
|
|
13
|
+
* @class UsuarioLancamento
|
|
14
|
+
* @implements {LogLancamentoBase}
|
|
15
|
+
*/
|
|
16
|
+
var LogLancamento = /** @class */ (function () {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of UsuarioLancamento.
|
|
19
|
+
* @param {Partial<LogLancamento>} usuarioLancamentoPayload
|
|
20
|
+
* @memberof Lancamento
|
|
21
|
+
*/
|
|
22
|
+
function LogLancamento(usuarioLancamentoPayload) {
|
|
23
|
+
var _this = this;
|
|
24
|
+
var keysOfProps = ["status", "_id", "_path", "data", "mensagem", "detalhes", "jornada"];
|
|
25
|
+
keysOfProps.forEach(function (key) {
|
|
26
|
+
_this[key] = usuarioLancamentoPayload
|
|
27
|
+
? usuarioLancamentoPayload[key]
|
|
28
|
+
: undefined;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return LogLancamento;
|
|
32
|
+
}());
|
|
33
|
+
exports.LogLancamento = LogLancamento;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot } from 'firebase/firestore';
|
|
2
|
+
import { UsuarioLancamento, UsuarioLancamentoBase } from './usuario-lancamento';
|
|
3
|
+
export declare class UsuarioLancamentoFirestoreData implements UsuarioLancamentoBase {
|
|
4
|
+
documento: string;
|
|
5
|
+
nome_completo: string;
|
|
6
|
+
nome: string;
|
|
7
|
+
ref: DocumentReference;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class UsuarioLancamentoFireConvert {
|
|
10
|
+
static fromFirestore(doc: DocumentSnapshot<UsuarioLancamentoFirestoreData> | QueryDocumentSnapshot<UsuarioLancamentoFirestoreData>): UsuarioLancamento;
|
|
11
|
+
static toFirestore(usuarioLancamento: UsuarioLancamento, documentReferenceFromPath: (path: string) => DocumentReference<any>): Partial<UsuarioLancamentoFirestoreData>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UsuarioLancamentoFireConvert = exports.UsuarioLancamentoFirestoreData = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var string_helper_1 = require("../../../utils/string-helper");
|
|
6
|
+
var type_guards_1 = require("../../../utils/type-guards");
|
|
7
|
+
var usuario_lancamento_1 = require("./usuario-lancamento");
|
|
8
|
+
var UsuarioLancamentoFirestoreData = /** @class */ (function () {
|
|
9
|
+
function UsuarioLancamentoFirestoreData() {
|
|
10
|
+
}
|
|
11
|
+
return UsuarioLancamentoFirestoreData;
|
|
12
|
+
}());
|
|
13
|
+
exports.UsuarioLancamentoFirestoreData = UsuarioLancamentoFirestoreData;
|
|
14
|
+
var UsuarioLancamentoFireConvert = /** @class */ (function () {
|
|
15
|
+
function UsuarioLancamentoFireConvert() {
|
|
16
|
+
}
|
|
17
|
+
UsuarioLancamentoFireConvert.fromFirestore = function (doc) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return new usuario_lancamento_1.UsuarioLancamento({
|
|
20
|
+
_id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
21
|
+
_path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
22
|
+
ref: (0, type_guards_1.TipoDocumentReference)(doc.get('ref'))
|
|
23
|
+
? doc.get('ref').path
|
|
24
|
+
: null,
|
|
25
|
+
documento: string_helper_1.StringHelper.trim(doc.get('documento'), null),
|
|
26
|
+
nome_completo: string_helper_1.StringHelper.trim(doc.get('nome_completo'), null),
|
|
27
|
+
nome: string_helper_1.StringHelper.trim(doc.get('nome'), null),
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
UsuarioLancamentoFireConvert.toFirestore = function (usuarioLancamento, documentReferenceFromPath) {
|
|
31
|
+
var usuarioLancamentoFirestore = {
|
|
32
|
+
documento: usuarioLancamento.documento,
|
|
33
|
+
nome_completo: usuarioLancamento.nome_completo,
|
|
34
|
+
nome: usuarioLancamento.nome,
|
|
35
|
+
ref: documentReferenceFromPath(usuarioLancamento.ref),
|
|
36
|
+
};
|
|
37
|
+
return (0, lodash_1.omitBy)(usuarioLancamentoFirestore, lodash_1.isUndefined);
|
|
38
|
+
};
|
|
39
|
+
return UsuarioLancamentoFireConvert;
|
|
40
|
+
}());
|
|
41
|
+
exports.UsuarioLancamentoFireConvert = UsuarioLancamentoFireConvert;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface UsuarioLancamentoBase {
|
|
2
|
+
documento: any;
|
|
3
|
+
nome_completo: any;
|
|
4
|
+
nome: any;
|
|
5
|
+
ref: any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Internal class col contas/${contaId}/lancamento/${lancamentoId}/usuarios_lancamento/${usuarioId}.
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @class UsuarioLancamento
|
|
12
|
+
* @implements {UsuarioLancamentoBase}
|
|
13
|
+
*/
|
|
14
|
+
export declare class UsuarioLancamento implements UsuarioLancamentoBase {
|
|
15
|
+
_id: string;
|
|
16
|
+
_path: string;
|
|
17
|
+
documento: string;
|
|
18
|
+
nome_completo: string;
|
|
19
|
+
nome: string;
|
|
20
|
+
ref: string;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an instance of UsuarioLancamento.
|
|
23
|
+
* @param {Partial<UsuarioLancamento>} usuarioLancamentoPayload
|
|
24
|
+
* @memberof Lancamento
|
|
25
|
+
*/
|
|
26
|
+
constructor(usuarioLancamentoPayload: Partial<UsuarioLancamento>);
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UsuarioLancamento = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Internal class col contas/${contaId}/lancamento/${lancamentoId}/usuarios_lancamento/${usuarioId}.
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @class UsuarioLancamento
|
|
9
|
+
* @implements {UsuarioLancamentoBase}
|
|
10
|
+
*/
|
|
11
|
+
var UsuarioLancamento = /** @class */ (function () {
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of UsuarioLancamento.
|
|
14
|
+
* @param {Partial<UsuarioLancamento>} usuarioLancamentoPayload
|
|
15
|
+
* @memberof Lancamento
|
|
16
|
+
*/
|
|
17
|
+
function UsuarioLancamento(usuarioLancamentoPayload) {
|
|
18
|
+
var _this = this;
|
|
19
|
+
var keysOfProps = ["_id", "_path", "documento", "nome", "ref", "nome_completo"];
|
|
20
|
+
keysOfProps.forEach(function (key) {
|
|
21
|
+
_this[key] = usuarioLancamentoPayload
|
|
22
|
+
? usuarioLancamentoPayload[key]
|
|
23
|
+
: undefined;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return UsuarioLancamento;
|
|
27
|
+
}());
|
|
28
|
+
exports.UsuarioLancamento = UsuarioLancamento;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum TiposOcorrenciaFrequenciaEnum {
|
|
2
|
+
Abono = "Abono",
|
|
3
|
+
Afastado = "Afastado",
|
|
4
|
+
Atestado = "Atestado",
|
|
5
|
+
DiaTrabalhado = "Dia trabalhado",
|
|
6
|
+
Falta = "Falta",
|
|
7
|
+
FaltaBH = "Falta BH",
|
|
8
|
+
Ferias = "F\u00E9rias",
|
|
9
|
+
Folga = "Folga",
|
|
10
|
+
JornadaExterna = "Jornada externa",
|
|
11
|
+
Suspensao = "Suspens\u00E3o"
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TiposOcorrenciaFrequenciaEnum = void 0;
|
|
4
|
+
var TiposOcorrenciaFrequenciaEnum;
|
|
5
|
+
(function (TiposOcorrenciaFrequenciaEnum) {
|
|
6
|
+
TiposOcorrenciaFrequenciaEnum["Abono"] = "Abono";
|
|
7
|
+
TiposOcorrenciaFrequenciaEnum["Afastado"] = "Afastado";
|
|
8
|
+
TiposOcorrenciaFrequenciaEnum["Atestado"] = "Atestado";
|
|
9
|
+
TiposOcorrenciaFrequenciaEnum["DiaTrabalhado"] = "Dia trabalhado";
|
|
10
|
+
TiposOcorrenciaFrequenciaEnum["Falta"] = "Falta";
|
|
11
|
+
TiposOcorrenciaFrequenciaEnum["FaltaBH"] = "Falta BH";
|
|
12
|
+
TiposOcorrenciaFrequenciaEnum["Ferias"] = "F\u00E9rias";
|
|
13
|
+
TiposOcorrenciaFrequenciaEnum["Folga"] = "Folga";
|
|
14
|
+
TiposOcorrenciaFrequenciaEnum["JornadaExterna"] = "Jornada externa";
|
|
15
|
+
TiposOcorrenciaFrequenciaEnum["Suspensao"] = "Suspens\u00E3o";
|
|
16
|
+
})(TiposOcorrenciaFrequenciaEnum = exports.TiposOcorrenciaFrequenciaEnum || (exports.TiposOcorrenciaFrequenciaEnum = {}));
|
package/lib/models/index.d.ts
CHANGED
package/lib/models/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -12,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./contas/excecoes"), exports);
|
|
14
18
|
__exportStar(require("./contas/feriado"), exports);
|
|
19
|
+
__exportStar(require("./contas/lancamento"), exports);
|
|
@@ -9,9 +9,8 @@ exports.TipoDocumentReference = exports.TipoTimestampFirestore = void 0;
|
|
|
9
9
|
* @return {*} {timestamp is Timestamp}
|
|
10
10
|
*/
|
|
11
11
|
function TipoTimestampFirestore(timestamp) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
((_b = timestamp) === null || _b === void 0 ? void 0 : _b.nanoseconds) !== undefined);
|
|
12
|
+
return ((timestamp === null || timestamp === void 0 ? void 0 : timestamp.seconds) !== undefined &&
|
|
13
|
+
(timestamp === null || timestamp === void 0 ? void 0 : timestamp.nanoseconds) !== undefined);
|
|
15
14
|
}
|
|
16
15
|
exports.TipoTimestampFirestore = TipoTimestampFirestore;
|
|
17
16
|
/**
|
|
@@ -22,8 +21,7 @@ exports.TipoTimestampFirestore = TipoTimestampFirestore;
|
|
|
22
21
|
* @return {*} {timestamp is DocumentReference}
|
|
23
22
|
*/
|
|
24
23
|
function TipoDocumentReference(timestamp) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
((_b = timestamp) === null || _b === void 0 ? void 0 : _b.path) !== undefined);
|
|
24
|
+
return ((timestamp === null || timestamp === void 0 ? void 0 : timestamp.id) !== undefined &&
|
|
25
|
+
(timestamp === null || timestamp === void 0 ? void 0 : timestamp.path) !== undefined);
|
|
28
26
|
}
|
|
29
27
|
exports.TipoDocumentReference = TipoDocumentReference;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flit-models",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -23,25 +23,25 @@
|
|
|
23
23
|
"author": "gustavo_damazio",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"firebase": "^9.6.
|
|
26
|
+
"firebase": "^9.6.8",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"ts-transformer-keys": "^0.4.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/jest": "^27.4.
|
|
32
|
-
"@types/lodash": "^4.14.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
34
|
-
"@typescript-eslint/parser": "^5.
|
|
35
|
-
"eslint": "^8.
|
|
31
|
+
"@types/jest": "^27.4.1",
|
|
32
|
+
"@types/lodash": "^4.14.179",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
|
34
|
+
"@typescript-eslint/parser": "^5.14.0",
|
|
35
|
+
"eslint": "^8.10.0",
|
|
36
36
|
"eslint-config-google": "^0.14.0",
|
|
37
|
-
"eslint-config-prettier": "^8.
|
|
37
|
+
"eslint-config-prettier": "^8.5.0",
|
|
38
38
|
"eslint-plugin-import": "^2.25.4",
|
|
39
|
-
"eslint-plugin-jest": "^26.
|
|
39
|
+
"eslint-plugin-jest": "^26.1.1",
|
|
40
40
|
"eslint-plugin-prettier": "^4.0.0",
|
|
41
|
-
"jest": "^27.
|
|
41
|
+
"jest": "^27.5.1",
|
|
42
42
|
"prettier": "^2.5.1",
|
|
43
43
|
"ts-jest": "^27.1.3",
|
|
44
44
|
"ttypescript": "^1.5.13",
|
|
45
|
-
"typescript": "^4.
|
|
45
|
+
"typescript": "^4.6.2"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot } from 'firebase/firestore';
|
|
2
|
-
import { EmpresaFeriado, EmpresaFeriadoBase } from './empresas-feriado';
|
|
3
|
-
export declare class EmpresaFeriadoFirestoreData implements EmpresaFeriadoBase {
|
|
4
|
-
ref: DocumentReference;
|
|
5
|
-
documento: string;
|
|
6
|
-
nome_fantasia: string;
|
|
7
|
-
razao_social: string;
|
|
8
|
-
}
|
|
9
|
-
export declare abstract class EmpresasFeriadoFireConvert {
|
|
10
|
-
static fromFirestore(doc: DocumentSnapshot<EmpresaFeriadoFirestoreData> | QueryDocumentSnapshot<EmpresaFeriadoFirestoreData>): EmpresaFeriado;
|
|
11
|
-
static toFirestore(empresaFeriado: EmpresaFeriado, docRefConstructor: (path: string) => DocumentReference<any>): Partial<EmpresaFeriadoFirestoreData>;
|
|
12
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmpresasFeriadoFireConvert = exports.EmpresaFeriadoFirestoreData = void 0;
|
|
4
|
-
var lodash_1 = require("lodash");
|
|
5
|
-
var string_helper_1 = require("../../utils/string-helper");
|
|
6
|
-
var type_guards_1 = require("../../utils/type-guards");
|
|
7
|
-
var empresas_feriado_1 = require("./empresas-feriado");
|
|
8
|
-
var EmpresaFeriadoFirestoreData = /** @class */ (function () {
|
|
9
|
-
function EmpresaFeriadoFirestoreData() {
|
|
10
|
-
}
|
|
11
|
-
return EmpresaFeriadoFirestoreData;
|
|
12
|
-
}());
|
|
13
|
-
exports.EmpresaFeriadoFirestoreData = EmpresaFeriadoFirestoreData;
|
|
14
|
-
var EmpresasFeriadoFireConvert = /** @class */ (function () {
|
|
15
|
-
function EmpresasFeriadoFireConvert() {
|
|
16
|
-
}
|
|
17
|
-
EmpresasFeriadoFireConvert.fromFirestore = function (doc) {
|
|
18
|
-
var _a, _b;
|
|
19
|
-
return new empresas_feriado_1.EmpresaFeriado({
|
|
20
|
-
uid: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
21
|
-
path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
22
|
-
documento: string_helper_1.StringHelper.trim(doc.get('documento'), null),
|
|
23
|
-
nome_fantasia: string_helper_1.StringHelper.trim(doc.get('nome_fantasia'), null),
|
|
24
|
-
razao_social: string_helper_1.StringHelper.trim(doc.get('razao_social'), null),
|
|
25
|
-
ref: (0, type_guards_1.TipoDocumentReference)(doc.get('ref'))
|
|
26
|
-
? doc.get('ref').path
|
|
27
|
-
: null,
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
EmpresasFeriadoFireConvert.toFirestore = function (empresaFeriado, docRefConstructor) {
|
|
31
|
-
return (0, lodash_1.omitBy)({
|
|
32
|
-
documento: empresaFeriado.documento,
|
|
33
|
-
nome_fantasia: empresaFeriado.nome_fantasia,
|
|
34
|
-
razao_social: empresaFeriado.razao_social,
|
|
35
|
-
ref: docRefConstructor(empresaFeriado.ref),
|
|
36
|
-
}, lodash_1.isUndefined);
|
|
37
|
-
};
|
|
38
|
-
return EmpresasFeriadoFireConvert;
|
|
39
|
-
}());
|
|
40
|
-
exports.EmpresasFeriadoFireConvert = EmpresasFeriadoFireConvert;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface EmpresaFeriadoBase {
|
|
2
|
-
ref: any;
|
|
3
|
-
documento: any;
|
|
4
|
-
nome_fantasia: any;
|
|
5
|
-
razao_social: any;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Internal class col contas/${contaId}/feriados/${feriadoId}/empresas_feriado/${empresaId}.
|
|
9
|
-
*
|
|
10
|
-
* @export
|
|
11
|
-
* @class FeriadoEmpresa
|
|
12
|
-
* @implements {FeriadoFirestoreData}
|
|
13
|
-
*/
|
|
14
|
-
export declare class EmpresaFeriado implements EmpresaFeriadoBase {
|
|
15
|
-
uid: string;
|
|
16
|
-
path: string;
|
|
17
|
-
ref: string;
|
|
18
|
-
documento: string;
|
|
19
|
-
nome_fantasia: string;
|
|
20
|
-
razao_social: string;
|
|
21
|
-
/**
|
|
22
|
-
* Creates an instance of FeriadoEmpresa.
|
|
23
|
-
* @param {Partial<EmpresaFeriado>} feriadoEmpresaPayload
|
|
24
|
-
* @memberof Feriado
|
|
25
|
-
*/
|
|
26
|
-
constructor(feriadoEmpresaPayload: Partial<EmpresaFeriado>);
|
|
27
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmpresaFeriado = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Internal class col contas/${contaId}/feriados/${feriadoId}/empresas_feriado/${empresaId}.
|
|
6
|
-
*
|
|
7
|
-
* @export
|
|
8
|
-
* @class FeriadoEmpresa
|
|
9
|
-
* @implements {FeriadoFirestoreData}
|
|
10
|
-
*/
|
|
11
|
-
var EmpresaFeriado = /** @class */ (function () {
|
|
12
|
-
/**
|
|
13
|
-
* Creates an instance of FeriadoEmpresa.
|
|
14
|
-
* @param {Partial<EmpresaFeriado>} feriadoEmpresaPayload
|
|
15
|
-
* @memberof Feriado
|
|
16
|
-
*/
|
|
17
|
-
function EmpresaFeriado(feriadoEmpresaPayload) {
|
|
18
|
-
var _this = this;
|
|
19
|
-
var keysOfProps = ["uid", "path", "ref", "documento", "nome_fantasia", "razao_social"];
|
|
20
|
-
keysOfProps.forEach(function (key) {
|
|
21
|
-
_this[key] = feriadoEmpresaPayload
|
|
22
|
-
? feriadoEmpresaPayload[key]
|
|
23
|
-
: undefined;
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return EmpresaFeriado;
|
|
27
|
-
}());
|
|
28
|
-
exports.EmpresaFeriado = EmpresaFeriado;
|