-
Notifications
You must be signed in to change notification settings - Fork 0
get hotel id feature ticket #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
danctila
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall great stuff @tars919 🎉. couple of notes and a few minor changes requested mostly to naming.
good:
- error handling (400, 404, 500) 🙏
- UUID validation is correct, test coverage is epic
- existing repo patterns
changes requested:
- naming conventions (GetById -> FindByID in repository)
- move
HotelRepositoryinterface fromstorage.gotorepo_types.go - Swagger godoc comments to handler method
backend/internal/handler/hotels.go
Outdated
|
|
||
| //Interface for hotel repository -> used in testing later | ||
| type HotelRepository interface { | ||
| GetByID(ctx context.Context, id string) (*models.Hotel, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be FindByID per naming convention (repository methods for GET should use find prefix). Applies to both the interface and implementation
| return &HotelRepository{db: db} | ||
| } | ||
|
|
||
| func (r *HotelRepository) GetByID(ctx context.Context, id string) (*models.Hotel, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method should be FindByID per naming convention
| DB: db, | ||
| DevsRepository: repository.NewDevsRepository(db), | ||
| RequestRepository: repository.NewRequestsRepo(db), | ||
| //added for hotel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove cmt
| type HotelRepository interface { | ||
| GetByID(ctx context.Context, id string) (*models.Hotel, error) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| type HotelRepository interface { | |
| GetByID(ctx context.Context, id string) (*models.Hotel, error) | |
| } | |
| type HotelRepository interface { | |
| FindByID(ctx context.Context, id string) (*models.Hotel, error) | |
| } |
backend/internal/service/server.go
Outdated
| helloHandler := handler.NewHelloHandler() | ||
| devsHandler := handler.NewDevsHandler(repository.NewDevsRepository(repo.DB)) | ||
| reqsHandler := handler.NewRequestsHandler(repository.NewRequestsRepo(repo.DB)) | ||
| hotelHandler := handler.NewHotelHandler(repository.NewHotelRepository(repo.DB)) //for hotel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove cmt
backend/internal/service/server.go
Outdated
| r.Post("/", reqsHandler.CreateRequest) | ||
| }) | ||
|
|
||
| // hotel routes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalize cmt
- changed naming conventions - added swagger comments - moved interface
danctila
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪
Description
This PR is documenting the implementation for the get hotels id ticket to retrieve a single hotel by its given UUID.
Type of Change
Related Issue(s)
Closes #43
What Changed?
Testing & Validation
How to Test
Test Coverage
Screenshots/Recordings
Unfinished Work & Known Issues
Notes & Nuances
Deployment Considerations
backend/supabase/migrations/).env.example)Pre-Merge Checklist
Code Quality
Testing & CI
Documentation
Security & Performance
Reviewer Notes
Areas needing extra attention:
Questions for reviewers: ...
Concerns: ...