feat(analysis): bold month names for DB-sourced data, regular for external
This commit is contained in:
@@ -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" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user