mtesseract / nakadi-client

Haskell Client Library for the Nakadi Event Broker
Other
13 stars 9 forks source link

Use seperate data types for Subscriptions-to-be-created and Subscriptions-already-created #103

Closed mtesseract closed 6 years ago

mtesseract commented 6 years ago

Currently these two cases are handled by the same data type "Subscription". It's field "id" (a Subscription ID) is optional. Which is, of course, a poor attempt at covering these two different use-cases.

When creating a subscription the field "id" should not be provided, not even Nothing. When an existing subscription is returned it should contained a mandatory subscription ID, not a Maybe.

It probably makes sense to come with two distinct data type names and use them accordingly.