-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: define event sourcing events in proto #874
base: main
Are you sure you want to change the base?
Conversation
97fb9d7
to
2d4a0c2
Compare
libs/hwes/event.go
Outdated
} | ||
|
||
func MessageToEventName(protoMessage proto.Message) string { | ||
protoEventType := proto.GetExtension(protoMessage.ProtoReflect().Descriptor().Options(), pbEventsV1.E_EventType).(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if I want to work with a v2, v3 etc event?
a.RegisterEventListener(propertyEventsV1.PropertyFieldTypeDataSelectOptionsRemoved, a.onFieldTypeDataSelectOptionsRemoved) | ||
a.RegisterEventListener(propertyEventsV1.PropertyArchived, a.onPropertyArchived) | ||
a.RegisterEventListener(propertyEventsV1.PropertyRetrieved, a.onPropertyRetrieved) | ||
a.RegisterEventListener(hwes.MessageToEventName(&pbTechnicalEventsV1.PropertyCreatedEvent{}), a.onPropertyCreated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could move this into RegisterEventListener and get rid of a lot of code duplication + get better type guarantees
The go_package "property-svc" gets converted into "property_svc" for the generated Golang code. If we can to import this proto, the generated Golang code imports "property-svc". This inconsistency results in non-compiling Golang code.
Which issues does this pull request close?
closes #873