flit-models 2.1.47 → 3.0.1
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/cargo/cargo-fire-convert.d.ts +13 -0
- package/lib/models/contas/cargo/cargo-fire-convert.js +42 -0
- package/lib/models/contas/cargo/index.d.ts +29 -0
- package/lib/models/contas/cargo/index.js +43 -0
- package/lib/models/contas/departamento/departamento-fire-convert.d.ts +12 -0
- package/lib/models/contas/departamento/departamento-fire-convert.js +40 -0
- package/lib/models/contas/departamento/index.d.ts +27 -0
- package/lib/models/contas/departamento/index.js +43 -0
- package/lib/models/contas/escala/escala-fire-convert.d.ts +31 -0
- package/lib/models/contas/escala/escala-fire-convert.js +84 -0
- package/lib/models/contas/escala/index.d.ts +65 -0
- package/lib/models/contas/escala/index.js +43 -0
- package/lib/models/contas/excecoes.d.ts +21 -21
- package/lib/models/contas/feriado/empresa-feriado-fire-convert.d.ts +4 -4
- package/lib/models/contas/feriado/empresa-feriado-fire-convert.js +3 -2
- package/lib/models/contas/feriado/empresa-feriado.js +1 -1
- package/lib/models/contas/feriado/feriado-fire-convert.d.ts +4 -4
- package/lib/models/contas/feriado/feriado-fire-convert.js +3 -5
- package/lib/models/contas/lancamento/index.d.ts +8 -0
- package/lib/models/contas/lancamento/index.js +1 -1
- package/lib/models/contas/lancamento/lancamento-fire-convert.d.ts +12 -8
- package/lib/models/contas/lancamento/lancamento-fire-convert.js +23 -50
- package/lib/models/contas/lancamento/lancamento-json-convert.d.ts +4 -0
- package/lib/models/contas/lancamento/lancamento-json-convert.js +6 -0
- package/lib/models/contas/lancamento/verificacoes/verificacao-lancamento-fire-convert.d.ts +7 -7
- package/lib/models/contas/lancamento/verificacoes/verificacao-lancamento-fire-convert.js +8 -6
- package/lib/models/index.d.ts +3 -0
- package/lib/models/index.js +3 -0
- package/lib/models/utils/type-guards.d.ts +4 -4
- package/lib/models/utils/type-guards.js +4 -4
- package/lib/shared/flitCalcularJornadaDependencyInjection.d.ts +22 -0
- package/lib/shared/flitCalcularJornadaDependencyInjection.js +61 -0
- package/lib/shared/flitModelsDependencyInjection.d.ts +24 -0
- package/lib/shared/flitModelsDependencyInjection.js +61 -0
- package/package.json +7 -6
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Cargo, CargoBase } from '.';
|
|
2
|
+
import { FirebaseDocumentSnapshotGeneric, FirebaseTimestampGeneric } from '../../../shared/flitModelsDependencyInjection';
|
|
3
|
+
export declare class CargoFirestoreData implements CargoBase {
|
|
4
|
+
cbo: string;
|
|
5
|
+
data_atualizacao_doc: FirebaseTimestampGeneric;
|
|
6
|
+
data_criacao_doc: FirebaseTimestampGeneric;
|
|
7
|
+
excluido: boolean;
|
|
8
|
+
nome: string;
|
|
9
|
+
}
|
|
10
|
+
export declare abstract class CargoFireConvert {
|
|
11
|
+
static fromFirestore(doc: FirebaseDocumentSnapshotGeneric | FirebaseDocumentSnapshotGeneric): Cargo;
|
|
12
|
+
static toFirestore(cargo: Cargo): Partial<CargoFirestoreData>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CargoFireConvert = exports.CargoFirestoreData = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var _1 = require(".");
|
|
6
|
+
var flitModelsDependencyInjection_1 = require("../../../shared/flitModelsDependencyInjection");
|
|
7
|
+
var CargoFirestoreData = /** @class */ (function () {
|
|
8
|
+
function CargoFirestoreData() {
|
|
9
|
+
}
|
|
10
|
+
return CargoFirestoreData;
|
|
11
|
+
}());
|
|
12
|
+
exports.CargoFirestoreData = CargoFirestoreData;
|
|
13
|
+
var CargoFireConvert = /** @class */ (function () {
|
|
14
|
+
function CargoFireConvert() {
|
|
15
|
+
}
|
|
16
|
+
CargoFireConvert.fromFirestore = function (doc) {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18
|
+
var docData = ((_a = doc.data()) !== null && _a !== void 0 ? _a : {});
|
|
19
|
+
return new _1.Cargo({
|
|
20
|
+
_id: (_b = doc.id) !== null && _b !== void 0 ? _b : null,
|
|
21
|
+
_path: (_c = doc.ref.path) !== null && _c !== void 0 ? _c : null,
|
|
22
|
+
cbo: (_d = docData.cbo) !== null && _d !== void 0 ? _d : null,
|
|
23
|
+
data_atualizacao_doc: (_f = (_e = docData.data_atualizacao_doc) === null || _e === void 0 ? void 0 : _e.toDate()) !== null && _f !== void 0 ? _f : null,
|
|
24
|
+
data_criacao_doc: (_h = (_g = docData.data_criacao_doc) === null || _g === void 0 ? void 0 : _g.toDate()) !== null && _h !== void 0 ? _h : null,
|
|
25
|
+
excluido: (_j = docData.excluido) !== null && _j !== void 0 ? _j : false,
|
|
26
|
+
nome: (_k = docData.nome) !== null && _k !== void 0 ? _k : null,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
CargoFireConvert.toFirestore = function (cargo) {
|
|
30
|
+
var _a, _b, _c, _d, _e;
|
|
31
|
+
var cargoFire = {
|
|
32
|
+
cbo: (_a = cargo.cbo) !== null && _a !== void 0 ? _a : null,
|
|
33
|
+
data_atualizacao_doc: (_b = flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(cargo.data_atualizacao_doc)) !== null && _b !== void 0 ? _b : null,
|
|
34
|
+
data_criacao_doc: (_c = flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(cargo.data_criacao_doc)) !== null && _c !== void 0 ? _c : null,
|
|
35
|
+
excluido: (_d = cargo.excluido) !== null && _d !== void 0 ? _d : false,
|
|
36
|
+
nome: (_e = cargo.nome) !== null && _e !== void 0 ? _e : null,
|
|
37
|
+
};
|
|
38
|
+
return (0, lodash_1.omitBy)(cargoFire, lodash_1.isUndefined);
|
|
39
|
+
};
|
|
40
|
+
return CargoFireConvert;
|
|
41
|
+
}());
|
|
42
|
+
exports.CargoFireConvert = CargoFireConvert;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './cargo-fire-convert';
|
|
2
|
+
export interface CargoBase {
|
|
3
|
+
cbo: string;
|
|
4
|
+
data_atualizacao_doc: any;
|
|
5
|
+
data_criacao_doc: any;
|
|
6
|
+
excluido: boolean;
|
|
7
|
+
nome: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Internal class col contas/${contaId}/cargo/${cargoId}.
|
|
11
|
+
*
|
|
12
|
+
* @export
|
|
13
|
+
* @class Lancamento
|
|
14
|
+
*/
|
|
15
|
+
export declare class Cargo implements CargoBase {
|
|
16
|
+
_id: string;
|
|
17
|
+
_path: string;
|
|
18
|
+
cbo: string;
|
|
19
|
+
data_atualizacao_doc: Date;
|
|
20
|
+
data_criacao_doc: Date;
|
|
21
|
+
excluido: boolean;
|
|
22
|
+
nome: string;
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of Lancamento.
|
|
25
|
+
* @param {Partial<Lancamento>} lancamentoPayload
|
|
26
|
+
* @memberof Lancamento
|
|
27
|
+
*/
|
|
28
|
+
constructor(lancamentoPayload: Partial<Cargo>);
|
|
29
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.Cargo = void 0;
|
|
18
|
+
__exportStar(require("./cargo-fire-convert"), exports);
|
|
19
|
+
/**
|
|
20
|
+
* Internal class col contas/${contaId}/cargo/${cargoId}.
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @class Lancamento
|
|
24
|
+
*/
|
|
25
|
+
var Cargo = /** @class */ (function () {
|
|
26
|
+
// #endregion
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of Lancamento.
|
|
29
|
+
* @param {Partial<Lancamento>} lancamentoPayload
|
|
30
|
+
* @memberof Lancamento
|
|
31
|
+
*/
|
|
32
|
+
function Cargo(lancamentoPayload) {
|
|
33
|
+
var _this = this;
|
|
34
|
+
var keysOfProps = ["_id", "_path", "nome", "excluido", "cbo", "data_atualizacao_doc", "data_criacao_doc"];
|
|
35
|
+
keysOfProps.forEach(function (key) {
|
|
36
|
+
_this[key] = lancamentoPayload
|
|
37
|
+
? lancamentoPayload[key]
|
|
38
|
+
: undefined;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return Cargo;
|
|
42
|
+
}());
|
|
43
|
+
exports.Cargo = Cargo;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Departamento, DepartamentoBase } from '.';
|
|
2
|
+
import { FirebaseDocumentSnapshotGeneric, FirebaseQueryDocumentSnapshotGeneric, FirebaseTimestampGeneric } from '../../../shared/flitModelsDependencyInjection';
|
|
3
|
+
export declare class DepartamentoFirestoreData implements DepartamentoBase {
|
|
4
|
+
data_atualizacao_doc: FirebaseTimestampGeneric;
|
|
5
|
+
data_criacao_doc: FirebaseTimestampGeneric;
|
|
6
|
+
descricao: string;
|
|
7
|
+
excluido: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class DepartamentoFireConvert {
|
|
10
|
+
static fromFirestore(doc: FirebaseDocumentSnapshotGeneric | FirebaseQueryDocumentSnapshotGeneric): Departamento;
|
|
11
|
+
static toFirestore(departamento: Departamento): Partial<DepartamentoFirestoreData>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DepartamentoFireConvert = exports.DepartamentoFirestoreData = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var _1 = require(".");
|
|
6
|
+
var flitModelsDependencyInjection_1 = require("../../../shared/flitModelsDependencyInjection");
|
|
7
|
+
var DepartamentoFirestoreData = /** @class */ (function () {
|
|
8
|
+
function DepartamentoFirestoreData() {
|
|
9
|
+
}
|
|
10
|
+
return DepartamentoFirestoreData;
|
|
11
|
+
}());
|
|
12
|
+
exports.DepartamentoFirestoreData = DepartamentoFirestoreData;
|
|
13
|
+
var DepartamentoFireConvert = /** @class */ (function () {
|
|
14
|
+
function DepartamentoFireConvert() {
|
|
15
|
+
}
|
|
16
|
+
DepartamentoFireConvert.fromFirestore = function (doc) {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
18
|
+
var docData = ((_a = doc.data()) !== null && _a !== void 0 ? _a : {});
|
|
19
|
+
return new _1.Departamento({
|
|
20
|
+
_id: (_b = doc.id) !== null && _b !== void 0 ? _b : null,
|
|
21
|
+
_path: (_c = doc.ref.path) !== null && _c !== void 0 ? _c : null,
|
|
22
|
+
data_atualizacao_doc: (_e = (_d = docData.data_atualizacao_doc) === null || _d === void 0 ? void 0 : _d.toDate()) !== null && _e !== void 0 ? _e : null,
|
|
23
|
+
data_criacao_doc: (_g = (_f = docData.data_criacao_doc) === null || _f === void 0 ? void 0 : _f.toDate()) !== null && _g !== void 0 ? _g : null,
|
|
24
|
+
descricao: (_h = docData.descricao) !== null && _h !== void 0 ? _h : null,
|
|
25
|
+
excluido: (_j = docData.excluido) !== null && _j !== void 0 ? _j : false,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
DepartamentoFireConvert.toFirestore = function (departamento) {
|
|
29
|
+
var _a, _b, _c, _d;
|
|
30
|
+
var departamentoFire = {
|
|
31
|
+
data_atualizacao_doc: (_a = flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(departamento.data_atualizacao_doc)) !== null && _a !== void 0 ? _a : null,
|
|
32
|
+
data_criacao_doc: (_b = flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(departamento.data_criacao_doc)) !== null && _b !== void 0 ? _b : null,
|
|
33
|
+
descricao: (_c = departamento.descricao) !== null && _c !== void 0 ? _c : null,
|
|
34
|
+
excluido: (_d = departamento.excluido) !== null && _d !== void 0 ? _d : false,
|
|
35
|
+
};
|
|
36
|
+
return (0, lodash_1.omitBy)(departamentoFire, lodash_1.isUndefined);
|
|
37
|
+
};
|
|
38
|
+
return DepartamentoFireConvert;
|
|
39
|
+
}());
|
|
40
|
+
exports.DepartamentoFireConvert = DepartamentoFireConvert;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './departamento-fire-convert';
|
|
2
|
+
export interface DepartamentoBase {
|
|
3
|
+
data_atualizacao_doc: any;
|
|
4
|
+
data_criacao_doc: any;
|
|
5
|
+
descricao: string;
|
|
6
|
+
excluido: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Internal class col contas/${contaId}/cargo/${cargoId}.
|
|
10
|
+
*
|
|
11
|
+
* @export
|
|
12
|
+
* @class Lancamento
|
|
13
|
+
*/
|
|
14
|
+
export declare class Departamento implements DepartamentoBase {
|
|
15
|
+
_id: string;
|
|
16
|
+
_path: string;
|
|
17
|
+
data_atualizacao_doc: Date;
|
|
18
|
+
data_criacao_doc: Date;
|
|
19
|
+
descricao: string;
|
|
20
|
+
excluido: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an instance of Lancamento.
|
|
23
|
+
* @param {Partial<Lancamento>} lancamentoPayload
|
|
24
|
+
* @memberof Lancamento
|
|
25
|
+
*/
|
|
26
|
+
constructor(lancamentoPayload: Partial<Departamento>);
|
|
27
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.Departamento = void 0;
|
|
18
|
+
__exportStar(require("./departamento-fire-convert"), exports);
|
|
19
|
+
/**
|
|
20
|
+
* Internal class col contas/${contaId}/cargo/${cargoId}.
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @class Lancamento
|
|
24
|
+
*/
|
|
25
|
+
var Departamento = /** @class */ (function () {
|
|
26
|
+
// #endregion
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of Lancamento.
|
|
29
|
+
* @param {Partial<Lancamento>} lancamentoPayload
|
|
30
|
+
* @memberof Lancamento
|
|
31
|
+
*/
|
|
32
|
+
function Departamento(lancamentoPayload) {
|
|
33
|
+
var _this = this;
|
|
34
|
+
var keysOfProps = ["_id", "_path", "descricao", "excluido", "data_atualizacao_doc", "data_criacao_doc"];
|
|
35
|
+
keysOfProps.forEach(function (key) {
|
|
36
|
+
_this[key] = lancamentoPayload
|
|
37
|
+
? lancamentoPayload[key]
|
|
38
|
+
: undefined;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return Departamento;
|
|
42
|
+
}());
|
|
43
|
+
exports.Departamento = Departamento;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Escala, EscalaBase } from '.';
|
|
2
|
+
import { FirebaseDocumentReferenceGeneric, FirebaseDocumentSnapshotGeneric, FirebaseQueryDocumentSnapshotGeneric, FirebaseTimestampGeneric } from '../../../shared/flitModelsDependencyInjection';
|
|
3
|
+
export declare class EscalaFirestoreData implements EscalaBase {
|
|
4
|
+
data_atualizacao_doc: FirebaseTimestampGeneric;
|
|
5
|
+
data_criacao_doc: FirebaseTimestampGeneric;
|
|
6
|
+
data_inicial: FirebaseTimestampGeneric;
|
|
7
|
+
descricao: string;
|
|
8
|
+
excluido: boolean;
|
|
9
|
+
jornadas: {
|
|
10
|
+
repetir: number;
|
|
11
|
+
ocorrencia_frequencia_ref: FirebaseDocumentReferenceGeneric;
|
|
12
|
+
periodos: {
|
|
13
|
+
entrada: {
|
|
14
|
+
data_relativa: FirebaseTimestampGeneric;
|
|
15
|
+
hora: string;
|
|
16
|
+
timezone_value: string;
|
|
17
|
+
};
|
|
18
|
+
saida: {
|
|
19
|
+
data_relativa: FirebaseTimestampGeneric;
|
|
20
|
+
hora: string;
|
|
21
|
+
timezone_value: string;
|
|
22
|
+
};
|
|
23
|
+
duracao: string;
|
|
24
|
+
descanso: string;
|
|
25
|
+
}[];
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
export declare abstract class EscalaFireConvert {
|
|
29
|
+
static fromFirestore(doc: FirebaseDocumentSnapshotGeneric | FirebaseQueryDocumentSnapshotGeneric): Escala;
|
|
30
|
+
static toFirestore(escala: Escala): Partial<EscalaFirestoreData>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EscalaFireConvert = exports.EscalaFirestoreData = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var _1 = require(".");
|
|
6
|
+
var flitModelsDependencyInjection_1 = require("../../../shared/flitModelsDependencyInjection");
|
|
7
|
+
var EscalaFirestoreData = /** @class */ (function () {
|
|
8
|
+
function EscalaFirestoreData() {
|
|
9
|
+
}
|
|
10
|
+
return EscalaFirestoreData;
|
|
11
|
+
}());
|
|
12
|
+
exports.EscalaFirestoreData = EscalaFirestoreData;
|
|
13
|
+
var EscalaFireConvert = /** @class */ (function () {
|
|
14
|
+
function EscalaFireConvert() {
|
|
15
|
+
}
|
|
16
|
+
EscalaFireConvert.fromFirestore = function (doc) {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
18
|
+
var docData = ((_a = doc.data()) !== null && _a !== void 0 ? _a : {});
|
|
19
|
+
return new _1.Escala({
|
|
20
|
+
_id: (_b = doc.id) !== null && _b !== void 0 ? _b : null,
|
|
21
|
+
_path: (_c = doc.ref.path) !== null && _c !== void 0 ? _c : null,
|
|
22
|
+
data_atualizacao_doc: ((_d = docData.data_atualizacao_doc) === null || _d === void 0 ? void 0 : _d.toDate()) || null,
|
|
23
|
+
data_criacao_doc: ((_e = docData.data_criacao_doc) === null || _e === void 0 ? void 0 : _e.toDate()) || null,
|
|
24
|
+
data_inicial: ((_f = docData.data_inicial) === null || _f === void 0 ? void 0 : _f.toDate()) || null,
|
|
25
|
+
descricao: (_g = docData.descricao) !== null && _g !== void 0 ? _g : null,
|
|
26
|
+
excluido: (_h = docData.excluido) !== null && _h !== void 0 ? _h : false,
|
|
27
|
+
jornadas: docData.jornadas.map(function (jornada) {
|
|
28
|
+
var _a;
|
|
29
|
+
return ({
|
|
30
|
+
ocorrencia_frequencia_ref: ((_a = jornada.ocorrencia_frequencia_ref) === null || _a === void 0 ? void 0 : _a.path) || null,
|
|
31
|
+
periodos: jornada.periodos.map(function (periodo) {
|
|
32
|
+
var _a;
|
|
33
|
+
return ({
|
|
34
|
+
entrada: {
|
|
35
|
+
data_relativa: ((_a = periodo.entrada.data_relativa) === null || _a === void 0 ? void 0 : _a.toDate()) || null,
|
|
36
|
+
hora: periodo.entrada.hora,
|
|
37
|
+
timezone_value: periodo.entrada.timezone_value,
|
|
38
|
+
},
|
|
39
|
+
saida: {
|
|
40
|
+
data_relativa: periodo.saida.data_relativa.toDate() || null,
|
|
41
|
+
hora: periodo.saida.hora,
|
|
42
|
+
timezone_value: periodo.saida.timezone_value,
|
|
43
|
+
},
|
|
44
|
+
duracao: periodo.duracao,
|
|
45
|
+
descanso: periodo.descanso,
|
|
46
|
+
});
|
|
47
|
+
}),
|
|
48
|
+
repetir: jornada.repetir,
|
|
49
|
+
});
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
EscalaFireConvert.toFirestore = function (escala) {
|
|
54
|
+
var _a;
|
|
55
|
+
var escalaFire = {
|
|
56
|
+
data_atualizacao_doc: flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(escala.data_atualizacao_doc),
|
|
57
|
+
data_criacao_doc: flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(escala.data_criacao_doc),
|
|
58
|
+
data_inicial: flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(escala.data_criacao_doc),
|
|
59
|
+
descricao: escala.descricao,
|
|
60
|
+
excluido: (_a = escala.excluido) !== null && _a !== void 0 ? _a : false,
|
|
61
|
+
jornadas: escala.jornadas.map(function (jornada) { return ({
|
|
62
|
+
ocorrencia_frequencia_ref: flitModelsDependencyInjection_1.FlitModelsDependencyInjection.DocumentReferenceFromPath(jornada.ocorrencia_frequencia_ref) || null,
|
|
63
|
+
periodos: jornada.periodos.map(function (periodo) { return ({
|
|
64
|
+
entrada: {
|
|
65
|
+
data_relativa: flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(periodo.entrada.data_relativa) || null,
|
|
66
|
+
hora: periodo.entrada.hora,
|
|
67
|
+
timezone_value: periodo.entrada.timezone_value,
|
|
68
|
+
},
|
|
69
|
+
saida: {
|
|
70
|
+
data_relativa: flitModelsDependencyInjection_1.FlitModelsDependencyInjection.TimestampFromDate(periodo.saida.data_relativa) || null,
|
|
71
|
+
hora: periodo.saida.hora,
|
|
72
|
+
timezone_value: periodo.saida.timezone_value,
|
|
73
|
+
},
|
|
74
|
+
duracao: periodo.duracao,
|
|
75
|
+
descanso: periodo.descanso,
|
|
76
|
+
}); }),
|
|
77
|
+
repetir: jornada.repetir,
|
|
78
|
+
}); }),
|
|
79
|
+
};
|
|
80
|
+
return (0, lodash_1.omitBy)(escalaFire, lodash_1.isUndefined);
|
|
81
|
+
};
|
|
82
|
+
return EscalaFireConvert;
|
|
83
|
+
}());
|
|
84
|
+
exports.EscalaFireConvert = EscalaFireConvert;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export * from './escala-fire-convert';
|
|
2
|
+
export interface EscalaBase {
|
|
3
|
+
data_atualizacao_doc: any;
|
|
4
|
+
data_criacao_doc: any;
|
|
5
|
+
data_inicial: any;
|
|
6
|
+
descricao: string;
|
|
7
|
+
excluido: boolean;
|
|
8
|
+
jornadas: {
|
|
9
|
+
repetir: number;
|
|
10
|
+
ocorrencia_frequencia_ref: any;
|
|
11
|
+
periodos: {
|
|
12
|
+
entrada: {
|
|
13
|
+
data_relativa: any;
|
|
14
|
+
hora: string;
|
|
15
|
+
timezone_value: string;
|
|
16
|
+
};
|
|
17
|
+
saida: {
|
|
18
|
+
data_relativa: any;
|
|
19
|
+
hora: string;
|
|
20
|
+
timezone_value: string;
|
|
21
|
+
};
|
|
22
|
+
duracao: string;
|
|
23
|
+
descanso: string;
|
|
24
|
+
}[];
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Internal class col contas/${contaId}/cargo/${cargoId}.
|
|
29
|
+
*
|
|
30
|
+
* @export
|
|
31
|
+
* @class Lancamento
|
|
32
|
+
*/
|
|
33
|
+
export declare class Escala implements EscalaBase {
|
|
34
|
+
_id: string;
|
|
35
|
+
_path: string;
|
|
36
|
+
data_atualizacao_doc: Date;
|
|
37
|
+
data_criacao_doc: Date;
|
|
38
|
+
data_inicial: Date;
|
|
39
|
+
descricao: string;
|
|
40
|
+
excluido: boolean;
|
|
41
|
+
jornadas: {
|
|
42
|
+
repetir: number;
|
|
43
|
+
ocorrencia_frequencia_ref: string;
|
|
44
|
+
periodos: {
|
|
45
|
+
entrada: {
|
|
46
|
+
data_relativa: Date;
|
|
47
|
+
hora: string;
|
|
48
|
+
timezone_value: string;
|
|
49
|
+
};
|
|
50
|
+
saida: {
|
|
51
|
+
data_relativa: Date;
|
|
52
|
+
hora: string;
|
|
53
|
+
timezone_value: string;
|
|
54
|
+
};
|
|
55
|
+
duracao: string;
|
|
56
|
+
descanso: string;
|
|
57
|
+
}[];
|
|
58
|
+
}[];
|
|
59
|
+
/**
|
|
60
|
+
* Creates an instance of Lancamento.
|
|
61
|
+
* @param {Partial<Lancamento>} lancamentoPayload
|
|
62
|
+
* @memberof Lancamento
|
|
63
|
+
*/
|
|
64
|
+
constructor(lancamentoPayload: Partial<Escala>);
|
|
65
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.Escala = void 0;
|
|
18
|
+
__exportStar(require("./escala-fire-convert"), exports);
|
|
19
|
+
/**
|
|
20
|
+
* Internal class col contas/${contaId}/cargo/${cargoId}.
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @class Lancamento
|
|
24
|
+
*/
|
|
25
|
+
var Escala = /** @class */ (function () {
|
|
26
|
+
// #endregion
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of Lancamento.
|
|
29
|
+
* @param {Partial<Lancamento>} lancamentoPayload
|
|
30
|
+
* @memberof Lancamento
|
|
31
|
+
*/
|
|
32
|
+
function Escala(lancamentoPayload) {
|
|
33
|
+
var _this = this;
|
|
34
|
+
var keysOfProps = ["_id", "_path", "descricao", "excluido", "data_inicial", "data_atualizacao_doc", "data_criacao_doc", "jornadas"];
|
|
35
|
+
keysOfProps.forEach(function (key) {
|
|
36
|
+
_this[key] = lancamentoPayload
|
|
37
|
+
? lancamentoPayload[key]
|
|
38
|
+
: undefined;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return Escala;
|
|
42
|
+
}());
|
|
43
|
+
exports.Escala = Escala;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FirebaseDocumentReferenceGeneric, FirebaseTimestampGeneric } from '../../shared/flitModelsDependencyInjection';
|
|
2
2
|
export declare enum EnumExcecaoTipo {
|
|
3
3
|
ATRASO = "ATRASO",
|
|
4
4
|
FALTA = "FALTA",
|
|
@@ -12,28 +12,28 @@ export declare enum EnumExcecaoStatus {
|
|
|
12
12
|
RETIFICADO = "RETIFICADO"
|
|
13
13
|
}
|
|
14
14
|
export interface IExcecao {
|
|
15
|
-
data_cancelamento?:
|
|
16
|
-
data_criacao:
|
|
17
|
-
data_lancamento_manual_horas_extras?:
|
|
18
|
-
data_parecer?:
|
|
19
|
-
data_referencia:
|
|
15
|
+
data_cancelamento?: FirebaseTimestampGeneric;
|
|
16
|
+
data_criacao: FirebaseTimestampGeneric;
|
|
17
|
+
data_lancamento_manual_horas_extras?: FirebaseTimestampGeneric;
|
|
18
|
+
data_parecer?: FirebaseTimestampGeneric;
|
|
19
|
+
data_referencia: FirebaseTimestampGeneric;
|
|
20
20
|
gestor: {
|
|
21
21
|
nome: string;
|
|
22
22
|
email: string;
|
|
23
|
-
ref:
|
|
23
|
+
ref: FirebaseDocumentReferenceGeneric;
|
|
24
24
|
};
|
|
25
25
|
observacao: string;
|
|
26
26
|
parecer?: string;
|
|
27
27
|
periodo?: {
|
|
28
|
-
inicio:
|
|
29
|
-
fim:
|
|
28
|
+
inicio: FirebaseTimestampGeneric;
|
|
29
|
+
fim: FirebaseTimestampGeneric;
|
|
30
30
|
};
|
|
31
|
-
retificacao_ref:
|
|
31
|
+
retificacao_ref: FirebaseDocumentReferenceGeneric;
|
|
32
32
|
status: EnumExcecaoStatus;
|
|
33
33
|
tempo?: number;
|
|
34
34
|
timezone: string;
|
|
35
35
|
tipo: EnumExcecaoTipo;
|
|
36
|
-
usuario_ref:
|
|
36
|
+
usuario_ref: FirebaseDocumentReferenceGeneric;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Classe construtora dos dos documento da coleção de Exceções.
|
|
@@ -46,28 +46,28 @@ export declare class Excecao implements IExcecao {
|
|
|
46
46
|
uid: string;
|
|
47
47
|
path: string;
|
|
48
48
|
usuario: any;
|
|
49
|
-
data_cancelamento?:
|
|
50
|
-
data_criacao:
|
|
51
|
-
data_lancamento_manual_horas_extras?:
|
|
52
|
-
data_parecer?:
|
|
53
|
-
data_referencia:
|
|
49
|
+
data_cancelamento?: FirebaseTimestampGeneric;
|
|
50
|
+
data_criacao: FirebaseTimestampGeneric;
|
|
51
|
+
data_lancamento_manual_horas_extras?: FirebaseTimestampGeneric;
|
|
52
|
+
data_parecer?: FirebaseTimestampGeneric;
|
|
53
|
+
data_referencia: FirebaseTimestampGeneric;
|
|
54
54
|
gestor: {
|
|
55
55
|
nome: string;
|
|
56
56
|
email: string;
|
|
57
|
-
ref:
|
|
57
|
+
ref: FirebaseDocumentReferenceGeneric;
|
|
58
58
|
};
|
|
59
59
|
observacao: string;
|
|
60
60
|
parecer?: string | undefined;
|
|
61
61
|
periodo?: {
|
|
62
|
-
inicio:
|
|
63
|
-
fim:
|
|
62
|
+
inicio: FirebaseTimestampGeneric;
|
|
63
|
+
fim: FirebaseTimestampGeneric;
|
|
64
64
|
} | undefined;
|
|
65
|
-
retificacao_ref:
|
|
65
|
+
retificacao_ref: FirebaseDocumentReferenceGeneric;
|
|
66
66
|
status: EnumExcecaoStatus;
|
|
67
67
|
tempo?: number | undefined;
|
|
68
68
|
timezone: string;
|
|
69
69
|
tipo: EnumExcecaoTipo;
|
|
70
|
-
usuario_ref:
|
|
70
|
+
usuario_ref: FirebaseDocumentReferenceGeneric;
|
|
71
71
|
/**
|
|
72
72
|
* Creates an instance of Excecao.
|
|
73
73
|
* @param {Partial<Excecao>} excecaoPayload
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FirebaseDocumentReferenceGeneric, FirebaseDocumentSnapshotGeneric, FirebaseQueryDocumentSnapshotGeneric } from '../../../shared/flitModelsDependencyInjection';
|
|
2
2
|
import { EmpresaFeriado, EmpresaFeriadoBase } from './empresa-feriado';
|
|
3
3
|
export declare class EmpresaFeriadoFirestoreData implements EmpresaFeriadoBase {
|
|
4
|
-
ref:
|
|
4
|
+
ref: FirebaseDocumentReferenceGeneric;
|
|
5
5
|
documento: string;
|
|
6
6
|
municipio: string;
|
|
7
7
|
nome: string;
|
|
8
8
|
uf: string;
|
|
9
9
|
}
|
|
10
10
|
export declare abstract class EmpresaFeriadoFireConvert {
|
|
11
|
-
static fromFirestore(doc:
|
|
12
|
-
static toFirestore(empresaFeriado: EmpresaFeriado
|
|
11
|
+
static fromFirestore(doc: FirebaseDocumentSnapshotGeneric | FirebaseQueryDocumentSnapshotGeneric): EmpresaFeriado;
|
|
12
|
+
static toFirestore(empresaFeriado: EmpresaFeriado): Partial<EmpresaFeriadoFirestoreData>;
|
|
13
13
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmpresaFeriadoFireConvert = exports.EmpresaFeriadoFirestoreData = void 0;
|
|
4
4
|
var lodash_1 = require("lodash");
|
|
5
|
+
var flitModelsDependencyInjection_1 = require("../../../shared/flitModelsDependencyInjection");
|
|
5
6
|
var string_helper_1 = require("../../utils/string-helper");
|
|
6
7
|
var type_guards_1 = require("../../utils/type-guards");
|
|
7
8
|
var empresa_feriado_1 = require("./empresa-feriado");
|
|
@@ -28,12 +29,12 @@ var EmpresaFeriadoFireConvert = /** @class */ (function () {
|
|
|
28
29
|
uf: string_helper_1.StringHelper.trim(doc.get('uf'), null),
|
|
29
30
|
});
|
|
30
31
|
};
|
|
31
|
-
EmpresaFeriadoFireConvert.toFirestore = function (empresaFeriado
|
|
32
|
+
EmpresaFeriadoFireConvert.toFirestore = function (empresaFeriado) {
|
|
32
33
|
return (0, lodash_1.omitBy)({
|
|
33
34
|
documento: empresaFeriado.documento,
|
|
34
35
|
municipio: empresaFeriado.municipio,
|
|
35
36
|
nome: empresaFeriado.nome,
|
|
36
|
-
ref:
|
|
37
|
+
ref: flitModelsDependencyInjection_1.FlitModelsDependencyInjection.DocumentReferenceFromPath(empresaFeriado.ref),
|
|
37
38
|
uf: empresaFeriado.uf,
|
|
38
39
|
}, lodash_1.isUndefined);
|
|
39
40
|
};
|
|
@@ -16,7 +16,7 @@ var EmpresaFeriado = /** @class */ (function () {
|
|
|
16
16
|
*/
|
|
17
17
|
function EmpresaFeriado(feriadoEmpresaPayload) {
|
|
18
18
|
var _this = this;
|
|
19
|
-
var keysOfProps = ["_id", "_path", "documento", "municipio", "nome", "
|
|
19
|
+
var keysOfProps = ["ref", "_id", "_path", "documento", "municipio", "nome", "uf"];
|
|
20
20
|
keysOfProps.forEach(function (key) {
|
|
21
21
|
_this[key] = feriadoEmpresaPayload
|
|
22
22
|
? feriadoEmpresaPayload[key]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
2
1
|
import { Feriado, FeriadoBase, FeriadoTipoEnum } from '.';
|
|
2
|
+
import { FirebaseDocumentSnapshotGeneric, FirebaseQueryDocumentSnapshotGeneric, FirebaseTimestampGeneric } from '../../../shared/flitModelsDependencyInjection';
|
|
3
3
|
export declare class FeriadoFirestoreData implements FeriadoBase {
|
|
4
|
-
data:
|
|
4
|
+
data: FirebaseTimestampGeneric;
|
|
5
5
|
descricao: string;
|
|
6
6
|
excluido: boolean;
|
|
7
7
|
importacao_id: string;
|
|
@@ -11,6 +11,6 @@ export declare class FeriadoFirestoreData implements FeriadoBase {
|
|
|
11
11
|
uf: string;
|
|
12
12
|
}
|
|
13
13
|
export declare abstract class FeriadoFireConvert {
|
|
14
|
-
static fromFirestore(doc:
|
|
15
|
-
static toFirestore(feriado: Feriado
|
|
14
|
+
static fromFirestore(doc: FirebaseDocumentSnapshotGeneric | FirebaseQueryDocumentSnapshotGeneric): Feriado;
|
|
15
|
+
static toFirestore(feriado: Feriado): Partial<FeriadoFirestoreData>;
|
|
16
16
|
}
|