// Code generated by candi v1.3.1.

package grpchandler

import (
	"monorepo/services/notification-service/internal/modules/push-notif/usecase"

	"google.golang.org/grpc"

	"pkg.agungdp.dev/candi/codebase/factory/types"
	"pkg.agungdp.dev/candi/codebase/interfaces"
)

// GRPCHandler rpc handler
type GRPCHandler struct {
	mw        interfaces.Middleware
	uc        usecase.PushNotifUsecase
	validator interfaces.Validator
}

// NewGRPCHandler func
func NewGRPCHandler(mw interfaces.Middleware, uc usecase.PushNotifUsecase, validator interfaces.Validator) *GRPCHandler {
	return &GRPCHandler{
		mw: mw, uc: uc, validator: validator,
	}
}

// Register grpc server
func (h *GRPCHandler) Register(server *grpc.Server, mwGroup *types.MiddlewareGroup) {
	// 	proto.RegisterPushNotifHandlerServer(server, h)

	// 	// register middleware for method
	// 	mwGroup.AddProto(proto.File_push_notif_push_notif_proto, "Hello", h.mw.GRPCBearerAuth)
	// }

	// // Hello rpc method
	// func (h *GRPCHandler) Hello(ctx context.Context, req *proto.Request) (*proto.Response, error) {
	// 	trace := tracer.StartTrace(ctx, "PushNotifDeliveryGRPC:Hello")
	// 	defer trace.Finish()
	// 	ctx = trace.Context()

	// 	tokenClaim := candishared.ParseTokenClaimFromContext(ctx) // must using GRPCBearerAuth in middleware for this handler

	// 	return &proto.Response{
	// 		Message: h.uc.Hello(ctx) + ", with your session (" + tokenClaim.Audience + ")",
	// 	}, nil
}
