package ports

import (
	"Yimaru-Backend/internal/domain"
	"context"
)

type RatingStore interface {
	UpsertRating(
		ctx context.Context,
		userID int64,
		targetType domain.RatingTargetType,
		targetID int64,
		stars int16,
		review *string,
	) (domain.Rating, error)
	GetRatingByUserAndTarget(
		ctx context.Context,
		userID int64,
		targetType domain.RatingTargetType,
		targetID int64,
	) (domain.Rating, error)
	GetRatingsByTarget(
		ctx context.Context,
		targetType domain.RatingTargetType,
		targetID int64,
		limit int32,
		offset int32,
	) ([]domain.Rating, error)
	GetRatingSummary(
		ctx context.Context,
		targetType domain.RatingTargetType,
		targetID int64,
	) (domain.RatingSummary, error)
	GetUserRatings(
		ctx context.Context,
		userID int64,
	) ([]domain.Rating, error)
	DeleteRating(
		ctx context.Context,
		ratingID int64,
		userID int64,
	) error
}
