package repositories

import (
	"GoMembership/internal/database"
	"GoMembership/internal/models"
)

type ConsentRepositoryInterface interface {
	CreateConsent(consent *models.Consent) (uint, error)
}

type ConsentRepository struct{}

func (repo *ConsentRepository) CreateConsent(consent *models.Consent) (uint, error) {
	result := database.DB.Create(consent)

	if result.Error != nil {
		return 0, result.Error
	}
	return consent.ID, nil
}
