package registration type RegistrationService struct { Notifier RegistrationNotifier Repository RegistrationRepository } func (service *RegistrationService) HandleNewRegistration(reg *Registration) error { return service.Repository.SaveRegistration(reg) } func (service *RegistrationService) GetUnconfirmedRegistrations() ([]*Registration, error) { return service.Repository.GetUnconfirmedRegistrations() } func (service *RegistrationService) ConfirmRegistration(registrationId string) error { registration, err := service.Repository.ConfirmRegistration(registrationId) if err != nil { return err } return service.Notifier.NotifyNewRegistration(registration) }