{"action":"created","issue":{"url":"https://api.github.com/repos/Java-Classes/MealOrder/issues/30","repository_url":"https://api.github.com/repos/Java-Classes/MealOrder","labels_url":"https://api.github.com/repos/Java-Classes/MealOrder/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/Java-Classes/MealOrder/issues/30/comments","events_url":"https://api.github.com/repos/Java-Classes/MealOrder/issues/30/events","html_url":"https://github.com/Java-Classes/MealOrder/pull/30","id":297785205,"number":30,"title":"Purchase order aggregate create.","user":{"login":"YegorUdovchenko","id":33632314,"avatar_url":"https://avatars2.githubusercontent.com/u/33632314?v=4","gravatar_id":"","url":"https://api.github.com/users/YegorUdovchenko","html_url":"https://github.com/YegorUdovchenko","followers_url":"https://api.github.com/users/YegorUdovchenko/followers","following_url":"https://api.github.com/users/YegorUdovchenko/following{/other_user}","gists_url":"https://api.github.com/users/YegorUdovchenko/gists{/gist_id}","starred_url":"https://api.github.com/users/YegorUdovchenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YegorUdovchenko/subscriptions","organizations_url":"https://api.github.com/users/YegorUdovchenko/orgs","repos_url":"https://api.github.com/users/YegorUdovchenko/repos","events_url":"https://api.github.com/users/YegorUdovchenko/events{/privacy}","received_events_url":"https://api.github.com/users/YegorUdovchenko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-16T13:29:37Z","updated_at":"2018-02-16T13:49:08Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Java-Classes/MealOrder/pulls/30","html_url":"https://github.com/Java-Classes/MealOrder/pull/30","diff_url":"https://github.com/Java-Classes/MealOrder/pull/30.diff","patch_url":"https://github.com/Java-Classes/MealOrder/pull/30.patch"},"body":"In this PR `PurchaseOrderAggregate`  business logic was processed.\r\n\r\n- Created handlers for purchase order commands.\r\n- Created purchase order event appliers.\r\n- Created `PurchaseOrderValidator` class to perform validation process upon `CreatePurchaseOrder` command handling. Its method `isAllowedPurchaseOrderCreation(CreatePurchaseOrder cmd)` checks incoming command for some options: its orders are with 'ACTIVE' status only, its orders and purchase order dates  are equal, its orders are not empty and its vendors are equal.\r\n- Created `PurchaseOrderValidator` method `findInvalidOrders(List<Order> orders)` to perform validation of each order in the list and return those which considered as invalid. For now it is forbidden to order more than 20 equal dishes in single order to prevent users mistakes.\r\n- Added methods that throw rejections upon command handling.\r\n- All handlers were covered with tests. "},"comment":{"url":"https://api.github.com/repos/Java-Classes/MealOrder/issues/comments/366239718","html_url":"https://github.com/Java-Classes/MealOrder/pull/30#issuecomment-366239718","issue_url":"https://api.github.com/repos/Java-Classes/MealOrder/issues/30","id":366239718,"user":{"login":"YegorUdovchenko","id":33632314,"avatar_url":"https://avatars2.githubusercontent.com/u/33632314?v=4","gravatar_id":"","url":"https://api.github.com/users/YegorUdovchenko","html_url":"https://github.com/YegorUdovchenko","followers_url":"https://api.github.com/users/YegorUdovchenko/followers","following_url":"https://api.github.com/users/YegorUdovchenko/following{/other_user}","gists_url":"https://api.github.com/users/YegorUdovchenko/gists{/gist_id}","starred_url":"https://api.github.com/users/YegorUdovchenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YegorUdovchenko/subscriptions","organizations_url":"https://api.github.com/users/YegorUdovchenko/orgs","repos_url":"https://api.github.com/users/YegorUdovchenko/repos","events_url":"https://api.github.com/users/YegorUdovchenko/events{/privacy}","received_events_url":"https://api.github.com/users/YegorUdovchenko/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T13:49:07Z","updated_at":"2018-02-16T13:49:07Z","author_association":"CONTRIBUTOR","body":"@vladislav-kozachenko PTAL"}}
{"actor":{"display_login":"YegorUdovchenko"}}