@php
$review = $batch->flavorResult;
$rating = (int) ($review->rating ?? 0);
// Tiny helper: a row of filled/empty marks for a 1β5 score.
$marks = function (int $score, string $glyph, string $on, string $off) {
$out = '';
for ($i = 1; $i <= 5; $i++) {
$color = $i <= $score ? $on : $off;
$out .= '' . $glyph . ' ';
}
return rtrim($out);
};
@endphp
@component('emails.layout', ['subject' => 'π ' . $batch->name . ' β tu resumen', 'preview' => 'Tu fermento ha salido genial. AquΓ tienes el resumen completo.'])
Β‘Enhorabuena! π
Tu lote {{ $batch->name }}
@if($batch->guide) de {{ $batch->guide->name }} @endif
ha terminado con muy buena nota. AquΓ tienes su resumen para que lo guardes.
{{-- ββ Rating βββββββββββββββββββββββββββββββββββββββββββ --}}
@if($rating > 0)
|
{!! $marks($rating, 'β
', '#E8B33D', '#D8D2C2') !!}
{{ $rating }}/5
@if($review?->overall_comment)
β{{ $review->overall_comment }}β
@endif
|
@endif
{{-- ββ Datos del lote βββββββββββββββββββββββββββββββββββ --}}
Datos
@php
$rows = array_filter([
'Fermento' => $batch->guide?->name,
'Inicio' => $batch->start_date?->format('d/m/Y'),
'Fin' => ($batch->actual_end_date ?? null)?->format('d/m/Y'),
'DuraciΓ³n' => $stats['days'] !== null ? $stats['days'] . ' dΓas' : null,
'Rendimiento' => $stats['yield'],
]);
@endphp
@foreach($rows as $label => $value)
| {{ $label }} |
{{ $value }} |
@endforeach
{{-- ββ EstadΓsticas de seguimiento ββββββββββββββββββββββ --}}
@if($stats['logs'] || $stats['measurements'] || $stats['ph_last'] !== null || $stats['temp_range'])
Seguimiento
@php
$statRows = array_filter([
'Registros diarios' => $stats['logs'] ?: null,
'Mediciones' => $stats['measurements'] ?: null,
'pH final' => $stats['ph_last'] !== null ? rtrim(rtrim(number_format($stats['ph_last'], 2, ',', '.'), '0'), ',') : null,
'Temperatura' => $stats['temp_range']
? number_format($stats['temp_range'][0], 0) . 'β' . number_format($stats['temp_range'][1], 0) . ' Β°C'
: null,
], fn ($v) => $v !== null);
@endphp
@foreach($statRows as $label => $value)
| {{ $label }} |
{{ $value }} |
@endforeach
@endif
{{-- ββ Perfil de sabor ββββββββββββββββββββββββββββββββββ --}}
@if(!empty($flavors))
Perfil de sabor
@foreach($flavors as $label => $score)
| {{ $label }} |
{!! $marks((int) $score, 'β', '#4B7A50', '#D8D2C2') !!} |
@endforeach
@endif
{{-- ββ CronologΓa βββββββββββββββββββββββββββββββββββββββ --}}
@if($timeline->isNotEmpty())
CronologΓa
@foreach($timeline as $step)
|
@if($step['day'] !== null) DΓa {{ $step['day'] }} @endif
|
{{ $step['title'] }}
@if($step['state'] === 'skipped')
Β· saltado
@endif
|
@endforeach
@endif
Ver lote completo
@endcomponent