deepset-ai / COVID-QA

API & Webapp to answer questions about COVID-19. Using NLP (Question Answering) and trusted data sources.
Apache License 2.0
343 stars 119 forks source link

Add document aggregate class for document page #135

Closed RomanKova closed 3 years ago

RomanKova commented 3 years ago

Created a document class following the Aggregate pattern of the DDD. It does versioning of documents to prevent concurrent updates to a document by two different people. This way it will prevent the integrity of the Document Object and list of Questions n Answers associated with it. invariance and validations are done. And internal objects like Questions/Answers are not exposed to the outside world. So the behavior is entirely controlled by the Aggregate root object Document