package activity

import (
	"context"

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

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