package myPlant

import (
	"context"
	"github.com/zeromicro/go-zero/core/logx"
	"sundynix-micro-go/app/plant/api/internal/svc"
	"sundynix-micro-go/app/plant/api/internal/types"
	plantPb "sundynix-micro-go/app/plant/rpc/plant"
)

type DeleteCarePlanLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewDeleteCarePlanLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteCarePlanLogic {
	return &DeleteCarePlanLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
}

func (l *DeleteCarePlanLogic) DeleteCarePlan(req *types.IdsReq) error {
	_, err := l.svcCtx.PlantRpc.DeleteCarePlan(l.ctx, &plantPb.IdsReq{Ids: req.Ids})
	return err
}
