diff --git a/docs/assets/reuses-service.png b/docs/assets/reuses-service.png new file mode 100644 index 0000000000000000000000000000000000000000..cdc1c41841189f3899449ebbe349d3e728427ec7 Binary files /dev/null and b/docs/assets/reuses-service.png differ diff --git a/docs/components/services/media-library.md b/docs/components/services/media-library.md index 2224d8df1d6bfb6de16b7f8f936dc815acd51a8a..fd818a9cbd5ae97b834be7ac2cd9a53788a4a5ff 100644 --- a/docs/components/services/media-library.md +++ b/docs/components/services/media-library.md @@ -22,4 +22,4 @@ Before uploading the file, it makes sure that the specified bucket is created. I The files are folded in sub-buckets as following `/<specified-bucket-name>/<year-YYYY>/<month-MM>/`. -The uploaded file keep its original name but is prefixed with the id of the corresponding entry in the mongo database. +The uploaded file keeps its original name but is prefixed with the id of the corresponding entry in the mongo database. diff --git a/docs/components/services/reuses.md b/docs/components/services/reuses.md index 0e169a68b6ca037bf160349af27b08596a7652e7..edcbb81fefa87c0a3edcfc88e6e1c3c6917dc95e 100644 --- a/docs/components/services/reuses.md +++ b/docs/components/services/reuses.md @@ -2,8 +2,34 @@ ## Features +The Metropolitan area of Lyon promotes the reuse of territorial data: analysis, map, site, service, application... This service provides a list of those reuses. + +A record in the underlying database includes the following information: + +* `_id`: a technical unique identifier (automatically generated); +* `name`: the name of the reuse; +* `uuid`: a business unique identifier (automatically generated if not provided); +* `creator`: the name of the entity that created the reuse; +* `logo`: the url of the reuse's logo; +* `website`: the website url of the reuse; +* `reuseTypes`: an array of the types of the reuse (mobile app, website, article); +* `datasetsUsed`: an array containing the `slugs` of the datasets being reused; +* `createDate`: the date on which the reuse has been created; +* `updateDate`: the date on which the reuse has been updated for the last time; +* `published`: a boolean flag, indicating whether the record is published or not (draft); + ## Dependencies +This service has no dependency on other components. + ## Endpoints +This service exposes one single endpoint, `/reuses`, supporting all the CRUD methods in a RESTful fashion. An healthcheck endpoint is exposed as well, `/health`, returning a `200` HTTP code when all indicators are healthy, `503` in the opposite case. The service is considered to be healthy if the underlying database is up. + ## Implementation + + + +The service is implemented using the [NestJS](https://nestjs.com/) framework. We refer the reader to the [NestJS-based micro-services](../../miscellaneous/nestjs-micro-services.md) page for further details concerning the latter framework and the features it provides. + +[MongoDB](https://www.mongodb.com/) is used for data persistence. Data modeling as well as connections to MongoDB are performed with [Mongoose](https://github.com/Automattic/mongoose).