Skip to content

Return related items to projects #116

@EliuX

Description

@EliuX

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 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: "<uuid>",
 customer_id: "<uuid>",
 tenant_id: "<uuid>",
 ....
}
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions