b2m-utils 0.0.243 → 0.0.244

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.
@@ -968,15 +968,16 @@ var getFilteredFeesToAudit = function (_a) {
968
968
  }
969
969
  return false;
970
970
  });
971
- // Remover fees duplicadas, mantendo apenas uma ocorrência de cada feeId
972
- var seenFeeIds = new Set();
971
+ // Remover fees duplicadas, considerando feeId + intervalos de peso/km
972
+ var seenFees = new Set();
973
973
  var uniqueFees = filteredFees === null || filteredFees === void 0 ? void 0 : filteredFees.filter(function (fee) {
974
- if (fee.feeId && seenFeeIds.has(fee.feeId)) {
974
+ var _a, _b, _c, _d, _e;
975
+ // Criar chave única considerando feeId + intervalos + vehicleTypeId
976
+ var key = "".concat(fee.feeId, "_").concat((_a = fee.minWeight) !== null && _a !== void 0 ? _a : 'null', "_").concat((_b = fee.maxWeight) !== null && _b !== void 0 ? _b : 'null', "_").concat((_c = fee.minKm) !== null && _c !== void 0 ? _c : 'null', "_").concat((_d = fee.maxKm) !== null && _d !== void 0 ? _d : 'null', "_").concat((_e = fee.vehicleTypeId) !== null && _e !== void 0 ? _e : 'null');
977
+ if (seenFees.has(key)) {
975
978
  return false;
976
979
  }
977
- if (fee.feeId) {
978
- seenFeeIds.add(fee.feeId);
979
- }
980
+ seenFees.add(key);
980
981
  return true;
981
982
  });
982
983
  // Garantir que ICMS sempre esteja presente
Binary file