package tagrepository

import (
	tagdomain "legalgo-BE-go/internal/domain/tag"

	"github.com/google/uuid"
)

func (acc *accessor) Create(spec tagdomain.TagReq) error {
	data := &tagdomain.Tag{
		ID:   uuid.NewString(),
		Code: spec.Code,
		Name: spec.Name,
	}

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

	return nil
}
