Re: [Specifications] Add Use Case: Creating events indirectly (ie. with PUT)

Review status: 0 of 1 files reviewed at latest revision, 7 unresolved discussions, some commit checks failed.

---

*[drafts/use-cases/5.1.creating-new-event-indirectly.md, line 34 at r1](https://reviewable.io:443/reviews/hydracg/specifications/143#-KxZXSL5Owpv1cqTG5AR:-KxZXSL5Owpv1cqTG5AS:b-9d5rbl) ([raw file](https://github.com/hydracg/specifications/blob/f03e3028e6417adf2767a44c0c854b4af3b5fb4d/drafts/use-cases/5.1.creating-new-event-indirectly.md#L34)):*
> ```Markdown
> var operation = client.get("http://example.com/events")
>     .getOperationOfType('http://schema.org/CreateAction', /* recursive */ true)
>     .filter(operation => operation.expects === 'http://schema.org/Event');
> ```

@alien-mcl See how I added the second `recursive` parameter. The indention is to search of operations in any linked resources. 

Also, is the native `filter` something you would do? Also, I realised now that it would return an Array. Should add indexer here...

---

*[drafts/use-cases/5.1.creating-new-event-indirectly.md, line 36 at r1](https://reviewable.io:443/reviews/hydracg/specifications/143#-KxZY9gJ8iisuB-N2HfY:-KxZY9gJ8iisuB-N2HfZ:bvyu5bh) ([raw file](https://github.com/hydracg/specifications/blob/f03e3028e6417adf2767a44c0c854b4af3b5fb4d/drafts/use-cases/5.1.creating-new-event-indirectly.md#L36)):*
> ```Markdown
>     .filter(operation => operation.expects === 'http://schema.org/Event');
>     
> client.invoke(operation, event, templateVariables);
> ```

@alien-mcl Here you see the second change where I added an optional parameter with template variables. Initially I was considering to have only one model - event and template var merged but I concluded it would break Single Responsibility in a way.

---


*Comments from [Reviewable](https://reviewable.io:443/reviews/hydracg/specifications/143)*
<!-- Sent from Reviewable.io -->


-- 
GitHub Notification of comment by tpluscode
Please view or discuss this issue at https://github.com/HydraCG/Specifications/pull/143#issuecomment-340216767 using your GitHub account

Received on Saturday, 28 October 2017 20:12:23 UTC