flit-models 2.1.12 → 2.1.15
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 +49 -12
- package/lib/models/contas/lancamento/index.js +16 -2
- package/lib/models/contas/lancamento/lancamento-fire-convert.d.ts +20 -8
- package/lib/models/contas/lancamento/lancamento-fire-convert.js +36 -16
- package/lib/models/contas/lancamento/lancamento-json-convert.d.ts +20 -8
- package/lib/models/contas/lancamento/lancamento-json-convert.js +27 -16
- package/lib/models/contas/lancamento/logs/log-lancamento-fire-convert.d.ts +8 -7
- package/lib/models/contas/lancamento/logs/log-lancamento-fire-convert.js +10 -8
- package/lib/models/contas/lancamento/logs/log-lancamento.d.ts +21 -13
- package/lib/models/contas/lancamento/logs/log-lancamento.js +11 -4
- package/lib/models/contas/lancamento/usuarios/usuario-lancamento.d.ts +1 -1
- package/lib/models/contas/lancamento/usuarios/usuario-lancamento.js +1 -1
- package/lib/models/contas/ocorrencia_frequencia/index.d.ts +1 -2
- package/lib/models/contas/ocorrencia_frequencia/index.js +14 -15
- package/lib/models/utils/array-helpers.d.ts +3 -0
- package/lib/models/utils/array-helpers.js +17 -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, LogLancamento, LogLancamentoBase, LogLancamentoFireConvert, LogLancamentoFirestoreData, LogLancamentoStatusEnum,
|
|
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; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TipoOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
|
|
2
2
|
export * from './lancamento-fire-convert';
|
|
3
3
|
export * from './lancamento-json-convert';
|
|
4
4
|
export * from './logs/log-lancamento-fire-convert';
|
|
@@ -10,12 +10,28 @@ export declare enum LancamentoStatusEnum {
|
|
|
10
10
|
PENDENTE = "PENDENTE",
|
|
11
11
|
VERIFICAR = "VERIFICAR"
|
|
12
12
|
}
|
|
13
|
+
export declare enum TipoAcaoLancamentoEnum {
|
|
14
|
+
Abono = "Abono",
|
|
15
|
+
AbonoParcial = "Abono Parcial",
|
|
16
|
+
Afastado = "Afastado",
|
|
17
|
+
Atestado = "Atestado",
|
|
18
|
+
DiaTrabalhado = "Dia trabalhado",
|
|
19
|
+
Falta = "Falta",
|
|
20
|
+
FaltaBH = "Falta BH",
|
|
21
|
+
Ferias = "F\u00E9rias",
|
|
22
|
+
Folga = "Folga",
|
|
23
|
+
JornadaExterna = "Jornada externa",
|
|
24
|
+
Suspensao = "Suspens\u00E3o"
|
|
25
|
+
}
|
|
13
26
|
export interface LancamentoBase {
|
|
27
|
+
data_criacao: any;
|
|
28
|
+
data_atualizacao: any;
|
|
14
29
|
data_inicial: any;
|
|
15
30
|
data_final: any;
|
|
31
|
+
data_intervalo: any[];
|
|
16
32
|
descricao: any;
|
|
17
33
|
excluido: any;
|
|
18
|
-
|
|
34
|
+
acao_tipo: any;
|
|
19
35
|
ocorrencia: {
|
|
20
36
|
ref?: any;
|
|
21
37
|
path?: any;
|
|
@@ -31,10 +47,19 @@ export interface LancamentoBase {
|
|
|
31
47
|
};
|
|
32
48
|
status: any;
|
|
33
49
|
todos_colaboradores: any;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
periodos: [
|
|
51
|
+
{
|
|
52
|
+
inicial: {
|
|
53
|
+
horas_minutos: any;
|
|
54
|
+
timezone_value: any;
|
|
55
|
+
};
|
|
56
|
+
final: {
|
|
57
|
+
horas_minutos: any;
|
|
58
|
+
timezone_value: any;
|
|
59
|
+
};
|
|
60
|
+
total_minutos: any;
|
|
61
|
+
}
|
|
62
|
+
];
|
|
38
63
|
}
|
|
39
64
|
/**
|
|
40
65
|
* Internal class col contas/${contaId}/lancamento/${lancamentoId}.
|
|
@@ -45,13 +70,12 @@ export interface LancamentoBase {
|
|
|
45
70
|
export declare class Lancamento implements LancamentoBase {
|
|
46
71
|
_id: string;
|
|
47
72
|
_path: string;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}];
|
|
52
|
-
ocorrencia_tipo: TiposOcorrenciaFrequenciaEnum;
|
|
73
|
+
data_criacao: Date;
|
|
74
|
+
data_atualizacao: Date;
|
|
75
|
+
acao_tipo: TipoAcaoLancamentoEnum;
|
|
53
76
|
data_final: Date;
|
|
54
77
|
data_inicial: Date;
|
|
78
|
+
data_intervalo: string[];
|
|
55
79
|
descricao: string;
|
|
56
80
|
empresa: {
|
|
57
81
|
path: string;
|
|
@@ -62,11 +86,24 @@ export declare class Lancamento implements LancamentoBase {
|
|
|
62
86
|
excluido: boolean;
|
|
63
87
|
ocorrencia: {
|
|
64
88
|
path: string;
|
|
65
|
-
tipo:
|
|
89
|
+
tipo: TipoOcorrenciaFrequenciaEnum;
|
|
66
90
|
descricao: string;
|
|
67
91
|
};
|
|
68
92
|
status: LancamentoStatusEnum;
|
|
69
93
|
todos_colaboradores: boolean;
|
|
94
|
+
periodos: [
|
|
95
|
+
{
|
|
96
|
+
inicial: {
|
|
97
|
+
horas_minutos: string;
|
|
98
|
+
timezone_value: string;
|
|
99
|
+
};
|
|
100
|
+
final: {
|
|
101
|
+
horas_minutos: string;
|
|
102
|
+
timezone_value: string;
|
|
103
|
+
};
|
|
104
|
+
total_minutos: number;
|
|
105
|
+
}
|
|
106
|
+
];
|
|
70
107
|
/**
|
|
71
108
|
* Creates an instance of Lancamento.
|
|
72
109
|
* @param {Partial<Lancamento>} lancamentoPayload
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Lancamento = exports.LancamentoStatusEnum = void 0;
|
|
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
20
|
__exportStar(require("./logs/log-lancamento-fire-convert"), exports);
|
|
@@ -27,6 +27,20 @@ var LancamentoStatusEnum;
|
|
|
27
27
|
LancamentoStatusEnum["PENDENTE"] = "PENDENTE";
|
|
28
28
|
LancamentoStatusEnum["VERIFICAR"] = "VERIFICAR";
|
|
29
29
|
})(LancamentoStatusEnum = exports.LancamentoStatusEnum || (exports.LancamentoStatusEnum = {}));
|
|
30
|
+
var TipoAcaoLancamentoEnum;
|
|
31
|
+
(function (TipoAcaoLancamentoEnum) {
|
|
32
|
+
TipoAcaoLancamentoEnum["Abono"] = "Abono";
|
|
33
|
+
TipoAcaoLancamentoEnum["AbonoParcial"] = "Abono Parcial";
|
|
34
|
+
TipoAcaoLancamentoEnum["Afastado"] = "Afastado";
|
|
35
|
+
TipoAcaoLancamentoEnum["Atestado"] = "Atestado";
|
|
36
|
+
TipoAcaoLancamentoEnum["DiaTrabalhado"] = "Dia trabalhado";
|
|
37
|
+
TipoAcaoLancamentoEnum["Falta"] = "Falta";
|
|
38
|
+
TipoAcaoLancamentoEnum["FaltaBH"] = "Falta BH";
|
|
39
|
+
TipoAcaoLancamentoEnum["Ferias"] = "F\u00E9rias";
|
|
40
|
+
TipoAcaoLancamentoEnum["Folga"] = "Folga";
|
|
41
|
+
TipoAcaoLancamentoEnum["JornadaExterna"] = "Jornada externa";
|
|
42
|
+
TipoAcaoLancamentoEnum["Suspensao"] = "Suspens\u00E3o";
|
|
43
|
+
})(TipoAcaoLancamentoEnum = exports.TipoAcaoLancamentoEnum || (exports.TipoAcaoLancamentoEnum = {}));
|
|
30
44
|
/**
|
|
31
45
|
* Internal class col contas/${contaId}/lancamento/${lancamentoId}.
|
|
32
46
|
*
|
|
@@ -42,7 +56,7 @@ var Lancamento = /** @class */ (function () {
|
|
|
42
56
|
*/
|
|
43
57
|
function Lancamento(lancamentoPayload) {
|
|
44
58
|
var _this = this;
|
|
45
|
-
var keysOfProps = ["status", "_id", "_path", "descricao", "excluido", "data_inicial", "data_final", "todos_colaboradores", "
|
|
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"];
|
|
46
60
|
keysOfProps.forEach(function (key) {
|
|
47
61
|
_this[key] = lancamentoPayload
|
|
48
62
|
? lancamentoPayload[key]
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
2
|
-
import { Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
|
|
3
|
-
import {
|
|
2
|
+
import { TipoAcaoLancamentoEnum, Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
|
|
3
|
+
import { TipoOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
|
|
4
4
|
export declare class LancamentoFirestoreData implements LancamentoBase {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
data_criacao: Timestamp;
|
|
6
|
+
data_atualizacao: Timestamp;
|
|
7
|
+
data_intervalo: string[];
|
|
8
|
+
periodos: [
|
|
9
|
+
{
|
|
10
|
+
inicial: {
|
|
11
|
+
horas_minutos: string;
|
|
12
|
+
timezone_value: string;
|
|
13
|
+
};
|
|
14
|
+
final: {
|
|
15
|
+
horas_minutos: string;
|
|
16
|
+
timezone_value: string;
|
|
17
|
+
};
|
|
18
|
+
total_minutos: number;
|
|
19
|
+
}
|
|
20
|
+
];
|
|
9
21
|
data_inicial: Timestamp;
|
|
10
22
|
data_final: Timestamp;
|
|
11
23
|
descricao: string;
|
|
12
24
|
excluido: boolean;
|
|
13
|
-
|
|
25
|
+
acao_tipo: TipoAcaoLancamentoEnum;
|
|
14
26
|
ocorrencia: {
|
|
15
27
|
ref: DocumentReference;
|
|
16
|
-
tipo:
|
|
28
|
+
tipo: TipoOcorrenciaFrequenciaEnum;
|
|
17
29
|
descricao: string;
|
|
18
30
|
};
|
|
19
31
|
empresa: {
|
|
@@ -4,6 +4,7 @@ exports.LancamentoFireConvert = exports.LancamentoFirestoreData = void 0;
|
|
|
4
4
|
var firestore_1 = require("firebase/firestore");
|
|
5
5
|
var lodash_1 = require("lodash");
|
|
6
6
|
var _1 = require(".");
|
|
7
|
+
var array_helpers_1 = require("../../utils/array-helpers");
|
|
7
8
|
var boolean_helper_1 = require("../../utils/boolean-helper");
|
|
8
9
|
var string_helper_1 = require("../../utils/string-helper");
|
|
9
10
|
var type_guards_1 = require("../../utils/type-guards");
|
|
@@ -21,15 +22,15 @@ var LancamentoFireConvert = /** @class */ (function () {
|
|
|
21
22
|
return new _1.Lancamento({
|
|
22
23
|
_id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
23
24
|
_path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
24
|
-
data_inicial: (0, type_guards_1.TipoTimestampFirestore)(doc.get('
|
|
25
|
+
data_inicial: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_inicial'))
|
|
25
26
|
? doc.get('data_inicial').toDate()
|
|
26
27
|
: null,
|
|
27
|
-
data_final: (0, type_guards_1.TipoTimestampFirestore)(doc.get('
|
|
28
|
+
data_final: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_final'))
|
|
28
29
|
? doc.get('data_final').toDate()
|
|
29
30
|
: null,
|
|
30
31
|
descricao: string_helper_1.StringHelper.trim(doc.get('descricao'), null),
|
|
31
32
|
excluido: boolean_helper_1.BooleanHelper.check(doc.get('excluido'), false),
|
|
32
|
-
|
|
33
|
+
acao_tipo: string_helper_1.StringHelper.trim(doc.get('tipo'), null),
|
|
33
34
|
status: string_helper_1.StringHelper.trim(doc.get('tipo'), null),
|
|
34
35
|
empresa: {
|
|
35
36
|
documento: string_helper_1.StringHelper.trim(doc.get('empresa.documento'), null),
|
|
@@ -37,16 +38,26 @@ var LancamentoFireConvert = /** @class */ (function () {
|
|
|
37
38
|
razao: string_helper_1.StringHelper.trim(doc.get('empresa.razao'), null),
|
|
38
39
|
path: string_helper_1.StringHelper.trim((_c = doc.ref) === null || _c === void 0 ? void 0 : _c.path, null),
|
|
39
40
|
},
|
|
40
|
-
ocorrencia:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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,
|
|
45
48
|
todos_colaboradores: boolean_helper_1.BooleanHelper.check(doc.get('todos_colaboradores'), true),
|
|
46
|
-
|
|
49
|
+
periodos: ((_d = doc.get('periodos')) === null || _d === void 0 ? void 0 : _d.length) ? doc.get('periodos') : null,
|
|
50
|
+
data_atualizacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_atualizacao'))
|
|
51
|
+
? doc.get('data_atualizacao').toDate()
|
|
52
|
+
: null,
|
|
53
|
+
data_criacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_criacao'))
|
|
54
|
+
? doc.get('data_criacao').toDate()
|
|
55
|
+
: null,
|
|
56
|
+
data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(doc.get('data_intervalo'), null),
|
|
47
57
|
});
|
|
48
58
|
};
|
|
49
59
|
LancamentoFireConvert.toFirestore = function (lancamento, documentReferenceFromPath, timestampfromDate) {
|
|
60
|
+
var _a;
|
|
50
61
|
var lancamentoFire = {
|
|
51
62
|
data_inicial: timestampfromDate
|
|
52
63
|
? timestampfromDate(lancamento.data_inicial)
|
|
@@ -54,9 +65,10 @@ var LancamentoFireConvert = /** @class */ (function () {
|
|
|
54
65
|
data_final: timestampfromDate
|
|
55
66
|
? timestampfromDate(lancamento.data_final)
|
|
56
67
|
: firestore_1.Timestamp.fromDate(lancamento.data_final),
|
|
68
|
+
data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
|
|
57
69
|
descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
|
|
58
70
|
excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
|
|
59
|
-
|
|
71
|
+
acao_tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
|
|
60
72
|
status: string_helper_1.StringHelper.trim(lancamento.status, null),
|
|
61
73
|
empresa: {
|
|
62
74
|
ref: documentReferenceFromPath(lancamento.empresa.path),
|
|
@@ -64,13 +76,21 @@ var LancamentoFireConvert = /** @class */ (function () {
|
|
|
64
76
|
fantasia: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
|
|
65
77
|
razao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
|
|
66
78
|
},
|
|
67
|
-
ocorrencia:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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,
|
|
72
86
|
todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, true),
|
|
73
|
-
|
|
87
|
+
periodos: ((_a = lancamento.periodos) === null || _a === void 0 ? void 0 : _a.length) ? lancamento.periodos : null,
|
|
88
|
+
data_atualizacao: timestampfromDate
|
|
89
|
+
? timestampfromDate(lancamento.data_atualizacao)
|
|
90
|
+
: firestore_1.Timestamp.fromDate(lancamento.data_atualizacao),
|
|
91
|
+
data_criacao: timestampfromDate
|
|
92
|
+
? timestampfromDate(lancamento.data_criacao)
|
|
93
|
+
: firestore_1.Timestamp.fromDate(lancamento.data_criacao),
|
|
74
94
|
};
|
|
75
95
|
return (0, lodash_1.omitBy)(lancamentoFire, lodash_1.isUndefined);
|
|
76
96
|
};
|
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import { Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
|
|
2
|
-
import {
|
|
1
|
+
import { TipoAcaoLancamentoEnum, Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
|
|
2
|
+
import { TipoOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
|
|
3
3
|
export declare class LancamentoJsonData implements LancamentoBase {
|
|
4
|
+
data_intervalo: string[];
|
|
5
|
+
data_criacao: string;
|
|
6
|
+
data_atualizacao: string;
|
|
7
|
+
periodos: [
|
|
8
|
+
{
|
|
9
|
+
inicial: {
|
|
10
|
+
horas_minutos: any;
|
|
11
|
+
timezone_value: any;
|
|
12
|
+
};
|
|
13
|
+
final: {
|
|
14
|
+
horas_minutos: any;
|
|
15
|
+
timezone_value: any;
|
|
16
|
+
};
|
|
17
|
+
total_minutos: any;
|
|
18
|
+
}
|
|
19
|
+
];
|
|
4
20
|
_id: string;
|
|
5
21
|
_path: string;
|
|
6
|
-
ajustes_jornada_realizada: [{
|
|
7
|
-
horasEMinutos: any;
|
|
8
|
-
timezoneValue: any;
|
|
9
|
-
}];
|
|
10
22
|
data_inicial: string;
|
|
11
23
|
data_final: string;
|
|
12
24
|
descricao: string;
|
|
13
25
|
excluido: boolean;
|
|
14
|
-
|
|
26
|
+
acao_tipo: TipoAcaoLancamentoEnum;
|
|
15
27
|
ocorrencia: {
|
|
16
28
|
path?: string;
|
|
17
|
-
tipo:
|
|
29
|
+
tipo: TipoOcorrenciaFrequenciaEnum;
|
|
18
30
|
descricao: string;
|
|
19
31
|
};
|
|
20
32
|
empresa: {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LancamentoJsonConvert = exports.LancamentoJsonData = void 0;
|
|
4
4
|
var lodash_1 = require("lodash");
|
|
5
5
|
var _1 = require(".");
|
|
6
|
+
var array_helpers_1 = require("../../utils/array-helpers");
|
|
6
7
|
var boolean_helper_1 = require("../../utils/boolean-helper");
|
|
7
8
|
var date_helper_1 = require("../../utils/date-helper");
|
|
8
9
|
var string_helper_1 = require("../../utils/string-helper");
|
|
@@ -16,7 +17,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
|
|
|
16
17
|
function LancamentoJsonConvert() {
|
|
17
18
|
}
|
|
18
19
|
LancamentoJsonConvert.fromJson = function (obj) {
|
|
19
|
-
var _a, _b
|
|
20
|
+
var _a, _b;
|
|
20
21
|
return new _1.Lancamento({
|
|
21
22
|
_id: (_a = obj._id) !== null && _a !== void 0 ? _a : null,
|
|
22
23
|
_path: (_b = obj._path) !== null && _b !== void 0 ? _b : null,
|
|
@@ -25,24 +26,29 @@ var LancamentoJsonConvert = /** @class */ (function () {
|
|
|
25
26
|
descricao: string_helper_1.StringHelper.trim(obj.descricao, null),
|
|
26
27
|
excluido: boolean_helper_1.BooleanHelper.check(obj.excluido, false),
|
|
27
28
|
status: string_helper_1.StringHelper.trim(obj.status, null),
|
|
28
|
-
|
|
29
|
+
acao_tipo: string_helper_1.StringHelper.trim(obj.acao_tipo, null),
|
|
29
30
|
empresa: {
|
|
30
31
|
documento: string_helper_1.StringHelper.trim(obj.empresa.documento, null),
|
|
31
32
|
fantasia: string_helper_1.StringHelper.trim(obj.empresa.fantasia, null),
|
|
32
33
|
razao: string_helper_1.StringHelper.trim(obj.empresa.razao, null),
|
|
33
34
|
path: string_helper_1.StringHelper.trim(obj.empresa.path, null),
|
|
34
35
|
},
|
|
35
|
-
ocorrencia:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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,
|
|
40
43
|
todos_colaboradores: boolean_helper_1.BooleanHelper.check(obj.excluido, true),
|
|
41
|
-
|
|
44
|
+
periodos: obj.periodos.length ? obj.periodos : null,
|
|
45
|
+
data_atualizacao: date_helper_1.DateHelper.fromString(obj.data_atualizacao, null),
|
|
46
|
+
data_criacao: date_helper_1.DateHelper.fromString(obj.data_criacao, null),
|
|
47
|
+
data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(obj.data_intervalo, null),
|
|
42
48
|
});
|
|
43
49
|
};
|
|
44
50
|
LancamentoJsonConvert.toJson = function (lancamento) {
|
|
45
|
-
var _a, _b, _c;
|
|
51
|
+
var _a, _b, _c, _d;
|
|
46
52
|
var lancamentoJson = {
|
|
47
53
|
_id: (_a = lancamento._id) !== null && _a !== void 0 ? _a : null,
|
|
48
54
|
_path: (_b = lancamento._path) !== null && _b !== void 0 ? _b : null,
|
|
@@ -51,20 +57,25 @@ var LancamentoJsonConvert = /** @class */ (function () {
|
|
|
51
57
|
descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
|
|
52
58
|
excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
|
|
53
59
|
status: string_helper_1.StringHelper.trim(lancamento.status, null),
|
|
54
|
-
|
|
60
|
+
acao_tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
|
|
55
61
|
empresa: {
|
|
56
62
|
documento: string_helper_1.StringHelper.trim(lancamento.empresa.documento, null),
|
|
57
63
|
fantasia: string_helper_1.StringHelper.trim(lancamento.empresa.fantasia, null),
|
|
58
64
|
razao: string_helper_1.StringHelper.trim(lancamento.empresa.razao, null),
|
|
59
65
|
path: string_helper_1.StringHelper.trim(lancamento.empresa.path, null),
|
|
60
66
|
},
|
|
61
|
-
ocorrencia:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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,
|
|
66
74
|
todos_colaboradores: boolean_helper_1.BooleanHelper.check(lancamento.todos_colaboradores, false),
|
|
67
|
-
|
|
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(),
|
|
78
|
+
data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
|
|
68
79
|
};
|
|
69
80
|
return (0, lodash_1.omitBy)(lancamentoJson, lodash_1.isUndefined);
|
|
70
81
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
2
|
-
import { LogLancamento, LogLancamentoBase, LogLancamentoStatusEnum } from './log-lancamento';
|
|
2
|
+
import { LogLancamento, LogLancamentoBase, LogLancamentoStatusEnum, TipoReferenciaLogLancamento } from './log-lancamento';
|
|
3
3
|
export declare class LogLancamentoFirestoreData implements LogLancamentoBase {
|
|
4
|
+
referencia: {
|
|
5
|
+
tipo: TipoReferenciaLogLancamento;
|
|
6
|
+
data?: Timestamp;
|
|
7
|
+
ref: DocumentReference;
|
|
8
|
+
};
|
|
4
9
|
visto: boolean;
|
|
5
|
-
|
|
10
|
+
data_criacao: Timestamp;
|
|
6
11
|
mensagem: string;
|
|
7
12
|
detalhes: {
|
|
8
13
|
[key: string]: any;
|
|
9
14
|
};
|
|
10
|
-
|
|
11
|
-
jornada: {
|
|
12
|
-
data: Timestamp;
|
|
13
|
-
ref: DocumentReference;
|
|
14
|
-
};
|
|
15
|
+
tipo: LogLancamentoStatusEnum;
|
|
15
16
|
}
|
|
16
17
|
export declare abstract class LogLancamentoFireConvert {
|
|
17
18
|
static fromFirestore(doc: DocumentSnapshot<LogLancamentoFirestoreData> | QueryDocumentSnapshot<LogLancamentoFirestoreData>): LogLancamento;
|
|
@@ -20,19 +20,20 @@ var LogLancamentoFireConvert = /** @class */ (function () {
|
|
|
20
20
|
return new log_lancamento_1.LogLancamento({
|
|
21
21
|
_id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
22
22
|
_path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
23
|
-
|
|
23
|
+
data_criacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('jornada.data'))
|
|
24
24
|
? doc.get('data_inicial').toDate()
|
|
25
25
|
: null,
|
|
26
|
-
|
|
26
|
+
referencia: {
|
|
27
27
|
ref: (0, type_guards_1.TipoDocumentReference)(doc.get('ref'))
|
|
28
28
|
? doc.get('ref').path
|
|
29
29
|
: null,
|
|
30
30
|
data: (0, type_guards_1.TipoTimestampFirestore)(doc.get('jornada.data'))
|
|
31
31
|
? doc.get('data_inicial').toDate()
|
|
32
32
|
: null,
|
|
33
|
+
tipo: string_helper_1.StringHelper.trim(doc.get('referencia.tipo'), null),
|
|
33
34
|
},
|
|
34
35
|
mensagem: string_helper_1.StringHelper.trim(doc.get('mensagem'), null),
|
|
35
|
-
|
|
36
|
+
tipo: string_helper_1.StringHelper.trim(doc.get('status'), null),
|
|
36
37
|
detalhes: (_c = doc.get('detalhes')) !== null && _c !== void 0 ? _c : null,
|
|
37
38
|
visto: (_d = doc.get('visto')) !== null && _d !== void 0 ? _d : false,
|
|
38
39
|
});
|
|
@@ -41,11 +42,12 @@ var LogLancamentoFireConvert = /** @class */ (function () {
|
|
|
41
42
|
var logLancamentoFirestore = {
|
|
42
43
|
mensagem: logLancamento.mensagem,
|
|
43
44
|
detalhes: logLancamento.detalhes,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
data: timestampfromDate(logLancamento.
|
|
48
|
-
ref: documentReferenceFromPath(logLancamento.
|
|
45
|
+
tipo: logLancamento.tipo,
|
|
46
|
+
data_criacao: timestampfromDate(logLancamento.data_criacao),
|
|
47
|
+
referencia: {
|
|
48
|
+
data: timestampfromDate(logLancamento.referencia.data),
|
|
49
|
+
ref: documentReferenceFromPath(logLancamento.referencia.ref),
|
|
50
|
+
tipo: string_helper_1.StringHelper.trim(logLancamento.referencia.tipo, null),
|
|
49
51
|
},
|
|
50
52
|
visto: boolean_helper_1.BooleanHelper.check(logLancamento.visto, false),
|
|
51
53
|
};
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
export declare enum LogLancamentoStatusEnum {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
AVISO = "AVISO",
|
|
3
|
+
CRITICO = "CRITICO",
|
|
4
|
+
ERRO = "ERRO",
|
|
5
|
+
INFORMATIVO = "INFORMATIVO"
|
|
6
|
+
}
|
|
7
|
+
export declare enum TipoReferenciaLogLancamento {
|
|
8
|
+
JORNADA = "JORNADA",
|
|
9
|
+
USUARIO = "USUARIO"
|
|
4
10
|
}
|
|
5
11
|
export interface LogLancamentoBase {
|
|
6
|
-
|
|
12
|
+
data_criacao: any;
|
|
7
13
|
mensagem: any;
|
|
8
14
|
detalhes: any;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
tipo: any;
|
|
16
|
+
referencia: {
|
|
17
|
+
tipo: any;
|
|
18
|
+
data?: any;
|
|
12
19
|
ref: any;
|
|
13
20
|
};
|
|
14
21
|
visto: any;
|
|
15
22
|
}
|
|
16
23
|
/**
|
|
17
|
-
* Internal class col contas/${contaId}/
|
|
24
|
+
* Internal class col contas/${contaId}/lancamentos/${lancamentoId}/logs_lancamentos/${usuarioId}.
|
|
18
25
|
*
|
|
19
26
|
* @export
|
|
20
27
|
* @class UsuarioLancamento
|
|
@@ -23,17 +30,18 @@ export interface LogLancamentoBase {
|
|
|
23
30
|
export declare class LogLancamento implements LogLancamentoBase {
|
|
24
31
|
_id: string;
|
|
25
32
|
_path: string;
|
|
26
|
-
|
|
33
|
+
data_criacao: Date;
|
|
27
34
|
mensagem: string;
|
|
28
35
|
detalhes: {
|
|
29
36
|
[key: string]: any;
|
|
30
37
|
};
|
|
31
|
-
|
|
32
|
-
jornada: {
|
|
33
|
-
data: Date;
|
|
34
|
-
ref: string;
|
|
35
|
-
};
|
|
38
|
+
tipo: LogLancamentoStatusEnum;
|
|
36
39
|
visto: boolean;
|
|
40
|
+
referencia: {
|
|
41
|
+
tipo: TipoReferenciaLogLancamento;
|
|
42
|
+
data?: any;
|
|
43
|
+
ref: any;
|
|
44
|
+
};
|
|
37
45
|
/**
|
|
38
46
|
* Creates an instance of UsuarioLancamento.
|
|
39
47
|
* @param {Partial<LogLancamento>} usuarioLancamentoPayload
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogLancamento = exports.LogLancamentoStatusEnum = void 0;
|
|
3
|
+
exports.LogLancamento = exports.TipoReferenciaLogLancamento = exports.LogLancamentoStatusEnum = void 0;
|
|
4
4
|
var LogLancamentoStatusEnum;
|
|
5
5
|
(function (LogLancamentoStatusEnum) {
|
|
6
|
-
LogLancamentoStatusEnum["
|
|
6
|
+
LogLancamentoStatusEnum["AVISO"] = "AVISO";
|
|
7
|
+
LogLancamentoStatusEnum["CRITICO"] = "CRITICO";
|
|
7
8
|
LogLancamentoStatusEnum["ERRO"] = "ERRO";
|
|
9
|
+
LogLancamentoStatusEnum["INFORMATIVO"] = "INFORMATIVO";
|
|
8
10
|
})(LogLancamentoStatusEnum = exports.LogLancamentoStatusEnum || (exports.LogLancamentoStatusEnum = {}));
|
|
11
|
+
var TipoReferenciaLogLancamento;
|
|
12
|
+
(function (TipoReferenciaLogLancamento) {
|
|
13
|
+
TipoReferenciaLogLancamento["JORNADA"] = "JORNADA";
|
|
14
|
+
TipoReferenciaLogLancamento["USUARIO"] = "USUARIO";
|
|
15
|
+
})(TipoReferenciaLogLancamento = exports.TipoReferenciaLogLancamento || (exports.TipoReferenciaLogLancamento = {}));
|
|
9
16
|
/**
|
|
10
|
-
* Internal class col contas/${contaId}/
|
|
17
|
+
* Internal class col contas/${contaId}/lancamentos/${lancamentoId}/logs_lancamentos/${usuarioId}.
|
|
11
18
|
*
|
|
12
19
|
* @export
|
|
13
20
|
* @class UsuarioLancamento
|
|
@@ -21,7 +28,7 @@ var LogLancamento = /** @class */ (function () {
|
|
|
21
28
|
*/
|
|
22
29
|
function LogLancamento(usuarioLancamentoPayload) {
|
|
23
30
|
var _this = this;
|
|
24
|
-
var keysOfProps = ["
|
|
31
|
+
var keysOfProps = ["data_criacao", "tipo", "_id", "_path", "mensagem", "detalhes", "visto", "referencia"];
|
|
25
32
|
keysOfProps.forEach(function (key) {
|
|
26
33
|
_this[key] = usuarioLancamentoPayload
|
|
27
34
|
? usuarioLancamentoPayload[key]
|
|
@@ -5,7 +5,7 @@ export interface UsuarioLancamentoBase {
|
|
|
5
5
|
ref: any;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Internal class col contas/${contaId}/
|
|
8
|
+
* Internal class col contas/${contaId}/lancamentos/${lancamentoId}/usuarios_lancamentos/${usuarioId}.
|
|
9
9
|
*
|
|
10
10
|
* @export
|
|
11
11
|
* @class UsuarioLancamento
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UsuarioLancamento = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Internal class col contas/${contaId}/
|
|
5
|
+
* Internal class col contas/${contaId}/lancamentos/${lancamentoId}/usuarios_lancamentos/${usuarioId}.
|
|
6
6
|
*
|
|
7
7
|
* @export
|
|
8
8
|
* @class UsuarioLancamento
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})(TiposOcorrenciaFrequenciaEnum = exports.TiposOcorrenciaFrequenciaEnum || (exports.TiposOcorrenciaFrequenciaEnum = {}));
|
|
3
|
+
exports.TipoOcorrenciaFrequenciaEnum = void 0;
|
|
4
|
+
var TipoOcorrenciaFrequenciaEnum;
|
|
5
|
+
(function (TipoOcorrenciaFrequenciaEnum) {
|
|
6
|
+
TipoOcorrenciaFrequenciaEnum["Abono"] = "Abono";
|
|
7
|
+
TipoOcorrenciaFrequenciaEnum["Afastado"] = "Afastado";
|
|
8
|
+
TipoOcorrenciaFrequenciaEnum["Atestado"] = "Atestado";
|
|
9
|
+
TipoOcorrenciaFrequenciaEnum["DiaTrabalhado"] = "Dia trabalhado";
|
|
10
|
+
TipoOcorrenciaFrequenciaEnum["Falta"] = "Falta";
|
|
11
|
+
TipoOcorrenciaFrequenciaEnum["FaltaBH"] = "Falta BH";
|
|
12
|
+
TipoOcorrenciaFrequenciaEnum["Ferias"] = "F\u00E9rias";
|
|
13
|
+
TipoOcorrenciaFrequenciaEnum["Folga"] = "Folga";
|
|
14
|
+
TipoOcorrenciaFrequenciaEnum["JornadaExterna"] = "Jornada externa";
|
|
15
|
+
TipoOcorrenciaFrequenciaEnum["Suspensao"] = "Suspens\u00E3o";
|
|
16
|
+
})(TipoOcorrenciaFrequenciaEnum = exports.TipoOcorrenciaFrequenciaEnum || (exports.TipoOcorrenciaFrequenciaEnum = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayHelper = void 0;
|
|
4
|
+
var ArrayHelper = /** @class */ (function () {
|
|
5
|
+
function ArrayHelper() {
|
|
6
|
+
}
|
|
7
|
+
ArrayHelper.checkStringArray = function (arr, def) {
|
|
8
|
+
if (Array.isArray(arr) && arr.every(function (e) { return typeof e === 'string'; })) {
|
|
9
|
+
return arr;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return def;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return ArrayHelper;
|
|
16
|
+
}());
|
|
17
|
+
exports.ArrayHelper = ArrayHelper;
|