flit-models 1.0.3 → 2.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/index.d.ts +1 -1
- package/lib/index.js +4 -1
- package/lib/models/contas/excecoes.d.ts +13 -7
- package/lib/models/contas/excecoes.js +3 -6
- package/lib/models/contas/feriado.d.ts +91 -0
- package/lib/models/contas/feriado.js +98 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +1 -0
- package/package.json +16 -17
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { EnumExcecaoStatus, EnumExcecaoTipo, Excecao, IExcecao, } from './models/index';
|
|
1
|
+
export { EnumExcecaoStatus, EnumExcecaoTipo, Excecao, IExcecao, Feriado, FeriadoEmpresa, FeriadoEmpresaFirestoreData, FeriadoFirestoreData, FeriadoTipoEnum, } from './models/index';
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Excecao = exports.EnumExcecaoTipo = exports.EnumExcecaoStatus = void 0;
|
|
3
|
+
exports.FeriadoTipoEnum = exports.FeriadoEmpresa = exports.Feriado = exports.Excecao = exports.EnumExcecaoTipo = exports.EnumExcecaoStatus = void 0;
|
|
4
4
|
var index_1 = require("./models/index");
|
|
5
5
|
Object.defineProperty(exports, "EnumExcecaoStatus", { enumerable: true, get: function () { return index_1.EnumExcecaoStatus; } });
|
|
6
6
|
Object.defineProperty(exports, "EnumExcecaoTipo", { enumerable: true, get: function () { return index_1.EnumExcecaoTipo; } });
|
|
7
7
|
Object.defineProperty(exports, "Excecao", { enumerable: true, get: function () { return index_1.Excecao; } });
|
|
8
|
+
Object.defineProperty(exports, "Feriado", { enumerable: true, get: function () { return index_1.Feriado; } });
|
|
9
|
+
Object.defineProperty(exports, "FeriadoEmpresa", { enumerable: true, get: function () { return index_1.FeriadoEmpresa; } });
|
|
10
|
+
Object.defineProperty(exports, "FeriadoTipoEnum", { enumerable: true, get: function () { return index_1.FeriadoTipoEnum; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Timestamp, DocumentReference, DocumentData } from 'firebase/firestore';
|
|
2
2
|
export declare enum EnumExcecaoTipo {
|
|
3
3
|
ATRASO = "ATRASO",
|
|
4
4
|
FALTA = "FALTA",
|
|
@@ -12,19 +12,22 @@ export declare enum EnumExcecaoStatus {
|
|
|
12
12
|
RETIFICADO = "RETIFICADO"
|
|
13
13
|
}
|
|
14
14
|
export interface IExcecao {
|
|
15
|
+
data_cancelamento?: Timestamp;
|
|
16
|
+
data_criacao: Timestamp;
|
|
17
|
+
data_lancamento_manual_horas_extras?: Timestamp;
|
|
18
|
+
data_parecer?: Timestamp;
|
|
19
|
+
data_referencia: Timestamp;
|
|
15
20
|
gestor: {
|
|
16
21
|
nome: String;
|
|
17
22
|
email: String;
|
|
18
23
|
ref: DocumentReference;
|
|
19
24
|
};
|
|
20
25
|
observacao: String;
|
|
26
|
+
parecer?: String;
|
|
21
27
|
periodo?: {
|
|
22
28
|
inicio: Timestamp;
|
|
23
29
|
fim: Timestamp;
|
|
24
30
|
};
|
|
25
|
-
referencia: Timestamp;
|
|
26
|
-
parecer?: String;
|
|
27
|
-
parecer_data?: Timestamp;
|
|
28
31
|
retificacao_ref: DocumentReference;
|
|
29
32
|
status: EnumExcecaoStatus;
|
|
30
33
|
tempo?: Number;
|
|
@@ -42,26 +45,29 @@ export interface IExcecao {
|
|
|
42
45
|
export declare class Excecao implements IExcecao {
|
|
43
46
|
uid: string;
|
|
44
47
|
path: string;
|
|
48
|
+
usuario: any;
|
|
49
|
+
data_cancelamento?: Timestamp;
|
|
50
|
+
data_criacao: Timestamp;
|
|
51
|
+
data_lancamento_manual_horas_extras?: Timestamp;
|
|
52
|
+
data_parecer?: Timestamp;
|
|
53
|
+
data_referencia: Timestamp;
|
|
45
54
|
gestor: {
|
|
46
55
|
nome: String;
|
|
47
56
|
email: String;
|
|
48
57
|
ref: DocumentReference<DocumentData>;
|
|
49
58
|
};
|
|
50
59
|
observacao: String;
|
|
51
|
-
parecer_data?: Timestamp;
|
|
52
60
|
parecer?: String | undefined;
|
|
53
61
|
periodo?: {
|
|
54
62
|
inicio: Timestamp;
|
|
55
63
|
fim: Timestamp;
|
|
56
64
|
} | undefined;
|
|
57
|
-
referencia: Timestamp;
|
|
58
65
|
retificacao_ref: DocumentReference<DocumentData>;
|
|
59
66
|
status: EnumExcecaoStatus;
|
|
60
67
|
tempo?: Number | undefined;
|
|
61
68
|
timezone: String;
|
|
62
69
|
tipo: EnumExcecaoTipo;
|
|
63
70
|
usuario_ref: DocumentReference<DocumentData>;
|
|
64
|
-
usuario: any;
|
|
65
71
|
/**
|
|
66
72
|
* Creates an instance of Excecao.
|
|
67
73
|
* @param {Partial<Excecao>} excecaoPayload
|
|
@@ -10,12 +10,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
14
|
exports.Excecao = exports.EnumExcecaoStatus = exports.EnumExcecaoTipo = void 0;
|
|
18
|
-
var lodash_1 =
|
|
15
|
+
var lodash_1 = require("lodash");
|
|
19
16
|
var EnumExcecaoTipo;
|
|
20
17
|
(function (EnumExcecaoTipo) {
|
|
21
18
|
EnumExcecaoTipo["ATRASO"] = "ATRASO";
|
|
@@ -45,7 +42,7 @@ var Excecao = /** @class */ (function () {
|
|
|
45
42
|
*/
|
|
46
43
|
function Excecao(excecaoPayload) {
|
|
47
44
|
var _this = this;
|
|
48
|
-
var keysOfProps = ["uid", "path", "
|
|
45
|
+
var keysOfProps = ["uid", "path", "usuario", "data_cancelamento", "data_criacao", "data_lancamento_manual_horas_extras", "data_parecer", "data_referencia", "gestor", "observacao", "parecer", "periodo", "retificacao_ref", "status", "tempo", "timezone", "tipo", "usuario_ref"];
|
|
49
46
|
keysOfProps.forEach(function (key) {
|
|
50
47
|
_this[key] = excecaoPayload ? excecaoPayload[key] : undefined;
|
|
51
48
|
});
|
|
@@ -59,7 +56,7 @@ var Excecao = /** @class */ (function () {
|
|
|
59
56
|
Excecao.prototype.toFirestoreData = function () {
|
|
60
57
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
61
58
|
var _a = this, toFirestoreData = _a.toFirestoreData, uid = _a.uid, path = _a.path, usuario = _a.usuario, rest = __rest(_a, ["toFirestoreData", "uid", "path", "usuario"]);
|
|
62
|
-
var object = Object.assign({}, lodash_1.
|
|
59
|
+
var object = Object.assign({}, (0, lodash_1.omitBy)(rest, lodash_1.isUndefined));
|
|
63
60
|
if (!Object.keys(object).length) {
|
|
64
61
|
throw new Error('Excecao => toFirestoreData => empty object error.');
|
|
65
62
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { DocumentData, DocumentReference, Timestamp } from '@firebase/firestore';
|
|
2
|
+
export declare enum FeriadoTipoEnum {
|
|
3
|
+
Nacional = "Nacional",
|
|
4
|
+
Estadual = "Estadual",
|
|
5
|
+
Municipal = "Municipal"
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Interface col contas/${contaId}/feriados/${feriadoId}.
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @interface FeriadoFirestoreData
|
|
12
|
+
*/
|
|
13
|
+
export interface FeriadoFirestoreData {
|
|
14
|
+
data: Timestamp;
|
|
15
|
+
descricao: string;
|
|
16
|
+
excluido: boolean;
|
|
17
|
+
importacao_id: string;
|
|
18
|
+
municipio: string;
|
|
19
|
+
tipo: FeriadoTipoEnum;
|
|
20
|
+
uf: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Internal class col contas/${contaId}/feriados/${feriadoId}.
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @class Feriado
|
|
27
|
+
*/
|
|
28
|
+
export declare class Feriado implements FeriadoFirestoreData {
|
|
29
|
+
uid: string;
|
|
30
|
+
path: string;
|
|
31
|
+
data: Timestamp;
|
|
32
|
+
descricao: string;
|
|
33
|
+
excluido: boolean;
|
|
34
|
+
importacao_id: string;
|
|
35
|
+
municipio: string;
|
|
36
|
+
tipo: FeriadoTipoEnum;
|
|
37
|
+
uf: string;
|
|
38
|
+
/**
|
|
39
|
+
* Creates an instance of Feriado.
|
|
40
|
+
* @param {Partial<Feriado>} feriadoPayload
|
|
41
|
+
* @memberof Feriado
|
|
42
|
+
*/
|
|
43
|
+
constructor(feriadoPayload: Partial<Feriado>);
|
|
44
|
+
/**
|
|
45
|
+
* Convert class in firestore date.
|
|
46
|
+
*
|
|
47
|
+
* @return {*}
|
|
48
|
+
* @memberof Feriado
|
|
49
|
+
*/
|
|
50
|
+
toFirestoreData(): FeriadoFirestoreData;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Interface col contas/${contaId}/feriados/${feriadoId}/empresas_feriado/${empresaId}.
|
|
54
|
+
*
|
|
55
|
+
* @export
|
|
56
|
+
* @interface FeriadoEmpresaFirestoreData
|
|
57
|
+
*/
|
|
58
|
+
export interface FeriadoEmpresaFirestoreData {
|
|
59
|
+
ref: DocumentReference;
|
|
60
|
+
documento: string;
|
|
61
|
+
nome_fantasia: string;
|
|
62
|
+
razao_social: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Internal class col contas/${contaId}/feriados/${feriadoId}/empresas_feriado/${empresaId}.
|
|
66
|
+
*
|
|
67
|
+
* @export
|
|
68
|
+
* @class FeriadoEmpresa
|
|
69
|
+
* @implements {FeriadoFirestoreData}
|
|
70
|
+
*/
|
|
71
|
+
export declare class FeriadoEmpresa implements FeriadoEmpresaFirestoreData {
|
|
72
|
+
uid: string;
|
|
73
|
+
path: string;
|
|
74
|
+
ref: DocumentReference<DocumentData>;
|
|
75
|
+
documento: string;
|
|
76
|
+
nome_fantasia: string;
|
|
77
|
+
razao_social: string;
|
|
78
|
+
/**
|
|
79
|
+
* Creates an instance of FeriadoEmpresa.
|
|
80
|
+
* @param {Partial<FeriadoEmpresa>} feriadoEmpresaPayload
|
|
81
|
+
* @memberof Feriado
|
|
82
|
+
*/
|
|
83
|
+
constructor(feriadoEmpresaPayload: Partial<FeriadoEmpresa>);
|
|
84
|
+
/**
|
|
85
|
+
* Convert class in firestore date.
|
|
86
|
+
*
|
|
87
|
+
* @return {*}
|
|
88
|
+
* @memberof FeriadoEmpresa
|
|
89
|
+
*/
|
|
90
|
+
toFirestoreData(): FeriadoEmpresa;
|
|
91
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.FeriadoEmpresa = exports.Feriado = exports.FeriadoTipoEnum = void 0;
|
|
15
|
+
var lodash_1 = require("lodash");
|
|
16
|
+
var FeriadoTipoEnum;
|
|
17
|
+
(function (FeriadoTipoEnum) {
|
|
18
|
+
FeriadoTipoEnum["Nacional"] = "Nacional";
|
|
19
|
+
FeriadoTipoEnum["Estadual"] = "Estadual";
|
|
20
|
+
FeriadoTipoEnum["Municipal"] = "Municipal";
|
|
21
|
+
})(FeriadoTipoEnum = exports.FeriadoTipoEnum || (exports.FeriadoTipoEnum = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Internal class col contas/${contaId}/feriados/${feriadoId}.
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @class Feriado
|
|
27
|
+
*/
|
|
28
|
+
var Feriado = /** @class */ (function () {
|
|
29
|
+
/**
|
|
30
|
+
* Creates an instance of Feriado.
|
|
31
|
+
* @param {Partial<Feriado>} feriadoPayload
|
|
32
|
+
* @memberof Feriado
|
|
33
|
+
*/
|
|
34
|
+
function Feriado(feriadoPayload) {
|
|
35
|
+
var _this = this;
|
|
36
|
+
var keysOfProps = ["uid", "path", "tipo", "data", "descricao", "excluido", "importacao_id", "municipio", "uf"];
|
|
37
|
+
keysOfProps.forEach(function (key) {
|
|
38
|
+
_this[key] = feriadoPayload ? feriadoPayload[key] : undefined;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Convert class in firestore date.
|
|
43
|
+
*
|
|
44
|
+
* @return {*}
|
|
45
|
+
* @memberof Feriado
|
|
46
|
+
*/
|
|
47
|
+
Feriado.prototype.toFirestoreData = function () {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
49
|
+
var _a = this, toFirestoreData = _a.toFirestoreData, uid = _a.uid, path = _a.path, rest = __rest(_a, ["toFirestoreData", "uid", "path"]);
|
|
50
|
+
var object = Object.assign({}, (0, lodash_1.omitBy)(rest, lodash_1.isUndefined));
|
|
51
|
+
if (!Object.keys(object).length) {
|
|
52
|
+
throw new Error('Feriado => toFirestoreData => empty object error.');
|
|
53
|
+
}
|
|
54
|
+
return object;
|
|
55
|
+
};
|
|
56
|
+
return Feriado;
|
|
57
|
+
}());
|
|
58
|
+
exports.Feriado = Feriado;
|
|
59
|
+
/**
|
|
60
|
+
* Internal class col contas/${contaId}/feriados/${feriadoId}/empresas_feriado/${empresaId}.
|
|
61
|
+
*
|
|
62
|
+
* @export
|
|
63
|
+
* @class FeriadoEmpresa
|
|
64
|
+
* @implements {FeriadoFirestoreData}
|
|
65
|
+
*/
|
|
66
|
+
var FeriadoEmpresa = /** @class */ (function () {
|
|
67
|
+
/**
|
|
68
|
+
* Creates an instance of FeriadoEmpresa.
|
|
69
|
+
* @param {Partial<FeriadoEmpresa>} feriadoEmpresaPayload
|
|
70
|
+
* @memberof Feriado
|
|
71
|
+
*/
|
|
72
|
+
function FeriadoEmpresa(feriadoEmpresaPayload) {
|
|
73
|
+
var _this = this;
|
|
74
|
+
var keysOfProps = ["uid", "path", "ref", "documento", "nome_fantasia", "razao_social"];
|
|
75
|
+
keysOfProps.forEach(function (key) {
|
|
76
|
+
_this[key] = feriadoEmpresaPayload
|
|
77
|
+
? feriadoEmpresaPayload[key]
|
|
78
|
+
: undefined;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Convert class in firestore date.
|
|
83
|
+
*
|
|
84
|
+
* @return {*}
|
|
85
|
+
* @memberof FeriadoEmpresa
|
|
86
|
+
*/
|
|
87
|
+
FeriadoEmpresa.prototype.toFirestoreData = function () {
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
+
var _a = this, toFirestoreData = _a.toFirestoreData, uid = _a.uid, path = _a.path, rest = __rest(_a, ["toFirestoreData", "uid", "path"]);
|
|
90
|
+
var object = Object.assign({}, (0, lodash_1.omitBy)(rest, lodash_1.isUndefined));
|
|
91
|
+
if (!Object.keys(object).length) {
|
|
92
|
+
throw new Error('Feriado => toFirestoreData => empty object error.');
|
|
93
|
+
}
|
|
94
|
+
return object;
|
|
95
|
+
};
|
|
96
|
+
return FeriadoEmpresa;
|
|
97
|
+
}());
|
|
98
|
+
exports.FeriadoEmpresa = FeriadoEmpresa;
|
package/lib/models/index.d.ts
CHANGED
package/lib/models/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flit-models",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -23,26 +23,25 @@
|
|
|
23
23
|
"author": "gustavo_damazio",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"
|
|
27
|
-
"firebase": "^8.2.9",
|
|
26
|
+
"firebase": "^9.6.0",
|
|
28
27
|
"lodash": "^4.17.21",
|
|
29
28
|
"ts-transformer-keys": "^0.4.3"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"@types/jest": "^
|
|
33
|
-
"@types/lodash": "^4.14.
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
35
|
-
"@typescript-eslint/parser": "^
|
|
36
|
-
"eslint": "^
|
|
31
|
+
"@types/jest": "^27.0.3",
|
|
32
|
+
"@types/lodash": "^4.14.177",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.6.0",
|
|
34
|
+
"@typescript-eslint/parser": "^5.6.0",
|
|
35
|
+
"eslint": "^8.4.1",
|
|
37
36
|
"eslint-config-google": "^0.14.0",
|
|
38
|
-
"eslint-config-prettier": "^8.
|
|
39
|
-
"eslint-plugin-import": "^2.
|
|
40
|
-
"eslint-plugin-jest": "^
|
|
41
|
-
"eslint-plugin-prettier": "^
|
|
42
|
-
"jest": "^
|
|
43
|
-
"prettier": "^2.
|
|
44
|
-
"ts-jest": "^
|
|
45
|
-
"ttypescript": "^1.5.
|
|
46
|
-
"typescript": "^4.
|
|
37
|
+
"eslint-config-prettier": "^8.3.0",
|
|
38
|
+
"eslint-plugin-import": "^2.25.3",
|
|
39
|
+
"eslint-plugin-jest": "^25.3.0",
|
|
40
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
41
|
+
"jest": "^27.4.3",
|
|
42
|
+
"prettier": "^2.5.1",
|
|
43
|
+
"ts-jest": "^27.1.1",
|
|
44
|
+
"ttypescript": "^1.5.13",
|
|
45
|
+
"typescript": "^4.5.2"
|
|
47
46
|
}
|
|
48
47
|
}
|