Skip to content

Feat/link backend mobile guests#181

Merged
manueltorres0 merged 44 commits intomainfrom
feat/link-backend-mobile-guests
Mar 24, 2026
Merged

Feat/link backend mobile guests#181
manueltorres0 merged 44 commits intomainfrom
feat/link-backend-mobile-guests

Conversation

@manueltorres0
Copy link
Contributor

@manueltorres0 manueltorres0 commented Mar 17, 2026

Description

  • builds on the guest and booking endpoint pr : Feat/guest and booking endpoint #178
  • added struct validation + tests + fixes to the structs/endpoint structure suggested by Dao in previous pr
  • added the frontend link up and added cursor based pagination

Type of Change

  • [] Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (code improvement without changing functionality)
  • Documentation update
  • Configuration/infrastructure change
  • Performance improvement
  • Test coverage improvement

Testing & Validation

How this was tested

  • handler layer tests for the guests handler

Screenshots/Recordings

https://drive.google.com/file/d/19mld677bPCtk2kogElLd0MGSdnFn4VKR/view?usp=sharing

Unfinished Work & Known Issues

  • The following items are intentionally deferred:
    • endpoint for getting the available floors, coming up in last pr
    • the hotel id is currently hard coded, waiting to talk to leads about how we want to handle this hotel id injection

Notes & Nuances

  • to run it you must comment out the middleware, because frontend for mobile does not have sign in flows yet

Pre-Merge Checklist

Code Quality

  • Code follows the project's style guidelines and conventions
  • Self-review completed (I've reviewed my own code for obvious issues)
  • No debugging code, console logs, or commented-out code left behind
  • No merge conflicts with the base branch
  • Meaningful commit messages that explain the "why"

Testing & CI

  • All CI checks are passing
  • All new and existing tests pass locally
  • Test coverage hasn't decreased (or decrease is justified)
  • Linting passes without errors

Documentation

  • Code is self-documenting or includes helpful comments for complex logic
  • API documentation updated (if backend endpoints changed)
  • Type definitions are accurate and up-to-date

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 12.50000% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.76%. Comparing base (15754bf) to head (3dbe0da).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
backend/internal/handler/bookings.go 0.00% 21 Missing ⚠️
backend/internal/repository/guests.go 0.00% 18 Missing ⚠️
backend/internal/repository/guest-bookings.go 0.00% 2 Missing ⚠️
backend/internal/service/server.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #181       +/-   ##
===========================================
- Coverage   84.00%   10.76%   -73.24%     
===========================================
  Files           7       94       +87     
  Lines          50     3224     +3174     
  Branches       24       24               
===========================================
+ Hits           42      347      +305     
- Misses          8     2872     +2864     
- Partials        0        5        +5     
Flag Coverage Δ
backend 24.14% <12.50%> (?)
mobile 84.00% <ø> (ø)
web 0.71% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
backend/internal/handler/guests.go 100.00% <100.00%> (ø)
clients/mobile/constants/theme.ts 100.00% <ø> (ø)
backend/internal/service/server.go 0.00% <0.00%> (ø)
backend/internal/repository/guest-bookings.go 0.00% <0.00%> (ø)
backend/internal/repository/guests.go 0.00% <0.00%> (ø)
backend/internal/handler/bookings.go 0.00% <0.00%> (ø)

... and 82 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vercel
Copy link

vercel bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
selfserve-web Ready Ready Preview, Comment Mar 18, 2026 1:01am

Copy link
Contributor

@Dao-Ho Dao-Ho left a comment

Choose a reason for hiding this comment

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

BANG 🔥 fire ships! Just some cmts and you're good to go

floors = append(floors, floor)
}
return floors, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Left this cmt on a your other pr but might be relevant here

I'm missing some context on what you're using this for so I'll just be adding additional info and let you use your best judgement.

If your page only requires to filter by floor, this is ok for now. But typically, filtering should be done using a post endpoint, since it's not really ideal to filter a lot of data using a query parameter. The query body is a much better use case for passing more complicated objects to the backend, and so filtering typically use query bodies to pass their objects/lists instead.

Also note that if you only want to retrieve bookings for rooms 1-50, your query would be very long.

Overall, if it's just fetching this to display a fixed amount that you know is small, than this is fine. Otherwise, I'd advise swapping over to use a POST to pass more complicated objects and data in the body.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forgot to delete this on this pr too, but this is not needed and dont think it will be in general, so I will delete, if it is needed later on we have to refactor anyway

func (h *GuestsHandler) GetGuestWithStays(c *fiber.Ctx) error {
id := c.Params("id")
_, err := uuid.Parse(id)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice catch 🔥

var departureDate *string
var arrivalDate *time.Time
var departureDate *time.Time
var roomNumber *int
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥 🔥

)}
</View>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

While it's not too readable, I don't expect this to be touched too much since it's a component. You can move some divs into its own component if you'd like, but this is optional.

I would use the color vars here tho

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored colors and component

Copy link
Contributor

@Dao-Ho Dao-Ho left a comment

Choose a reason for hiding this comment

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

LGTM, this is such a big ship, great work Manuel! 🐐 🚀 You're on fire 🔥 🔥 🔥 🔥

@manueltorres0 manueltorres0 merged commit 0335894 into main Mar 24, 2026
16 checks passed
@manueltorres0 manueltorres0 deleted the feat/link-backend-mobile-guests branch March 24, 2026 00:20
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.

3 participants