Files
GoMembership/internal/services/consent_service.go

26 lines
578 B
Go

package services
import (
"GoMembership/internal/models"
"GoMembership/internal/repositories"
"time"
)
type ConsentService interface {
RegisterConsent(consent *models.Consent) (int64, error)
}
type consentService struct {
repo repositories.ConsentRepository
}
func NewConsentService(repo repositories.ConsentRepository) ConsentService {
return &consentService{repo}
}
func (service *consentService) RegisterConsent(consent *models.Consent) (int64, error) {
consent.CreatedAt = time.Now()
consent.UpdatedAt = time.Now()
return service.repo.CreateConsent(consent)
}