package subscriberepository

import (
	subscribedomain "legalgo-BE-go/internal/domain/subscribe"

	"github.com/google/uuid"
)

func (s *SubsAccs) Create(subsPlanId string) (string, error) {
	spec := &subscribedomain.Subscribe{
		ID:              uuid.NewString(),
		SubscribePlanID: subsPlanId,
	}

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

	return spec.ID, nil
}
