Files
asin-check/drizzle/meta/0000_snapshot.json
Victor Noguera c006d87c54 feat: add supplier scoring and UPC file analysis functionality
- Implemented supplier scoring logic in `supplier-scoring.ts` with functions to compute demand score, competition penalty, and overall supplier product score.
- Created unit tests for supplier scoring in `supplier-scoring.test.ts` to validate scoring logic against various scenarios.
- Developed UPC file analysis tool in `upc-file-analysis.ts` to process UPCs in batches, fetch product data from Keepa and SP-API, and generate supplier results.
- Added UPC input reading functionality in `upc-file-reader.ts` to handle XLSX and XLS files, including validation for UPC formats.
- Introduced a command-line tool in `upc-lookup.ts` for looking up UPCs and displaying detailed results or mappings to ASINs.
- Enhanced error handling and logging throughout the new modules for better traceability and user feedback.
2026-05-25 00:53:47 -04:00

1545 lines
40 KiB
JSON

{
"id": "5b8f629e-e65a-40a4-b261-4a460b4c23fb",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.analysis_results": {
"name": "analysis_results",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"run_id": {
"name": "run_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"asin": {
"name": "asin",
"type": "text",
"primaryKey": false,
"notNull": true
},
"product_name": {
"name": "product_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"brand": {
"name": "brand",
"type": "text",
"primaryKey": false,
"notNull": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": false
},
"upc": {
"name": "upc",
"type": "text",
"primaryKey": false,
"notNull": false
},
"unit_cost": {
"name": "unit_cost",
"type": "real",
"primaryKey": false,
"notNull": false
},
"avg_price_90d_sheet": {
"name": "avg_price_90d_sheet",
"type": "real",
"primaryKey": false,
"notNull": false
},
"selling_price_sheet": {
"name": "selling_price_sheet",
"type": "real",
"primaryKey": false,
"notNull": false
},
"fba_net_sheet": {
"name": "fba_net_sheet",
"type": "real",
"primaryKey": false,
"notNull": false
},
"gross_profit_dollar": {
"name": "gross_profit_dollar",
"type": "real",
"primaryKey": false,
"notNull": false
},
"gross_profit_pct": {
"name": "gross_profit_pct",
"type": "real",
"primaryKey": false,
"notNull": false
},
"net_profit_sheet": {
"name": "net_profit_sheet",
"type": "real",
"primaryKey": false,
"notNull": false
},
"roi_sheet": {
"name": "roi_sheet",
"type": "real",
"primaryKey": false,
"notNull": false
},
"moq": {
"name": "moq",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"moq_cost": {
"name": "moq_cost",
"type": "real",
"primaryKey": false,
"notNull": false
},
"qty_available": {
"name": "qty_available",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"supplier": {
"name": "supplier",
"type": "text",
"primaryKey": false,
"notNull": false
},
"source_url": {
"name": "source_url",
"type": "text",
"primaryKey": false,
"notNull": false
},
"asin_link": {
"name": "asin_link",
"type": "text",
"primaryKey": false,
"notNull": false
},
"promo_coupon_code": {
"name": "promo_coupon_code",
"type": "text",
"primaryKey": false,
"notNull": false
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"lead_date": {
"name": "lead_date",
"type": "text",
"primaryKey": false,
"notNull": false
},
"current_price": {
"name": "current_price",
"type": "real",
"primaryKey": false,
"notNull": false
},
"avg_price_90d": {
"name": "avg_price_90d",
"type": "real",
"primaryKey": false,
"notNull": false
},
"sales_rank": {
"name": "sales_rank",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"rank_avg_90d": {
"name": "rank_avg_90d",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"monthly_sold": {
"name": "monthly_sold",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"rank_drops_30d": {
"name": "rank_drops_30d",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"rank_drops_90d": {
"name": "rank_drops_90d",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"seller_count": {
"name": "seller_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"amazon_is_seller": {
"name": "amazon_is_seller",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"amazon_buybox_share_pct_90d": {
"name": "amazon_buybox_share_pct_90d",
"type": "real",
"primaryKey": false,
"notNull": false
},
"fba_fee": {
"name": "fba_fee",
"type": "real",
"primaryKey": false,
"notNull": false
},
"fbm_fee": {
"name": "fbm_fee",
"type": "real",
"primaryKey": false,
"notNull": false
},
"referral_percent": {
"name": "referral_percent",
"type": "real",
"primaryKey": false,
"notNull": false
},
"can_sell": {
"name": "can_sell",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sellability_status": {
"name": "sellability_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sellability_reason": {
"name": "sellability_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"supplier_score": {
"name": "supplier_score",
"type": "real",
"primaryKey": false,
"notNull": false
},
"supplier_profit": {
"name": "supplier_profit",
"type": "real",
"primaryKey": false,
"notNull": false
},
"supplier_margin": {
"name": "supplier_margin",
"type": "real",
"primaryKey": false,
"notNull": false
},
"supplier_roi": {
"name": "supplier_roi",
"type": "real",
"primaryKey": false,
"notNull": false
},
"supplier_reason": {
"name": "supplier_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"upc_lookup_status": {
"name": "upc_lookup_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"upc_lookup_reason": {
"name": "upc_lookup_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"candidate_asins": {
"name": "candidate_asins",
"type": "text",
"primaryKey": false,
"notNull": false
},
"verdict": {
"name": "verdict",
"type": "text",
"primaryKey": false,
"notNull": true
},
"confidence": {
"name": "confidence",
"type": "real",
"primaryKey": false,
"notNull": false
},
"reasoning": {
"name": "reasoning",
"type": "text",
"primaryKey": false,
"notNull": false
},
"fetched_at": {
"name": "fetched_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"idx_analysis_results_run_id": {
"name": "idx_analysis_results_run_id",
"columns": [
{
"expression": "run_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_analysis_results_asin": {
"name": "idx_analysis_results_asin",
"columns": [
{
"expression": "asin",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_analysis_results_verdict": {
"name": "idx_analysis_results_verdict",
"columns": [
{
"expression": "verdict",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_analysis_results_sellability_status": {
"name": "idx_analysis_results_sellability_status",
"columns": [
{
"expression": "sellability_status",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_analysis_results_fetched_at": {
"name": "idx_analysis_results_fetched_at",
"columns": [
{
"expression": "fetched_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"analysis_results_run_id_runs_id_fk": {
"name": "analysis_results_run_id_runs_id_fk",
"tableFrom": "analysis_results",
"tableTo": "runs",
"columnsFrom": [
"run_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.category_product_results": {
"name": "category_product_results",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"asin": {
"name": "asin",
"type": "text",
"primaryKey": false,
"notNull": true
},
"run_id": {
"name": "run_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"brand": {
"name": "brand",
"type": "text",
"primaryKey": false,
"notNull": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": false
},
"unit_cost": {
"name": "unit_cost",
"type": "real",
"primaryKey": false,
"notNull": false
},
"current_price": {
"name": "current_price",
"type": "real",
"primaryKey": false,
"notNull": false
},
"avg_price_90d": {
"name": "avg_price_90d",
"type": "real",
"primaryKey": false,
"notNull": false
},
"avg_price_90d_sheet": {
"name": "avg_price_90d_sheet",
"type": "real",
"primaryKey": false,
"notNull": false
},
"selling_price_sheet": {
"name": "selling_price_sheet",
"type": "real",
"primaryKey": false,
"notNull": false
},
"sales_rank": {
"name": "sales_rank",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"sales_rank_avg_90d": {
"name": "sales_rank_avg_90d",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"seller_count": {
"name": "seller_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"amazon_is_seller": {
"name": "amazon_is_seller",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"amazon_buybox_share_pct_90d": {
"name": "amazon_buybox_share_pct_90d",
"type": "real",
"primaryKey": false,
"notNull": false
},
"monthly_sold": {
"name": "monthly_sold",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"rank_drops_30d": {
"name": "rank_drops_30d",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"rank_drops_90d": {
"name": "rank_drops_90d",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"fba_fee": {
"name": "fba_fee",
"type": "real",
"primaryKey": false,
"notNull": false
},
"fbm_fee": {
"name": "fbm_fee",
"type": "real",
"primaryKey": false,
"notNull": false
},
"referral_percent": {
"name": "referral_percent",
"type": "real",
"primaryKey": false,
"notNull": false
},
"can_sell": {
"name": "can_sell",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sellability_status": {
"name": "sellability_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sellability_reason": {
"name": "sellability_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"verdict": {
"name": "verdict",
"type": "text",
"primaryKey": false,
"notNull": true
},
"confidence": {
"name": "confidence",
"type": "real",
"primaryKey": false,
"notNull": true
},
"reasoning": {
"name": "reasoning",
"type": "text",
"primaryKey": false,
"notNull": false
},
"fetched_at": {
"name": "fetched_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"idx_category_results_run_id": {
"name": "idx_category_results_run_id",
"columns": [
{
"expression": "run_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_category_results_verdict": {
"name": "idx_category_results_verdict",
"columns": [
{
"expression": "verdict",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_category_results_sellability_status": {
"name": "idx_category_results_sellability_status",
"columns": [
{
"expression": "sellability_status",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_category_results_fetched_at": {
"name": "idx_category_results_fetched_at",
"columns": [
{
"expression": "fetched_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"category_product_results_run_id_runs_id_fk": {
"name": "category_product_results_run_id_runs_id_fk",
"tableFrom": "category_product_results",
"tableTo": "runs",
"columnsFrom": [
"run_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"category_product_results_asin_unique": {
"name": "category_product_results_asin_unique",
"nullsNotDistinct": false,
"columns": [
"asin"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.runs": {
"name": "runs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"type": {
"name": "type",
"type": "run_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"input_file": {
"name": "input_file",
"type": "text",
"primaryKey": false,
"notNull": false
},
"output_file": {
"name": "output_file",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "run_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'running'"
},
"error_message": {
"name": "error_message",
"type": "text",
"primaryKey": false,
"notNull": false
},
"total_products": {
"name": "total_products",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"fba_count": {
"name": "fba_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"fbm_count": {
"name": "fbm_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"skip_count": {
"name": "skip_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"category_id": {
"name": "category_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"category_label": {
"name": "category_label",
"type": "text",
"primaryKey": false,
"notNull": false
},
"top_asins_checked": {
"name": "top_asins_checked",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"available_asins": {
"name": "available_asins",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"started_at": {
"name": "started_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"completed_at": {
"name": "completed_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"idx_runs_started_at": {
"name": "idx_runs_started_at",
"columns": [
{
"expression": "started_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_runs_type": {
"name": "idx_runs_type",
"columns": [
{
"expression": "type",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_runs_status": {
"name": "idx_runs_status",
"columns": [
{
"expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.sellers": {
"name": "sellers",
"schema": "",
"columns": {
"seller_id": {
"name": "seller_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"seller_name": {
"name": "seller_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"rating": {
"name": "rating",
"type": "real",
"primaryKey": false,
"notNull": false
},
"rating_count": {
"name": "rating_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"storefront_asin_total": {
"name": "storefront_asin_total",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"persisted_inventory_sample_count": {
"name": "persisted_inventory_sample_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"last_updated_at": {
"name": "last_updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"raw_seller_json": {
"name": "raw_seller_json",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.stalker_asin_scans": {
"name": "stalker_asin_scans",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"run_id": {
"name": "run_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"source_asin": {
"name": "source_asin",
"type": "text",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"offer_count": {
"name": "offer_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"candidate_seller_count": {
"name": "candidate_seller_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"matched_seller_count": {
"name": "matched_seller_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"fetched_at": {
"name": "fetched_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"raw_product_json": {
"name": "raw_product_json",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"idx_stalker_scans_run_id": {
"name": "idx_stalker_scans_run_id",
"columns": [
{
"expression": "run_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_stalker_scans_source_asin": {
"name": "idx_stalker_scans_source_asin",
"columns": [
{
"expression": "source_asin",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"stalker_asin_scans_run_id_stalker_runs_id_fk": {
"name": "stalker_asin_scans_run_id_stalker_runs_id_fk",
"tableFrom": "stalker_asin_scans",
"tableTo": "stalker_runs",
"columnsFrom": [
"run_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"uq_stalker_scans_run_asin": {
"name": "uq_stalker_scans_run_asin",
"nullsNotDistinct": false,
"columns": [
"run_id",
"source_asin"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.stalker_asin_sellers": {
"name": "stalker_asin_sellers",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"scan_id": {
"name": "scan_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"seller_id": {
"name": "seller_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"offer_price": {
"name": "offer_price",
"type": "real",
"primaryKey": false,
"notNull": false
},
"condition": {
"name": "condition",
"type": "text",
"primaryKey": false,
"notNull": false
},
"is_fba": {
"name": "is_fba",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"stock": {
"name": "stock",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"seller_rating": {
"name": "seller_rating",
"type": "real",
"primaryKey": false,
"notNull": false
},
"seller_rating_count": {
"name": "seller_rating_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"raw_offer_json": {
"name": "raw_offer_json",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"stalker_asin_sellers_scan_id_stalker_asin_scans_id_fk": {
"name": "stalker_asin_sellers_scan_id_stalker_asin_scans_id_fk",
"tableFrom": "stalker_asin_sellers",
"tableTo": "stalker_asin_scans",
"columnsFrom": [
"scan_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"stalker_asin_sellers_seller_id_sellers_seller_id_fk": {
"name": "stalker_asin_sellers_seller_id_sellers_seller_id_fk",
"tableFrom": "stalker_asin_sellers",
"tableTo": "sellers",
"columnsFrom": [
"seller_id"
],
"columnsTo": [
"seller_id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"uq_stalker_asin_sellers_scan_seller": {
"name": "uq_stalker_asin_sellers_scan_seller",
"nullsNotDistinct": false,
"columns": [
"scan_id",
"seller_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.stalker_runs": {
"name": "stalker_runs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"input_file": {
"name": "input_file",
"type": "text",
"primaryKey": false,
"notNull": true
},
"started_at": {
"name": "started_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"completed_at": {
"name": "completed_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"requested_asins": {
"name": "requested_asins",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"skipped_asins": {
"name": "skipped_asins",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"scanned_asins": {
"name": "scanned_asins",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"source_asins_with_matches": {
"name": "source_asins_with_matches",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"candidate_sellers": {
"name": "candidate_sellers",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"qualifying_sellers": {
"name": "qualifying_sellers",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"matched_sellers": {
"name": "matched_sellers",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"seller_metadata_requests": {
"name": "seller_metadata_requests",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"seller_storefront_requests": {
"name": "seller_storefront_requests",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"inventory_sellability_checked_asins": {
"name": "inventory_sellability_checked_asins",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"inventory_sellability_available_asins": {
"name": "inventory_sellability_available_asins",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"inventory_sellability_excluded_asins": {
"name": "inventory_sellability_excluded_asins",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"persisted_inventory_asins": {
"name": "persisted_inventory_asins",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true
},
"error_message": {
"name": "error_message",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"idx_stalker_runs_started_at": {
"name": "idx_stalker_runs_started_at",
"columns": [
{
"expression": "started_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.stalker_seller_inventory": {
"name": "stalker_seller_inventory",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"run_id": {
"name": "run_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"seller_id": {
"name": "seller_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"asin": {
"name": "asin",
"type": "text",
"primaryKey": false,
"notNull": true
},
"can_sell": {
"name": "can_sell",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"sellability_status": {
"name": "sellability_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sellability_reason": {
"name": "sellability_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"product_title": {
"name": "product_title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"brand": {
"name": "brand",
"type": "text",
"primaryKey": false,
"notNull": false
},
"category_tree": {
"name": "category_tree",
"type": "text",
"primaryKey": false,
"notNull": false
},
"current_price": {
"name": "current_price",
"type": "real",
"primaryKey": false,
"notNull": false
},
"avg_price_90d": {
"name": "avg_price_90d",
"type": "real",
"primaryKey": false,
"notNull": false
},
"sales_rank": {
"name": "sales_rank",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"monthly_sold": {
"name": "monthly_sold",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"seller_count": {
"name": "seller_count",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"amazon_is_seller": {
"name": "amazon_is_seller",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"raw_product_json": {
"name": "raw_product_json",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_seen_at": {
"name": "last_seen_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"raw_inventory_json": {
"name": "raw_inventory_json",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"idx_stalker_inventory_seller_id": {
"name": "idx_stalker_inventory_seller_id",
"columns": [
{
"expression": "seller_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_stalker_inventory_asin": {
"name": "idx_stalker_inventory_asin",
"columns": [
{
"expression": "asin",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_stalker_inventory_product_title": {
"name": "idx_stalker_inventory_product_title",
"columns": [
{
"expression": "product_title",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"stalker_seller_inventory_run_id_stalker_runs_id_fk": {
"name": "stalker_seller_inventory_run_id_stalker_runs_id_fk",
"tableFrom": "stalker_seller_inventory",
"tableTo": "stalker_runs",
"columnsFrom": [
"run_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"stalker_seller_inventory_seller_id_sellers_seller_id_fk": {
"name": "stalker_seller_inventory_seller_id_sellers_seller_id_fk",
"tableFrom": "stalker_seller_inventory",
"tableTo": "sellers",
"columnsFrom": [
"seller_id"
],
"columnsTo": [
"seller_id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"uq_stalker_inventory_run_seller_asin": {
"name": "uq_stalker_inventory_run_seller_asin",
"nullsNotDistinct": false,
"columns": [
"run_id",
"seller_id",
"asin"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
"public.run_status": {
"name": "run_status",
"schema": "public",
"values": [
"running",
"ok",
"empty",
"failed",
"completed"
]
},
"public.run_type": {
"name": "run_type",
"schema": "public",
"values": [
"lead_analysis",
"category_analysis",
"supplier_upc",
"stalker"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}