package subscribeplanrepository

import (
	subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"

	"github.com/google/uuid"
)

func (s *SubsPlan) Create(spec subscribeplandomain.SubscribePlanReq) error {
	data := &subscribeplandomain.SubscribePlan{
		ID:   uuid.NewString(),
		Code: spec.Code,
		Name: spec.Name,
	}

	if err := s.DB.Create(&data).Error; err != nil {
		return err
	}

	return nil
}
