flit-models 2.1.11 → 2.1.12

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.
@@ -1,6 +1,7 @@
1
1
  import { DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Timestamp } from 'firebase/firestore';
2
2
  import { LogLancamento, LogLancamentoBase, LogLancamentoStatusEnum } from './log-lancamento';
3
3
  export declare class LogLancamentoFirestoreData implements LogLancamentoBase {
4
+ visto: boolean;
4
5
  data: Timestamp;
5
6
  mensagem: string;
6
7
  detalhes: {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LogLancamentoFireConvert = exports.LogLancamentoFirestoreData = void 0;
4
4
  var lodash_1 = require("lodash");
5
+ var boolean_helper_1 = require("../../../utils/boolean-helper");
5
6
  var string_helper_1 = require("../../../utils/string-helper");
6
7
  var type_guards_1 = require("../../../utils/type-guards");
7
8
  var log_lancamento_1 = require("./log-lancamento");
@@ -15,7 +16,7 @@ var LogLancamentoFireConvert = /** @class */ (function () {
15
16
  function LogLancamentoFireConvert() {
16
17
  }
17
18
  LogLancamentoFireConvert.fromFirestore = function (doc) {
18
- var _a, _b, _c;
19
+ var _a, _b, _c, _d;
19
20
  return new log_lancamento_1.LogLancamento({
20
21
  _id: (_a = doc.id) !== null && _a !== void 0 ? _a : null,
21
22
  _path: (_b = doc.ref.path) !== null && _b !== void 0 ? _b : null,
@@ -33,6 +34,7 @@ var LogLancamentoFireConvert = /** @class */ (function () {
33
34
  mensagem: string_helper_1.StringHelper.trim(doc.get('mensagem'), null),
34
35
  status: string_helper_1.StringHelper.trim(doc.get('status'), null),
35
36
  detalhes: (_c = doc.get('detalhes')) !== null && _c !== void 0 ? _c : null,
37
+ visto: (_d = doc.get('visto')) !== null && _d !== void 0 ? _d : false,
36
38
  });
37
39
  };
38
40
  LogLancamentoFireConvert.toFirestore = function (logLancamento, timestampfromDate, documentReferenceFromPath) {
@@ -45,6 +47,7 @@ var LogLancamentoFireConvert = /** @class */ (function () {
45
47
  data: timestampfromDate(logLancamento.jornada.data),
46
48
  ref: documentReferenceFromPath(logLancamento.jornada.ref),
47
49
  },
50
+ visto: boolean_helper_1.BooleanHelper.check(logLancamento.visto, false),
48
51
  };
49
52
  return (0, lodash_1.omitBy)(logLancamentoFirestore, lodash_1.isUndefined);
50
53
  };
@@ -11,6 +11,7 @@ export interface LogLancamentoBase {
11
11
  data: any;
12
12
  ref: any;
13
13
  };
14
+ visto: any;
14
15
  }
15
16
  /**
16
17
  * Internal class col contas/${contaId}/lancamento/${lancamentoId}/logs_lancamento/${usuarioId}.
@@ -32,6 +33,7 @@ export declare class LogLancamento implements LogLancamentoBase {
32
33
  data: Date;
33
34
  ref: string;
34
35
  };
36
+ visto: boolean;
35
37
  /**
36
38
  * Creates an instance of UsuarioLancamento.
37
39
  * @param {Partial<LogLancamento>} usuarioLancamentoPayload
@@ -21,7 +21,7 @@ var LogLancamento = /** @class */ (function () {
21
21
  */
22
22
  function LogLancamento(usuarioLancamentoPayload) {
23
23
  var _this = this;
24
- var keysOfProps = ["status", "_id", "_path", "data", "mensagem", "detalhes", "jornada"];
24
+ var keysOfProps = ["status", "_id", "_path", "data", "mensagem", "detalhes", "jornada", "visto"];
25
25
  keysOfProps.forEach(function (key) {
26
26
  _this[key] = usuarioLancamentoPayload
27
27
  ? usuarioLancamentoPayload[key]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-models",
3
- "version": "2.1.11",
3
+ "version": "2.1.12",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",