{"action":"created","issue":{"url":"https://api.github.com/repos/egoholic/domain-driven-toolkit/issues/2","labels_url":"https://api.github.com/repos/egoholic/domain-driven-toolkit/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/egoholic/domain-driven-toolkit/issues/2/comments","events_url":"https://api.github.com/repos/egoholic/domain-driven-toolkit/issues/2/events","html_url":"https://github.com/egoholic/domain-driven-toolkit/issues/2","id":63946965,"number":2,"title":"DSL for Aggregators","user":{"login":"egoholic","id":327453,"avatar_url":"https://avatars.githubusercontent.com/u/327453?v=3","gravatar_id":"","url":"https://api.github.com/users/egoholic","html_url":"https://github.com/egoholic","followers_url":"https://api.github.com/users/egoholic/followers","following_url":"https://api.github.com/users/egoholic/following{/other_user}","gists_url":"https://api.github.com/users/egoholic/gists{/gist_id}","starred_url":"https://api.github.com/users/egoholic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egoholic/subscriptions","organizations_url":"https://api.github.com/users/egoholic/orgs","repos_url":"https://api.github.com/users/egoholic/repos","events_url":"https://api.github.com/users/egoholic/events{/privacy}","received_events_url":"https://api.github.com/users/egoholic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"egoholic","id":327453,"avatar_url":"https://avatars.githubusercontent.com/u/327453?v=3","gravatar_id":"","url":"https://api.github.com/users/egoholic","html_url":"https://github.com/egoholic","followers_url":"https://api.github.com/users/egoholic/followers","following_url":"https://api.github.com/users/egoholic/following{/other_user}","gists_url":"https://api.github.com/users/egoholic/gists{/gist_id}","starred_url":"https://api.github.com/users/egoholic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egoholic/subscriptions","organizations_url":"https://api.github.com/users/egoholic/orgs","repos_url":"https://api.github.com/users/egoholic/repos","events_url":"https://api.github.com/users/egoholic/events{/privacy}","received_events_url":"https://api.github.com/users/egoholic/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-03-24T09:22:51Z","updated_at":"2015-04-07T12:40:31Z","closed_at":null,"body":"We need a simple DSL to describe aggregators around ROOT-entities to provide awesomeness =)\r\n\r\nIt should looks like:\r\n\r\n```ruby\r\naggregate :invoice do\r\n  root_entity :invoice # by default Root entity has the same name as an aggregate\r\n  \r\n  aggregates_many_instances_of :product, with: -> (invoice) { some_query_code }\r\n\r\n  # There are should be `product` aggregate which describes how to get product's price.\r\n  aggregates_many_instances_of :price, through: :product\r\n\r\n  aggregates_one_instance_of :creator, with: -> (invoice) { some_query_code } \r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/egoholic/domain-driven-toolkit/issues/comments/90534851","html_url":"https://github.com/egoholic/domain-driven-toolkit/issues/2#issuecomment-90534851","issue_url":"https://api.github.com/repos/egoholic/domain-driven-toolkit/issues/2","id":90534851,"user":{"login":"egoholic","id":327453,"avatar_url":"https://avatars.githubusercontent.com/u/327453?v=3","gravatar_id":"","url":"https://api.github.com/users/egoholic","html_url":"https://github.com/egoholic","followers_url":"https://api.github.com/users/egoholic/followers","following_url":"https://api.github.com/users/egoholic/following{/other_user}","gists_url":"https://api.github.com/users/egoholic/gists{/gist_id}","starred_url":"https://api.github.com/users/egoholic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egoholic/subscriptions","organizations_url":"https://api.github.com/users/egoholic/orgs","repos_url":"https://api.github.com/users/egoholic/repos","events_url":"https://api.github.com/users/egoholic/events{/privacy}","received_events_url":"https://api.github.com/users/egoholic/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T12:40:31Z","updated_at":"2015-04-07T12:40:31Z","body":"Another way: For each aggregate we need to define the whole field of requests. But I hope we can do the same in the simpler way described above.\r\n"}}