vault backup: 2023-11-06 15:08:01

This commit is contained in:
Paul Trowbridge 2023-11-06 15:08:01 -05:00
parent cd7056c502
commit fe6306cfa3

4
api.ts
View File

@ -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