b2m-utils 0.0.246 → 0.0.247

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/build/index.js CHANGED
@@ -887,7 +887,7 @@ var getFilteredFeesToAudit = function (_a) {
887
887
  var _b;
888
888
  var lane = _a.lane, ratecard = _a.ratecard, cte = _a.cte;
889
889
  var filteredFees = (_b = lane === null || lane === void 0 ? void 0 : lane.RatecardLaneFee) === null || _b === void 0 ? void 0 : _b.filter(function (i) {
890
- var _a, _b, _c, _d, _e, _f, _g, _h;
890
+ var _a, _b, _c, _d, _e, _f, _g;
891
891
  var defaultConditionalFees = [
892
892
  exports.FeeEnum.SUFRAMA,
893
893
  exports.FeeEnum.TDA_FREIGHT,
@@ -957,32 +957,13 @@ var getFilteredFeesToAudit = function (_a) {
957
957
  }
958
958
  else if (i.minWeight || i.maxWeight) {
959
959
  if (cte === null || cte === void 0 ? void 0 : cte.taxedWeight) {
960
- var ceiledWeight = Math.ceil(+cte.taxedWeight);
961
- console.log('[getFilteredFeesToAudit] Verificando fee por peso:', {
962
- feeName: (_h = i.fee) === null || _h === void 0 ? void 0 : _h.name,
963
- feeId: i.feeId,
964
- minWeight: i.minWeight,
965
- maxWeight: i.maxWeight,
966
- cteTaxedWeight: cte.taxedWeight,
967
- ceiledWeight: ceiledWeight,
968
- passedMinCheck: ceiledWeight >= +i.minWeight,
969
- passedMaxCheck: i.maxWeight ? ceiledWeight <= +i.maxWeight : 'sem maxWeight',
970
- });
971
- if (ceiledWeight >= +i.minWeight) {
972
- if (ceiledWeight <= +i.maxWeight) {
973
- console.log('[getFilteredFeesToAudit] ✅ Fee aprovada (dentro do intervalo)');
960
+ if (Math.ceil(+cte.taxedWeight) >= +i.minWeight) {
961
+ if (Math.ceil(+cte.taxedWeight) <= +i.maxWeight) {
974
962
  return true;
975
963
  }
976
964
  else if (!i.maxWeight) {
977
- console.log('[getFilteredFeesToAudit] ✅ Fee aprovada (excedente)');
978
965
  return true;
979
966
  }
980
- else {
981
- console.log('[getFilteredFeesToAudit] ❌ Fee rejeitada (peso excede maxWeight)');
982
- }
983
- }
984
- else {
985
- console.log('[getFilteredFeesToAudit] ❌ Fee rejeitada (peso menor que minWeight)');
986
967
  }
987
968
  }
988
969
  }
@@ -991,18 +972,10 @@ var getFilteredFeesToAudit = function (_a) {
991
972
  }
992
973
  return false;
993
974
  });
994
- console.log('[getFilteredFeesToAudit] Fees após filtro inicial:', filteredFees === null || filteredFees === void 0 ? void 0 : filteredFees.length);
995
975
  // Remover fees duplicadas, mantendo apenas uma ocorrência de cada feeId
996
976
  var seenFeeIds = new Set();
997
977
  var uniqueFees = filteredFees === null || filteredFees === void 0 ? void 0 : filteredFees.filter(function (fee) {
998
- var _a;
999
978
  if (fee.feeId && seenFeeIds.has(fee.feeId)) {
1000
- console.log('[getFilteredFeesToAudit] ⚠️ Fee duplicada removida:', {
1001
- feeName: (_a = fee.fee) === null || _a === void 0 ? void 0 : _a.name,
1002
- feeId: fee.feeId,
1003
- minWeight: fee.minWeight,
1004
- maxWeight: fee.maxWeight,
1005
- });
1006
979
  return false;
1007
980
  }
1008
981
  if (fee.feeId) {
@@ -1010,7 +983,6 @@ var getFilteredFeesToAudit = function (_a) {
1010
983
  }
1011
984
  return true;
1012
985
  });
1013
- console.log('[getFilteredFeesToAudit] Fees após remoção de duplicatas:', uniqueFees === null || uniqueFees === void 0 ? void 0 : uniqueFees.length);
1014
986
  // Garantir que ICMS sempre esteja presente
1015
987
  var hasIcms = uniqueFees === null || uniqueFees === void 0 ? void 0 : uniqueFees.some(function (fee) { return fee.feeId === exports.FeeEnum.ICMS; });
1016
988
  if (!hasIcms) {
@@ -1033,7 +1005,6 @@ var getFilteredFeesToAudit = function (_a) {
1033
1005
  },
1034
1006
  });
1035
1007
  }
1036
- console.log('[getFilteredFeesToAudit] Fees finais retornadas:', uniqueFees === null || uniqueFees === void 0 ? void 0 : uniqueFees.length);
1037
1008
  return uniqueFees;
1038
1009
  };
1039
1010
 
package/build/index.js.gz CHANGED
Binary file