splitted user registration into user, consents & bankaccount creation
This commit is contained in:
25
internal/services/consent_service.go
Normal file
25
internal/services/consent_service.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user