feat: enhance product analysis results with additional fields and update handling logic

This commit is contained in:
Victor Noguera
2026-04-13 03:32:46 -04:00
parent 299ad7a1a6
commit 811fe9b10a
4 changed files with 83 additions and 7 deletions

View File

@@ -31,6 +31,8 @@ type ProductListRecord = {
seller_count: number | null;
sales_rank: number | null;
current_price: number | null;
avg_price_90d: number | null;
reasoning: string | null;
fetched_at: string;
};
@@ -286,6 +288,11 @@ function getProductList(filters: URLSearchParams) {
"sales_rank",
"current_price",
"product_name",
"brand",
"category",
"avg_price_90d",
"confidence",
"reasoning",
"fetched_at",
]);
const orderBy = parseResultSort(
@@ -309,6 +316,8 @@ function getProductList(filters: URLSearchParams) {
sellers AS seller_count,
sales_rank,
current_price,
avg_price_90d,
reasoning,
fetched_at
FROM results
UNION ALL
@@ -326,6 +335,8 @@ function getProductList(filters: URLSearchParams) {
seller_count,
sales_rank,
current_price,
avg_price_90d,
reasoning,
fetched_at
FROM product_analysis_results
`;