dimanche 17 janvier 2021

Database schema for logistic company

I am working on a web platform for managing logistics company orders. We have to manage a logistic company branches and its customers which have 1 or more branches as well. Note that a company branch manages 1 or more customer branches

The requirements are the following

  1. Company admin must be able to view all company branches, all customers for each company branch, and all customer branches for each customer
  2. Company user has access to only 1 company branch (assigned) and can view all customers assigned to him (not necessarily all customers of the company branch). For each customer it can view 1 or more branches (not necessarily all the customer branches)
  3. A customer admin can view all customer branches for its customer
  4. A customer user can view only the customer branches assigned to him

In addition, I was thinking to link each order generated to a customer branch that requested it. Allowing the most fine-grained control over how can view the orders. For example, a customer user assigned to only customer branch A can view orders linked to only customer branch A, while a company user can view the orders linked to all customer branches: branch A, branch B and branch C.

This is the schema that I came up with but I feel that something is wrong enter image description here

Aucun commentaire:

Enregistrer un commentaire