feat: add accurate price and payment information

This commit is contained in:
JasterV 2026-02-11 17:39:34 +01:00
parent b442f1243a
commit 1359f75a7e
16 changed files with 176 additions and 36 deletions

View file

@ -212,6 +212,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking do
customer_phone: booking.customer_phone,
customer_comment: booking.customer_comment,
space_name: booking.space.name,
space_slug: booking.space.slug,
start_datetime: booking.start_datetime,
end_datetime: booking.end_datetime
}
@ -283,6 +284,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking do
customer_email: booking.customer_email,
customer_phone: booking.customer_phone,
space_name: booking.space.name,
space_slug: booking.space.slug,
start_datetime: booking.start_datetime,
end_datetime: booking.end_datetime,
action: "accepted"
@ -314,6 +316,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking do
customer_email: booking.customer_email,
customer_phone: booking.customer_phone,
space_name: booking.space.name,
space_slug: booking.space.slug,
start_datetime: booking.start_datetime,
end_datetime: booking.end_datetime,
action: "rejected",

View file

@ -16,6 +16,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.AdminActionEmailWorker do
"customer_email" => customer_email,
"customer_phone" => customer_phone,
"space_name" => space_name,
"space_slug" => space_slug,
"start_datetime" => start_datetime_str,
"end_datetime" => end_datetime_str,
"action" => "accepted"
@ -30,6 +31,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.AdminActionEmailWorker do
customer_email: customer_email,
customer_phone: customer_phone,
space_name: space_name,
space_slug: space_slug,
start_datetime: start_datetime,
end_datetime: end_datetime,
date: CalendarExt.format_datetime_date_only(start_datetime),

View file

@ -18,6 +18,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.Email do
customer_phone: customer_phone,
customer_comment: customer_comment,
space_name: space_name,
space_slug: space_slug,
date: date,
start_time: start_time,
end_time: end_time
@ -31,6 +32,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.Email do
customer_phone: customer_phone,
customer_comment: customer_comment,
space_name: space_name,
space_slug: space_slug,
date: date,
start_time: start_time,
end_time: end_time,
@ -115,6 +117,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.Email do
customer_email: customer_email,
customer_phone: customer_phone,
space_name: space_name,
space_slug: space_slug,
date: date,
start_time: start_time,
end_time: end_time
@ -127,6 +130,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.Email do
customer_email: customer_email,
customer_phone: customer_phone,
space_name: space_name,
space_slug: space_slug,
date: date,
start_time: start_time,
end_time: end_time,

View file

@ -18,6 +18,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.RequestCreatedEmailWorker do
"customer_phone" => customer_phone,
"customer_comment" => customer_comment,
"space_name" => space_name,
"space_slug" => space_slug,
"start_datetime" => start_datetime_str,
"end_datetime" => end_datetime_str
}
@ -32,6 +33,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.RequestCreatedEmailWorker do
customer_phone: customer_phone,
customer_comment: customer_comment,
space_name: space_name,
space_slug: space_slug,
start_datetime: start_datetime,
end_datetime: end_datetime,
date: CalendarExt.format_datetime_date_only(start_datetime),

View file

@ -112,8 +112,6 @@ defmodule SpazioSolazzoWeb.LandingComponents do
title="Meeting Room"
description="A private, sun-drenched sanctuary designed for focus and collaboration."
booking_path={~p"/book/asset/\#{@asset.id}"}
price="€40"
price_unit="hour"
capacity="Up to 8 People"
images={@images}
/>
@ -122,8 +120,6 @@ defmodule SpazioSolazzoWeb.LandingComponents do
slot :description, required: true
attr :booking_path, :string, required: true
attr :booking_label, :string, default: "Book This Room"
attr :price, :string, required: true
attr :price_unit, :string, default: "hour"
attr :capacity, :string, required: true
attr :images, :list, default: []
@ -145,18 +141,14 @@ defmodule SpazioSolazzoWeb.LandingComponents do
<p class="text-lg text-neutral leading-relaxed max-w-xl">
{render_slot(@description)}
</p>
<div class="flex flex-col sm:flex-row gap-4 pt-2">
<div class="flex pt-2">
<.link
navigate={@booking_path}
class="btn btn-primary h-14 px-8 rounded-2xl text-lg font-bold shadow-xl w-full sm:w-auto hover:-translate-y-1"
class="btn btn-primary h-14 px-8 rounded-2xl text-lg font-bold shadow-xl hover:-translate-y-1"
>
<span>{@booking_label}</span>
<.icon name="hero-arrow-right" class="w-5 h-5" />
</.link>
<div class="flex items-center gap-2 text-neutral px-4 h-14 w-full sm:w-auto justify-center">
<span class="text-2xl font-bold text-base-content">{@price}</span>
<span class="text-sm">/ {@price_unit}</span>
</div>
</div>
</div>
<div class="order-1 lg:order-2 relative group">

View file

@ -14,8 +14,6 @@ defmodule SpazioSolazzoWeb.PageComponents do
<.space_card
title="Coworking"
description="Flexible desk spaces for remote work"
price="15"
time_unit="4 hours"
image_url="https://..."
primary_label="Workspace"
image_position={:left}
@ -26,8 +24,6 @@ defmodule SpazioSolazzoWeb.PageComponents do
<.space_card
title="Meeting Room"
description="Private conference rooms"
price="40"
time_unit="hour"
image_url="https://..."
primary_label="Business"
primary_label_variant={:secondary}
@ -39,8 +35,6 @@ defmodule SpazioSolazzoWeb.PageComponents do
"""
attr :title, :string, required: true
attr :description, :string, required: true
attr :price, :string, required: true
attr :time_unit, :string, required: true
attr :image_url, :string, required: true
attr :primary_label, :string, required: true
attr :primary_label_variant, :atom, default: :primary, values: [:primary, :secondary, :accent]
@ -101,14 +95,10 @@ defmodule SpazioSolazzoWeb.PageComponents do
<% end %>
</p>
<div class="card-actions flex flex-col sm:flex-row gap-8 sm:items-center justify-between mt-auto pt-10 border-t border-base-200">
<span class="text-3xl font-extrabold text-base-content">
{@price}
<span class="text-base font-light text-neutral">/ {@time_unit}</span>
</span>
<div class="card-actions flex justify-center mt-auto pt-10 border-t border-base-200">
<.link
navigate={@booking_url}
class="btn btn-primary h-10 px-5 rounded-2xl uppercase text-xs tracking-widest"
class="btn btn-primary h-12 px-8 rounded-2xl uppercase text-xs tracking-widest"
>
View more <.icon name="hero-arrow-right" class="size-5" />
</.link>

View file

@ -13,6 +13,53 @@
<.detail_item label="Phone">{@customer_phone || "N/A"}</.detail_item>
</.details_list>
<div style="background-color: #f0f9ff; border-left: 4px solid #3b82f6; padding: 15px; margin: 20px 0; color: #2d3748;">
<h3 style="margin: 0 0 10px 0; font-weight: 600; color: #1e40af;">
💰 Pricing Information
</h3>
<%= cond do %>
<% @space_slug == "arcipelago" -> %>
<p style="margin: 0; font-size: 16px; color: #2d3748;">
<strong>€5</strong> for half day (up to 4 hours)<br />
<strong>€9</strong> for full day (more than 4 hours)
</p>
<% @space_slug == "media-room" -> %>
<p style="margin: 0; font-size: 16px; color: #2d3748;">
<strong>€15</strong> per hour
</p>
<% @space_slug == "hall" -> %>
<p style="margin: 0; font-size: 16px; color: #2d3748;">
<strong>€5</strong> per person for the entire time slot
</p>
<% true -> %>
<p style="margin: 0; font-size: 16px; color: #2d3748;">
Pricing information will be confirmed shortly.
</p>
<% end %>
</div>
<div style="background-color: #f9fafb; border-radius: 8px; padding: 20px; margin: 20px 0;">
<h3 style="color: #2d3748; margin-top: 0;">💳 Payment Information</h3>
<p style="color: #4a5568; font-size: 14px; margin-bottom: 10px;">
Payment can be made on arrival via:
</p>
<ul style="color: #4a5568; font-size: 14px; margin: 0; padding-left: 20px;">
<li>Cash</li>
<li>POS (card payment)</li>
</ul>
</div>
<%= if @space_slug == "arcipelago" do %>
<div style="background-color: #fef3c7; border-left: 4px solid #f59e0b; padding: 15px; margin: 20px 0; color: #2d3748;">
<h3 style="margin: 0 0 10px 0; font-weight: 600; color: #92400e;">
👥 Membership Required
</h3>
<p style="margin: 0; font-size: 14px; color: #78350f;">
The coworking space is for Caravanserai association members only. Membership costs €3 and can be completed at the space. Your membership will be valid until December 31, 2026.
</p>
</div>
<% end %>
<div style="background-color: #f0fdf4; border-left: 4px solid #22c55e; padding: 15px; margin: 20px 0; color: #2d3748;">
<p style="margin: 0; font-weight: 500;">
✅ Your booking is confirmed! Please arrive on time.

View file

@ -14,6 +14,53 @@
<.detail_item label="Note">{@customer_comment || "N/A"}</.detail_item>
</.details_list>
<div style="background-color: #f0f9ff; border-left: 4px solid #3b82f6; padding: 15px; margin: 20px 0; color: #2d3748;">
<h3 style="margin: 0 0 10px 0; font-weight: 600; color: #1e40af;">
💰 Pricing Information
</h3>
<%= cond do %>
<% @space_slug == "arcipelago" -> %>
<p style="margin: 0; font-size: 16px; color: #2d3748;">
<strong>€5</strong> for half day (up to 4 hours)<br />
<strong>€9</strong> for full day (more than 4 hours)
</p>
<% @space_slug == "media-room" -> %>
<p style="margin: 0; font-size: 16px; color: #2d3748;">
<strong>€15</strong> per hour
</p>
<% @space_slug == "hall" -> %>
<p style="margin: 0; font-size: 16px; color: #2d3748;">
<strong>€5</strong> per person for the entire time slot
</p>
<% true -> %>
<p style="margin: 0; font-size: 16px; color: #2d3748;">
Pricing information will be confirmed shortly.
</p>
<% end %>
</div>
<div style="background-color: #f9fafb; border-radius: 8px; padding: 20px; margin: 20px 0;">
<h3 style="color: #2d3748; margin-top: 0;">💳 Payment Information</h3>
<p style="color: #4a5568; font-size: 14px; margin-bottom: 10px;">
Payment can be made on arrival via:
</p>
<ul style="color: #4a5568; font-size: 14px; margin: 0; padding-left: 20px;">
<li>Cash</li>
<li>POS (card payment)</li>
</ul>
</div>
<%= if @space_slug == "arcipelago" do %>
<div style="background-color: #fef3c7; border-left: 4px solid #f59e0b; padding: 15px; margin: 20px 0; color: #2d3748;">
<h3 style="margin: 0 0 10px 0; font-weight: 600; color: #92400e;">
👥 Membership Required
</h3>
<p style="margin: 0; font-size: 14px; color: #78350f;">
The coworking space is for Caravanserai association members only. Membership costs €3 and can be completed at the space. Your membership will be valid until December 31, 2026.
</p>
</div>
<% end %>
<div style="background-color: #fffaf0; border-left: 4px solid #ed8936; padding: 15px; margin: 20px 0; color: #2d3748;">
<p style="margin: 0; font-weight: 500;">
⏳ Your request is pending approval. You will receive an email once an administrator reviews your request.

View file

@ -130,13 +130,30 @@ defmodule SpazioSolazzoWeb.BookingFormLiveComponent do
</div>
<div class="text-xs text-neutral space-y-1">
<ul class="list-disc list-inside space-y-0.5 ml-1">
<li>Pricing details will be sent to your email</li>
<li>Payment via cash or POS on arrival</li>
<li>Cancel anytime with no commitment</li>
<li>Payment upon arrival only</li>
</ul>
</div>
</div>
</div>
<%= if @space.slug == "arcipelago" do %>
<div class="mt-4 p-4 bg-warning/5 border border-warning/20 rounded-xl">
<div class="flex gap-3">
<div class="flex-shrink-0">
<.icon name="hero-user-group" class="size-5 text-warning" />
</div>
<div class="text-xs text-neutral space-y-1">
<p class="font-semibold">Membership Required</p>
<p>
Coworking is for Caravanserai association members. Membership costs 3, can be done at the space, and is valid until December 31, 2026.
</p>
</div>
</div>
</div>
<% end %>
<div class="mt-6 flex items-center gap-3">
<button
type="submit"

View file

@ -14,6 +14,20 @@
</p>
</div>
<div class="max-w-4xl mx-auto mb-6 p-4 bg-info/10 border border-info/30 rounded-xl">
<div class="flex gap-3">
<div class="flex-shrink-0">
<.icon name="hero-envelope" class="size-5 text-info" />
</div>
<div class="text-sm text-neutral">
<p class="font-semibold text-base-content mb-1">Pricing Information</p>
<p>
When you submit your booking request, you will receive an email with price information. Payment can be made on arrival via cash or POS.
</p>
</div>
</div>
</div>
<div class="max-w-4xl mx-auto bg-white dark:bg-slate-800 rounded-3xl p-8 md:p-12 border border-slate-200 dark:border-slate-700 shadow-xl shadow-slate-200/50 dark:shadow-none">
<h2 class="text-2xl font-bold text-slate-900 dark:text-white mb-8">
Available Time Slots

View file

@ -2,8 +2,6 @@
<.page_header
booking_path={~p"/book/space/#{@space.slug}"}
booking_label="Request a desk"
price="€25"
price_unit="day"
capacity={@space.capacity}
images={[
~p"/images/coworking_room/01.jpg",
@ -18,6 +16,35 @@
</:description>
</.page_header>
<section class="py-6 px-6 bg-base-100">
<div class="mx-auto max-w-[1000px]">
<div class="p-6 bg-warning/10 border-l-4 border-warning rounded-xl">
<div class="flex gap-4">
<div class="flex-shrink-0">
<.icon name="hero-user-group" class="size-6 text-warning" />
</div>
<div>
<h3 class="text-lg font-bold text-base-content mb-2">Membership Required</h3>
<p class="text-neutral mb-3">
The coworking space is for <strong>Caravanserai association members</strong>
only. If you're not yet a member, don't worry!
</p>
<div class="bg-base-100/50 rounded-lg p-4 mt-3">
<p class="text-sm text-neutral mb-2">
<strong>💳 Membership Details:</strong>
</p>
<ul class="text-sm text-neutral space-y-1 ml-4 list-disc">
<li>Cost: <strong>€3</strong></li>
<li>Can be completed directly at the space</li>
<li>Valid until <strong>December 31, 2026</strong></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<.features_section
title="Everything for the modern nomad"
description="We've curated the perfect environment for productivity, ensuring you have the tools to thrive in Sicily."

View file

@ -2,8 +2,6 @@
<.page_header
booking_path={~p"/book/space/#{@space.slug}"}
booking_label="Booking request"
price="€35"
price_unit="hour"
capacity="8"
images={[
~p"/images/meeting_room/01.jpg",

View file

@ -2,8 +2,6 @@
<.page_header
booking_path={~p"/book/space/#{@space.slug}"}
booking_label="Booking request"
price="€50"
price_unit="hour"
capacity="8"
images={[
~p"/images/music_room/01.jpg",

View file

@ -51,8 +51,6 @@
id="coworking"
title={@coworking_space.name}
description={@coworking_space.description}
price="15"
time_unit="4 hours"
image_url={~p"/images/coworking_room/01.jpg"}
primary_label="Coworking"
primary_label_variant={:secondary}
@ -66,8 +64,6 @@
id="meeting"
title={@meeting_space.name}
description={@meeting_space.description}
price="40"
time_unit="hour"
image_url={~p"/images/meeting_room/01.jpg"}
primary_label="Meeting"
primary_label_variant={:secondary}
@ -83,8 +79,6 @@
id="music"
title={@music_space.name}
description={@music_space.description}
price="25"
time_unit="hour"
image_url={~p"/images/music_room/01.jpg"}
primary_label="Music"
primary_label_variant={:primary}

View file

@ -13,6 +13,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.RequestCreatedEmailWorkerTest do
"customer_phone" => "+1234567890",
"customer_comment" => "Test comment",
"space_name" => "Coworking Space",
"space_slug" => "arcipelago",
"start_datetime" => "2026-02-02T09:00:00Z",
"end_datetime" => "2026-02-02T13:00:00Z"
}
@ -35,6 +36,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.RequestCreatedEmailWorkerTest do
"customer_phone" => "+1234567890",
"customer_comment" => "Test comment",
"space_name" => "Coworking Space",
"space_slug" => "arcipelago",
"start_datetime" => "2026-02-02T09:00:00Z",
"end_datetime" => "2026-02-02T13:00:00Z"
}
@ -59,6 +61,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.RequestCreatedEmailWorkerTest do
"customer_phone" => "+1234567890",
"customer_comment" => "Another test",
"space_name" => "Meeting Room",
"space_slug" => "media-room",
"start_datetime" => "2026-02-03T14:00:00Z",
"end_datetime" => "2026-02-03T18:00:00Z"
}
@ -84,6 +87,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.RequestCreatedEmailWorkerTest do
"customer_phone" => "+1234567890",
"customer_comment" => "Test",
"space_name" => "Music Room",
"space_slug" => "hall",
"start_datetime" => "2026-02-04T10:00:00Z",
"end_datetime" => "2026-02-04T12:00:00Z"
}
@ -110,6 +114,7 @@ defmodule SpazioSolazzo.BookingSystem.Booking.RequestCreatedEmailWorkerTest do
"customer_phone" => "+1234567890",
"customer_comment" => "Admin comment",
"space_name" => "Coworking Space",
"space_slug" => "arcipelago",
"start_datetime" => "2026-02-05T09:00:00Z",
"end_datetime" => "2026-02-05T11:00:00Z"
}

View file

@ -15,7 +15,7 @@ defmodule SpazioSolazzo.BookingSystem.BookingTest do
user = register_user("testuser@example.com", "Test User")
date = ~D[2026-02-10]
date = Date.add(Date.utc_today(), 7)
%{space: space, user: user, date: date}
end