fix: align server deadlines and follow consumers with preparation state
This commit is contained in:
+2
-8
@@ -1,3 +1,4 @@
|
||||
import { deadlineInfo } from '../src/services/tenderCalendar.js';
|
||||
import { exchangeRates } from './exchange-rates.mjs';
|
||||
import { uniqueTenders, announcementFields } from './tender-quality.mjs';
|
||||
/**
|
||||
@@ -152,13 +153,6 @@ const bugunEklenenSayisi = (liste) => {
|
||||
return (liste || []).filter((t) => t.kaynak === 'ilan.gov.tr' && t.ilanTarihi === bugun).length;
|
||||
};
|
||||
|
||||
function daysUntil(ddmmyyyy) {
|
||||
if (!ddmmyyyy) return null;
|
||||
const [d, m, y] = ddmmyyyy.split('.').map(Number);
|
||||
if (!d || !m || !y) return null;
|
||||
return Math.ceil((new Date(y, m - 1, d) - new Date()) / 86400000);
|
||||
}
|
||||
|
||||
// ilan.gov.tr kaydını ihaleist tender modeline çevir
|
||||
function mapAd(ad) {
|
||||
const cityUpper = (ad.addressCityName || '').toLocaleUpperCase('tr-TR');
|
||||
@@ -171,7 +165,7 @@ function mapAd(ad) {
|
||||
const usul = getFilter(ad, 'İhale Usulü') || 'Belirtilmemiş';
|
||||
const ihaleTuru = getFilter(ad, 'İhale Türü') || '';
|
||||
const searchBase = `${ad.title || ''} ${ad.advertiserName || ''}`; // yalnızca arama için
|
||||
const kalanGun = daysUntil(tarih);
|
||||
const kalanGun = deadlineInfo({ tarih }).days;
|
||||
|
||||
let aciliyetBadge = null;
|
||||
if (kalanGun !== null && kalanGun >= 0 && kalanGun <= 3) aciliyetBadge = '⚠️ SON 3 GÜN';
|
||||
|
||||
Reference in New Issue
Block a user