Skip to content
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

EMD->EML generation bug: Should not require additional readmodel property in EMD #10

Open
robertreppel opened this issue Apr 14, 2018 · 1 comment

Comments

@robertreppel
Copy link
Contributor

In the current version there needs to be at least one read model parameter which is not an aggregate ID in order for the EMD->EML converter to be able to find the events a read model needs to subscribe to:

This is OK:

# test
Register -> userId, name
User Registration Happened // userId, name
Submit -> timesheetId
Timesheet Submitted // timesheetId
Timesheets* // timesheetId, userId, name

This should be OK, but isn't:

# test
Register -> userId, name
User Registration Happened // userId, name
Submit -> timesheetId
Timesheet Submitted // timesheetId
Timesheets* // timesheetId, userId

les validate results in:

EML Errors:
MissingReadmodelSubscribesToEvent: test-Timesheets: Missing Readmodel SubscribesTo Event(s)

There is no need for this limitation - EMD->EML should be able to find the "Timesheet Submitted" and "User Registration Happened" events based on the EMD supplied.

@robertreppel robertreppel added the help wanted Extra attention is needed label Apr 14, 2018
@mohkami
Copy link
Contributor

mohkami commented May 21, 2018

It may be more of a question to understand the problem a bit better:
should Timesheets subscribe to both User Registration Happened and Timesheet Submitted?
I was trying to debug this with the following input:

# test
Register -> userId, name
User Registration Happened // userId, name
Submit -> timesheetId
Timesheet Submitted // timesheetId
Timesheets* // timesheetId, userId, name

But if I log the readmodel, it seems that User Registration Happened it the only one it subscribes to.

My logging(log.Printf("%v", readmodel)) is in this loop: https://github.com/Adaptech/les/blob/master/pkg/eml/validateReadmodels.go#L8

The output:

2018/05/20 20:04:50 {{Timesheets timesheetId [UserRegistrationHappened]}}
2018/05/20 20:04:50 {{Timesheets timesheetId [UserRegistrationHappened]}}

@robertreppel robertreppel removed the help wanted Extra attention is needed label May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants