package tagrepository

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

	"github.com/google/uuid"
)

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

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

	return nil
}
