Backend: - Enriched GetAllUserBookings response with calculated total_amount, amount_paid, and duration_minutes. - Refactored GetBookingHandler to return a flat booking object matching frontend expectations. - Added account_role to admin user list response and sorted users by booking activity. - Corrected function name oo to AdminCreateBookingForUserHandler. Frontend: - Rebuilt BookingCreateModal into a 4-step wizard supporting guest bookings, service overrides, and real-time availability checks. - Fixed account dashboard logic to correctly identify upcoming vs past bookings and sort unpaid items to the top. - Extracted booking flow into a shared BookingFlow component. - Redirected admin users from home page to /today.
25 lines
704 B
Svelte
25 lines
704 B
Svelte
<script lang="ts">
|
|
import { Button } from '$lib/components/ui/button';
|
|
import BookingCreateModal from '$lib/components/admin/BookingCreateModal.svelte';
|
|
|
|
let showCreateModal = false;
|
|
</script>
|
|
|
|
<div class="rounded-lg border border-gray-200 bg-white p-4">
|
|
<h3 class="mb-2 text-sm font-semibold tracking-wide text-gray-600 uppercase">
|
|
Call-In / Social Messaging Booking
|
|
</h3>
|
|
|
|
<p class="mb-4 text-sm text-gray-500">
|
|
Create a booking and check timeslots for a discussed appointed
|
|
</p>
|
|
|
|
<div class="flex items-center gap-3">
|
|
<Button onclick={() => (showCreateModal = true)}>Create Booking</Button>
|
|
</div>
|
|
</div>
|
|
|
|
{#if showCreateModal}
|
|
<BookingCreateModal bind:open={showCreateModal} />
|
|
{/if}
|