ioet / ioet/time-tracker-backend

Return related items to projects

Open
#116 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Python
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The project model is contained, in a tree-like structure, inside an optional project type and an optional customer. It would be nice to present in the UI such structure and for that, we need to give more details than just an id. Luckily, Cosmos DB supports in its SQL API a [JOIN](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-join) statement, which we can use to allow such feature.

TODO:
- Experiment with the model project a way to get the related entities, the final result would be the name of the related model and the attributes we are interested in. E.g.
```
{
name: "My project"
description: "....",
project_type: {
name: "Startup"
}
customer: {
name: "VIP client"
},
project_type_id: "",
customer_id: "",
tenant_id: "",
....
}
```
- If possible, use this first model to create a declarative way to create these kind relation bindings using `JOIN` statements, maybe using python decorators or magic functions contained in the class `commons.data_access_layer.cosmos_db.CosmosDBModel`.
- After we have a stable working version, please create a ticket so we can use the same strategy for other models that have this kind of relationship, i.e. `project_type`, `time_entry`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.