IO-3255 Review comments.

This commit is contained in:
Patrick Fic
2025-08-27 11:50:00 -07:00
parent 5b400dce4f
commit 553c154e46
5 changed files with 38 additions and 28 deletions

View File

@@ -23,6 +23,8 @@ const KNOWN_PART_RATE_TYPES = [
* @returns {object} The parts tax rates object.
*/
//PF: Major validation would be required on this - EMS files are inconsistent with things like 5% being passed as 5.0 or .05.
//PF: Is this data being sent by them now?
const extractPartsTaxRates = (profile = {}) => {
const rateInfos = Array.isArray(profile.RateInfo) ? profile.RateInfo : [profile.RateInfo || {}];
const partsTaxRates = {};
@@ -31,7 +33,7 @@ const extractPartsTaxRates = (profile = {}) => {
const rateTypeRaw =
typeof r?.RateType === "string"
? r.RateType
: typeof r?.RateType === "object" && r?.RateType._
: typeof r?.RateType === "object" && r?.RateType._ //PF: what does _ align to?
? r.RateType._
: "";
const rateType = (rateTypeRaw || "").toUpperCase();