fix: withhold print action until bid validation finishes

This commit is contained in:
2026-09-06 15:08:56 +03:00
parent 1e36c17487
commit fb2c2b120e
6 changed files with 72 additions and 8 deletions
+21
View File
@@ -0,0 +1,21 @@
// Synthetic UI fixture, never a claim of official tender eligibility.
import {sourceRows,bidSourceOptions,bidSourceSnapshot} from '../../src/services/bidSource.js';
import {documentKey,HEALTH_CHECKS} from '../../src/services/preparationChecks.js';
export function readyBid(tender) {
const document={document:'QA isteğe bağlı belge',mandatory:false,note:'Yalnız sentetik senaryo'};
const analysis={documentChecklist:[document]},itemSource={};
const partialBid={enabled:false,source:'',selected:[],assignments:{}};
const options=bidSourceOptions(tender,analysis,itemSource);
const rows=sourceRows(tender,analysis,options.selected || 'tender');
const sourceSnapshot=JSON.stringify([bidSourceSnapshot(tender,analysis,rows),partialBid,itemSource,options.signature]);
return {...tender,bidDraft:{
firma:{firmaUnvan:'QA Sentetik Laboratuvar',adres:'QA Test Adresi',vergiDairesi:'QA',vergiNo:'0000000000',yetkiliAd:'QA Test Kullanıcısı',yetkiliGorev:'Test',telefon:'0000000000',eposta:'qa@example.test'},
teklifTuru:'birim',gecerlilikGun:'120',kisim:'',goturuBedel:'',priceSchema:1,
pricesBySource:Object.fromEntries(rows.map(row=>[row.priceKey,'125.50'])),
sourceSnapshot,reviewedSource:sourceSnapshot,manualDocuments:[],partialBid,itemSource,analysisSource:analysis,
checks:{documents:{[documentKey(document)]:{status:'notApplicable',evidence:'QA senaryosunda istenmiyor.'}},
products:Object.fromEntries(rows.map(row=>[row.priceKey,{status:'suitable',product:'QA sentetik ürün',source:'QA teknik madde 1',
...Object.fromEntries(HEALTH_CHECKS.map(([key])=>[key,{status:'notApplicable',evidence:'QA senaryosu.'}]))}]))},
}};
}