feat: transition bestseller analysis storage to SQLite and add category blacklist
- Replaces Excel output with structured database tables for tracking category analysis runs and product results. - Implements a blacklist to exclude specific category IDs from the bestseller pipeline. - Adds unit tests for category processing and enhances logging with levels and timestamps. - Introduces foreign key enforcement and updated schema definitions in the database module.
This commit is contained in:
42
src/types.ts
42
src/types.ts
@@ -73,3 +73,45 @@ export interface AnalysisResult {
|
||||
product: EnrichedProduct;
|
||||
verdict: LlmVerdict;
|
||||
}
|
||||
|
||||
export interface CategoryRunSummaryDb {
|
||||
categoryId: number;
|
||||
categoryLabel: string;
|
||||
runTimestamp: string;
|
||||
topAsinsChecked: number;
|
||||
availableAsins: number;
|
||||
fbaCount: number;
|
||||
fbmCount: number;
|
||||
skipCount: number;
|
||||
status: "ok" | "empty" | "failed";
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export interface ProductAnalysisResultDb {
|
||||
asin: string;
|
||||
runId: number;
|
||||
name: string;
|
||||
brand?: string;
|
||||
category?: string;
|
||||
unitCost?: number;
|
||||
currentPrice?: number;
|
||||
avgPrice90d?: number;
|
||||
avgPrice90dSheet?: number;
|
||||
sellingPriceSheet?: number;
|
||||
salesRank?: number;
|
||||
salesRankAvg90d?: number;
|
||||
sellerCount?: number;
|
||||
monthlySold?: number;
|
||||
rankDrops30d?: number;
|
||||
rankDrops90d?: number;
|
||||
fbaFee?: number;
|
||||
fbmFee?: number;
|
||||
referralPercent?: number;
|
||||
canSell?: string;
|
||||
sellabilityStatus?: string;
|
||||
sellabilityReason?: string;
|
||||
verdict: string;
|
||||
confidence: number;
|
||||
reasoning?: string;
|
||||
fetchedAt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user