30 lines
707 B
Go
30 lines
707 B
Go
package local
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"galaxy/user/internal/ports"
|
|
)
|
|
|
|
// NoopDeclaredCountryChangedPublisher validates and discards auxiliary
|
|
// declared-country change events.
|
|
type NoopDeclaredCountryChangedPublisher struct{}
|
|
|
|
// PublishDeclaredCountryChanged validates event and discards it.
|
|
func (NoopDeclaredCountryChangedPublisher) PublishDeclaredCountryChanged(
|
|
ctx context.Context,
|
|
event ports.DeclaredCountryChangedEvent,
|
|
) error {
|
|
if ctx == nil {
|
|
return fmt.Errorf("publish declared-country changed event: nil context")
|
|
}
|
|
if err := ctx.Err(); err != nil {
|
|
return err
|
|
}
|
|
|
|
return event.Validate()
|
|
}
|
|
|
|
var _ ports.DeclaredCountryChangedPublisher = NoopDeclaredCountryChangedPublisher{}
|