package activity

import (
	"context"

	v1 "server/api/activity/v1"
	"server/internal/model"
	"server/internal/service"
)

func (c *ControllerV1) ItemAdd(ctx context.Context, req *v1.ItemAddReq) (res *v1.ItemAddRes, err error) {
	id, err := service.SignInRewardDetails().Create(ctx, &model.SignInRewardDetail{
		RuleId:     req.RuleId,
		DayNumber:  req.DayNumber,
		RewardType: req.RewardType,
		Quantity:   req.Quantity,
		Status:     req.Status,
	})
	if err != nil {
		return nil, err
	}
	return &v1.ItemAddRes{Id: id, Success: true}, nil
}
