@php $isAdmin = auth()->user()?->is_admin ?? false; $tenderMeta = $tender->meta ?? []; $aiMeta = $tender->ai_meta ?? []; $tenderValues = data_get($tenderMeta, 'values', []); $tenderWinner = data_get($tenderMeta, 'winner'); $buyerContact = data_get($tenderMeta, 'buyer_contact'); $tenderContract = data_get($tenderMeta, 'contract'); $tenderDates = data_get($tenderMeta, 'dates'); $tenderLocation = data_get($tenderMeta, 'location'); $pricingMeta = data_get($aiMeta, 'pricing'); $lotsExpectations = collect(data_get($aiMeta, 'lots_expectations', [])); $lotExpectMap = $lotsExpectations->keyBy('lot_key'); @endphp @if($isAdmin)
← Retour
{{ $tender->publish_at?->format('d/m/Y H:i') }} · {{ strtoupper($tender->source) }} · {{ $tender->source_id }}

{{ $tender->title }}

{{ $tender->buyer_name }}
Proximité (vecto): {{ $proximityScore !== null ? $proximityScore : '—' }}
@if($tender->ai_category) {{ $tender->ai_category }} @endif Estimation: {{ $tender->ai_estimated_value !== null ? number_format((float)$tender->ai_estimated_value, 0, ',', ' ').' '.$tender->currency : '—' }}
@php $s = $tender->latestScore?->score; @endphp {{ $s!==null ? $s : '—' }} @if($tender->url) Lien source @endif
@php $summaryDisplayed = false; @endphp @if($tender->ai_summary)
Résumé
{{ $tender->ai_summary }}
@php $summaryDisplayed = true; @endphp @endif
Valeur estimée acheteur
{{ $tender->estimated_value ? number_format((float)$tender->estimated_value, 0, ',', ' ') . ' ' . ($tender->currency ?? 'EUR') : '—' }}
@if(data_get($tenderValues, 'buyer_estimated_overall'))
Référence BOAMP: {{ number_format((float) data_get($tenderValues, 'buyer_estimated_overall'), 0, ',', ' ') }} {{ data_get($tenderValues, 'currency', 'EUR') }}
@endif
Montant attribué
{{ data_get($tenderValues, 'awarded_total') ? number_format((float) data_get($tenderValues, 'awarded_total'), 0, ',', ' ') . ' ' . data_get($tenderValues, 'currency', 'EUR') : ($tender->ai_estimated_value ? number_format((float)$tender->ai_estimated_value, 0, ',', ' ').' '.($tender->currency ?? 'EUR') : '—') }}
@if(data_get($tenderValues, 'buyer_estimated_overall'))
Estimation IA: {{ $tender->ai_estimated_value ? number_format((float)$tender->ai_estimated_value, 0, ',', ' ') . ' ' . ($tender->currency ?? 'EUR') : '—' }}
@endif
Publication
Publié le {{ $tender->publish_at?->format('d/m/Y H:i') ?? '—' }}
Clôture {{ $tender->deadline_at?->format('d/m/Y H:i') ?? 'N/A' }}
@if($tenderDates)
Attribution: {{ data_get($tenderDates, 'award_date') ?? '—' }}
@endif
@if($tenderWinner || $buyerContact || $tenderLocation || $tenderContract)
@if($tenderWinner)
Titulaire
{{ data_get($tenderWinner, 'name') }}
SIRET: {{ data_get($tenderWinner, 'siret', '—') }}
{{ trim((data_get($tenderWinner, 'postal_code').' '.data_get($tenderWinner, 'city'))) }}
@if(data_get($tenderWinner, 'website')) {{ data_get($tenderWinner, 'website') }} @endif
@endif @if($buyerContact)
Contact acheteur
{{ data_get($buyerContact, 'name') }}
Tél: {{ data_get($buyerContact, 'phone', '—') }}
@endif @if($tenderContract)
Contrat
Référence: {{ data_get($tenderContract, 'reference', '—') }}
@if(data_get($tenderContract, 'period.start'))
Période: {{ data_get($tenderContract, 'period.start') }} → {{ data_get($tenderContract, 'period.end') }}
@endif
@endif
@endif @if($pricingMeta)
Pricing / projections
Attribué total
{{ data_get($pricingMeta, 'known_values.awarded_total_eur') ? number_format((float) data_get($pricingMeta, 'known_values.awarded_total_eur'), 0, ',', ' ') . ' €' : '—' }}
Attribué / an
{{ data_get($pricingMeta, 'derived.awarded_per_year_eur') ? number_format((float) data_get($pricingMeta, 'derived.awarded_per_year_eur'), 0, ',', ' ') . ' €' : '—' }}
Attribué / mois
{{ data_get($pricingMeta, 'derived.awarded_per_month_eur') ? number_format((float) data_get($pricingMeta, 'derived.awarded_per_month_eur'), 0, ',', ' ') . ' €' : '—' }}
Durée (ans)
{{ data_get($pricingMeta, 'derived.duration_years') ?? '—' }}
@if(data_get($pricingMeta, 'typical_cost_structure_estimate'))
Structure estimée
{{ data_get($pricingMeta, 'typical_cost_structure_estimate.assumption') }}
Forfait: {{ data_get($pricingMeta, 'typical_cost_structure_estimate.range_percent.fixed_forfait.min') }}–{{ data_get($pricingMeta, 'typical_cost_structure_estimate.range_percent.fixed_forfait.max') }}% · Variable: {{ data_get($pricingMeta, 'typical_cost_structure_estimate.range_percent.variable_curative_and_parts.min') }}–{{ data_get($pricingMeta, 'typical_cost_structure_estimate.range_percent.variable_curative_and_parts.max') }}%
@endif
@endif {{-- Zone de debug BOAMP supprimée pour alléger la vue --}} @if(isset($normLots) && $normLots->count())
@foreach($normLots as $lot) @php $lotExpectation = $lotExpectMap->get($lot->lot_key); $embedded = !empty($lot->embedding); @endphp
@endforeach
@elseif(is_array($lots) && count($lots))
Lots (source)
    @foreach($lots as $lot)
  • @php $num = $lot['numLot'] ?? $lot['num'] ?? $lot['numero'] ?? null; $tit = $lot['intitule'] ?? $lot['titre'] ?? $lot['objet'] ?? null; @endphp {{ $num ? ('Lot ' . $num) : 'Lot' }} — {{ $tit ?: 'Sans intitulé' }}
  • @endforeach
@endif @php $hasCharacteristics = $tender->procedure || $tender->contract_type || ($tender->cpv && count($tender->cpv)) || $tender->region; $hasLocationCard = ! empty(array_filter([ data_get($tenderLocation, 'address'), data_get($tenderLocation, 'city'), data_get($tenderLocation, 'postal_code'), data_get($tenderLocation, 'nuts'), ])); @endphp @if($hasCharacteristics || $hasLocationCard)
@if($hasCharacteristics)
Caractéristiques
Procédure: {{ $tender->procedure ?? '—' }}
Type de contrat: {{ $tender->contract_type ?? '—' }}
CPV: {{ $tender->cpv ? implode(', ', $tender->cpv) : '—' }}
Région / NUTS: {{ $tender->region ?? '—' }}
@endif @if($hasLocationCard)
Localisation
{{ data_get($tenderLocation, 'city') ?? data_get($tenderLocation, 'address') ?? '—' }}
@if(data_get($tenderLocation, 'address'))
{{ data_get($tenderLocation, 'address') }}
@endif @if(data_get($tenderLocation, 'postal_code') || data_get($tenderLocation, 'city'))
{{ data_get($tenderLocation, 'postal_code') }} {{ data_get($tenderLocation, 'city') }}
@endif
NUTS: {{ data_get($tenderLocation, 'nuts', $tender->region ?? '—') }}
@endif
@endif @if($tender->description)
{{ $tender->description }}
@endif @if($urlDoc || $nomContact || $visit || $critPondere || $capEx || $capEco || $capTech || $lieuExec || $dureeMois)
@if($urlDoc)
Lien DCE / consultation
{{ $urlDoc }}
@endif @if($nomContact)
Contact marché
{{ $nomContact }}
@endif @if($visit)
Visite / information complémentaire
{{ $visit }}
@endif @if($critPondere)
Critères d’attribution (pondérés)
    @foreach($critPondere as $c)
  • {{ ($c['critere'] ?? 'Critère') }} — {{ ($c['criterePCT'] ?? '—') }}%
  • @endforeach
@endif @if($capEx || $capEco || $capTech)
Conditions de participation
    @if($capEx)
  • Capacité à exercer: {{ $capEx }}
  • @endif @if($capEco)
  • Capacité économique/financière: {{ $capEco }}
  • @endif @if($capTech)
  • Capacité technique: {{ $capTech }}
  • @endif
@endif @if($lieuExec)
Lieu d’exécution
{{ is_string($lieuExec) ? $lieuExec : json_encode($lieuExec, JSON_UNESCAPED_UNICODE) }}
@endif @if($dureeMois)
Durée (mois)
{{ $dureeMois }}
@endif
@endif @if($addrLine || $cityLine || $tel || $mel || $site)
Coordonnées acheteur
@if($addrLine)
{{ $addrLine }}
@endif @if($cityLine)
{{ $cityLine }}
@endif @if($tel)
Tél: {{ $tel }}
@endif @if($mel)
Email: {{ $mel }}
@endif @if($site)
Profil acheteur: {{ $site }}
@endif
@endif @if(isset($docs) && $docs->count())
Documents récupérés
@foreach($docs as $d)
{{ $d->filename ?: parse_url($d->url, PHP_URL_PATH) }}
{{ $d->mime }} · {{ $d->size ? number_format($d->size/1024,1,',',' ') . ' KB' : '—' }} · {{ $d->status }}
Ouvrir
@if($d->text)
{{ \Illuminate\Support\Str::limit($d->text, 2000) }}
@endif
@endforeach
@endif
@else
← Retour
{{ $tender->publish_at?->format('d/m/Y H:i') ?? 'Date inconnue' }} · {{ strtoupper($tender->source) }} · {{ $tender->source_id ?? '—' }}

{{ $tender->title }}

{{ $tender->buyer_name ?? 'Acheteur non communiqué' }}
Proximité
{{ $proximityScore !== null ? $proximityScore : '—' }}
@if($tender->url) Lien source @endif
Estimation IA
{{ $tender->ai_estimated_value ? number_format((float)$tender->ai_estimated_value, 0, ',', ' ') . ' ' . ($tender->currency ?? 'EUR') : ($tender->estimated_value ? number_format((float)$tender->estimated_value, 0, ',', ' ') . ' ' . ($tender->currency ?? 'EUR') : '—') }}
Publication
Publié le {{ $tender->publish_at?->format('d/m/Y H:i') ?? '—' }}
Clôture {{ $tender->deadline_at?->format('d/m/Y H:i') ?? 'N/A' }}
Catégorie
{{ $tender->ai_category ?? '—' }}
@php $userSummary = $tender->ai_summary ?: ($tender->ai_brief ?? null); @endphp @if($userSummary)
Résumé

{{ $userSummary }}

@elseif($tender->description)
Description

{{ Str::limit($tender->description, 800) }}

@endif
@if(isset($normLots) && $normLots->count())

Lots compatibles

Sélection des lots correspondant à vos secteurs. Chaque fiche reprend l'essentiel : budget, CPV et points clés.

@foreach($normLots as $lot) @php $embedded = !empty($lot->embedding); $lotBrief = $lot->ai_brief ?? data_get($lot->meta, 'brief_text') ?? data_get($lot->meta, 'llm.lot_brief_text') ?? $lot->description; @endphp
Lot {{ $lot->number ?: '—' }} — {{ $lot->title ?: 'Sans intitulé' }}
{{ $lot->estimated_value ? number_format((float)$lot->estimated_value, 0, ',', ' ') . ' ' . ($lot->currency ?? 'EUR') : 'Budget non communiqué' }}
{{ $embedded ? 'Prêt à analyser' : 'Analyse en cours' }}
@if($lotBrief)

{{ Str::limit($lotBrief, 500) }}

@endif
Secteurs
{{ !empty($lot->sector_names) ? implode(', ', $lot->sector_names) : '—' }}
CPV
{{ $lot->cpv && count($lot->cpv) ? implode(', ', $lot->cpv) : '—' }}
@if(data_get($lot->meta, 'location.city'))
Localisation
{{ data_get($lot->meta, 'location.city') }}
@endif @if($lot->currency)
Devise
{{ $lot->currency }}
@endif
@endforeach
@endif @if(isset($docs) && $docs->count())

Documents disponibles

    @foreach($docs as $d) @php $docPath = parse_url($d->url, PHP_URL_PATH); $docName = $d->filename ?: ($docPath ? basename($docPath) : 'Document'); @endphp
  • {{ $docName }} Ouvrir
  • @endforeach
@endif
@endif