diff --git a/auto-bid-admin/src/pages/bids.tsx b/auto-bid-admin/src/pages/bids.tsx index a07fc15..b8de9b2 100644 --- a/auto-bid-admin/src/pages/bids.tsx +++ b/auto-bid-admin/src/pages/bids.tsx @@ -24,6 +24,11 @@ export default function Bids() { const [openedBid, bidModal] = useDisclosure(false); const columns: IColumn[] = [ + { + key: 'id', + title: 'ID', + typeFilter: 'number', + }, { key: 'name', title: 'Name', diff --git a/auto-bid-server/bot-data/metadata.json b/auto-bid-server/bot-data/metadata.json index e49ae4f..3dedfb9 100644 --- a/auto-bid-server/bot-data/metadata.json +++ b/auto-bid-server/bot-data/metadata.json @@ -1 +1 @@ -{"createdAt":1744361020595} \ No newline at end of file +{"createdAt":1744420823691} \ No newline at end of file diff --git a/auto-bid-server/src/modules/bids/services/mail/imap.service.ts b/auto-bid-server/src/modules/bids/services/mail/imap.service.ts index bca5581..555f628 100644 --- a/auto-bid-server/src/modules/bids/services/mail/imap.service.ts +++ b/auto-bid-server/src/modules/bids/services/mail/imap.service.ts @@ -35,6 +35,8 @@ export class ImapService { tls: true, tlsOptions: { rejectUnauthorized: false }, }); + + console.log(this.configService.get('MAIL_USER')); } async connectIMAP() { diff --git a/auto-bid-tool/models/langtons.com.au/langtons-product-bid.js b/auto-bid-tool/models/langtons.com.au/langtons-product-bid.js index 2c1cc55..118a21b 100644 --- a/auto-bid-tool/models/langtons.com.au/langtons-product-bid.js +++ b/auto-bid-tool/models/langtons.com.au/langtons-product-bid.js @@ -4,7 +4,7 @@ import { sendMessage } from '../../system/apis/notification.js'; import { createOutBidLog } from '../../system/apis/out-bid-log.js'; import configs from '../../system/config.js'; import CONSTANTS from '../../system/constants.js'; -import { convertAETtoUTC, removeFalsyValues, takeSnapshot } from '../../system/utils.js'; +import { convertAETtoUTC, isTimeReached, removeFalsyValues, takeSnapshot } from '../../system/utils.js'; import { ProductBid } from '../product-bid.js'; export class LangtonsProductBid extends ProductBid { @@ -24,9 +24,9 @@ export class LangtonsProductBid extends ProductBid { return el ? el.innerText : null; }); - return time ? convertAETtoUTC(time) : null; + // return time ? convertAETtoUTC(time) : null; - // return new Date(Date.now() + 2 * 60 * 1000).toUTCString(); + return new Date(Date.now() + 6 * 60 * 1000).toUTCString(); } catch (error) { // Nếu có lỗi xảy ra trong quá trình lấy thời gian, trả về null return null; @@ -121,12 +121,12 @@ export class LangtonsProductBid extends ProductBid { lot_id: result?.lotId || null, reserve_price: result.lotData?.minimumBid || null, current_price: result.lotData?.currentMaxBid || null, - // close_time: close_time && !this.close_time ? String(close_time) : null, - close_time: close_time ? String(close_time) : null, + close_time: close_time && !this.close_time ? String(close_time) : null, + // close_time: close_time ? String(close_time) : null, name, }, - // [], - ['close_time'], + [], + // ['close_time'], ); console.log(`🚀 [${this.id}] Processed data ready for update`); @@ -184,6 +184,12 @@ export class LangtonsProductBid extends ProductBid { return; // Dừng hàm nếu giá đã vượt qua giới hạn } + // Kiểm tra thời gian bid + if (this.start_bid_time && !isTimeReached(this.start_bid_time)) { + console.log(`⏳ [${this.id}] Not yet time to bid. Skipping Product: ${this.name || 'None'}`); + return; + } + // Đợi phản hồi từ API const response = await this.waitForApiResponse(); @@ -357,7 +363,7 @@ export class LangtonsProductBid extends ProductBid { } } - if (lotData.myBid && this.max_price != lotData.myBid) { + if (lotData.myBid && this.max_price && this.max_price != lotData.myBid) { this.handlePlaceBid(); } } catch (error) {