Deploy to Staging #9

Merged
zelda merged 5 commits from main into staging 2025-04-14 12:24:26 +10:00
4 changed files with 22 additions and 9 deletions
Showing only changes of commit bd55531c46 - Show all commits

View File

@ -24,6 +24,11 @@ export default function Bids() {
const [openedBid, bidModal] = useDisclosure(false); const [openedBid, bidModal] = useDisclosure(false);
const columns: IColumn<IBid>[] = [ const columns: IColumn<IBid>[] = [
{
key: 'id',
title: 'ID',
typeFilter: 'number',
},
{ {
key: 'name', key: 'name',
title: 'Name', title: 'Name',

View File

@ -1 +1 @@
{"createdAt":1744361020595} {"createdAt":1744420823691}

View File

@ -35,6 +35,8 @@ export class ImapService {
tls: true, tls: true,
tlsOptions: { rejectUnauthorized: false }, tlsOptions: { rejectUnauthorized: false },
}); });
console.log(this.configService.get<string>('MAIL_USER'));
} }
async connectIMAP() { async connectIMAP() {

View File

@ -4,7 +4,7 @@ import { sendMessage } from '../../system/apis/notification.js';
import { createOutBidLog } from '../../system/apis/out-bid-log.js'; import { createOutBidLog } from '../../system/apis/out-bid-log.js';
import configs from '../../system/config.js'; import configs from '../../system/config.js';
import CONSTANTS from '../../system/constants.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'; import { ProductBid } from '../product-bid.js';
export class LangtonsProductBid extends ProductBid { export class LangtonsProductBid extends ProductBid {
@ -24,9 +24,9 @@ export class LangtonsProductBid extends ProductBid {
return el ? el.innerText : null; 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) { } catch (error) {
// Nếu có lỗi xảy ra trong quá trình lấy thời gian, trả về null // Nếu có lỗi xảy ra trong quá trình lấy thời gian, trả về null
return null; return null;
@ -121,12 +121,12 @@ export class LangtonsProductBid extends ProductBid {
lot_id: result?.lotId || null, lot_id: result?.lotId || null,
reserve_price: result.lotData?.minimumBid || null, reserve_price: result.lotData?.minimumBid || null,
current_price: result.lotData?.currentMaxBid || null, current_price: result.lotData?.currentMaxBid || null,
// close_time: close_time && !this.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, // close_time: close_time ? String(close_time) : null,
name, name,
}, },
// [], [],
['close_time'], // ['close_time'],
); );
console.log(`🚀 [${this.id}] Processed data ready for update`); 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 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 // Đợi phản hồi từ API
const response = await this.waitForApiResponse(); 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(); this.handlePlaceBid();
} }
} catch (error) { } catch (error) {