### UPDATE APPOINTMENTS MODULE — MATCH ORDER CREATION PAGE

When creating an appointment, I want the creation flow and the UI to be EXACTLY the same as creating a salon order.

Please update the Appointment Creation Logic and API as follows:

========================================
### 1) Same UI/Structure as Salon Orders
========================================

The appointment creation page must look and behave the same as the Order Creation page:

- Select client
- Select branch
- Add services
- For each service:
  - select quantity
  - base price pulled from service definition
  - VAT calculation same as order services
  - select executing employee (optional)
  - scheduled date/time
- Notes field
- Calculate:
  - subtotal
  - VAT
  - total

Everything must match the order flow except *one difference* described below.

========================================
### 2) Add "appointment_type" as a required field
========================================

Add a required selector:

appointment_type:
- "in_salon"
- "home_service"

Default = "in_salon"

========================================
### 3) If appointment_type = "home_service"
========================================

Show the following additional fields:

- location_lat  (required)
- location_lng  (required)
- address_text  (required)
- delivery_fee  (auto-loaded from settings)

Also:
- delivery_fee must be pulled from system settings table:
  Example setting:
  key: "home_service_delivery_fee"
  value: numeric amount

If the setting does not exist, return error:
"رسوم التوصيل غير معرفة في الإعدادات"

Total calculation must be:

total_amount = subtotal_amount + vat_amount + delivery_fee

========================================
### 4) If appointment_type = "in_salon"
========================================

Hide the location fields and delivery fee.
delivery_fee = 0 automatically.

========================================
### 5) Validation Rules
========================================

If appointment_type = "home_service":
- location_lat is required → error "موقع العميل مطلوب"
- location_lng is required → error "موقع العميل مطلوب"
- address_text is required → error "عنوان العميل مطلوب"
- delivery_fee must be loaded from settings → error if missing

If no services selected → "يجب اختيار خدمة واحدة على الأقل"

========================================
### 6) Behavior after creation
========================================

- status = "pending"
- appointment_number auto-generated "AP-xxxx"
- subtotal_amount, vat_amount, total_amount stored same as order logic

========================================
### 7) API Model Update
========================================

Update POST /appointments to accept:

{
  "client_id": 10,
  "branch_id": 1,
  "appointment_type": "home_service",
  "scheduled_at": "2025-10-02T18:30:00",

  "location_lat": 21.5,
  "location_lng": 39.1,
  "address_text": "حي السلامة، جدة",

  "services": [
    {
      "service_id": 10,
      "quantity": 1,
      "preferred_employee_id": null,
      "scheduled_at": "2025-10-02T19:00:00"
    }
  ],

  "notes": "أرجو الالتزام بالوقت"
}

delivery_fee should NOT be passed by API — it must be loaded from settings automatically.

========================================
### 8) Summary
========================================

✓ Make appointment creation identical to order creation  
✓ Same flow, same calculations, same service structure  
✓ Only difference: appointment_type and optional location & delivery fee  
✓ delivery fee is loaded from settings, not from user input  
✓ total = subtotal + VAT + delivery fee (only for home_service)
