feat(frontend): add former name display, referral discount type, and refunds to bookings

Update frontend types, stores, and components to support name history display and new API fields.

- Add previousFirstName/previousLastName to User type and BookingUser type
- Add referral discount_source type and refunds array to Booking type
- Create nameDisplay.ts utility for rendering '(formerly ...)' labels
- Create booking.ts utility for booking-related helpers
- Update 25+ admin, payments, today, and account components to display
  former names on booking cards, modals, appointment views, and user lists

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-06-20 16:59:31 +01:00
co-authored by Sisyphus
parent 1cf7083bcc
commit 1a3829b4d9
27 changed files with 597 additions and 300 deletions
@@ -220,7 +220,10 @@ import { SvelteDate } from 'svelte/reactivity';
let defaultType = $derived(
defaultPaymentType ?? (depositOutstanding ? 'deposit' : 'full')
);
let paymentType = $state<'full' | 'partial' | 'deposit'>(defaultType as 'full' | 'partial' | 'deposit');
let paymentType = $state<'full' | 'partial' | 'deposit'>('full');
$effect(() => {
paymentType = defaultType as 'full' | 'partial' | 'deposit';
});
let pollingInterval: ReturnType<typeof setInterval> | null = null;
@@ -923,6 +926,11 @@ import { SvelteDate } from 'svelte/reactivity';
disabled={false}
/>
{/if}
<!-- Card validation error shown inline near card input -->
{#if cardValidationError}
<p class="text-sm text-red-600">{cardValidationError}</p>
{/if}
{/if}
{#if depositPolicyWarning}
@@ -965,9 +973,6 @@ import { SvelteDate } from 'svelte/reactivity';
</div>
<!-- Pay button -->
{#if payButtonError}
<p class="text-sm text-red-600">{payButtonError}</p>
{/if}
<Button
onclick={() => (paymentType === 'deposit' ? handlePayDeposit() : handlePayFull())}
class="w-full"
@@ -1034,13 +1039,13 @@ import { SvelteDate } from 'svelte/reactivity';
disabled={status !== 'idle'}
/>
</div>
{#if partialValidationError}
<p class="mt-1 text-sm text-red-600">{partialValidationError}</p>
{/if}
</div>
{/if}
<!-- Pay button -->
{#if payButtonError}
<p class="text-sm text-red-600">{payButtonError}</p>
{/if}
<Button
onclick={() => (paymentType === 'partial' ? handlePayPartial() : handlePayFull())}
class="w-full"