Reservation Details

Reservation Number: <%= @reservation.reservation_number %>

Property: <%= @reservation.property&.property_number %>

Expires At: <%= @reservation.expires_at.strftime("%d-%b-%Y %H:%M") %>

Status: <% case @reservation.status %> <% when "pending" %> Pending <% when "approved" %> Approved <% when "expired" %> Expired <% when "cancelled" %> Cancelled <% when "sold" %> Sold <% end %>

Notes: <%= @reservation.notes.presence || "None" %>

<% if @reservation.created_by&.role == "agent" %>

Reserved by Agent

Name: <%= @reservation.created_by.full_name %>

Email: <%= @reservation.created_by.email %>

Phone: <%= @reservation.created_by.agent_profile&.phone %>

Agency: <%= @reservation.created_by.agent_profile&.company_name %>

<% end %>

Client Details

<% customer = @reservation.customer %> <% if customer.present? %>

Full Name: <%= [customer.firstname, customer.middlename, customer.lastname].compact.join(' ') %>

Email: <%= customer.email %>

Mobile 1: <%= customer.mobile_1 %>

Mobile 2: <%= customer.mobile_2 %>

Address: <%= [customer.address_1, customer.address_2, customer.city, customer.country].compact.join(', ') %>

<% if customer.documents.any? %>
Uploaded Documents
<% customer.documents.each do |doc| %>
<% if doc.file.content_type.start_with?("image/") %> <%= image_tag(doc.file, width: 120, class: "img-fluid rounded shadow-sm") if doc.file.attached? %> <% end %>

<%= doc.title %>

<%= link_to "📄 Preview", rails_blob_path(doc.file, disposition: "inline"), target: "_blank", class: "btn btn-sm btn-outline-info rounded-pill px-3 py-1" %> <%= link_to "⬇️ Download", rails_blob_path(doc.file, disposition: "attachment"), class: "btn btn-sm btn-outline-primary rounded-pill px-3 py-1" %>
<% end %>
<% else %>

No documents uploaded.

<% end %>
<% else %>

No client information found for this reservation.

<% end %> <% if @reservation.pending? %>
<%= button_to "Reject", reject_admin_portal_reservation_path(@reservation), method: :patch, data: { turbo: false }, class: "btn btn-danger rounded-pill px-5 py-2 shadow-lg" %>
<% end %> <%= link_to "Back to Reservations", admin_portal_reservations_path, class: "btn btn-secondary mt-5 rounded-pill px-4 py-2 shadow-lg" %> <%= render "approve_modal", reservation: @reservation, templates: @templates %>