Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:\Users\hp\.m2\repository\org\openjfx\javafx-controls\17.0.11\javafx-controls-17.0.11.jar;C:\Users\hp\.m2\repository\org\openjfx\javafx-controls\17.0.11\javafx-controls-17.0.11-win.jar;C:\Users\hp\.m2\repository\org\openjfx\javafx-graphics\17.0.11\javafx-graphics-17.0.11.jar;C:\Users\hp\.m2\repository\org\openjfx\javafx-graphics\17.0.11\javafx-graphics-17.0.11-win.jar;C:\Users\hp\.m2\repository\org\openjfx\javafx-base\17.0.11\javafx-base-17.0.11.jar;C:\Users\hp\.m2\repository\org\openjfx\javafx-base\17.0.11\javafx-base-17.0.11-win.jar;C:\Users\hp\.m2\repository\org\openjfx\javafx-fxml\17.0.11\javafx-fxml-17.0.11.jar;C:\Users\hp\.m2\repository\org\openjfx\javafx-fxml\17.0.11\javafx-fxml-17.0.11-win.jar;C:\Users\hp\.m2\repository\org\xerial\sqlite-jdbc\3.45.1.0\sqlite-jdbc-3.45.1.0.jar;C:\Users\hp\.m2\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;C:\Users\hp\.m2\repository\io\github\mkpaz\atlantafx-base\2.0.1\atlantafx-base-2.0.1.jar;C:\Users\hp\.m2\repository\org\kordamp\ikonli\ikonli-javafx\12.3.1\ikonli-javafx-12.3.1.jar;C:\Users\hp\.m2\repository\org\kordamp\ikonli\ikonli-core\12.3.1\ikonli-core-12.3.1.jar;C:\Users\hp\.m2\repository\org\kordamp\ikonli\ikonli-fontawesome5-pack\12.3.1\ikonli-fontawesome5-pack-12.3.1.jar
Binary file modified data/auction.db.sqlite
Binary file not shown.
Binary file added data/auction.db.sqlite.bak.1779786816486
Binary file not shown.
Binary file added data/auction.db.sqlite.bak.1779786866193
Binary file not shown.
Binary file added data/auction.db.sqlite.bak.1779786916380
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions docs/M2_demo_plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# M2 Demo Plan — RTDAS

Goal: record a 4–7 minute demo showing the stable gallery→detail→bid flow, connection-loss handling, and high-concurrency behavior.

Segments:
- Intro (20s): one-sentence problem statement and what's being shown.
- Start server + client (30s): show terminal commands to start server and client. Use existing VS Code task `Run RTDAS Server` for server.
- Gallery (60s): show category filter, sort, refresh, and open an auction detail (hero image).
- Auction Detail (90s): show server-time countdown, bid-history refresh, place a bid, and show immediate UI updates.
- Connection loss (45s): simulate network loss (stop server), show reconnect banner, then restart server and show recovery.
- High-concurrency note (30s): mention stress test results and show test summary output (console). Optionally play a short snippet of test run output.
- Wrap-up (20s): call-to-action, PR link, and where code lives.

Prep checklist:
- [ ] Ensure branch `task/member2` is pushed and tests pass locally.
- [ ] Close other apps that may show notifications.
- [ ] Set screen recording to 1920x1080, 30fps, 1280kbps audio.
- [ ] Have terminal and app windows sized for readability.

Recording commands (PowerShell) — start server:
```powershell
$root = 'd:\Real Time Distributed Auction System\Real-Time-Distributed-Auction-System'
Set-Location $root
mvn -DskipTests compile exec:java
```

Recording commands — run targeted tests (optional clip):
```powershell
Set-Location $root
mvn -Dtest=com.auction.stress.ConcurrentBiddingHighStressTest test
```

How to simulate connection loss during demo:
- In the server terminal, press Ctrl+C to stop the server; wait to show the reconnect banner on the client.
- Restart server with the same command and show the client auto-reconnect.

Deliverables I will produce if you want:
- `docs/M2_demo_plan.md` (this file)
- `scripts/record_demo.ps1` — helper to start server/test runs
- Short script/narration lines for each segment (ready-to-read)

Next step: tell me which deliverables you want me to create now (script, narration, or attempt to start server for a recording rehearsal).
9 changes: 9 additions & 0 deletions exports/my_auctions_export.csv
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
AuctionID,Title,Category,StartingPrice,FinalPrice,Winner,Status,StartTime,EndTime
1,Vintage Camera,Electronics,100.0,105.0,bek1234,SOLD,2026-05-26T19:53:00Z,2026-05-26T19:58:00Z
2,Smart Watch,Wearbles,1000.0,1000.0,,CANCELLED,2026-05-26T20:15:00Z,2026-05-26T20:20:00Z
3,Handmade Oak Dining Table,Furniture,150.0,170.0,bek1234,SOLD,2026-05-27T15:02:00Z,2026-05-27T15:06:08.798246900Z
4,Handcrafted Acoustic Guitar — Solid Spruce Top,Musical Instruments,150.0,160.0,bekam1234,SOLD,2026-05-27T15:42:00Z,2026-05-27T15:46:00Z
5,Vintage Leica III,Electronics,500.0,640.0,bekam1234,SOLD,2026-05-27T19:41:00Z,2026-05-27T19:45:28.284658700Z
6,Handmade Patchwork Quilt,Furniture,200.0,340.0,bek1234,SOLD,2026-05-27T21:11:00Z,2026-05-27T21:16:14.465744500Z
7,Signed First Edition,Art,1200.0,1280.0,bekam1234,SOLD,2026-05-27T22:16:59.510155500Z,2026-05-27T22:19:59.510155500Z
8,Antique Oak Side Table,Furniture,350.0,435.45,bek1234,SOLD,2026-05-28T00:31:00Z,2026-05-28T00:37:00Z
9,Limited Print Poster,Art,8000.0,9000.0,bekam1234,SOLD,2026-05-28T00:34:07.295512800Z,2026-05-28T00:38:08.008908700Z
13 changes: 13 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- JavaFX Swing bridge for tests (JFXPanel) -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>${javafx.version}</version>
<scope>test</scope>
</dependency>
<!-- AtlantaFX for modern styling -->
<dependency>
<groupId>io.github.mkpaz</groupId>
Expand All @@ -64,6 +71,12 @@
<artifactId>ikonli-fontawesome5-pack</artifactId>
<version>12.3.1</version>
</dependency>
<!-- AVIF reader for user-uploaded images -->
<dependency>
<groupId>io.github.nemanjastokuca</groupId>
<artifactId>avif-imageio-native-reader</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>

<build>
Expand Down
32 changes: 32 additions & 0 deletions sample_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
BEGIN TRANSACTION;

-- Users (simple hashes for local testing)
INSERT OR IGNORE INTO users (username, password_hash, role, created_at) VALUES
('seller2','5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8','USER','2026-05-01T00:00:00Z'),
('seller3','5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8','USER','2026-05-01T00:00:00Z'),
('seller4','5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8','USER','2026-05-01T00:00:00Z'),
('seller5','5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8','USER','2026-05-01T00:00:00Z'),
('bidder11','5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8','USER','2026-05-10T00:00:00Z'),
('bidder12','5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8','USER','2026-05-10T00:00:00Z'),
('bidder21','5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8','USER','2026-05-15T00:00:00Z'),
('bidder31','5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8','USER','2026-05-20T00:00:00Z');

-- Auction items with `category` using enum names (ELECTRONICS, FURNITURE, ART, OTHER)
INSERT OR REPLACE INTO auction_items (id, title, description, category, starting_price_cents, current_bid_cents, highest_bidder_username, seller_username, start_time, end_time, cap_end_time, status, img1, img2, img3, relisted_from) VALUES
(101, 'Vintage Leica III', 'Classic rangefinder, needs CLA', 'ELECTRONICS', 50000, 65000, 'bidder11', 'seller2', '2026-05-01T09:00:00Z', '2026-06-01T12:00:00Z', '2026-06-01T12:00:00Z', 'ACTIVE', NULL, NULL, NULL, NULL),
(102, 'Handmade Patchwork Quilt', 'Queen size, hand-stitched', 'FURNITURE', 20000, 0, NULL, 'seller3', '2026-06-10T10:00:00Z', '2026-06-17T18:00:00Z', '2026-06-17T18:10:00Z', 'SCHEDULED', NULL, NULL, NULL, NULL),
(103, 'Signed First Edition', 'Hardcover, excellent', 'ART', 120000, 150000, 'bidder21', 'seller4', '2026-05-20T08:00:00Z', '2026-05-30T20:00:00Z', '2026-05-30T20:00:00Z', 'ACTIVE', NULL, NULL, NULL, NULL),
(104, 'Antique Oak Side Table', 'Restored, small blemish', 'FURNITURE', 30000, 45000, 'bidder31', 'seller5', '2026-04-01T08:00:00Z', '2026-04-07T20:00:00Z', '2026-04-07T20:00:00Z', 'SOLD', NULL, NULL, NULL, NULL),
(105, 'Limited Print Poster', 'Framed, 24x36', 'ART', 8000, 9500, 'bidder31', 'seller2', '2026-05-25T12:00:00Z', '2026-06-05T22:00:00Z', '2026-06-05T22:05:00Z', 'ACTIVE', NULL, NULL, NULL, NULL),
(106, 'Handcrafted Ceramic Vase', 'Artist-signed, small chip near base', 'OTHER', 6000, 7000, 'bidder12', 'seller3', '2026-06-01T09:00:00Z', '2026-06-08T17:00:00Z', '2026-06-08T17:00:00Z', 'SCHEDULED', NULL, NULL, NULL, NULL);

-- Recent bids (explicit ids)
INSERT OR REPLACE INTO bids (id, auction_item_id, bidder_username, amount_cents, timestamp) VALUES
(1001, 101, 'bidder11', 65000, '2026-05-26T14:02:10Z'),
(1002, 101, 'bidder12', 64000, '2026-05-26T13:55:05Z'),
(1003, 103, 'bidder21', 150000, '2026-05-25T09:10:30Z'),
(1004, 105, 'bidder31', 9500, '2026-05-26T10:22:00Z'),
(1005, 105, 'bidder12', 9200, '2026-05-26T09:50:12Z'),
(1006, 104, 'bidder31', 45000, '2026-04-07T20:00:00Z');

COMMIT;
20 changes: 20 additions & 0 deletions scripts/record_demo.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env pwsh
# Helper script to start server and optionally run a stress test for recording.

param(
[switch] $RunStressTest
)

$root = "d:\Real Time Distributed Auction System\Real-Time-Distributed-Auction-System"
Set-Location $root

Write-Host "Starting server (logs will stream)..."
Start-Process -NoNewWindow -FilePath "mvn" -ArgumentList "-DskipTests","compile","exec:java" -WorkingDirectory $root

if ($RunStressTest) {
Write-Host "Waiting 2s then running stress test (will print results)..."
Start-Sleep -Seconds 2
mvn -Dtest=com.auction.stress.ConcurrentBiddingHighStressTest test
}

Write-Host "Server started. Use your client to demo flows. Ctrl+C in this console will not stop the started process (find java process to stop)."
38 changes: 38 additions & 0 deletions server_sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
src\main\java\com\auction\server\core\AuctionManager.java
src\main\java\com\auction\server\core\ImageStore.java
src\main\java\com\auction\server\core\LifecycleManager.java
src\main\java\com\auction\server\core\LockManager.java
src\main\java\com\auction\server\core\ServerBootstrap.java
src\main\java\com\auction\server\core\ServerLauncher.java
src\main\java\com\auction\server\core\SessionContext.java
src\main\java\com\auction\server\core\TransactionManager.java
src\main\java\com\auction\server\core\UdpBroadcaster.java
src\main\java\com\auction\server\core\logging\AsyncLogger.java
src\main\java\com\auction\server\core\logging\EventType.java
src\main\java\com\auction\server\core\logging\LogCategory.java
src\main\java\com\auction\server\core\logging\LogEntry.java
src\main\java\com\auction\server\repository\AuctionRepository.java
src\main\java\com\auction\server\repository\BidRepository.java
src\main\java\com\auction\server\repository\DatabaseManager.java
src\main\java\com\auction\server\repository\UserRepository.java
src\main\java\com\auction\server\service\AuctionReaper.java
src\main\java\com\auction\server\service\AuctionServiceImpl.java
src\main\java\com\auction\server\util\AuditLogger.java
src\main\java\com\auction\server\util\SecurityUtil.java
src\main\java\com\auction\shared\Constants.java
src\main\java\com\auction\shared\enums\AuctionStatus.java
src\main\java\com\auction\shared\enums\Category.java
src\main\java\com\auction\shared\exceptions\AuctionClosedException.java
src\main\java\com\auction\shared\exceptions\AuctionException.java
src\main\java\com\auction\shared\exceptions\DuplicateBidException.java
src\main\java\com\auction\shared\exceptions\InsufficientBidException.java
src\main\java\com\auction\shared\exceptions\RateLimitedException.java
src\main\java\com\auction\shared\exceptions\SelfBidException.java
src\main\java\com\auction\shared\exceptions\SnipeCapReachedException.java
src\main\java\com\auction\shared\exceptions\StaleDataException.java
src\main\java\com\auction\shared\exceptions\UnauthorizedException.java
src\main\java\com\auction\shared\interfaces\IAuctionService.java
src\main\java\com\auction\shared\models\Admin.java
src\main\java\com\auction\shared\models\AuctionItem.java
src\main\java\com\auction\shared\models\Bid.java
src\main\java\com\auction\shared\models\User.java
59 changes: 59 additions & 0 deletions sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
src\main\java\com\auction\ApplicationInfo.java
src\main\java\com\auction\TestLoad.java
src\main\java\com\auction\client\ClientApp.java
src\main\java\com\auction\client\controllers\AdminPanelController.java
src\main\java\com\auction\client\controllers\AuctionBidHistoryController.java
src\main\java\com\auction\client\controllers\AuctionDetailController.java
src\main\java\com\auction\client\controllers\ConnectController.java
src\main\java\com\auction\client\controllers\GalleryController.java
src\main\java\com\auction\client\controllers\LoginController.java
src\main\java\com\auction\client\controllers\RegistrationController.java
src\main\java\com\auction\client\controllers\UserDashboardController.java
src\main\java\com\auction\client\core\ClientContext.java
src\main\java\com\auction\client\core\ClientLauncher.java
src\main\java\com\auction\client\network\RmiClientProvider.java
src\main\java\com\auction\client\network\UdpDiscoveryClient.java
src\main\java\com\auction\client\service\BidHistoryService.java
src\main\java\com\auction\client\service\PollingService.java
src\main\java\com\auction\client\service\ThumbnailExecutor.java
src\main\java\com\auction\client\ui\ViewLoader.java
src\main\java\com\auction\server\core\AuctionManager.java
src\main\java\com\auction\server\core\ImageStore.java
src\main\java\com\auction\server\core\LifecycleManager.java
src\main\java\com\auction\server\core\LockManager.java
src\main\java\com\auction\server\core\ServerBootstrap.java
src\main\java\com\auction\server\core\ServerLauncher.java
src\main\java\com\auction\server\core\SessionContext.java
src\main\java\com\auction\server\core\TransactionManager.java
src\main\java\com\auction\server\core\UdpBroadcaster.java
src\main\java\com\auction\server\core\logging\AsyncLogger.java
src\main\java\com\auction\server\core\logging\EventType.java
src\main\java\com\auction\server\core\logging\LogCategory.java
src\main\java\com\auction\server\core\logging\LogEntry.java
src\main\java\com\auction\server\repository\AuctionRepository.java
src\main\java\com\auction\server\repository\BidRepository.java
src\main\java\com\auction\server\repository\DatabaseManager.java
src\main\java\com\auction\server\repository\UserRepository.java
src\main\java\com\auction\server\service\AuctionReaper.java
src\main\java\com\auction\server\service\AuctionServiceImpl.java
src\main\java\com\auction\server\util\AuditLogger.java
src\main\java\com\auction\server\util\SecurityUtil.java
src\main\java\com\auction\shared\Constants.java
src\main\java\com\auction\shared\enums\AuctionStatus.java
src\main\java\com\auction\shared\enums\Category.java
src\main\java\com\auction\shared\exceptions\AuctionClosedException.java
src\main\java\com\auction\shared\exceptions\AuctionException.java
src\main\java\com\auction\shared\exceptions\DuplicateBidException.java
src\main\java\com\auction\shared\exceptions\InsufficientBidException.java
src\main\java\com\auction\shared\exceptions\RateLimitedException.java
src\main\java\com\auction\shared\exceptions\SelfBidException.java
src\main\java\com\auction\shared\exceptions\SnipeCapReachedException.java
src\main\java\com\auction\shared\exceptions\StaleDataException.java
src\main\java\com\auction\shared\exceptions\UnauthorizedException.java
src\main\java\com\auction\shared\interfaces\IAuctionService.java
src\main\java\com\auction\shared\models\Admin.java
src\main\java\com\auction\shared\models\AuctionItem.java
src\main\java\com\auction\shared\models\Bid.java
src\main\java\com\auction\shared\models\User.java
src\main\java\com\auction\tools\TestRegisterLogin.java
src\main\java\com\auction\tools\UdpDiscoveryListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package com.auction.client.controllers;

import com.auction.client.core.ClientContext;
import com.auction.client.service.BidHistoryService;
import com.auction.shared.models.Bid;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;

public class AuctionBidHistoryController {

@FXML private Label titleLabel;
@FXML private Label subtitleLabel;
@FXML private Label auctionIdLabel;
@FXML private Button backButton;
@FXML private TableView<Bid> bidHistoryTable;
@FXML private TableColumn<Bid, String> timeColumn;
@FXML private TableColumn<Bid, String> userColumn;
@FXML private TableColumn<Bid, Long> amountColumn;
@FXML private Label statusLabel;

@FXML
public void initialize() {
if (timeColumn != null) {
timeColumn.setCellValueFactory(new PropertyValueFactory<>("timestampFormatted"));
}
if (userColumn != null) {
userColumn.setCellValueFactory(new PropertyValueFactory<>("bidderUsername"));
}
if (amountColumn != null) {
amountColumn.setCellValueFactory(new PropertyValueFactory<>("amountCents"));
amountColumn.setCellFactory(col -> new javafx.scene.control.TableCell<Bid, Long>() {
@Override
protected void updateItem(Long value, boolean empty) {
super.updateItem(value, empty);
if (empty || value == null) {
setText(null);
} else {
setText(com.auction.shared.Constants.formatCents(value));
}
}
});
}

int auctionId = ClientContext.getInstance().getCurrentAuctionId();
if (auctionId >= 0) {
if (auctionIdLabel != null) {
auctionIdLabel.setText("Auction #" + auctionId);
}
loadHistory(auctionId);
} else {
if (statusLabel != null) statusLabel.setText("No auction selected.");
}
}

private void loadHistory(int auctionId) {
if (bidHistoryTable != null) {
bidHistoryTable.getItems().clear();
}
Platform.runLater(() -> {
if (statusLabel != null) statusLabel.setText("Loading bid history...");
});

BidHistoryService.loadBidHistoryAsync(auctionId).whenComplete((list, throwable) -> {
if (throwable != null) {
Platform.runLater(() -> {
if (statusLabel != null) statusLabel.setText("Failed to load bid history.");
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Bid History Error");
alert.setHeaderText("Could not load bid history");
alert.setContentText(throwable.getCause() == null ? throwable.getMessage() : throwable.getCause().getMessage());
alert.showAndWait();
});
return;
}

Platform.runLater(() -> {
if (bidHistoryTable != null) {
bidHistoryTable.getItems().setAll(list == null ? java.util.List.of() : list);
}
if (statusLabel != null) {
int size = list == null ? 0 : list.size();
statusLabel.setText(size + (size == 1 ? " bid loaded" : " bids loaded"));
}
});
});
}

@FXML
private void handleRefreshHistory() {
int auctionId = ClientContext.getInstance().getCurrentAuctionId();
if (auctionId >= 0) {
loadHistory(auctionId);
}
}

@FXML
private void handleBackToDetail() {
try {
ClientContext.getInstance().getViewLoader().loadView("auction_detail.fxml");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
Loading
Loading