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.
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).