b2m-utils 0.0.259 → 0.0.260

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
@@ -919,6 +919,25 @@ var getFilteredFeesToAudit = function (_a) {
919
919
  var lane = _a.lane, ratecard = _a.ratecard, cte = _a.cte;
920
920
  var filteredFees = (_b = lane === null || lane === void 0 ? void 0 : lane.RatecardLaneFee) === null || _b === void 0 ? void 0 : _b.filter(function (i) {
921
921
  var _a, _b, _c, _d, _e, _f, _g;
922
+ // Verificar se o fee está dentro do período de vigência
923
+ if (i.startsAt && i.endsAt) {
924
+ if (!cte.emissionDate) {
925
+ return false;
926
+ }
927
+ var emissionDate = new Date(cte.emissionDate);
928
+ if (i.startsAt) {
929
+ var startsAt = new Date(i.startsAt);
930
+ if (emissionDate < startsAt) {
931
+ return false;
932
+ }
933
+ }
934
+ if (i.endsAt) {
935
+ var endsAt = new Date(i.endsAt);
936
+ if (emissionDate > endsAt) {
937
+ return false;
938
+ }
939
+ }
940
+ }
922
941
  var defaultConditionalFees = [
923
942
  exports.FeeEnum.EMEX_COMMODITY_VALUE,
924
943
  exports.FeeEnum.EMEX_MIN_VALUE,
package/build/index.js.gz CHANGED
Binary file