We can split the logic for Concierge into five major chunks. We shall address the required logic flow for each of the individual chunks, and then at the end, combine them all to get the big picture of what we are trying to achieve.
Logical flow diagrams
The doc processor
First and foremost, we want to accept the payload sent to endpoint and start processing the document. Let's assume that api.FeedHandler accepts, validates, and sends the payload on pProcessCh:
The doc store
Let's then consider dStoreCh, which is the channel used for adding and retrieving documents...