flit-models 2.1.30 → 2.1.33

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 CHANGED
@@ -1 +1 @@
1
- export { EmpresaFeriado, EmpresaFeriadoBase, EmpresaFeriadoFireConvert, EmpresaFeriadoFirestoreData, EnumExcecaoStatus, EnumExcecaoTipo, Excecao, Feriado, FeriadoBase, FeriadoFireConvert, FeriadoFirestoreData, FeriadoJsonConvert, FeriadoJsonData, FeriadoTipoEnum, IExcecao, Lancamento, LancamentoBase, LancamentoFireConvert, LancamentoFirestoreData, LancamentoJsonConvert, LancamentoJsonData, LancamentoStatusEnum, VerificacaoLancamentoFireConvert, VerificacaoLancamentoFirestoreData, TipoAcaoLancamentoEnum, TipoOcorrenciaFrequenciaEnum, TipoReferenciaVerificacaoLancamento, UsuarioLancamento, UsuarioLancamentoBase, UsuarioLancamentoFireConvert, UsuarioLancamentoFirestoreData, VerificacaoLancamento, VerificacaoLancamentoBase, } from './models/index';
1
+ export { EmpresaFeriado, EmpresaFeriadoBase, EmpresaFeriadoFireConvert, EmpresaFeriadoFirestoreData, EnumExcecaoStatus, EnumExcecaoTipo, Excecao, Feriado, FeriadoBase, FeriadoFireConvert, FeriadoFirestoreData, FeriadoJsonConvert, FeriadoJsonData, FeriadoTipoEnum, IExcecao, Lancamento, LancamentoBase, LancamentoFireConvert, LancamentoFirestoreData, LancamentoJsonConvert, LancamentoJsonData, LancamentoStatusEnum, VerificacaoLancamentoFireConvert, VerificacaoLancamentoFirestoreData, TipoAcaoLancamentoEnum, TipoOcorrenciaFrequenciaEnum, TipoReferenciaVerificacaoLancamento, VerificacaoLancamento, VerificacaoLancamentoBase, OcorrenciaFrequenciaCopiaEmDocumento, } 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.VerificacaoLancamento = exports.UsuarioLancamentoFirestoreData = exports.UsuarioLancamentoFireConvert = exports.UsuarioLancamento = exports.TipoReferenciaVerificacaoLancamento = exports.TipoOcorrenciaFrequenciaEnum = exports.TipoAcaoLancamentoEnum = exports.VerificacaoLancamentoFirestoreData = exports.VerificacaoLancamentoFireConvert = exports.LancamentoStatusEnum = exports.LancamentoJsonData = exports.LancamentoJsonConvert = exports.LancamentoFirestoreData = exports.LancamentoFireConvert = exports.Lancamento = exports.FeriadoTipoEnum = exports.FeriadoJsonData = exports.FeriadoJsonConvert = exports.FeriadoFirestoreData = exports.FeriadoFireConvert = exports.Feriado = exports.Excecao = exports.EnumExcecaoTipo = exports.EnumExcecaoStatus = exports.EmpresaFeriadoFirestoreData = exports.EmpresaFeriadoFireConvert = exports.EmpresaFeriado = void 0;
3
+ exports.VerificacaoLancamento = exports.TipoReferenciaVerificacaoLancamento = exports.TipoOcorrenciaFrequenciaEnum = exports.TipoAcaoLancamentoEnum = exports.VerificacaoLancamentoFirestoreData = exports.VerificacaoLancamentoFireConvert = exports.LancamentoStatusEnum = exports.LancamentoJsonData = exports.LancamentoJsonConvert = exports.LancamentoFirestoreData = exports.LancamentoFireConvert = exports.Lancamento = exports.FeriadoTipoEnum = exports.FeriadoJsonData = exports.FeriadoJsonConvert = exports.FeriadoFirestoreData = exports.FeriadoFireConvert = exports.Feriado = exports.Excecao = exports.EnumExcecaoTipo = exports.EnumExcecaoStatus = exports.EmpresaFeriadoFirestoreData = exports.EmpresaFeriadoFireConvert = exports.EmpresaFeriado = void 0;
4
4
  var index_1 = require("./models/index");
5
5
  Object.defineProperty(exports, "EmpresaFeriado", { enumerable: true, get: function () { return index_1.EmpresaFeriado; } });
6
6
  Object.defineProperty(exports, "EmpresaFeriadoFireConvert", { enumerable: true, get: function () { return index_1.EmpresaFeriadoFireConvert; } });
@@ -25,7 +25,4 @@ Object.defineProperty(exports, "VerificacaoLancamentoFirestoreData", { enumerabl
25
25
  Object.defineProperty(exports, "TipoAcaoLancamentoEnum", { enumerable: true, get: function () { return index_1.TipoAcaoLancamentoEnum; } });
26
26
  Object.defineProperty(exports, "TipoOcorrenciaFrequenciaEnum", { enumerable: true, get: function () { return index_1.TipoOcorrenciaFrequenciaEnum; } });
27
27
  Object.defineProperty(exports, "TipoReferenciaVerificacaoLancamento", { enumerable: true, get: function () { return index_1.TipoReferenciaVerificacaoLancamento; } });
28
- Object.defineProperty(exports, "UsuarioLancamento", { enumerable: true, get: function () { return index_1.UsuarioLancamento; } });
29
- Object.defineProperty(exports, "UsuarioLancamentoFireConvert", { enumerable: true, get: function () { return index_1.UsuarioLancamentoFireConvert; } });
30
- Object.defineProperty(exports, "UsuarioLancamentoFirestoreData", { enumerable: true, get: function () { return index_1.UsuarioLancamentoFirestoreData; } });
31
28
  Object.defineProperty(exports, "VerificacaoLancamento", { enumerable: true, get: function () { return index_1.VerificacaoLancamento; } });
@@ -3,8 +3,6 @@ export * from './lancamento-fire-convert';
3
3
  export * from './lancamento-json-convert';
4
4
  export * from './verificacoes/verificacao-lancamento-fire-convert';
5
5
  export * from './verificacoes/verificacao-lancamento';
6
- export * from './usuarios/usuario-lancamento-fire-convert';
7
- export * from './usuarios/usuario-lancamento';
8
6
  export declare enum LancamentoStatusEnum {
9
7
  COMPLETO = "COMPLETO",
10
8
  PROCESSANDO = "PROCESSANDO",
@@ -34,8 +32,7 @@ export interface LancamentoBase {
34
32
  excluido: any;
35
33
  acao_tipo: any;
36
34
  ocorrencia: {
37
- ref?: any;
38
- path?: any;
35
+ uid: any;
39
36
  tipo: any;
40
37
  descricao: any;
41
38
  };
@@ -48,6 +45,7 @@ export interface LancamentoBase {
48
45
  };
49
46
  status: any;
50
47
  todos_colaboradores: any;
48
+ colaboradores_ids: any[];
51
49
  periodos: [
52
50
  {
53
51
  inicial: {
@@ -86,12 +84,13 @@ export declare class Lancamento implements LancamentoBase {
86
84
  };
87
85
  excluido: boolean;
88
86
  ocorrencia: {
89
- path: string;
87
+ uid: string;
90
88
  tipo: TipoOcorrenciaFrequenciaEnum;
91
89
  descricao: string;
92
90
  };
93
91
  status: LancamentoStatusEnum;
94
92
  todos_colaboradores: boolean;
93
+ colaboradores_ids: string[];
95
94
  periodos: [
96
95
  {
97
96
  inicial: {
@@ -19,8 +19,6 @@ __exportStar(require("./lancamento-fire-convert"), exports);
19
19
  __exportStar(require("./lancamento-json-convert"), exports);
20
20
  __exportStar(require("./verificacoes/verificacao-lancamento-fire-convert"), exports);
21
21
  __exportStar(require("./verificacoes/verificacao-lancamento"), exports);
22
- __exportStar(require("./usuarios/usuario-lancamento-fire-convert"), exports);
23
- __exportStar(require("./usuarios/usuario-lancamento"), exports);
24
22
  var LancamentoStatusEnum;
25
23
  (function (LancamentoStatusEnum) {
26
24
  LancamentoStatusEnum["COMPLETO"] = "COMPLETO";
@@ -57,7 +55,7 @@ var Lancamento = /** @class */ (function () {
57
55
  */
58
56
  function Lancamento(lancamentoPayload) {
59
57
  var _this = this;
60
- var keysOfProps = ["data_criacao", "status", "_id", "_path", "descricao", "excluido", "data_inicial", "data_final", "acao_tipo", "ocorrencia", "todos_colaboradores", "periodos", "data_atualizacao", "data_intervalo", "empresa"];
58
+ var keysOfProps = ["data_criacao", "status", "_id", "_path", "descricao", "excluido", "data_atualizacao", "data_intervalo", "periodos", "data_inicial", "data_final", "acao_tipo", "ocorrencia", "empresa", "todos_colaboradores", "colaboradores_ids"];
61
59
  keysOfProps.forEach(function (key) {
62
60
  _this[key] = lancamentoPayload
63
61
  ? lancamentoPayload[key]
@@ -24,7 +24,7 @@ export declare class LancamentoFirestoreData implements LancamentoBase {
24
24
  excluido: boolean;
25
25
  acao_tipo: TipoAcaoLancamentoEnum;
26
26
  ocorrencia: {
27
- ref: DocumentReference;
27
+ uid: string;
28
28
  tipo: TipoOcorrenciaFrequenciaEnum;
29
29
  descricao: string;
30
30
  };
@@ -36,6 +36,7 @@ export declare class LancamentoFirestoreData implements LancamentoBase {
36
36
  };
37
37
  status: LancamentoStatusEnum;
38
38
  todos_colaboradores: boolean;
39
+ colaboradores_ids: string[];
39
40
  }
40
41
  export declare abstract class LancamentoFireConvert {
41
42
  static fromFirestore(doc: DocumentSnapshot<LancamentoFirestoreData> | QueryDocumentSnapshot<LancamentoFirestoreData>): Lancamento;
@@ -18,42 +18,44 @@ var LancamentoFireConvert = /** @class */ (function () {
18
18
  function LancamentoFireConvert() {
19
19
  }
20
20
  LancamentoFireConvert.fromFirestore = function (doc) {
21
- var _a, _b, _c, _d;
21
+ var _a, _b, _c, _d, _e, _f, _g, _h;
22
+ var docData = ((_a = doc.data()) !== null && _a !== void 0 ? _a : {});
22
23
  return new _1.Lancamento({
23
- _id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
24
- _path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
25
- data_inicial: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_inicial'))
26
- ? doc.get('data_inicial').toDate()
24
+ _id: (_b = doc.id) !== null && _b !== void 0 ? _b : null,
25
+ _path: (_c = doc.ref.path) !== null && _c !== void 0 ? _c : null,
26
+ data_inicial: (0, type_guards_1.TipoTimestampFirestore)(docData.data_inicial)
27
+ ? docData.data_inicial.toDate()
27
28
  : null,
28
- data_final: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_final'))
29
- ? doc.get('data_final').toDate()
29
+ data_final: (0, type_guards_1.TipoTimestampFirestore)(docData.data_final)
30
+ ? docData.data_final.toDate()
30
31
  : null,
31
- descricao: string_helper_1.StringHelper.trim(doc.get('descricao'), null),
32
- excluido: boolean_helper_1.BooleanHelper.check(doc.get('excluido'), false),
33
- acao_tipo: string_helper_1.StringHelper.trim(doc.get('acao_tipo'), null),
34
- status: string_helper_1.StringHelper.trim(doc.get('status'), null),
32
+ descricao: string_helper_1.StringHelper.trim(docData.descricao, null),
33
+ excluido: boolean_helper_1.BooleanHelper.check(docData.excluido, false),
34
+ acao_tipo: string_helper_1.StringHelper.trim(docData.acao_tipo, null),
35
+ status: string_helper_1.StringHelper.trim(docData.status, null),
35
36
  empresa: {
36
- documento: string_helper_1.StringHelper.trim(doc.get('empresa.documento'), null),
37
- fantasia: string_helper_1.StringHelper.trim(doc.get('empresa.fantasia'), null),
38
- razao: string_helper_1.StringHelper.trim(doc.get('empresa.razao'), null),
39
- path: string_helper_1.StringHelper.trim(doc.get('empresa.ref').path, null),
37
+ documento: string_helper_1.StringHelper.trim((_d = docData.empresa) === null || _d === void 0 ? void 0 : _d.documento, null),
38
+ fantasia: string_helper_1.StringHelper.trim((_e = docData.empresa) === null || _e === void 0 ? void 0 : _e.fantasia, null),
39
+ razao: string_helper_1.StringHelper.trim((_f = docData.empresa) === null || _f === void 0 ? void 0 : _f.razao, null),
40
+ path: string_helper_1.StringHelper.trim((_g = docData.empresa) === null || _g === void 0 ? void 0 : _g.ref.path, null),
40
41
  },
41
- ocorrencia: doc.get('ocorrencia')
42
+ ocorrencia: docData.ocorrencia
42
43
  ? {
43
- descricao: string_helper_1.StringHelper.trim(doc.get('ocorrencia.descricao'), null),
44
- path: string_helper_1.StringHelper.trim((_c = doc.get('ocorrencia.ref')) === null || _c === void 0 ? void 0 : _c.path, null),
45
- tipo: string_helper_1.StringHelper.trim(doc.get('ocorrencia.tipo'), null),
44
+ descricao: string_helper_1.StringHelper.trim(docData.ocorrencia.descricao, null),
45
+ uid: string_helper_1.StringHelper.trim(docData.ocorrencia.uid, null),
46
+ tipo: string_helper_1.StringHelper.trim(docData.ocorrencia.tipo, null),
46
47
  }
47
48
  : null,
48
- todos_colaboradores: boolean_helper_1.BooleanHelper.check(doc.get('todos_colaboradores'), true),
49
- periodos: ((_d = doc.get('periodos')) === null || _d === void 0 ? void 0 : _d.length) ? doc.get('periodos') : null,
50
- data_atualizacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_atualizacao'))
51
- ? doc.get('data_atualizacao').toDate()
49
+ todos_colaboradores: boolean_helper_1.BooleanHelper.check(docData.todos_colaboradores, true),
50
+ periodos: ((_h = docData.periodos) === null || _h === void 0 ? void 0 : _h.length) ? docData.periodos : null,
51
+ data_atualizacao: (0, type_guards_1.TipoTimestampFirestore)(docData.data_atualizacao)
52
+ ? docData.data_atualizacao.toDate()
52
53
  : undefined,
53
- data_criacao: (0, type_guards_1.TipoTimestampFirestore)(doc.get('data_criacao'))
54
- ? doc.get('data_criacao').toDate()
54
+ data_criacao: (0, type_guards_1.TipoTimestampFirestore)(docData.data_criacao)
55
+ ? docData.data_criacao.toDate()
55
56
  : undefined,
56
- data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(doc.get('data_intervalo'), undefined),
57
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(docData.data_intervalo, undefined),
58
+ colaboradores_ids: array_helpers_1.ArrayHelper.checkStringArray(docData.colaboradores_ids, null),
57
59
  });
58
60
  };
59
61
  LancamentoFireConvert.toFirestore = function (lancamento, documentReferenceFromPath, timestampfromDate) {
@@ -73,7 +75,8 @@ var LancamentoFireConvert = /** @class */ (function () {
73
75
  : lancamento.data_final
74
76
  ? firestore_1.Timestamp.fromDate(lancamento.data_final)
75
77
  : null,
76
- data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, undefined),
78
+ data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, null),
79
+ colaboradores_ids: array_helpers_1.ArrayHelper.checkStringArray(lancamento.colaboradores_ids, null),
77
80
  descricao: string_helper_1.StringHelper.trim(lancamento.descricao, null),
78
81
  excluido: boolean_helper_1.BooleanHelper.check(lancamento.excluido, false),
79
82
  acao_tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
@@ -86,7 +89,7 @@ var LancamentoFireConvert = /** @class */ (function () {
86
89
  },
87
90
  ocorrencia: lancamento.ocorrencia
88
91
  ? {
89
- ref: documentReferenceFromPath(lancamento.ocorrencia.path),
92
+ uid: string_helper_1.StringHelper.trim(lancamento.ocorrencia.uid, null),
90
93
  descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
91
94
  tipo: string_helper_1.StringHelper.trim(lancamento.acao_tipo, null),
92
95
  }
@@ -1,6 +1,7 @@
1
1
  import { TipoAcaoLancamentoEnum, Lancamento, LancamentoBase, LancamentoStatusEnum } from '.';
2
2
  import { TipoOcorrenciaFrequenciaEnum } from '../ocorrencia_frequencia';
3
3
  export declare class LancamentoJsonData implements LancamentoBase {
4
+ colaboradores_ids: string[];
4
5
  data_intervalo: string[];
5
6
  data_criacao: string;
6
7
  data_atualizacao: string;
@@ -25,7 +26,7 @@ export declare class LancamentoJsonData implements LancamentoBase {
25
26
  excluido: boolean;
26
27
  acao_tipo: TipoAcaoLancamentoEnum;
27
28
  ocorrencia: {
28
- path: string;
29
+ uid: string;
29
30
  tipo: TipoOcorrenciaFrequenciaEnum;
30
31
  descricao: string;
31
32
  };
@@ -36,7 +36,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
36
36
  ocorrencia: obj.ocorrencia
37
37
  ? {
38
38
  descricao: string_helper_1.StringHelper.trim(obj.ocorrencia.descricao, null),
39
- path: string_helper_1.StringHelper.trim(obj.ocorrencia.path, null),
39
+ uid: string_helper_1.StringHelper.trim(obj.ocorrencia.uid, null),
40
40
  tipo: string_helper_1.StringHelper.trim(obj.ocorrencia.tipo, null),
41
41
  }
42
42
  : null,
@@ -45,6 +45,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
45
45
  data_atualizacao: date_helper_1.DateHelper.fromString(obj.data_atualizacao, null),
46
46
  data_criacao: date_helper_1.DateHelper.fromString(obj.data_criacao, null),
47
47
  data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(obj.data_intervalo, null),
48
+ colaboradores_ids: array_helpers_1.ArrayHelper.checkStringArray(obj.colaboradores_ids, null),
48
49
  });
49
50
  };
50
51
  LancamentoJsonConvert.toJson = function (lancamento) {
@@ -67,7 +68,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
67
68
  ocorrencia: lancamento.ocorrencia
68
69
  ? {
69
70
  descricao: string_helper_1.StringHelper.trim(lancamento.ocorrencia.descricao, null),
70
- path: string_helper_1.StringHelper.trim(lancamento.ocorrencia.path, null),
71
+ uid: string_helper_1.StringHelper.trim(lancamento.ocorrencia.uid, null),
71
72
  tipo: string_helper_1.StringHelper.trim(lancamento.ocorrencia.tipo, null),
72
73
  }
73
74
  : null,
@@ -76,6 +77,7 @@ var LancamentoJsonConvert = /** @class */ (function () {
76
77
  data_criacao: (_f = lancamento.data_criacao) === null || _f === void 0 ? void 0 : _f.toISOString(),
77
78
  data_atualizacao: (_g = lancamento.data_atualizacao) === null || _g === void 0 ? void 0 : _g.toISOString(),
78
79
  data_intervalo: array_helpers_1.ArrayHelper.checkStringArray(lancamento.data_intervalo, undefined),
80
+ colaboradores_ids: array_helpers_1.ArrayHelper.checkStringArray(lancamento.colaboradores_ids, undefined),
79
81
  };
80
82
  return (0, lodash_1.omitBy)(lancamentoJson, lodash_1.isUndefined);
81
83
  };
@@ -10,3 +10,8 @@ export declare enum TipoOcorrenciaFrequenciaEnum {
10
10
  JornadaExterna = "Jornada externa",
11
11
  Suspensao = "Suspens\u00E3o"
12
12
  }
13
+ export interface OcorrenciaFrequenciaCopiaEmDocumento {
14
+ uid: string;
15
+ tipo: TipoOcorrenciaFrequenciaEnum;
16
+ descricao: string;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-models",
3
- "version": "2.1.30",
3
+ "version": "2.1.33",
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.9",
26
+ "firebase": "^9.6.10",
27
27
  "lodash": "^4.17.21",
28
28
  "ts-transformer-keys": "^0.4.3"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/jest": "^27.4.1",
32
- "@types/lodash": "^4.14.180",
33
- "@typescript-eslint/eslint-plugin": "^5.15.0",
34
- "@typescript-eslint/parser": "^5.15.0",
35
- "eslint": "^8.11.0",
32
+ "@types/lodash": "^4.14.181",
33
+ "@typescript-eslint/eslint-plugin": "^5.18.0",
34
+ "@typescript-eslint/parser": "^5.18.0",
35
+ "eslint": "^8.12.0",
36
36
  "eslint-config-google": "^0.14.0",
37
37
  "eslint-config-prettier": "^8.5.0",
38
- "eslint-plugin-import": "^2.25.4",
39
- "eslint-plugin-jest": "^26.1.2",
38
+ "eslint-plugin-import": "^2.26.0",
39
+ "eslint-plugin-jest": "^26.1.4",
40
40
  "eslint-plugin-prettier": "^4.0.0",
41
41
  "jest": "^27.5.1",
42
- "prettier": "^2.6.0",
43
- "ts-jest": "^27.1.3",
42
+ "prettier": "^2.6.2",
43
+ "ts-jest": "^27.1.4",
44
44
  "ttypescript": "^1.5.13",
45
- "typescript": "^4.6.2"
45
+ "typescript": "^4.6.3"
46
46
  }
47
47
  }
@@ -1,12 +0,0 @@
1
- import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot } from 'firebase/firestore';
2
- import { UsuarioLancamento, UsuarioLancamentoBase } from './usuario-lancamento';
3
- export declare class UsuarioLancamentoFirestoreData implements UsuarioLancamentoBase {
4
- documento: string;
5
- nome_completo: string;
6
- nome: string;
7
- ref: DocumentReference;
8
- }
9
- export declare abstract class UsuarioLancamentoFireConvert {
10
- static fromFirestore(doc: DocumentSnapshot<UsuarioLancamentoFirestoreData> | QueryDocumentSnapshot<UsuarioLancamentoFirestoreData>): UsuarioLancamento;
11
- static toFirestore(usuarioLancamento: UsuarioLancamento, documentReferenceFromPath: (path: string) => DocumentReference<any>): Partial<UsuarioLancamentoFirestoreData>;
12
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UsuarioLancamentoFireConvert = exports.UsuarioLancamentoFirestoreData = 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 usuario_lancamento_1 = require("./usuario-lancamento");
8
- var UsuarioLancamentoFirestoreData = /** @class */ (function () {
9
- function UsuarioLancamentoFirestoreData() {
10
- }
11
- return UsuarioLancamentoFirestoreData;
12
- }());
13
- exports.UsuarioLancamentoFirestoreData = UsuarioLancamentoFirestoreData;
14
- var UsuarioLancamentoFireConvert = /** @class */ (function () {
15
- function UsuarioLancamentoFireConvert() {
16
- }
17
- UsuarioLancamentoFireConvert.fromFirestore = function (doc) {
18
- var _a, _b;
19
- return new usuario_lancamento_1.UsuarioLancamento({
20
- _id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
21
- _path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
22
- ref: (0, type_guards_1.TipoDocumentReference)(doc.get('ref'))
23
- ? doc.get('ref').path
24
- : null,
25
- documento: string_helper_1.StringHelper.trim(doc.get('documento'), null),
26
- nome_completo: string_helper_1.StringHelper.trim(doc.get('nome_completo'), null),
27
- nome: string_helper_1.StringHelper.trim(doc.get('nome'), null),
28
- });
29
- };
30
- UsuarioLancamentoFireConvert.toFirestore = function (usuarioLancamento, documentReferenceFromPath) {
31
- var usuarioLancamentoFirestore = {
32
- documento: usuarioLancamento.documento,
33
- nome_completo: usuarioLancamento.nome_completo,
34
- nome: usuarioLancamento.nome,
35
- ref: documentReferenceFromPath(usuarioLancamento.ref),
36
- };
37
- return (0, lodash_1.omitBy)(usuarioLancamentoFirestore, lodash_1.isUndefined);
38
- };
39
- return UsuarioLancamentoFireConvert;
40
- }());
41
- exports.UsuarioLancamentoFireConvert = UsuarioLancamentoFireConvert;
@@ -1,27 +0,0 @@
1
- export interface UsuarioLancamentoBase {
2
- documento: any;
3
- nome_completo: any;
4
- nome: any;
5
- ref: any;
6
- }
7
- /**
8
- * Internal class col contas/${contaId}/lancamentos/${lancamentoId}/usuarios_lancamentos/${usuarioId}.
9
- *
10
- * @export
11
- * @class UsuarioLancamento
12
- * @implements {UsuarioLancamentoBase}
13
- */
14
- export declare class UsuarioLancamento implements UsuarioLancamentoBase {
15
- _id: string;
16
- _path: string;
17
- documento: string;
18
- nome_completo: string;
19
- nome: string;
20
- ref: string;
21
- /**
22
- * Creates an instance of UsuarioLancamento.
23
- * @param {Partial<UsuarioLancamento>} usuarioLancamentoPayload
24
- * @memberof Lancamento
25
- */
26
- constructor(usuarioLancamentoPayload: Partial<UsuarioLancamento>);
27
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UsuarioLancamento = void 0;
4
- /**
5
- * Internal class col contas/${contaId}/lancamentos/${lancamentoId}/usuarios_lancamentos/${usuarioId}.
6
- *
7
- * @export
8
- * @class UsuarioLancamento
9
- * @implements {UsuarioLancamentoBase}
10
- */
11
- var UsuarioLancamento = /** @class */ (function () {
12
- /**
13
- * Creates an instance of UsuarioLancamento.
14
- * @param {Partial<UsuarioLancamento>} usuarioLancamentoPayload
15
- * @memberof Lancamento
16
- */
17
- function UsuarioLancamento(usuarioLancamentoPayload) {
18
- var _this = this;
19
- var keysOfProps = ["_id", "_path", "documento", "nome", "ref", "nome_completo"];
20
- keysOfProps.forEach(function (key) {
21
- _this[key] = usuarioLancamentoPayload
22
- ? usuarioLancamentoPayload[key]
23
- : undefined;
24
- });
25
- }
26
- return UsuarioLancamento;
27
- }());
28
- exports.UsuarioLancamento = UsuarioLancamento;