splitted user registration into user, consents & bankaccount creation

This commit is contained in:
$(pass /github/name)
2024-07-07 21:39:58 +02:00
parent a76d73aa82
commit 555d1be575
13 changed files with 270 additions and 53 deletions

View File

@@ -0,0 +1,25 @@
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)
}