No description
Find a file
Víctor Martínez 2cbce8ec39
refactor: make phone number optional (#9)
This pull request makes phone numbers optional for both user registrations and bookings, and updates validation, database schema, and UI to reflect this change. The main focus is to ensure that users are no longer required to provide a phone number, and that the application gracefully handles cases where a phone number is absent.

**Database & Resource Model Updates**

* Made the `phone_number` attribute in the `users` table and the `customer_phone` attribute in the `bookings` table nullable, including migration and resource snapshot updates. [[1]](diffhunk://#diff-baa6aed3674c4d6cbbebeafb076662df02dc4c25231dbd9dc9c8f0534ed1a1bfR1-R29) [[2]](diffhunk://#diff-a401f66b2ae5bfb798eb1bc2221bfeeac943e258950c90d59570b0bae05d3664R1-R244) [[3]](diffhunk://#diff-0c1180d6f6abc19b5987c8703bdee9ef67905535202f950e8327c32bd5b89d8aR1-R82)
* Updated Ash resource definitions in `user.ex` and `booking.ex` to allow `phone_number` and `customer_phone` to be `nil`. [[1]](diffhunk://#diff-9194b9d80dce091f6dcb56f784217272ae160e35454c4b4ccc8850ad5ee06e38L152-R152) [[2]](diffhunk://#diff-4b1ddd6d86899f2144c69d142883b8719c755e32c03dbda5da2188208a5ad503L55-R55) [[3]](diffhunk://#diff-4b1ddd6d86899f2144c69d142883b8719c755e32c03dbda5da2188208a5ad503L170-R170)

**Validation & Parsing Logic**

* Renamed and refactored user registration field validation to `ParseRegistrationFields`, allowing phone numbers to be omitted and trimming input values. Empty phone numbers are now treated as absent rather than as errors. [[1]](diffhunk://#diff-8ffdd76e260e3cda6f0816c8e585ae76b993a90d2519c38185a5fe22b4b49e47L1-R1) [[2]](diffhunk://#diff-8ffdd76e260e3cda6f0816c8e585ae76b993a90d2519c38185a5fe22b4b49e47R14-R60)
* Updated the authentication callback logic to trim input values and omit the phone number parameter if it is blank.

**User Interface Improvements**

* Updated registration and booking forms to indicate that phone numbers are optional, removed the required attribute, and improved placeholder text. [[1]](diffhunk://#diff-f356eb84970d8c9ee6ff1992c297b0cae07bade37ff967c1e6e0de6f8b67081cL101-R115) [[2]](diffhunk://#diff-43c0e1f7a869ee5c43a911bc10dc80cbb265a8672340ef0fa7c1d3009c047f02L92-R92)
* Updated email templates and confirmation screens to display "N/A" or "-" when phone numbers are missing. [[1]](diffhunk://#diff-48468ef2d1bb2c33b5ffb40457b77532815c7faf1830932661f665bff58b2177R6-R11) [[2]](diffhunk://#diff-3f33187b4021450b481ce53fe13166addea582c627f2cfbc99c75c7ce5c34857L10-R10) [[3]](diffhunk://#diff-43c0e1f7a869ee5c43a911bc10dc80cbb265a8672340ef0fa7c1d3009c047f02L92-R92)

**Profile Management**

* Improved profile update flow to ensure the form reflects the latest user data after saving changes.
* Made the "Full Name" field explicitly required in the profile form UI.
2026-01-15 15:57:54 +01:00
.github/workflows fix: review cleanup workflow (#8) 2026-01-14 17:27:14 +01:00
assets Setup first public version of the project 2026-01-10 19:03:02 +01:00
config feat: Reconfigure CI for review environments (#6) 2026-01-14 14:50:25 +01:00
lib refactor: make phone number optional (#9) 2026-01-15 15:57:54 +01:00
priv refactor: make phone number optional (#9) 2026-01-15 15:57:54 +01:00
rel feat: setup for fly.io deployment 2026-01-13 13:57:52 +01:00
test refactor: make phone number optional (#9) 2026-01-15 15:57:54 +01:00
.credo.exs refactor: make phone number optional (#9) 2026-01-15 15:57:54 +01:00
.dockerignore feat: setup for fly.io deployment 2026-01-13 13:57:52 +01:00
.formatter.exs Setup first public version of the project 2026-01-10 19:03:02 +01:00
.gitignore Setup first public version of the project 2026-01-10 19:03:02 +01:00
.igniter.exs Setup first public version of the project 2026-01-10 19:03:02 +01:00
AGENTS.md Setup first public version of the project 2026-01-10 19:03:02 +01:00
CLAUDE.md Setup first public version of the project 2026-01-10 19:03:02 +01:00
compose.yml Setup first public version of the project 2026-01-10 19:03:02 +01:00
Dockerfile feat: setup for fly.io deployment 2026-01-13 13:57:52 +01:00
flex chore: add command to run IEx on the server 2026-01-13 14:23:02 +01:00
fly.review.toml feat: Reconfigure CI for review environments (#6) 2026-01-14 14:50:25 +01:00
fly.toml feat: Reconfigure CI for review environments (#6) 2026-01-14 14:50:25 +01:00
LICENSE.md Setup first public version of the project 2026-01-10 19:03:02 +01:00
mix.exs Setup first public version of the project 2026-01-10 19:03:02 +01:00
mix.lock Setup first public version of the project 2026-01-10 19:03:02 +01:00
README.md feat: setup for fly.io deployment 2026-01-13 13:57:52 +01:00
yamlfmt.yml Setup first public version of the project 2026-01-10 19:03:02 +01:00

SpazioSolazzo

Spazio Solazzo is a cultural space in the heart of Palermo where people around the world gather to work, meet or play music.

Spazio Solazzo is managed by the Caravanserai cultural association and is found next to the Mojo Coliving project, which also makes part of Caravanserai.

This project allows Caravanserai to manage the booking of the different spaces inside Spazio Solazzo. Spazio Solazzo at the moment is made out of three other spaces:

  • A Coworking space, where people can book desks to work and share during the day.
  • A meeting room that people and companies can book for their own meetings.
  • A music jam space that single musicians and bands can book for their rehearsals and other musical projects.

Development

This site is build with Elixir.

I've decided to use the Phoenix web framework together with the Ash framework, together they allow me to build a rich interactive website with a rich data model easy to develop, test and maintain.

Personally, Phoenix is my go-to framework for any web projects that require any interactivity and real-time feedback to the users.

Ash helps modeling your domain and business logic in a very straight-forward way that integrates seamlessly with Phoenix.

Setup DB

First you will need to have Docker and Docker compose installed. See installation instructions.

Then, to spin up your local postgres database simply run:

docker compose up -d

Setup Phoenix project

You'll need to make sure you have Elixir, Erlang and Phoenix installed in your system.

After that, download the dependencies:

mix deps.get

And setup the project with:

mix setup

This should run the DB migrations and seed the DB with mock data.

Now you should be ready to run the tests:

mix test

Or to run the compiler, formatter, tests, credo and more:

mix precommit

Now, to start your Phoenix server:

  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:8080 from your browser and you're ready to go!

License

Copyright 2026 Victor Martinez Montané

Licensed under the Apache License, Version 2.0 (the "License"), subject to the Commons Clause License Condition v1.0. You may not use this file except in compliance with the License.

See the LICENSE file for details.