@extends('layouts.bootstrap') @section('title', 'Verify Similar Products - ' . $tender->name) @section('header')

Verify Similar Products

Back to Tender
@endsection @section('content')

Verify Similar Products

Review products that are similar to existing ones for tender: {{ $tender->name }}

Back to Import
Import Progress Summary
@php $autoLinkedCount = count(array_filter($importData['auto_imported'] ?? [], function($item) { return isset($item['action']) && $item['action'] === 'auto_linked_100_match'; })); $regularImported = $importData['imported'] - $autoLinkedCount; @endphp
{{ $regularImported }}
New Products
@if($autoLinkedCount > 0)
{{ $autoLinkedCount }}
Auto-Linked (100%)
@endif
{{ $importData['exact_duplicates'] }}
Duplicates Skipped
{{ count($importData['similar_items']) }}
Need Verification
{{ $importData['total_rows'] }}
Total Rows
@if(!empty($importData['errors']))
{{ count($importData['errors']) }}
Errors
@endif
Manual Verification Required

The following products are similar to existing products in the database. Please review each item and decide whether to Skip, Import as New, or Link to Existing.

Auto-linking: Products with 100% matches are automatically linked during import. Only products with partial matches (90-99%) require manual verification.
@csrf
Products Requiring Verification ({{ count($importData['similar_items']) }})
@foreach($importData['similar_items'] as $index => $item)
Row {{ $item['row'] }}: Similar Product Found
{{ count($item['similar_products']) }} similar matches
New Product (from CSV)
{{ $item['new_product']['name'] }}
@if($item['new_product']['description'])

{{ $item['new_product']['description'] }}

@endif
@if($item['new_product']['country_of_origin'])
Country: {{ $item['new_product']['country_of_origin'] }}
@endif @if($item['new_product']['price_bdt'])
Price: ৳{{ number_format($item['new_product']['price_bdt'], 2) }}
@endif @if($item['new_product']['measurement_unit'])
Unit: {{ $item['new_product']['measurement_unit'] }}
@endif @if($item['new_product']['quantity_required'])
Quantity: {{ $item['new_product']['quantity_required'] }}
@endif
Similar Existing Products
@foreach($item['similar_products'] as $similar) @php $isExactMatch = $similar['similarity'] == 100; $badgeClass = $isExactMatch ? 'bg-success' : 'bg-info'; $cardClass = $isExactMatch ? 'border-success' : 'border-info'; @endphp
{{ $similar['name'] }} @if($isExactMatch) @endif
Product ID: {{ $similar['id'] }}
{{ $similar['similarity'] }}% @if($isExactMatch) EXACT @else similar @endif
@if($isExactMatch)
This is an exact match. Consider linking to avoid duplicates.
@endif
@endforeach

What would you like to do with this product?
@endforeach
Back to Import
@push('scripts') @endpush @endsection