diff --git a/api.ts b/api.ts index bfd7745..e236f7d 100644 --- a/api.ts +++ b/api.ts @@ -41,7 +41,7 @@ function apply_guidance(doc: any) { let highestCustomerRelevanceLevel = -1; // Function to update price and assign relevance indicator - function updatePriceAndAssignRelevance(items, channelFirstChar, v1ds, v0ds, histKey) { + function setAnchors(items, channelFirstChar, v1ds, v0ds, histKey) { for (let item of items) { // Update the last_price with the most recent price const years = Object.keys(item.season); @@ -95,7 +95,7 @@ function apply_guidance(doc: any) { // Iterate over each key in the "hist" object for (let key of Object.keys(doc.hist)) { // Update price and relevance for each item in the current key - updatePriceAndAssignRelevance(doc.hist[key], doc.chan[0], doc.v1ds, doc.v0ds, key); + setAnchors(doc.hist[key], doc.chan[0], doc.v1ds, doc.v0ds, key); } // Assign the most relevant market price and key to the top level of the document