b2m-utils 0.0.183 → 0.0.184
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.esm.js +19 -7
- package/build/index.esm.js.gz +0 -0
- package/build/index.esm.js.map +1 -1
- package/build/index.js +19 -7
- package/build/index.js.gz +0 -0
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -6959,19 +6959,31 @@ var getFilteredFeesToAudit = function (_a) {
|
|
|
6959
6959
|
};
|
|
6960
6960
|
|
|
6961
6961
|
var getLaneFromRatecard = function (cte) {
|
|
6962
|
-
var _a, _b;
|
|
6962
|
+
var _a, _b, _c, _d;
|
|
6963
6963
|
var ratecard = getRatecardFromCte(cte);
|
|
6964
6964
|
var cityOriginId = cte.cityOriginId, cityDestination = cte.cityDestination;
|
|
6965
6965
|
var destinationUf = (_a = cityDestination === null || cityDestination === void 0 ? void 0 : cityDestination.state) === null || _a === void 0 ? void 0 : _a.uf;
|
|
6966
6966
|
if ((ratecard === null || ratecard === void 0 ? void 0 : ratecard.RatecardLane) && ((_b = ratecard === null || ratecard === void 0 ? void 0 : ratecard.RatecardLane) === null || _b === void 0 ? void 0 : _b.length) > 0 && cityOriginId && destinationUf) {
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
}
|
|
6971
|
-
return false;
|
|
6967
|
+
// Primeiro, buscar rota direta (Origem -> Destino)
|
|
6968
|
+
var directLane = ratecard.RatecardLane.find(function (i) {
|
|
6969
|
+
return i.cityOriginId === cityOriginId && i.ufDestination === destinationUf;
|
|
6972
6970
|
});
|
|
6973
|
-
|
|
6971
|
+
if (directLane) {
|
|
6972
|
+
return directLane;
|
|
6973
|
+
}
|
|
6974
|
+
// Se não encontrar rota direta, buscar rota inversa (Destino -> Origem)
|
|
6975
|
+
// Para isso, precisamos encontrar a UF da origem
|
|
6976
|
+
var originUf_1 = (_d = (_c = cte.cityOrigin) === null || _c === void 0 ? void 0 : _c.state) === null || _d === void 0 ? void 0 : _d.uf;
|
|
6977
|
+
if (originUf_1) {
|
|
6978
|
+
var reverseLane = ratecard.RatecardLane.find(function (i) {
|
|
6979
|
+
return i.cityOriginId === (cityDestination === null || cityDestination === void 0 ? void 0 : cityDestination.id) && i.ufDestination === originUf_1;
|
|
6980
|
+
});
|
|
6981
|
+
if (reverseLane) {
|
|
6982
|
+
return reverseLane;
|
|
6983
|
+
}
|
|
6984
|
+
}
|
|
6974
6985
|
}
|
|
6986
|
+
return undefined;
|
|
6975
6987
|
};
|
|
6976
6988
|
|
|
6977
6989
|
var getNormalizedCityName = function (name) {
|
package/build/index.js.gz
CHANGED
|
Binary file
|