@php $ws = $approvalWorkspace ?? []; $terms = $ws['terms'] ?? ['requested' => [], 'recommended' => [], 'approved' => []]; $req = $terms['requested'] ?? []; $rec = $terms['recommended'] ?? []; $apr = $terms['approved'] ?? []; $fmt = static fn ($n) => number_format((float) ($n ?? 0), 2); $termLabel = static function (array $row): string { $v = (int) ($row['term_value'] ?? 0); $u = (string) ($row['term_unit'] ?? 'monthly'); return $v > 0 ? $v.' '.$u : '—'; }; // tabs = legacy pill nav; steps = parent Alpine workspaceStep drives visibility $lafMode = $approvalLafMode ?? 'steps'; $stepMode = $lafMode === 'steps'; @endphp

Credit Approval Decision

{{ $ws['rail_label'] ?? 'Approval' }}

@if (! empty($ws['credit_approved']))

Credit approved @if (! empty($ws['ready_for_payout'])) · Ready for payout @else · Not ready for payout @endif

@endif
@if (! empty($ws['frozen'])) Decision frozen @endif
@unless ($stepMode) @endunless {{-- STEP 1 / Terms --}}
Field Requested Recommended Approved
Principal {{ $fmt($req['principal'] ?? 0) }} {{ $fmt($rec['principal'] ?? 0) }} {{ $fmt($apr['principal'] ?? 0) }}
Term {{ $termLabel($req) }} {{ $termLabel($rec) }} {{ $termLabel($apr) }}
Frequency {{ $req['repayment_frequency'] ?? '—' }} {{ $rec['repayment_frequency'] ?? '—' }} {{ $apr['repayment_frequency'] ?? '—' }}
@if (! empty($rec['decision']))

Appraisal recommendation: {{ str($rec['decision'])->replace('_', ' ')->headline() }}

@endif

Approved principal is set when you record the approval decision. You can change it from the requested amount there.

@if ($stepMode)

Client

{{ $ws['client_summary']['client_name'] ?? '—' }}

{{ $ws['client_summary']['client_number'] ?? '' }} · {{ $ws['client_summary']['branch'] ?? '' }}

Product: {{ $ws['product'] ?? '—' }}

Capacity & security

@if (! empty($ws['affordability']['available']))

Affordability: {{ $ws['affordability']['result'] ?? '—' }} ({{ $ws['affordability']['installment_ratio'] ?? '—' }}%)

@else

Affordability analysis unavailable

@endif

Guarantors: {{ $ws['guarantors']['count'] ?? 0 }} · Collateral: {{ $ws['collateral'] ?? '—' }}

@endif
@unless ($stepMode)

Client

{{ $ws['client_summary']['client_name'] ?? '—' }}

{{ $ws['client_summary']['client_number'] ?? '' }} · {{ $ws['client_summary']['branch'] ?? '' }}

Product: {{ $ws['product'] ?? '—' }}

Capacity & security

@if (! empty($ws['affordability']['available']))

Affordability: {{ $ws['affordability']['result'] ?? '—' }} ({{ $ws['affordability']['installment_ratio'] ?? '—' }}%)

@else

Affordability analysis unavailable

@endif

Guarantors: {{ $ws['guarantors']['count'] ?? 0 }} · Collateral: {{ $ws['collateral'] ?? '—' }}

@endunless {{-- STEP 2 / Readiness + Exceptions --}}
@php $appraisalReady = $ws['appraisal_summary']['readiness'] ?? []; @endphp

Appraisal readiness

{{ str(($appraisalReady['status'] ?? 'unknown'))->replace('_', ' ')->headline() }} · {{ $appraisalReady['completion_percentage'] ?? 0 }}%

Evidence before approval

@forelse (($ws['evidence']['before_approval_blockers'] ?? []) as $blocker)

{{ $blocker['label'] ?? 'Evidence required' }} @if (! empty($blocker['action_url'])) Open @endif

@empty

No evidence blocking approval.

@endforelse
@if (! empty($ws['pre_treasury_blockers']))

Open items before payout

@foreach ($ws['pre_treasury_blockers'] as $blocker)

{{ $blocker['label'] ?? '' }}

@endforeach
@endif @if ($stepMode) @forelse (($ws['exceptions'] ?? []) as $ex)

{{ $ex['description'] ?? ($ex['type'] ?? 'Exception') }}

Policy {{ $ex['policy_value'] ?? '—' }} → Actual {{ $ex['actual_value'] ?? '—' }}

@if (! empty($ex['reason']))

{{ $ex['reason'] }}

@endif
@empty

No exceptions recorded.

@endforelse @if (! empty($ws['conditions']))

Approval conditions

    @foreach ($ws['conditions'] as $cond)
  • {{ $cond['description'] ?? '' }} ({{ $cond['due_stage'] ?? 'before_treasury' }} · {{ $cond['status'] ?? 'open' }})
  • @endforeach
@endif @if (! empty($ws['graduation']))

Graduation context

Suggested {{ $fmt($ws['graduation']['suggested_limit'] ?? 0) }} · Approved {{ $fmt($ws['graduation']['approved_amount'] ?? ($ws['graduation']['requested_amount'] ?? 0)) }} @if (isset($ws['graduation']['graduation_percent'])) · {{ $ws['graduation']['graduation_percent'] }}% @endif

@endif @endif
@unless ($stepMode)
@forelse (($ws['exceptions'] ?? []) as $ex)

{{ $ex['description'] ?? ($ex['type'] ?? 'Exception') }}

Policy {{ $ex['policy_value'] ?? '—' }} → Actual {{ $ex['actual_value'] ?? '—' }}

@if (! empty($ex['reason']))

{{ $ex['reason'] }}

@endif
@empty

No exceptions recorded.

@endforelse @if (! empty($ws['conditions']))

Approval conditions

    @foreach ($ws['conditions'] as $cond)
  • {{ $cond['description'] ?? '' }} ({{ $cond['due_stage'] ?? 'before_treasury' }} · {{ $cond['status'] ?? 'open' }})
  • @endforeach
@endif @if (! empty($ws['graduation']))

Graduation context

Suggested {{ $fmt($ws['graduation']['suggested_limit'] ?? 0) }} · Approved {{ $fmt($ws['graduation']['approved_amount'] ?? ($ws['graduation']['requested_amount'] ?? 0)) }} @if (isset($ws['graduation']['graduation_percent'])) · {{ $ws['graduation']['graduation_percent'] }}% @endif

@endif
@endunless {{-- History: step 3 in steps mode, or History tab --}}

Decision history

@if (! empty($ws['legacy_decision']))

Earlier approval record.

@endif @forelse (($ws['timeline'] ?? []) as $entry)

{{ $entry['decision'] ?? '—' }} · {{ $entry['actor'] ?? '—' }}

{{ optional($entry['timestamp'] ?? null)->diffForHumans() ?? '' }}

{{ $entry['comment'] ?? '' }}

@empty

No decision timeline entries yet.

@endforelse