# Catering CMS, Banquet Inquiries & Quotation Engine

This document details the executive catering operations, inquiry triage pipeline, and commercial quotation engine of Eniceberny Bakery and Culinary Hub.

---

## 1. Executive Catering Philosophy & Business Scope

Eniceberny provides high-end event catering, luxury dessert stations, corporate hospitality, and authentic Ghanaian banquets across the Ashanti and Greater Accra regions.

```mermaid
graph TD
    A[Public Patron / Corporate Client] -->|Submit Event Details on /catering| B(Inquiry Pipeline /admin/catering)
    B -->|Review Headcount & Budget| C{Feasible?}
    C -->|No| D[Mark Declined with Client Feedback]
    C -->|Yes| E[Assign Event Lead & Status: under_review]
    E -->|Generate Formal Quotation| F[Quote Engine /admin/quotes/create]
    F -->|Itemized Rates & Deposit Terms| G[Formal PDF Proposal / Client Email]
    G -->|Client Acceptance & 50% Deposit| H[One-Click Convert to Order]
    H --> I[Kitchen Production Queue & Event Calendar]
```

### Core Catering Service Profiles:
1. **Corporate Hospitality & Boardroom Breakfasts**: Fresh artisan pastry boxes, cold-pressed juices, breakfast sliders, and seasonal fruit platters for 10 to 150 executives.
2. **Grand Wedding Receptions & Banquets**: Multi-tiered artisanal celebration cakes, full chafing dish buffet spreads (Jollof, Fried Rice, Grilled Tilapia, Charcoal Chicken, Plantain), and uniformed service crews for 50 to 500+ guests.
3. **Cocktail Soirées & Dessert Stations**: Mini meat pies, choux pastries, parfaits, signature Sobolo spritzers, and interactive dessert tables.

---

## 2. Inbound Inquiry Pipeline (`/admin/catering`)

Event leads are collected from the public portal at `/catering` via `CateringController::submitInquiry` (`POST /catering/inquiry`):

### 2.1 Lead Attributes Collected:
- **Client Information**: Full Name, Email Address, Primary Phone, WhatsApp Hotline.
- **Event Particulars**: Event Type (Wedding, Corporate Meeting, Birthday, Social Banquet), Target Date, Venue Location.
- **Scale & Budget**: Estimated Guest Headcount (e.g. 50–500), Target Budget in Ghana Cedis (`budget`).
- **Culinary Preferences**: Dietary constraints (e.g. Nut-Free, Halal, Vegetarian, Gluten-Free), requested menu categories, and freeform client notes.

### 2.2 Operational Triage Workflow:
- Inquiries enter the system in `pending` status.
- Event managers review guest counts and culinary requirements against kitchen schedule capacity.
- **Status Lifecycle**: `pending` $\rightarrow$ `under_review` $\rightarrow$ `quoted` $\rightarrow$ `confirmed` $\rightarrow$ `declined`.
- An inquiry can be converted into a formal quotation with one click, pre-populating client contact details, event dates, and guest headcount.

---

## 3. Commercial Quotation Engine (`/admin/quotes`)

The quotation engine empowers administrators to draft, price, review, print, and convert proposals:

### 3.1 Data Architecture:
- **`quotes`**: Stores quote identifier (e.g. `QT-260927-4401`), client particulars, target event date, headcount, subtotal, discount, tax, total proposal value, status, validity expiration (default 14 days), and terms of service.
- **`quote_items`**: Child table storing individual line items with service description, quantity, unit rate in Ghana Cedis (`unit_price`), and computed line subtotal.

### 3.2 Dynamic Interactive Builder (`/admin/quotes/create`)
The quote creation screen leverages reactive Alpine.js architecture:
- **Line Items Grid**: Operators can add unlimited custom service items (e.g. *"Tiered Royal Velvet Wedding Cake"*, *"Chafing Dish Setup & Service Crew"*, *"Assorted Fruit Punch Dispensers"*).
- **Tabular Figures**: Quantity steppers and unit rates recalculate line totals and overall proposal sums dynamically with `tabular-nums`.
- **Commercial Adjustments**: Apply discretionary promotional discounts and tax levies.
- **Standard Terms of Service**: Automatically injects Eniceberny's standard booking terms:
  > *"50% non-refundable deposit required upon acceptance to lock event date. Balance due 48 hours prior to service."*

---

## 4. Formal Printable Proposal & PDF Sheet (`/admin/quotes/{quote}/print`)

Clicking **"Print / Export PDF"** renders an editorial document:
- **Header Crest**: Brand logo, gold foil styling, and business hotlines.
- **Dual-Column Metadata**: Left column displays client particulars; right column shows event date, venue, headcount, and quote reference.
- **Itemized Ledger**: Clean grid of services, portion counts, unit rates, and totals.
- **Financial Summary Box**: Subtotal, discount deductions, tax additions, and final proposal total.
- **Sign-Off Seal**: Dual signature lines for Client Acceptance and Executive Chef Approval.
- **Clean Media Print Styling**: Injected `@media print` CSS removes navigation bars, footers, and shadows for clean PDF output.

---

## 5. Automated Conversion to Production Order

Upon client acceptance and receipt of the booking deposit, the operator clicks **"Convert to Order"**:

```php
// app/Http/Controllers/Admin/QuoteController.php
DB::transaction(function () use ($quote) {
    $order = Order::create([
        'order_number' => 'EB-CAT-' . strtoupper(Str::random(8)),
        'user_id' => $quote->user_id,
        'customer_name' => $quote->customer_name,
        'customer_email' => $quote->customer_email,
        'customer_phone' => $quote->customer_phone,
        'order_type' => 'catering',
        'subtotal' => $quote->subtotal,
        'discount_amount' => $quote->discount_amount,
        'tax_amount' => $quote->tax_amount,
        'total' => $quote->total,
        'status' => 'confirmed',
        'payment_status' => 'partially_paid',
    ]);

    foreach ($quote->items as $item) {
        $order->items()->create([
            'product_name' => $item->description,
            'quantity' => $item->quantity,
            'unit_price' => $item->unit_price,
            'subtotal' => $item->subtotal,
        ]);
    }

    $quote->update(['status' => 'converted']);
    AuditLog::log('quote.converted_to_order', Quote::class, $quote->id);
});
```

### Conversion Side-Effects:
1. Spawns an official `Order` with `order_type: 'catering'` and status `confirmed`.
2. Replicates all quotation line items into immutable `OrderItem` records.
3. Generates the order receipt and public invoice tracking link (`/invoices/{order_number}`).
4. Records an immutable audit log entry.
5. Redirects the manager directly to the newly spawned order profile for production scheduling.
