Edit Booking {#if booking}
ID: {booking.id}
{/if}
{#if loading}
Loading booking...
{:else if booking}

Customer

Name
{booking.user?.full_name || '—'}
Email
{booking.user?.email || '—'}
Phone
{booking.user?.phone || '—'}
Time
{(() => { const date = new SvelteDate(booking.start_time); return date.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true }); })()}

Services ({services.length})

{#if services.length === 0}
No services added yet. Click "Add Service" to begin.
{:else}
{#each services as service, index (index)}
{service.service_name}
{formatDuration(service.override_duration_minutes ?? service.duration_minutes ?? 0)} • £{(service.override_price ?? service.price ?? 0).toFixed(2)}
{#if service.override_price !== undefined || service.override_duration_minutes !== undefined}
Modified
{/if}
{/each}
Total: {formatDuration(totalDuration)} £{totalPrice.toFixed(2)}
{/if}
{#if booking?.payments && booking.payments.length > 0}

Payments ({booking.payments.length})

{#each booking.payments as payment, index (index)}
{payment.payment_type === 'deposit' ? 'Deposit' : payment.payment_type === 'full' ? 'Full Payment' : payment.payment_type} {#if payment.payment_method} via {payment.payment_method} {/if}
{payment.status} | £{(payment.amount / 100).toFixed(2)} {#if payment.invoice_number} | Inv: {payment.invoice_number} {/if}
{new SvelteDate(payment.created_at).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' })}
{#if payment.status === 'completed'} {/if}
{/each}
{/if}