Skip to content

Conversation

JonathanGian
Copy link
Contributor

This pull request implements several improvements and new features related to user profile completion and booking creation, as well as some API and type definition updates. The most significant changes include enforcing profile completeness before allowing bookings, expanding booking permissions, introducing a profile completion modal on the frontend, and refactoring API/type definitions for better consistency.

I had to go back and fix the addresses because the endpoint was changed at some point without updating the frontend. So the PR became a bit bigger than I would of liked. Validation still has to be added to the process a bit more, but that would need to be in another ticket so it doesnt get too big.

Backend: Profile and Booking Logic

  • Enforced that users must have a full name in their profile before creating a booking. If missing, a specific error with an error code and missing fields is thrown so the frontend can prompt the user. A warning is also provided if the phone number is missing, and multiple warnings are combined as needed. [1] [2]
  • Expanded the roles allowed to create bookings to include storage_manager and tenant_admin, in addition to user and requester.
  • Updated global validation options to hide target and value in validation errors for cleaner error responses.

Frontend: Profile Completion Modal

  • Added a new ProfileCompletionModal component that prompts users to complete their profile (full name required, phone and address recommended/optional) before proceeding with bookings. The modal includes validation, multi-language support, and user feedback.

API & Type Definitions

  • Updated address-related API methods (addAddress, updateAddress) to use a CreateAddressInput type, ensuring the user_id is not redundantly included in the payload. [1] [2]
  • Refactored and reordered several Supabase database type definitions and function argument orders for consistency and clarity, particularly for notification and booking-related procedures. [1] [2] [3] [4] [5]

These changes collectively improve data integrity, user experience, and maintainability across the booking and user profile flows.

Copy link

supabase bot commented Sep 4, 2025

This pull request has been ignored for the connected project rcbddkhvysexkvgqpcud because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link
Contributor

@athinakantis athinakantis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good. I wish instead of the modal we could have it as a section at the top where you create a booking to fill in any missing details. But we can talk about this as a team. This is a good solution to ensure we're not missing any user data.

There were some console.logs. Once those are removed I'd be happy to merge :)

@JonathanGian
Copy link
Contributor Author

It's good. I wish instead of the modal we could have it as a section at the top where you create a booking to fill in any missing details. But we can talk about this as a team. This is a good solution to ensure we're not missing any user data.

There were some console.logs. Once those are removed I'd be happy to merge :)

Ya that could be good, I was just wanted to be done with this PR after having to fix the addresses endpoint

@athinakantis athinakantis merged commit 971fd90 into develop Sep 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants