flit-models 2.0.2 → 2.1.2
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 +8 -2
- package/lib/models/contas/feriado/empresas-feriado-fire-convert.d.ts +12 -0
- package/lib/models/contas/feriado/empresas-feriado-fire-convert.js +40 -0
- package/lib/models/contas/feriado/empresas-feriado.d.ts +27 -0
- package/lib/models/contas/feriado/empresas-feriado.js +28 -0
- package/lib/models/contas/feriado/feriado-fire-convert.d.ts +16 -0
- package/lib/models/contas/feriado/feriado-fire-convert.js +50 -0
- package/lib/models/contas/feriado/feriado-json-convert.d.ts +17 -0
- package/lib/models/contas/feriado/feriado-json-convert.js +50 -0
- package/lib/models/contas/feriado/index.d.ts +39 -0
- package/lib/models/contas/feriado/index.js +31 -0
- package/lib/models/contas/feriado.d.ts +2 -2
- package/lib/models/contas/feriado.js +1 -1
- package/lib/models/index.d.ts +4 -0
- package/lib/models/index.js +4 -0
- package/lib/models/utils/boolean-helper.d.ts +3 -0
- package/lib/models/utils/boolean-helper.js +17 -0
- package/lib/models/utils/date-helper.d.ts +4 -0
- package/lib/models/utils/date-helper.js +21 -0
- package/lib/models/utils/string-helper.d.ts +3 -0
- package/lib/models/utils/string-helper.js +17 -0
- package/lib/models/utils/type-guards.d.ts +17 -0
- package/lib/models/utils/type-guards.js +29 -0
- package/package.json +12 -12
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { EnumExcecaoStatus, EnumExcecaoTipo, Excecao, IExcecao, Feriado,
|
|
1
|
+
export { EnumExcecaoStatus, EnumExcecaoTipo, Excecao, IExcecao, Feriado, EmpresaFeriado, EmpresaFeriadoFirestoreData as FeriadoEmpresaFirestoreData, FeriadoFirestoreData, FeriadoTipoEnum, EmpresasFeriadoFireConvert, FeriadoFireConvert, FeriadoJsonConvert, FeriadoJsonData, } from './models/index';
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FeriadoTipoEnum = exports.
|
|
3
|
+
exports.FeriadoJsonData = exports.FeriadoJsonConvert = exports.FeriadoFireConvert = exports.EmpresasFeriadoFireConvert = exports.FeriadoTipoEnum = exports.FeriadoFirestoreData = exports.FeriadoEmpresaFirestoreData = exports.EmpresaFeriado = 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
8
|
Object.defineProperty(exports, "Feriado", { enumerable: true, get: function () { return index_1.Feriado; } });
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "EmpresaFeriado", { enumerable: true, get: function () { return index_1.EmpresaFeriado; } });
|
|
10
|
+
Object.defineProperty(exports, "FeriadoEmpresaFirestoreData", { enumerable: true, get: function () { return index_1.EmpresaFeriadoFirestoreData; } });
|
|
11
|
+
Object.defineProperty(exports, "FeriadoFirestoreData", { enumerable: true, get: function () { return index_1.FeriadoFirestoreData; } });
|
|
10
12
|
Object.defineProperty(exports, "FeriadoTipoEnum", { enumerable: true, get: function () { return index_1.FeriadoTipoEnum; } });
|
|
13
|
+
Object.defineProperty(exports, "EmpresasFeriadoFireConvert", { enumerable: true, get: function () { return index_1.EmpresasFeriadoFireConvert; } });
|
|
14
|
+
Object.defineProperty(exports, "FeriadoFireConvert", { enumerable: true, get: function () { return index_1.FeriadoFireConvert; } });
|
|
15
|
+
Object.defineProperty(exports, "FeriadoJsonConvert", { enumerable: true, get: function () { return index_1.FeriadoJsonConvert; } });
|
|
16
|
+
Object.defineProperty(exports, "FeriadoJsonData", { enumerable: true, get: function () { return index_1.FeriadoJsonData; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DocumentReference, DocumentSnapshot } 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>): EmpresaFeriado;
|
|
11
|
+
static toFirestore(empresaFeriado: EmpresaFeriado, docRefConstructor: (path: string) => DocumentReference<any>): Partial<EmpresaFeriadoFirestoreData>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
2
|
+
import { Feriado, FeriadoBase, FeriadoTipoEnum } from '.';
|
|
3
|
+
export declare class FeriadoFirestoreData implements FeriadoBase {
|
|
4
|
+
data: Timestamp;
|
|
5
|
+
descricao: string;
|
|
6
|
+
excluido: boolean;
|
|
7
|
+
importacao_id: string;
|
|
8
|
+
municipio: string;
|
|
9
|
+
tipo: FeriadoTipoEnum;
|
|
10
|
+
todas_empresas: boolean;
|
|
11
|
+
uf: string;
|
|
12
|
+
}
|
|
13
|
+
export declare abstract class FeriadoFireConvert {
|
|
14
|
+
static fromFirestore(doc: DocumentSnapshot<FeriadoFirestoreData>): Feriado;
|
|
15
|
+
static toFirestore(feriado: Feriado): Partial<FeriadoFirestoreData>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeriadoFireConvert = exports.FeriadoFirestoreData = 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 FeriadoFirestoreData = /** @class */ (function () {
|
|
11
|
+
function FeriadoFirestoreData() {
|
|
12
|
+
}
|
|
13
|
+
return FeriadoFirestoreData;
|
|
14
|
+
}());
|
|
15
|
+
exports.FeriadoFirestoreData = FeriadoFirestoreData;
|
|
16
|
+
var FeriadoFireConvert = /** @class */ (function () {
|
|
17
|
+
function FeriadoFireConvert() {
|
|
18
|
+
}
|
|
19
|
+
FeriadoFireConvert.fromFirestore = function (doc) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
return new _1.Feriado({
|
|
22
|
+
uid: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
23
|
+
path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
24
|
+
data: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data'))
|
|
25
|
+
? doc.get('data').toDate()
|
|
26
|
+
: null,
|
|
27
|
+
descricao: string_helper_1.StringHelper.trim(doc.get('descricao'), null),
|
|
28
|
+
excluido: boolean_helper_1.BooleanHelper.check(doc.get('excluido'), false),
|
|
29
|
+
importacao_id: string_helper_1.StringHelper.trim(doc.get('importacao_id'), null),
|
|
30
|
+
municipio: string_helper_1.StringHelper.trim(doc.get('municipio'), null),
|
|
31
|
+
tipo: string_helper_1.StringHelper.trim(doc.get('tipo'), null),
|
|
32
|
+
todas_empresas: boolean_helper_1.BooleanHelper.check(doc.get('todas_empresas'), true),
|
|
33
|
+
uf: string_helper_1.StringHelper.trim(doc.get('uf'), null),
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
FeriadoFireConvert.toFirestore = function (feriado) {
|
|
37
|
+
return (0, lodash_1.omitBy)({
|
|
38
|
+
data: firestore_1.Timestamp.fromDate(feriado.data),
|
|
39
|
+
descricao: string_helper_1.StringHelper.trim(feriado.descricao, null),
|
|
40
|
+
excluido: boolean_helper_1.BooleanHelper.check(feriado.excluido, false),
|
|
41
|
+
importacao_id: string_helper_1.StringHelper.trim(feriado.importacao_id, null),
|
|
42
|
+
municipio: string_helper_1.StringHelper.trim(feriado.municipio, null),
|
|
43
|
+
tipo: string_helper_1.StringHelper.trim(feriado.tipo, null),
|
|
44
|
+
todas_empresas: boolean_helper_1.BooleanHelper.check(feriado.todas_empresas, true),
|
|
45
|
+
uf: string_helper_1.StringHelper.trim(feriado.uf, null),
|
|
46
|
+
}, lodash_1.isUndefined);
|
|
47
|
+
};
|
|
48
|
+
return FeriadoFireConvert;
|
|
49
|
+
}());
|
|
50
|
+
exports.FeriadoFireConvert = FeriadoFireConvert;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Feriado, FeriadoBase, FeriadoTipoEnum } from '.';
|
|
2
|
+
export declare class FeriadoJsonData implements FeriadoBase {
|
|
3
|
+
uid: string;
|
|
4
|
+
path: string;
|
|
5
|
+
data: string;
|
|
6
|
+
descricao: string;
|
|
7
|
+
excluido: boolean;
|
|
8
|
+
importacao_id: string;
|
|
9
|
+
municipio: string;
|
|
10
|
+
tipo: FeriadoTipoEnum;
|
|
11
|
+
todas_empresas: boolean;
|
|
12
|
+
uf: string;
|
|
13
|
+
}
|
|
14
|
+
export declare abstract class FeriadoJsonConvert {
|
|
15
|
+
static fromJson(obj: FeriadoJsonData): Feriado;
|
|
16
|
+
static toJson(feriado: Feriado): Partial<FeriadoJsonData>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeriadoJsonConvert = exports.FeriadoJsonData = 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 FeriadoJsonData = /** @class */ (function () {
|
|
10
|
+
function FeriadoJsonData() {
|
|
11
|
+
}
|
|
12
|
+
return FeriadoJsonData;
|
|
13
|
+
}());
|
|
14
|
+
exports.FeriadoJsonData = FeriadoJsonData;
|
|
15
|
+
var FeriadoJsonConvert = /** @class */ (function () {
|
|
16
|
+
function FeriadoJsonConvert() {
|
|
17
|
+
}
|
|
18
|
+
FeriadoJsonConvert.fromJson = function (obj) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
return new _1.Feriado({
|
|
21
|
+
uid: (_a = obj.uid) !== null && _a !== void 0 ? _a : null,
|
|
22
|
+
path: (_b = obj.path) !== null && _b !== void 0 ? _b : null,
|
|
23
|
+
data: date_helper_1.DateHelper.fromString(obj.data, null),
|
|
24
|
+
descricao: string_helper_1.StringHelper.trim(obj.descricao, null),
|
|
25
|
+
excluido: boolean_helper_1.BooleanHelper.check(obj.excluido, false),
|
|
26
|
+
importacao_id: string_helper_1.StringHelper.trim(obj.importacao_id, null),
|
|
27
|
+
municipio: string_helper_1.StringHelper.trim(obj.municipio, null),
|
|
28
|
+
tipo: string_helper_1.StringHelper.trim(obj.tipo, null),
|
|
29
|
+
todas_empresas: boolean_helper_1.BooleanHelper.check(obj.todas_empresas, true),
|
|
30
|
+
uf: string_helper_1.StringHelper.trim(obj.uf, null),
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
FeriadoJsonConvert.toJson = function (feriado) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
return (0, lodash_1.omitBy)({
|
|
36
|
+
uid: (_a = feriado.uid) !== null && _a !== void 0 ? _a : null,
|
|
37
|
+
path: (_b = feriado.path) !== null && _b !== void 0 ? _b : null,
|
|
38
|
+
data: feriado.data.toISOString(),
|
|
39
|
+
descricao: string_helper_1.StringHelper.trim(feriado.descricao, null),
|
|
40
|
+
excluido: boolean_helper_1.BooleanHelper.check(feriado.excluido, false),
|
|
41
|
+
importacao_id: string_helper_1.StringHelper.trim(feriado.importacao_id, null),
|
|
42
|
+
municipio: string_helper_1.StringHelper.trim(feriado.municipio, null),
|
|
43
|
+
tipo: string_helper_1.StringHelper.trim(feriado.tipo, null),
|
|
44
|
+
todas_empresas: boolean_helper_1.BooleanHelper.check(feriado.todas_empresas, true),
|
|
45
|
+
uf: string_helper_1.StringHelper.trim(feriado.uf, null),
|
|
46
|
+
}, lodash_1.isUndefined);
|
|
47
|
+
};
|
|
48
|
+
return FeriadoJsonConvert;
|
|
49
|
+
}());
|
|
50
|
+
exports.FeriadoJsonConvert = FeriadoJsonConvert;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare enum FeriadoTipoEnum {
|
|
2
|
+
Nacional = "Nacional",
|
|
3
|
+
Estadual = "Estadual",
|
|
4
|
+
Municipal = "Municipal"
|
|
5
|
+
}
|
|
6
|
+
export interface FeriadoBase {
|
|
7
|
+
data: any;
|
|
8
|
+
descricao: any;
|
|
9
|
+
excluido: any;
|
|
10
|
+
importacao_id: any;
|
|
11
|
+
municipio: any;
|
|
12
|
+
tipo: any;
|
|
13
|
+
todas_empresas: any;
|
|
14
|
+
uf: any;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Internal class col contas/${contaId}/feriados/${feriadoId}.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @class Feriado
|
|
21
|
+
*/
|
|
22
|
+
export declare class Feriado implements FeriadoBase {
|
|
23
|
+
uid: string;
|
|
24
|
+
path: string;
|
|
25
|
+
data: Date;
|
|
26
|
+
descricao: string;
|
|
27
|
+
excluido: boolean;
|
|
28
|
+
importacao_id: string;
|
|
29
|
+
municipio: string;
|
|
30
|
+
tipo: FeriadoTipoEnum;
|
|
31
|
+
todas_empresas: boolean;
|
|
32
|
+
uf: string;
|
|
33
|
+
/**
|
|
34
|
+
* Creates an instance of Feriado.
|
|
35
|
+
* @param {Partial<Feriado>} feriadoPayload
|
|
36
|
+
* @memberof Feriado
|
|
37
|
+
*/
|
|
38
|
+
constructor(feriadoPayload: Partial<Feriado>);
|
|
39
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Feriado = exports.FeriadoTipoEnum = void 0;
|
|
4
|
+
var FeriadoTipoEnum;
|
|
5
|
+
(function (FeriadoTipoEnum) {
|
|
6
|
+
FeriadoTipoEnum["Nacional"] = "Nacional";
|
|
7
|
+
FeriadoTipoEnum["Estadual"] = "Estadual";
|
|
8
|
+
FeriadoTipoEnum["Municipal"] = "Municipal";
|
|
9
|
+
})(FeriadoTipoEnum = exports.FeriadoTipoEnum || (exports.FeriadoTipoEnum = {}));
|
|
10
|
+
/**
|
|
11
|
+
* Internal class col contas/${contaId}/feriados/${feriadoId}.
|
|
12
|
+
*
|
|
13
|
+
* @export
|
|
14
|
+
* @class Feriado
|
|
15
|
+
*/
|
|
16
|
+
var Feriado = /** @class */ (function () {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of Feriado.
|
|
19
|
+
* @param {Partial<Feriado>} feriadoPayload
|
|
20
|
+
* @memberof Feriado
|
|
21
|
+
*/
|
|
22
|
+
function Feriado(feriadoPayload) {
|
|
23
|
+
var _this = this;
|
|
24
|
+
var keysOfProps = ["uid", "path", "tipo", "data", "descricao", "excluido", "importacao_id", "municipio", "todas_empresas", "uf"];
|
|
25
|
+
keysOfProps.forEach(function (key) {
|
|
26
|
+
_this[key] = feriadoPayload ? feriadoPayload[key] : undefined;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return Feriado;
|
|
30
|
+
}());
|
|
31
|
+
exports.Feriado = Feriado;
|
|
@@ -17,7 +17,7 @@ export interface FeriadoFirestoreData {
|
|
|
17
17
|
importacao_id: string;
|
|
18
18
|
municipio: string;
|
|
19
19
|
tipo: FeriadoTipoEnum;
|
|
20
|
-
|
|
20
|
+
todas_empresas: boolean;
|
|
21
21
|
uf: string;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -35,7 +35,7 @@ export declare class Feriado implements FeriadoFirestoreData {
|
|
|
35
35
|
importacao_id: string;
|
|
36
36
|
municipio: string;
|
|
37
37
|
tipo: FeriadoTipoEnum;
|
|
38
|
-
|
|
38
|
+
todas_empresas: boolean;
|
|
39
39
|
uf: string;
|
|
40
40
|
/**
|
|
41
41
|
* Creates an instance of Feriado.
|
|
@@ -33,7 +33,7 @@ var Feriado = /** @class */ (function () {
|
|
|
33
33
|
*/
|
|
34
34
|
function Feriado(feriadoPayload) {
|
|
35
35
|
var _this = this;
|
|
36
|
-
var keysOfProps = ["uid", "path", "tipo", "data", "descricao", "excluido", "importacao_id", "municipio", "
|
|
36
|
+
var keysOfProps = ["uid", "path", "tipo", "data", "descricao", "excluido", "importacao_id", "municipio", "todas_empresas", "uf"];
|
|
37
37
|
keysOfProps.forEach(function (key) {
|
|
38
38
|
_this[key] = feriadoPayload ? feriadoPayload[key] : undefined;
|
|
39
39
|
});
|
package/lib/models/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export * from './contas/excecoes';
|
|
2
2
|
export * from './contas/feriado';
|
|
3
|
+
export * from './contas/feriado/empresas-feriado';
|
|
4
|
+
export * from './contas/feriado/feriado-fire-convert';
|
|
5
|
+
export * from './contas/feriado/empresas-feriado-fire-convert';
|
|
6
|
+
export * from './contas/feriado/feriado-json-convert';
|
package/lib/models/index.js
CHANGED
|
@@ -12,3 +12,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./contas/excecoes"), exports);
|
|
14
14
|
__exportStar(require("./contas/feriado"), exports);
|
|
15
|
+
__exportStar(require("./contas/feriado/empresas-feriado"), exports);
|
|
16
|
+
__exportStar(require("./contas/feriado/feriado-fire-convert"), exports);
|
|
17
|
+
__exportStar(require("./contas/feriado/empresas-feriado-fire-convert"), exports);
|
|
18
|
+
__exportStar(require("./contas/feriado/feriado-json-convert"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BooleanHelper = void 0;
|
|
4
|
+
var BooleanHelper = /** @class */ (function () {
|
|
5
|
+
function BooleanHelper() {
|
|
6
|
+
}
|
|
7
|
+
BooleanHelper.check = function (bool, def) {
|
|
8
|
+
if (typeof bool === 'boolean') {
|
|
9
|
+
return bool;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return def;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return BooleanHelper;
|
|
16
|
+
}());
|
|
17
|
+
exports.BooleanHelper = BooleanHelper;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateHelper = void 0;
|
|
4
|
+
var DateHelper = /** @class */ (function () {
|
|
5
|
+
function DateHelper() {
|
|
6
|
+
}
|
|
7
|
+
DateHelper.isValidDate = function (d) {
|
|
8
|
+
return d instanceof Date && !isNaN(d.getTime());
|
|
9
|
+
};
|
|
10
|
+
DateHelper.fromString = function (str, def) {
|
|
11
|
+
var date = new Date(str);
|
|
12
|
+
if (DateHelper.isValidDate(date)) {
|
|
13
|
+
return date;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return def;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return DateHelper;
|
|
20
|
+
}());
|
|
21
|
+
exports.DateHelper = DateHelper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringHelper = void 0;
|
|
4
|
+
var StringHelper = /** @class */ (function () {
|
|
5
|
+
function StringHelper() {
|
|
6
|
+
}
|
|
7
|
+
StringHelper.trim = function (str, def) {
|
|
8
|
+
if (typeof str === 'string') {
|
|
9
|
+
return str.trim();
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return def;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return StringHelper;
|
|
16
|
+
}());
|
|
17
|
+
exports.StringHelper = StringHelper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DocumentReference, Timestamp } from 'firebase/firestore';
|
|
2
|
+
/**
|
|
3
|
+
* Typeguard para o tipo Timestamp do firestore.
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @param {(Timestamp | string | Date)} timestamp
|
|
7
|
+
* @return {*} {timestamp is Timestamp}
|
|
8
|
+
*/
|
|
9
|
+
export declare function TipoTimestampFirestore(timestamp: Timestamp | string | Date): timestamp is Timestamp;
|
|
10
|
+
/**
|
|
11
|
+
* Typeguard para o tipo DocumentReference do firestore.
|
|
12
|
+
*
|
|
13
|
+
* @export
|
|
14
|
+
* @param {(DocumentReference | string | Date)} timestamp
|
|
15
|
+
* @return {*} {timestamp is DocumentReference}
|
|
16
|
+
*/
|
|
17
|
+
export declare function TipoDocumentReference(timestamp: DocumentReference | string | Date): timestamp is DocumentReference;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TipoDocumentReference = exports.TipoTimestampFirestore = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Typeguard para o tipo Timestamp do firestore.
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @param {(Timestamp | string | Date)} timestamp
|
|
9
|
+
* @return {*} {timestamp is Timestamp}
|
|
10
|
+
*/
|
|
11
|
+
function TipoTimestampFirestore(timestamp) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
return (((_a = timestamp) === null || _a === void 0 ? void 0 : _a.seconds) !== undefined &&
|
|
14
|
+
((_b = timestamp) === null || _b === void 0 ? void 0 : _b.nanoseconds) !== undefined);
|
|
15
|
+
}
|
|
16
|
+
exports.TipoTimestampFirestore = TipoTimestampFirestore;
|
|
17
|
+
/**
|
|
18
|
+
* Typeguard para o tipo DocumentReference do firestore.
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {(DocumentReference | string | Date)} timestamp
|
|
22
|
+
* @return {*} {timestamp is DocumentReference}
|
|
23
|
+
*/
|
|
24
|
+
function TipoDocumentReference(timestamp) {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return (((_a = timestamp) === null || _a === void 0 ? void 0 : _a.id) !== undefined &&
|
|
27
|
+
((_b = timestamp) === null || _b === void 0 ? void 0 : _b.path) !== undefined);
|
|
28
|
+
}
|
|
29
|
+
exports.TipoDocumentReference = TipoDocumentReference;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flit-models",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.2",
|
|
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.5",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"ts-transformer-keys": "^0.4.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/jest": "^27.0
|
|
32
|
-
"@types/lodash": "^4.14.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
34
|
-
"@typescript-eslint/parser": "^5.
|
|
35
|
-
"eslint": "^8.
|
|
31
|
+
"@types/jest": "^27.4.0",
|
|
32
|
+
"@types/lodash": "^4.14.178",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
34
|
+
"@typescript-eslint/parser": "^5.10.1",
|
|
35
|
+
"eslint": "^8.8.0",
|
|
36
36
|
"eslint-config-google": "^0.14.0",
|
|
37
37
|
"eslint-config-prettier": "^8.3.0",
|
|
38
|
-
"eslint-plugin-import": "^2.25.
|
|
39
|
-
"eslint-plugin-jest": "^
|
|
38
|
+
"eslint-plugin-import": "^2.25.4",
|
|
39
|
+
"eslint-plugin-jest": "^26.0.0",
|
|
40
40
|
"eslint-plugin-prettier": "^4.0.0",
|
|
41
|
-
"jest": "^27.4.
|
|
41
|
+
"jest": "^27.4.7",
|
|
42
42
|
"prettier": "^2.5.1",
|
|
43
|
-
"ts-jest": "^27.1.
|
|
43
|
+
"ts-jest": "^27.1.3",
|
|
44
44
|
"ttypescript": "^1.5.13",
|
|
45
|
-
"typescript": "^4.5.
|
|
45
|
+
"typescript": "^4.5.5"
|
|
46
46
|
}
|
|
47
47
|
}
|