package logic

import (
	"juwan-backend/app/search/rpc/internal/models"
	"juwan-backend/app/search/rpc/pb"
)

func entFavoriteToPb(f *models.Favorites) *pb.Favorites {
	return &pb.Favorites{
		Id:         f.ID,
		UserId:     f.UserID,
		TargetType: f.TargetType,
		TargetId:   f.TargetID,
		CreatedAt:  f.CreatedAt.Unix(),
	}
}

func validTargetType(targetType string) bool {
	return targetType == "player" || targetType == "shop"
}
