From aedc6b58ab07e4eb2e8ed21aa95d4288d8388489 Mon Sep 17 00:00:00 2001 From: Michael McCarty Date: Fri, 10 Jul 2026 07:27:27 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feat:=20add=20missing-contract=20rows?= =?UTF-8?q?=20for=20unprocessed=20when=20percent=3D-200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/boost/rerun-chart.go | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/boost/rerun-chart.go b/src/boost/rerun-chart.go index b9122bf6..7b0855f2 100644 --- a/src/boost/rerun-chart.go +++ b/src/boost/rerun-chart.go @@ -105,6 +105,8 @@ func printContractChart(userID string, archive []*ei.LocalContract, percent int, generousGift, _ = strconv.ParseBool(val) } + processedIDs := make(map[string]bool) + for _, a := range archive { contractID := a.GetContractIdentifier() evaluation := a.GetEvaluation() @@ -126,6 +128,8 @@ func printContractChart(userID string, archive []*ei.LocalContract, percent int, } } + processedIDs[contractID] = true + if c.ContractVersion == 2 { maxCxp := c.CxpMax if generousGift { @@ -171,6 +175,57 @@ func printContractChart(userID string, archive []*ei.LocalContract, percent int, } } + if percent == -200 { + for _, contractID := range contractIDList { + if processedIDs[contractID] { + continue + } + c, ok := ei.GetEggIncContract(contractID) + if !ok { + continue + } + if c.ContractVersion == 2 { + evaluationCxp := 0.0 + maxCxp := c.CxpMax + if generousGift { + maxCxp = c.CxpMaxGG + } + hasSiab := false + if generousGift { + if c.CxpMaxSiabGG > c.CxpMaxGG { + maxCxp = c.CxpMaxSiabGG + if c.CxpMaxSiabGG > evaluationCxp { + hasSiab = true + } + } + } else { + if c.CxpMaxSiab > c.CxpMax { + maxCxp = c.CxpMaxSiab + if c.CxpMaxSiab > evaluationCxp { + hasSiab = true + } + } + } + + dayLabel := "" + if len(contractDayMap) > 0 { + dayLabel = contractDayMap[contractID] + } + rows = append(rows, chartRow{ + contractID: contractID, + cxp: evaluationCxp, + maxCxp: maxCxp, + gap: maxCxp - evaluationCxp, + percent: 0.0, + validUntil: c.ValidUntil.Unix(), + dayLabel: dayLabel, + hasSiab: hasSiab, + maxCoopSize: c.MaxCoopSize, + }) + } + } + } + session := &chartSession{ xid: xid.New().String(), userID: userID,