flit-models 2.1.0 → 2.1.4
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 +3 -1
- package/lib/models/contas/feriado/empresas-feriado-fire-convert.d.ts +2 -2
- package/lib/models/contas/feriado/empresas-feriado-fire-convert.js +3 -3
- package/lib/models/contas/feriado/feriado-fire-convert.d.ts +2 -2
- package/lib/models/contas/feriado/feriado-fire-convert.js +10 -10
- 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/index.d.ts +1 -0
- package/lib/models/index.js +1 -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 +1 -1
- package/lib/models/utils/string-helper.js +2 -2
- package/package.json +3 -3
- package/lib/models/contas/feriado.d.ts +0 -93
- package/lib/models/contas/feriado.js +0 -98
- package/lib/models/utils/typeGuards.d.ts +0 -9
- package/lib/models/utils/typeGuards.js +0 -16
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { EnumExcecaoStatus, EnumExcecaoTipo, Excecao, IExcecao, Feriado, EmpresaFeriado, EmpresaFeriadoFirestoreData as FeriadoEmpresaFirestoreData, FeriadoFirestoreData, FeriadoTipoEnum, EmpresasFeriadoFireConvert, FeriadoFireConvert, } from './models/index';
|
|
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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FeriadoFireConvert = exports.EmpresasFeriadoFireConvert = exports.FeriadoTipoEnum = exports.FeriadoFirestoreData = exports.FeriadoEmpresaFirestoreData = exports.EmpresaFeriado = exports.Feriado = exports.Excecao = exports.EnumExcecaoTipo = exports.EnumExcecaoStatus = void 0;
|
|
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; } });
|
|
@@ -12,3 +12,5 @@ Object.defineProperty(exports, "FeriadoFirestoreData", { enumerable: true, get:
|
|
|
12
12
|
Object.defineProperty(exports, "FeriadoTipoEnum", { enumerable: true, get: function () { return index_1.FeriadoTipoEnum; } });
|
|
13
13
|
Object.defineProperty(exports, "EmpresasFeriadoFireConvert", { enumerable: true, get: function () { return index_1.EmpresasFeriadoFireConvert; } });
|
|
14
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; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentReference, DocumentSnapshot } from 'firebase/firestore';
|
|
1
|
+
import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot } from 'firebase/firestore';
|
|
2
2
|
import { EmpresaFeriado, EmpresaFeriadoBase } from './empresas-feriado';
|
|
3
3
|
export declare class EmpresaFeriadoFirestoreData implements EmpresaFeriadoBase {
|
|
4
4
|
ref: DocumentReference;
|
|
@@ -7,6 +7,6 @@ export declare class EmpresaFeriadoFirestoreData implements EmpresaFeriadoBase {
|
|
|
7
7
|
razao_social: string;
|
|
8
8
|
}
|
|
9
9
|
export declare abstract class EmpresasFeriadoFireConvert {
|
|
10
|
-
static fromFirestore(doc: DocumentSnapshot<EmpresaFeriadoFirestoreData>): EmpresaFeriado;
|
|
10
|
+
static fromFirestore(doc: DocumentSnapshot<EmpresaFeriadoFirestoreData> | QueryDocumentSnapshot<EmpresaFeriadoFirestoreData>): EmpresaFeriado;
|
|
11
11
|
static toFirestore(empresaFeriado: EmpresaFeriado, docRefConstructor: (path: string) => DocumentReference<any>): Partial<EmpresaFeriadoFirestoreData>;
|
|
12
12
|
}
|
|
@@ -19,9 +19,9 @@ var EmpresasFeriadoFireConvert = /** @class */ (function () {
|
|
|
19
19
|
return new empresas_feriado_1.EmpresaFeriado({
|
|
20
20
|
uid: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
|
|
21
21
|
path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
|
|
22
|
-
documento: string_helper_1.StringHelper.trim(doc.get('documento')),
|
|
23
|
-
nome_fantasia: string_helper_1.StringHelper.trim(doc.get('nome_fantasia')),
|
|
24
|
-
razao_social: string_helper_1.StringHelper.trim(doc.get('razao_social')),
|
|
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
25
|
ref: (0, type_guards_1.TipoDocumentReference)(doc.get('ref'))
|
|
26
26
|
? doc.get('ref').path
|
|
27
27
|
: null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
1
|
+
import { DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
|
|
2
2
|
import { Feriado, FeriadoBase, FeriadoTipoEnum } from '.';
|
|
3
3
|
export declare class FeriadoFirestoreData implements FeriadoBase {
|
|
4
4
|
data: Timestamp;
|
|
@@ -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: DocumentSnapshot<FeriadoFirestoreData>): Feriado;
|
|
14
|
+
static fromFirestore(doc: DocumentSnapshot<FeriadoFirestoreData> | QueryDocumentSnapshot<FeriadoFirestoreData>): Feriado;
|
|
15
15
|
static toFirestore(feriado: Feriado): Partial<FeriadoFirestoreData>;
|
|
16
16
|
}
|
|
@@ -24,25 +24,25 @@ var FeriadoFireConvert = /** @class */ (function () {
|
|
|
24
24
|
data: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data'))
|
|
25
25
|
? doc.get('data').toDate()
|
|
26
26
|
: null,
|
|
27
|
-
descricao: string_helper_1.StringHelper.trim(doc.get('descricao')),
|
|
27
|
+
descricao: string_helper_1.StringHelper.trim(doc.get('descricao'), null),
|
|
28
28
|
excluido: boolean_helper_1.BooleanHelper.check(doc.get('excluido'), false),
|
|
29
|
-
importacao_id: string_helper_1.StringHelper.trim(doc.get('importacao_id')),
|
|
30
|
-
municipio: string_helper_1.StringHelper.trim(doc.get('municipio')),
|
|
31
|
-
tipo: string_helper_1.StringHelper.trim(doc.get('tipo')),
|
|
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
32
|
todas_empresas: boolean_helper_1.BooleanHelper.check(doc.get('todas_empresas'), true),
|
|
33
|
-
uf: string_helper_1.StringHelper.trim(doc.get('uf')),
|
|
33
|
+
uf: string_helper_1.StringHelper.trim(doc.get('uf'), null),
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
FeriadoFireConvert.toFirestore = function (feriado) {
|
|
37
37
|
return (0, lodash_1.omitBy)({
|
|
38
38
|
data: firestore_1.Timestamp.fromDate(feriado.data),
|
|
39
|
-
descricao: string_helper_1.StringHelper.trim(feriado.descricao),
|
|
39
|
+
descricao: string_helper_1.StringHelper.trim(feriado.descricao, null),
|
|
40
40
|
excluido: boolean_helper_1.BooleanHelper.check(feriado.excluido, false),
|
|
41
|
-
importacao_id: string_helper_1.StringHelper.trim(feriado.importacao_id),
|
|
42
|
-
municipio: string_helper_1.StringHelper.trim(feriado.municipio),
|
|
43
|
-
tipo: string_helper_1.StringHelper.trim(feriado.tipo),
|
|
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
44
|
todas_empresas: boolean_helper_1.BooleanHelper.check(feriado.todas_empresas, true),
|
|
45
|
-
uf: string_helper_1.StringHelper.trim(feriado.uf),
|
|
45
|
+
uf: string_helper_1.StringHelper.trim(feriado.uf, null),
|
|
46
46
|
}, lodash_1.isUndefined);
|
|
47
47
|
};
|
|
48
48
|
return 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;
|
package/lib/models/index.d.ts
CHANGED
package/lib/models/index.js
CHANGED
|
@@ -15,3 +15,4 @@ __exportStar(require("./contas/feriado"), exports);
|
|
|
15
15
|
__exportStar(require("./contas/feriado/empresas-feriado"), exports);
|
|
16
16
|
__exportStar(require("./contas/feriado/feriado-fire-convert"), exports);
|
|
17
17
|
__exportStar(require("./contas/feriado/empresas-feriado-fire-convert"), exports);
|
|
18
|
+
__exportStar(require("./contas/feriado/feriado-json-convert"), exports);
|
|
@@ -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;
|
|
@@ -4,12 +4,12 @@ exports.StringHelper = void 0;
|
|
|
4
4
|
var StringHelper = /** @class */ (function () {
|
|
5
5
|
function StringHelper() {
|
|
6
6
|
}
|
|
7
|
-
StringHelper.trim = function (str) {
|
|
7
|
+
StringHelper.trim = function (str, def) {
|
|
8
8
|
if (typeof str === 'string') {
|
|
9
9
|
return str.trim();
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
return
|
|
12
|
+
return def;
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
return StringHelper;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flit-models",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/jest": "^27.4.0",
|
|
32
32
|
"@types/lodash": "^4.14.178",
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^5.10.
|
|
34
|
-
"@typescript-eslint/parser": "^5.10.
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.10.2",
|
|
34
|
+
"@typescript-eslint/parser": "^5.10.2",
|
|
35
35
|
"eslint": "^8.8.0",
|
|
36
36
|
"eslint-config-google": "^0.14.0",
|
|
37
37
|
"eslint-config-prettier": "^8.3.0",
|
|
@@ -1,93 +0,0 @@
|
|
|
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
|
-
todas_empresas: boolean;
|
|
21
|
-
uf: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Internal class col contas/${contaId}/feriados/${feriadoId}.
|
|
25
|
-
*
|
|
26
|
-
* @export
|
|
27
|
-
* @class Feriado
|
|
28
|
-
*/
|
|
29
|
-
export declare class Feriado implements FeriadoFirestoreData {
|
|
30
|
-
uid: string;
|
|
31
|
-
path: string;
|
|
32
|
-
data: Timestamp;
|
|
33
|
-
descricao: string;
|
|
34
|
-
excluido: boolean;
|
|
35
|
-
importacao_id: string;
|
|
36
|
-
municipio: string;
|
|
37
|
-
tipo: FeriadoTipoEnum;
|
|
38
|
-
todas_empresas: boolean;
|
|
39
|
-
uf: string;
|
|
40
|
-
/**
|
|
41
|
-
* Creates an instance of Feriado.
|
|
42
|
-
* @param {Partial<Feriado>} feriadoPayload
|
|
43
|
-
* @memberof Feriado
|
|
44
|
-
*/
|
|
45
|
-
constructor(feriadoPayload: Partial<Feriado>);
|
|
46
|
-
/**
|
|
47
|
-
* Convert class in firestore date.
|
|
48
|
-
*
|
|
49
|
-
* @return {*}
|
|
50
|
-
* @memberof Feriado
|
|
51
|
-
*/
|
|
52
|
-
toFirestoreData(): FeriadoFirestoreData;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Interface col contas/${contaId}/feriados/${feriadoId}/empresas_feriado/${empresaId}.
|
|
56
|
-
*
|
|
57
|
-
* @export
|
|
58
|
-
* @interface FeriadoEmpresaFirestoreData
|
|
59
|
-
*/
|
|
60
|
-
export interface FeriadoEmpresaFirestoreData {
|
|
61
|
-
ref: DocumentReference;
|
|
62
|
-
documento: string;
|
|
63
|
-
nome_fantasia: string;
|
|
64
|
-
razao_social: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Internal class col contas/${contaId}/feriados/${feriadoId}/empresas_feriado/${empresaId}.
|
|
68
|
-
*
|
|
69
|
-
* @export
|
|
70
|
-
* @class FeriadoEmpresa
|
|
71
|
-
* @implements {FeriadoFirestoreData}
|
|
72
|
-
*/
|
|
73
|
-
export declare class FeriadoEmpresa implements FeriadoEmpresaFirestoreData {
|
|
74
|
-
uid: string;
|
|
75
|
-
path: string;
|
|
76
|
-
ref: DocumentReference<DocumentData>;
|
|
77
|
-
documento: string;
|
|
78
|
-
nome_fantasia: string;
|
|
79
|
-
razao_social: string;
|
|
80
|
-
/**
|
|
81
|
-
* Creates an instance of FeriadoEmpresa.
|
|
82
|
-
* @param {Partial<FeriadoEmpresa>} feriadoEmpresaPayload
|
|
83
|
-
* @memberof Feriado
|
|
84
|
-
*/
|
|
85
|
-
constructor(feriadoEmpresaPayload: Partial<FeriadoEmpresa>);
|
|
86
|
-
/**
|
|
87
|
-
* Convert class in firestore date.
|
|
88
|
-
*
|
|
89
|
-
* @return {*}
|
|
90
|
-
* @memberof FeriadoEmpresa
|
|
91
|
-
*/
|
|
92
|
-
toFirestoreData(): FeriadoEmpresa;
|
|
93
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
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", "todas_empresas", "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;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { 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;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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;
|