Skip to content

feat: Add rating eligibility gRPC and queries#10

Merged
janosevicsm merged 1 commit intodevelopfrom
feature/rating-eligibility
Feb 21, 2026
Merged

feat: Add rating eligibility gRPC and queries#10
janosevicsm merged 1 commit intodevelopfrom
feature/rating-eligibility

Conversation

@janosevicsm
Copy link
Copy Markdown
Contributor

Add a CheckRatingEligibility RPC to the internal proto, implement the gRPC handler, and add repository queries to support it. The proto defines request/response messages for guest_id, target_id and target_type and returns eligible + reason. ReservationGrpcService.checkRatingEligibility parses IDs, checks whether the target is a HOST or accommodation, logs the check, and uses new repository methods to count completed (APPROVED, endDate < today) stays; eligibility is true when at least one completed stay is found. Two JPQL methods were added to ReservationRepository: countCompletedStaysAtAccommodation and countCompletedStaysWithHost, both counting approved past reservations for the guest against an accommodation or host respectively.

Add a CheckRatingEligibility RPC to the internal proto, implement the gRPC handler, and add repository queries to support it. The proto defines request/response messages for guest_id, target_id and target_type and returns eligible + reason. ReservationGrpcService.checkRatingEligibility parses IDs, checks whether the target is a HOST or accommodation, logs the check, and uses new repository methods to count completed (APPROVED, endDate < today) stays; eligibility is true when at least one completed stay is found. Two JPQL methods were added to ReservationRepository: countCompletedStaysAtAccommodation and countCompletedStaysWithHost, both counting approved past reservations for the guest against an accommodation or host respectively.
@janosevicsm janosevicsm self-assigned this Feb 21, 2026
@janosevicsm janosevicsm merged commit d699ead into develop Feb 21, 2026
1 check 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