feat(analysis): bold month names for DB-sourced data, regular for external

This commit is contained in:
Jose Selesan
2026-08-27 11:37:43 -03:00
parent 28f9dea7ba
commit d8aed4970c
3 changed files with 23 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ type MonthlyLastRow = {
month: string;
type: string;
buy: number;
source: "db" | "external";
};
type ExternalQuote = {
@@ -94,7 +95,7 @@ export async function getMonthlyLast(c: Context) {
for (const type of TYPES) {
const buy = dbMap.get(month)?.get(type);
if (buy !== undefined) {
result.push({ month, type, buy });
result.push({ month, type, buy, source: "db" });
}
}
}
@@ -152,13 +153,13 @@ export async function getMonthlyLast(c: Context) {
for (const type of TYPES) {
const dbBuy = dbMap.get(month)?.get(type);
if (dbBuy !== undefined) {
result.push({ month, type, buy: dbBuy });
result.push({ month, type, buy: dbBuy, source: "db" });
continue;
}
const extBuy = externalData.get(type)?.get(month);
if (extBuy !== undefined) {
result.push({ month, type, buy: extBuy });
result.push({ month, type, buy: extBuy, source: "external" });
}
}
}