diff --git a/README.md b/README.md index a369d48..486dc49 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ mvn exec:java -Dexec.mainClass="com.auction.scraper.TroostwijkScraper" ▼ ┌──────────────────┐ │ SQLITE DATABASE │ - │ troostwijk.db │ + │ output/cache.db │ └──────────────────┘ │ ┌─────────────────┼─────────────────┐ @@ -329,19 +329,112 @@ mvn exec:java -Dexec.mainClass="com.auction.scraper.TroostwijkScraper" value > threshold] ``` +```mermaid +flowchart TD + subgraph P1["PHASE 1: EXTERNAL SCRAPER (Python/Playwright)"] + direction LR + A1[Listing Pages
/auctions?page=N] --> A2[Extract URLs] + B1[Auction Pages
/a/auction-id] --> B2[Parse __NEXT_DATA__ JSON] + C1[Lot Pages
/l/lot-id] --> C2[Parse __NEXT_DATA__ JSON] + A2 --> D1[INSERT auctions to SQLite] + B2 --> D1 + C2 --> D2[INSERT lots & image URLs] + + D1 --> DB[(SQLite Database
output/cache.db)] + D2 --> DB + end + + DB --> P2_Entry + + subgraph P2["PHASE 2: MONITORING & PROCESSING (Java)"] + direction TB + P2_Entry[Data Ready] --> Monitor[TroostwijkMonitor
Read lots every hour] + P2_Entry --> DBService[DatabaseService
Query & Import] + P2_Entry --> Adapter[ScraperDataAdapter
Transform TEXT → INTEGER] + + Monitor --> BM[Bid Monitoring
Check API every 1h] + DBService --> IP[Image Processing
Download & Analyze] + Adapter --> DataForNotify[Formatted Data] + + BM --> BidUpdate{New bid?} + BidUpdate -->|Yes| UpdateDB[Update current_bid in DB] + UpdateDB --> NotifyTrigger1 + + IP --> Detection[Object Detection
YOLO/OpenCV DNN] + Detection --> ObjectCheck{Detect objects?} + ObjectCheck -->|Vehicle| Save1[Save labels & estimate value] + ObjectCheck -->|Furniture| Save2[Save labels & estimate value] + ObjectCheck -->|Machinery| Save3[Save labels & estimate value] + Save1 --> NotifyTrigger2 + Save2 --> NotifyTrigger2 + Save3 --> NotifyTrigger2 + + CA[Closing Alerts
Check < 5 min] --> TimeCheck{Time critical?} + TimeCheck -->|Yes| NotifyTrigger3 + end + + NotifyTrigger1 --> NS + NotifyTrigger2 --> NS + NotifyTrigger3 --> NS + + subgraph P3["PHASE 3: NOTIFICATION SYSTEM"] + NS[NotificationService] --> DN[Desktop Notify
Windows/macOS/Linux] + NS --> EN[Email Notify
Gmail SMTP] + NS --> PL[Set Priority Level
0=Normal, 1=High] + end + + DN --> UI[User Interaction & Decisions] + EN --> UI + PL --> UI + + subgraph UI_Details[User Decision Points / Trigger Events] + direction LR + E1["1. BID CHANGE
'Nieuw bod op kavel 12345...'
Actions: Place bid? Monitor? Ignore?"] + E2["2. OBJECT DETECTED
'Lot contains: Vehicle...'
Actions: Review? Confirm value?"] + E3["3. CLOSING ALERT
'Kavel 12345 sluit binnen 5 min.'
Actions: Place final bid? Let expire?"] + E4["4. VIEWING DAY QUESTIONS
'Bezichtiging op [date]...'"] + E5["5. ITEM RECOGNITION CONFIRMATION
'Detected: [object]...'"] + E6["6. VALUE ESTIMATE APPROVAL
'Geschatte waarde: €X...'"] + E7["7. EXCEPTION HANDLING
'Afwijkende sluitingstijd...'"] + end + + UI --> UI_Details + + %% Object Detection Sub-Flow Detail + subgraph P2_Detail["Object Detection & Value Estimation Pipeline"] + direction LR + DI[Downloaded Image] --> IPS[ImageProcessingService] + IPS --> ODS[ObjectDetectionService] + ODS --> Load[Load YOLO model] + ODS --> Run[Run inference] + ODS --> Post[Post-process detections
confidence > 0.5] + Post --> ObjList["Detected Objects List
(80 COCO classes)"] + ObjList --> VEL[Value Estimation Logic
Future enhancement] + VEL --> Match[Match to categories] + VEL --> History[Historical price analysis] + VEL --> Condition[Condition assessment] + VEL --> Market[Market trends] + Market --> ValueEst["Estimated Value Range
Confidence: 75%"] + ValueEst --> SaveToDB[Save to Database] + SaveToDB --> TriggerNotify{Value > threshold?} + end + + IP -.-> P2_Detail + TriggerNotify -.-> NotifyTrigger2 +``` ## Integration Hooks & Timing -| Event | Frequency | Trigger | Notification Type | User Action Required | -|-------|-----------|---------|-------------------|---------------------| -| **New auction discovered** | On scrape | Scraper finds new auction | Desktop + Email (optional) | Review auction | -| **Bid change detected** | Every 1 hour | Monitor detects higher bid | Desktop + Email | Place counter-bid? | -| **Closing soon (< 30 min)** | When detected | Time-based check | Desktop + Email | Review lot | -| **Closing imminent (< 5 min)** | When detected | Time-based check | Desktop + Email (HIGH) | Final bid decision | -| **Object detected** | On image process | YOLO finds objects | Desktop + Email | Confirm identification | -| **Value estimated** | After detection | Estimation complete | Desktop + Email | Approve estimate | -| **Viewing day scheduled** | From lot metadata | Scraper extracts date | Desktop + Email | Confirm attendance | -| **Exception/Change** | On update | Scraper detects change | Desktop + Email (HIGH) | Acknowledge | +| Event | Frequency | Trigger | Notification Type | User Action Required | +|--------------------------------|-------------------|----------------------------|----------------------------|------------------------| +| **New auction discovered** | On scrape | Scraper finds new auction | Desktop + Email (optional) | Review auction | +| **Bid change detected** | Every 1 hour | Monitor detects higher bid | Desktop + Email | Place counter-bid? | +| **Closing soon (< 30 min)** | When detected | Time-based check | Desktop + Email | Review lot | +| **Closing imminent (< 5 min)** | When detected | Time-based check | Desktop + Email (HIGH) | Final bid decision | +| **Object detected** | On image process | YOLO finds objects | Desktop + Email | Confirm identification | +| **Value estimated** | After detection | Estimation complete | Desktop + Email | Approve estimate | +| **Viewing day scheduled** | From lot metadata | Scraper extracts date | Desktop + Email | Confirm attendance | +| **Exception/Change** | On update | Scraper detects change | Desktop + Email (HIGH) | Acknowledge | ## Project Structure diff --git a/src/main/java/auctiora/AuctionMonitorResource.java b/src/main/java/auctiora/AuctionMonitorResource.java index f01e143..0d4ae65 100644 --- a/src/main/java/auctiora/AuctionMonitorResource.java +++ b/src/main/java/auctiora/AuctionMonitorResource.java @@ -6,9 +6,15 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import org.jboss.logging.Logger; +import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; - +import java.util.stream.Collectors; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.stream.Collectors; /** * REST API for Auction Monitor control and status. * Provides endpoints for: @@ -359,4 +365,170 @@ public class AuctionMonitorResource { .build(); } } + /** + * GET /api/monitor/charts/country-distribution + * Returns dynamic country distribution for charts + */ + @GET + @Path("/charts/country-distribution") + public Response getCountryDistribution() { + try { + var auctions = db.getAllAuctions(); + Map distribution = auctions.stream() + .filter(a -> a.country() != null && !a.country().isEmpty()) + .collect(Collectors.groupingBy( + AuctionInfo::country, + Collectors.counting() + )); + + return Response.ok(distribution).build(); + } catch (Exception e) { + LOG.error("Failed to get country distribution", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(Map.of("error", e.getMessage())) + .build(); + } + } + + /** + * GET /api/monitor/charts/category-distribution + * Returns dynamic category distribution for charts + */ + @GET + @Path("/charts/category-distribution") + public Response getCategoryDistribution() { + try { + var lots = db.getAllLots(); + Map distribution = lots.stream() + .filter(l -> l.category() != null && !l.category().isEmpty()) + .collect(Collectors.groupingBy( + l -> l.category().length() > 20 ? l.category().substring(0, 20) + "..." : l.category(), + Collectors.counting() + )); + + return Response.ok(distribution).build(); + } catch (Exception e) { + LOG.error("Failed to get category distribution", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(Map.of("error", e.getMessage())) + .build(); + } + } + + /** + * GET /api/monitor/charts/bidding-trend + * Returns time series data for last N hours + */ + @GET + @Path("/charts/bidding-trend") + public Response getBiddingTrend(@QueryParam("hours") @DefaultValue("24") int hours) { + try { + var lots = db.getAllLots(); + Map trends = new HashMap<>(); + + // Initialize hours + LocalDateTime now = LocalDateTime.now(); + for (int i = hours - 1; i >= 0; i--) { + LocalDateTime hour = now.minusHours(i); + int hourKey = hour.getHour(); + trends.put(hourKey, new TrendHour(hourKey, 0, 0)); + } + + // Count lots and bids per hour (mock implementation - in real app, use timestamp data) + // This is a simplified version - you'd need actual timestamps in DB + for (var lot : lots) { + if (lot.closingTime() != null) { + int hour = lot.closingTime().getHour(); + TrendHour trend = trends.getOrDefault(hour, new TrendHour(hour, 0, 0)); + trend.lots++; + if (lot.currentBid() > 0) trend.bids++; + } + } + + return Response.ok(trends.values()).build(); + } catch (Exception e) { + LOG.error("Failed to get bidding trend", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(Map.of("error", e.getMessage())) + .build(); + } + } + + /** + * GET /api/monitor/charts/insights + * Returns intelligent insights + */ + @GET + @Path("/charts/insights") + public Response getInsights() { + try { + var lots = db.getAllLots(); + var auctions = db.getAllAuctions(); + + List> insights = new ArrayList<>(); + + // Calculate insights + long criticalCount = lots.stream().filter(l -> l.minutesUntilClose() < 30).count(); + if (criticalCount > 10) { + insights.add(Map.of( + "icon", "fa-exclamation-circle", + "title", criticalCount + " lots closing soon", + "description", "High urgency items require attention" + )); + } + + double bidRate = lots.stream().filter(l -> l.currentBid() > 0).count() * 100.0 / lots.size(); + if (bidRate > 60) { + insights.add(Map.of( + "icon", "fa-chart-line", + "title", String.format("%.1f%% bid rate", bidRate), + "description", "Strong market engagement detected" + )); + } + + long imageCoverage = db.getImageCount() * 100 / Math.max(lots.size(), 1); + if (imageCoverage < 80) { + insights.add(Map.of( + "icon", "fa-images", + "title", imageCoverage + "% image coverage", + "description", "Consider processing more images" + )); + } + + // Add geographic insight + String topCountry = auctions.stream() + .collect(Collectors.groupingBy(AuctionInfo::country, Collectors.counting())) + .entrySet().stream() + .max(Map.Entry.comparingByValue()) + .map(Map.Entry::getKey) + .orElse("N/A"); + + insights.add(Map.of( + "icon", "fa-globe", + "title", topCountry + " leading", + "description", "Top performing country" + )); + + return Response.ok(insights).build(); + } catch (Exception e) { + LOG.error("Failed to get insights", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(Map.of("error", e.getMessage())) + .build(); + } + } + + // Helper class for trend data + public static class TrendHour { + + public int hour; + public int lots; + public int bids; + + public TrendHour(int hour, int lots, int bids) { + this.hour = hour; + this.lots = lots; + this.bids = bids; + } + } } diff --git a/src/main/resources/META-INF/resources/index.html b/src/main/resources/META-INF/resources/index.html index 0746686..dda3d0f 100644 --- a/src/main/resources/META-INF/resources/index.html +++ b/src/main/resources/META-INF/resources/index.html @@ -3,222 +3,1397 @@ - Scrape-UI 1 - Enterprise + Auctiora - Intelligence Dashboard + + + - -
-
-

Scrape-UI Enterprise

-

Powered by Quarkus + Modern Frontend

-
-
+ +
- -
- - -
-

Build & Runtime Status

-
-
- -
-

📦 Maven Build

-
-
- Group: - - -
-
- Artifact: - - -
-
- Version: - - -
-
-
- - -
-

🚀 Runtime

-
-
- Status: - - -
-
- Java: - - -
-
- Platform: - - -
-
-
+ +
+
+
+
+

+ + Auctiora Intelligence Dashboard +

+

Real-time Auction Analytics & Predictive Monitoring

- - -
-
-
-

Last Updated

-

-

-
- +
- - -
-

API Test

- -
-
Click the button to test the API
+
+ + +
+ +
+
+
+
+
Active Auctions
+
+ +
+
+ -- +
+
+
+ +
+
+
+ +
+
+
+
Total Lots
+
+ +
+
+ -- +
+
+
+ +
+
+
+ +
+
+
+
Image Assets
+
+ +
+
+ -- +
+
+
+ +
+
+
+ +
+
+
+
Active Bidding
+
+ +
+
+ -- +
+
+
+ +
+
+
+ +
+
+
+
Closing Soon
+
+ +
+
+ -- +
+
+
+ +
+
- -
-
-

⚡ Quarkus Backend

-

Fast startup, low memory footprint, optimized for containers

+ +
+
+ +

Live Insights

-
-

🚀 REST API

-

RESTful endpoints with JSON responses

+
+
+ Loading insights... +
-
-

🎨 Modern UI

-

Responsive design with Tailwind CSS

+
+ + +
+
+
+

+ + Bidding Intelligence +

+
+ + -- lots/hour +
+
+
+
+
Lots with Bids
+
+ +
+
--% conversion
+
+
+
Total Bid Value
+
+ +
+
--% vs avg
+
+
+
Average Bid
+
+ +
+
--% premium
+
+
+
+ +
+

+ + API Performance +

+
+
+ + Total Requests + + + + +
+
+ + Success Rate + + + + +
+
+ + Failed + + + + +
+
+ + Avg Latency + + + + +
+
+
+
+ + +
+
+

+ + Workflow Orchestration +

+
+ All systems ready +
+
+
+ + + + + + + +
+
+ + +
+ +
+
+

+ + Geographic Distribution +

+
+ Live +
+
+
+
+
+
+
+
+
+
+
--
+
Top Market
+
+
+
--
+
Countries
+
+
+
--
+
Growth
+
+
+
+ + +
+
+

+ + Category Intelligence +

+
+ Live +
+
+
+
+
+
+
+
+
+
+
--
+
Top Category
+
+
+
--
+
Categories
+
+
+
--
+
Avg Bids
+
+
+
+
+ + +
+

+ + Market Activity Trend (Last 24h) +

+
+
+
+
+
+
+
+ + +
+
+

+ + Critical Time Alerts + + -- + +

+
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+ Lot ID + + Title + + Current Bid + + Closing Time + + Time Left + + Actions +
+
+ Loading critical alerts... +
+
+
+
Showing 0 of 0 lots
+ +
+
+ + +
+
+

+ + Activity Intelligence +

+
+ + +
+
+
+
+ + --:-- + Dashboard initialized and monitoring started... +
+
+
+
Last 50 events | Auto-scroll enabled
+
Errors: 0
+ +
+
+
+

+ + Auctiora v2.1 - AI-Powered Auction Intelligence +

+
+ Quarkus + SQLite + Plotly + Tailwind +
+
+

+ Auto-refresh: 15s | + Data age: 0s | + API: Healthy +

+
+
+ - + \ No newline at end of file diff --git a/src/main/resources/META-INF/resources/praetium.html b/src/main/resources/META-INF/resources/praetium.html deleted file mode 100644 index 37ee01f..0000000 --- a/src/main/resources/META-INF/resources/praetium.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - - - Auctiora - Monitoring Dashboard - - - - - - - - -
-
-
-
-

- - Auctiora Monitoring Dashboard -

-

Real-time Auction Data Processing & Monitoring

-
-
-
- - System Online -
-
Last updated: --:--
-
-
-
-
- - -
- - -
-
-
-
-
Auctions
-
--
-
-
- -
-
-
- -
-
-
-
Total Lots
-
--
-
-
- -
-
-
- -
-
-
-
Images
-
--
-
-
- -
-
-
- -
-
-
-
Active Lots
-
--
-
-
- -
-
-
- -
-
-
-
Closing Soon
-
--
-
-
- -
-
-
-
- - -
-
-

- - Bidding Statistics -

-
-
-
Lots with Bids
-
--
-
-
-
Total Bid Value
-
--
-
-
-
Average Bid
-
--
-
-
-
- -
-

- - Rate Limiting -

-
-
- Total Requests - -- -
-
- Successful - -- -
-
- Failed - -- -
-
- Avg Duration - -- -
-
-
-
- - -
-

- - Workflow Controls -

-
- - - - - - - -
-
- - -
- -
-

- - Auctions by Country -

-
-
- - -
-

- - Lots by Category -

-
-
-
- - -
-
-

- - Lots Closing Soon (< 30 min) -

- -
-
- - - - - - - - - - - - - - - - -
Lot IDTitleCurrent BidClosing TimeMinutes LeftActions
Loading...
-
-
- - -
-

- - Activity Log -

-
-
Monitoring system started...
-
-
-
- - -
-
-

- - Auctiora - Auction Data Processing & Monitoring System -

-

- Architecture: Quarkus + SQLite + REST API | Auto-refresh: 15 seconds -

-
-
- - - - diff --git a/src/main/resources/META-INF/resources/status.html b/src/main/resources/META-INF/resources/status.html new file mode 100644 index 0000000..0746686 --- /dev/null +++ b/src/main/resources/META-INF/resources/status.html @@ -0,0 +1,224 @@ + + + + + + Scrape-UI 1 - Enterprise + + + + + +
+
+

Scrape-UI Enterprise

+

Powered by Quarkus + Modern Frontend

+
+
+ + +
+ + +
+

Build & Runtime Status

+
+
+ +
+

📦 Maven Build

+
+
+ Group: + - +
+
+ Artifact: + - +
+
+ Version: + - +
+
+
+ + +
+

🚀 Runtime

+
+
+ Status: + - +
+
+ Java: + - +
+
+ Platform: + - +
+
+
+
+ + +
+
+
+

Last Updated

+

-

+
+ +
+
+
+
+ + +
+

API Test

+ +
+
Click the button to test the API
+
+
+ + +
+
+

⚡ Quarkus Backend

+

Fast startup, low memory footprint, optimized for containers

+
+
+

🚀 REST API

+

RESTful endpoints with JSON responses

+
+
+

🎨 Modern UI

+

Responsive design with Tailwind CSS

+
+
+
+ + + + diff --git a/wiki/EXPERT_ANALITICS.sql b/wiki/EXPERT_ANALITICS.sql new file mode 100644 index 0000000..5d1c58f --- /dev/null +++ b/wiki/EXPERT_ANALITICS.sql @@ -0,0 +1,153 @@ +-- Extend 'lots' table +ALTER TABLE lots + ADD COLUMN starting_bid DECIMAL(12, 2); +ALTER TABLE lots + ADD COLUMN estimated_min DECIMAL(12, 2); +ALTER TABLE lots + ADD COLUMN estimated_max DECIMAL(12, 2); +ALTER TABLE lots + ADD COLUMN reserve_price DECIMAL(12, 2); +ALTER TABLE lots + ADD COLUMN reserve_met BOOLEAN DEFAULT FALSE; +ALTER TABLE lots + ADD COLUMN bid_increment DECIMAL(12, 2); +ALTER TABLE lots + ADD COLUMN watch_count INTEGER DEFAULT 0; +ALTER TABLE lots + ADD COLUMN view_count INTEGER DEFAULT 0; +ALTER TABLE lots + ADD COLUMN first_bid_time TEXT; +ALTER TABLE lots + ADD COLUMN last_bid_time TEXT; +ALTER TABLE lots + ADD COLUMN bid_velocity DECIMAL(5, 2); +-- bids per hour + +-- New table: bid history (CRITICAL) +CREATE TABLE bid_history +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + lot_id TEXT REFERENCES lots (lot_id), + bid_amount DECIMAL(12, 2) NOT NULL, + bid_time TEXT NOT NULL, + is_winning BOOLEAN DEFAULT FALSE, + is_autobid BOOLEAN DEFAULT FALSE, + bidder_id TEXT, -- anonymized + created_at TEXT DEFAULT CURRENT_TIMESTAMP +); + +CREATE INDEX idx_bid_history_lot_time ON bid_history (lot_id, bid_time); +-- Extend 'lots' table +ALTER TABLE lots + ADD COLUMN condition_score DECIMAL(3, 2); -- 0.00-10.00 +ALTER TABLE lots + ADD COLUMN condition_description TEXT; +ALTER TABLE lots + ADD COLUMN year_manufactured INTEGER; +ALTER TABLE lots + ADD COLUMN serial_number TEXT; +ALTER TABLE lots + ADD COLUMN originality_score DECIMAL(3, 2); -- % original parts +ALTER TABLE lots + ADD COLUMN provenance TEXT; +ALTER TABLE lots + ADD COLUMN comparable_lot_ids TEXT; +-- JSON array + +-- New table: comparable sales +CREATE TABLE comparable_sales +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + lot_id TEXT REFERENCES lots (lot_id), + comparable_lot_id TEXT, + similarity_score DECIMAL(3, 2), -- 0.00-1.00 + price_difference_percent DECIMAL(5, 2), + created_at TEXT DEFAULT CURRENT_TIMESTAMP +); + +-- New table: market indices +CREATE TABLE market_indices +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + category TEXT NOT NULL, + manufacturer TEXT, + avg_price DECIMAL(12, 2), + median_price DECIMAL(12, 2), + price_change_30d DECIMAL(5, 2), + volume_change_30d DECIMAL(5, 2), + calculated_at TEXT DEFAULT CURRENT_TIMESTAMP +); +-- Extend 'auctions' table +ALTER TABLE auctions + ADD COLUMN auction_house TEXT; +ALTER TABLE auctions + ADD COLUMN auction_house_rating DECIMAL(3, 2); +ALTER TABLE auctions + ADD COLUMN buyers_premium_percent DECIMAL(5, 2); +ALTER TABLE auctions + ADD COLUMN payment_methods TEXT; -- JSON +ALTER TABLE auctions + ADD COLUMN shipping_cost_min DECIMAL(12, 2); +ALTER TABLE auctions + ADD COLUMN shipping_cost_max DECIMAL(12, 2); +ALTER TABLE auctions + ADD COLUMN seller_verified BOOLEAN DEFAULT FALSE; + +-- New table: auction performance metrics +CREATE TABLE auction_metrics +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + auction_id TEXT REFERENCES auctions (auction_id), + sell_through_rate DECIMAL(5, 2), + avg_hammer_vs_estimate DECIMAL(5, 2), + total_hammer_price DECIMAL(15, 2), + total_starting_price DECIMAL(15, 2), + calculated_at TEXT DEFAULT CURRENT_TIMESTAMP +); + +-- New table: seasonal trends +CREATE TABLE seasonal_trends +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + category TEXT NOT NULL, + month INTEGER NOT NULL, + avg_price_multiplier DECIMAL(4, 2), -- vs annual avg + volume_multiplier DECIMAL(4, 2), + PRIMARY KEY (category, month) +); +-- New table: external market data +CREATE TABLE external_market_data +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + category TEXT NOT NULL, + manufacturer TEXT, + model TEXT, + dealer_avg_price DECIMAL(12, 2), + retail_avg_price DECIMAL(12, 2), + wholesale_avg_price DECIMAL(12, 2), + source TEXT, + fetched_at TEXT DEFAULT CURRENT_TIMESTAMP +); + +-- New table: image analysis results +CREATE TABLE image_analysis +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + image_id INTEGER REFERENCES images (id), + damage_detected BOOLEAN, + damage_severity DECIMAL(3, 2), + wear_level TEXT CHECK (wear_level IN ('EXCELLENT', 'GOOD', 'FAIR', 'POOR')), + estimated_hours_used INTEGER, + ai_confidence DECIMAL(3, 2) +); + +-- New table: economic indicators +CREATE TABLE economic_indicators +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + indicator_date TEXT NOT NULL, + currency TEXT NOT NULL, + exchange_rate DECIMAL(10, 4), + inflation_rate DECIMAL(5, 2), + market_volatility DECIMAL(5, 2) +); diff --git a/wiki/EXPERT_ANALITICS_PRIORITY.md b/wiki/EXPERT_ANALITICS_PRIORITY.md new file mode 100644 index 0000000..9cc35c8 --- /dev/null +++ b/wiki/EXPERT_ANALITICS_PRIORITY.md @@ -0,0 +1,38 @@ +```mermaid +graph TD + A[Add bid_history table] --> B[Add watch_count + estimates] + B --> C[Create market_indices] + C --> D[Add condition + year fields] + D --> E[Build comparable matching] + E --> F[Enrich with auction house data] + F --> G[Add AI image analysis] +``` + +| Current Practice | New Requirement | Why | +|-----------------------|---------------------------------|---------------------------| +| Scrape once per hour | **Scrape every bid update** | Capture velocity & timing | +| Save only current bid | **Save full bid history** | Detect patterns & sniping | +| Ignore watchers | **Track watch\_count** | Predict competition | +| Skip auction metadata | **Capture house estimates** | Anchor valuations | +| No historical data | **Store sold prices** | Train prediction models | +| Basic text scraping | **Parse condition/serial/year** | Enable comparables | + + +```bazaar +Week 1-2: Foundation +Implement bid_history scraping (most critical) +Add watch_count, starting_bid, estimated_min/max fields +Calculate basic bid_velocity +Week 3-4: Valuation +Extract year_manufactured, manufacturer, condition_description +Create market_indices (manually or via external API) +Build comparable lot matching logic +Week 5-6: Intelligence Layer +Add auction house performance tracking +Implement undervaluation detection algorithm +Create price alert system +Week 7-8: Automation +Integrate image analysis API +Add economic indicator tracking +Refine ML-based price predictions +``` \ No newline at end of file