@credithub/harlan-components 1.97.6 → 1.97.7

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,3 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  var __rest = (this && this.__rest) || function (s, e) {
2
13
  var t = {};
3
14
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -102,17 +113,24 @@ export var selectRelevantData = function (data) {
102
113
  // ────────────────────────────────────────────────
103
114
  var _r = ResumoDosDados !== null && ResumoDosDados !== void 0 ? ResumoDosDados : {}, _omit = _r.protestoLiminar, ResumoSafe = __rest(_r, ["protestoLiminar"]);
104
115
  var protestosData = [];
116
+ var ultimaOcorrenciaProtestos = ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.ultimaOcorrenciaProtestos;
105
117
  if (Array.isArray(ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.protestoHistory) &&
106
118
  ResumoSafe.protestoHistory.length) {
107
119
  var latest = __spreadArray([], ResumoSafe.protestoHistory, true).sort(function (a, b) { return new Date(b.data).getTime() - new Date(a.data).getTime(); })[0];
108
- protestosData = [latest];
120
+ var latestWithCorrectDate = ultimaOcorrenciaProtestos
121
+ ? __assign(__assign({}, latest), { data: ultimaOcorrenciaProtestos }) : latest;
122
+ protestosData = [latestWithCorrectDate];
109
123
  // 💡 mantém histórico enxuto também em ResumoSafe
110
- ResumoSafe.protestoHistory = [latest];
124
+ ResumoSafe.protestoHistory = [latestWithCorrectDate];
111
125
  }
112
126
  if (!protestosData.length &&
113
127
  typeof protestosNumero === 'number' &&
114
128
  protestosNumero > 0) {
115
- protestosData = [{ quantidade: protestosNumero }];
129
+ protestosData = [
130
+ ultimaOcorrenciaProtestos
131
+ ? { quantidade: protestosNumero, data: ultimaOcorrenciaProtestos }
132
+ : { quantidade: protestosNumero }
133
+ ];
116
134
  }
117
135
  // ────────────────────────────────────────────────
118
136
  // 2. Processos jurídicos – ativos + passivos