Gives a list of all the document types available. Paginated. An optional query parameter is versions=true where it also populates each document type with all the previous versions respectively
none
/api/v1/document-types
POST
Create a document type
admin
/api/v1/document-types/:id
GET
Retrieves a document type with id :id
none
/api/v1/document-types/:id
PUT
Updates a document type with ID :id
admin
/api/v1/document-types/:id
DELETE
Deletes a document type with ID :id
admin
/api/v1/document-types/:id/versions
GET
Retrieves all the versions of a specific document type :id
admin
/api/v1/document-types/:id/versions/:v
GET
Retrieves a version (:v) of a specific document type with the ID :id
admin
Everytime you create a new documentType and update it, you will be creating a new version in another collection, thanks to mongoose-version.
For now, every change creates a new version. I wasn't able to "ignore" the creation of a new version based on a list of paths, so even if you change the name, or the description, a new version is created, but i think that for now, it does what it should do.
Also i made some others fixes to docker-compose and updated the README.md for the setup instructions.
Well, this is just a start! But i think it works perfectly for document.
This pull requests closes issues #18 #19 and #20.
Finally DocumentType is done. An example of a documentType would look like this:
APIs available:
/api/v1/document-types
GET
versions=true
where it also populates each document type with all the previous versions respectivelynone
/api/v1/document-types
POST
admin
/api/v1/document-types/:id
GET
:id
none
/api/v1/document-types/:id
PUT
:id
admin
/api/v1/document-types/:id
DELETE
:id
admin
/api/v1/document-types/:id/versions
GET
:id
admin
/api/v1/document-types/:id/versions/:v
GET
:id
admin
Everytime you create a new documentType and update it, you will be creating a new version in another collection, thanks to
mongoose-version
.For now, every change creates a new version. I wasn't able to "ignore" the creation of a new version based on a list of paths, so even if you change the name, or the description, a new version is created, but i think that for now, it does what it should do.
Also i made some others fixes to docker-compose and updated the README.md for the setup instructions.
Well, this is just a start! But i think it works perfectly for document.