package client

import (
	"context"

	"google.golang.org/grpc"
	activityv1 "hyapp.local/api/proto/activity/v1"
)

// InviteActivityRewardClient abstracts gateway reads and claims from activity-service invite reward APIs.
type InviteActivityRewardClient interface {
	GetInviteActivityRewardStatus(ctx context.Context, req *activityv1.GetInviteActivityRewardStatusRequest) (*activityv1.GetInviteActivityRewardStatusResponse, error)
	ClaimInviteActivityReward(ctx context.Context, req *activityv1.ClaimInviteActivityRewardRequest) (*activityv1.ClaimInviteActivityRewardResponse, error)
	ListInviteActivityLeaderboard(ctx context.Context, req *activityv1.ListInviteActivityLeaderboardRequest) (*activityv1.ListInviteActivityLeaderboardResponse, error)
}

type grpcInviteActivityRewardClient struct {
	client activityv1.InviteActivityRewardServiceClient
}

func NewGRPCInviteActivityRewardClient(conn *grpc.ClientConn) InviteActivityRewardClient {
	return &grpcInviteActivityRewardClient{client: activityv1.NewInviteActivityRewardServiceClient(conn)}
}

func (c *grpcInviteActivityRewardClient) GetInviteActivityRewardStatus(ctx context.Context, req *activityv1.GetInviteActivityRewardStatusRequest) (*activityv1.GetInviteActivityRewardStatusResponse, error) {
	return c.client.GetInviteActivityRewardStatus(ctx, req)
}

func (c *grpcInviteActivityRewardClient) ClaimInviteActivityReward(ctx context.Context, req *activityv1.ClaimInviteActivityRewardRequest) (*activityv1.ClaimInviteActivityRewardResponse, error) {
	return c.client.ClaimInviteActivityReward(ctx, req)
}

func (c *grpcInviteActivityRewardClient) ListInviteActivityLeaderboard(ctx context.Context, req *activityv1.ListInviteActivityLeaderboardRequest) (*activityv1.ListInviteActivityLeaderboardResponse, error) {
	return c.client.ListInviteActivityLeaderboard(ctx, req)
}
