| ... | @@ -3,7 +3,7 @@ |
... | @@ -3,7 +3,7 @@ |
|
|
Unlike the other data, customers (private individual or company) are stored in a specific manner, so that
|
|
Unlike the other data, customers (private individual or company) are stored in a specific manner, so that
|
|
|
|
|
|
|
|
* clients (=private individuals) can log in
|
|
* clients (=private individuals) can log in
|
|
|
* a client may have different permissions
|
|
* a client may have different agendas (access rights)
|
|
|
* a vehicle may be owned by either a client or a company
|
|
* a vehicle may be owned by either a client or a company
|
|
|
|
|
|
|
|
This means that we added plugins to the general queries and transitions, to make it easier or possible at all to administrate and query the data correctly.
|
|
This means that we added plugins to the general queries and transitions, to make it easier or possible at all to administrate and query the data correctly.
|
| ... | @@ -56,7 +56,29 @@ Companies can be retrieved with the equivalent query: |
... | @@ -56,7 +56,29 @@ Companies can be retrieved with the equivalent query: |
|
|
|
|
|
|
|
## Client Agendas
|
|
## Client Agendas
|
|
|
|
|
|
|
|
There are three client agendas: "admin" (ID: 10), "employee" (ID:) and "customer".
|
|
There are three client agendas: "admin" (ID: 10), "employee" (ID: 11) and "customer" (ID: 9).
|
|
|
|
|
|
|
|
These IDs should not change, but they could in theory.
|
|
|
|
|
|
|
|
To list them:
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
|
|
|
|
POST {{url}}/data/system/agenda/query
|
|
|
|
{}
|
|
|
|
```
|
|
|
|
|
|
|
|
To find one:
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
|
|
|
|
POST {{url}}/data/system/agenda/query
|
|
|
|
{
|
|
|
|
"conds": {"name": "employee"}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
"admin" and "employee" clients have full access to all customer data, employees may have limited access to some edit options.
|
|
"admin" and "employee" clients have full access to all customer data, employees may have limited access to some edit options.
|
|
|
|
|
|
| ... | @@ -85,6 +107,45 @@ Admin Customers are those who have the agenda "admin" assigned to them. So, to l |
... | @@ -85,6 +107,45 @@ Admin Customers are those who have the agenda "admin" assigned to them. So, to l |
|
|
```
|
|
```
|
|
|
Note that this query only returns the relevant data for the main query - core.customer. The join is used for filtering only. "prefetch" instead of "join" would return the data from system.client and system.assignment as well.
|
|
Note that this query only returns the relevant data for the main query - core.customer. The join is used for filtering only. "prefetch" instead of "join" would return the data from system.client and system.assignment as well.
|
|
|
|
|
|
|
|
|
### Add Agenda
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
|
|
|
|
# POST {{url}}/data/system/assignment/transitions/create
|
|
|
|
{
|
|
|
|
"agenda": 10,
|
|
|
|
"assigned_client": 34
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Remove Agenda
|
|
|
|
|
|
|
|
First, find the id of the assignment of the client to the agenda you want to remove:
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
|
|
|
|
# POST {{url}}/data/system/assignment/query
|
|
|
|
{
|
|
|
|
"conds": {
|
|
|
|
"agenda" : 10,
|
|
|
|
"assigned_client": 5
|
|
|
|
},
|
|
|
|
"attrs" : {"columns" : "id"}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Then delete the entry using that id:
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
|
|
|
|
# POST {{url}}/data/system/assignment/transitions/12/delete
|
|
|
|
{}
|
|
|
|
```
|
|
|
|
|
|
|
## Administration
|
|
## Administration
|
|
|
|
|
|
|
|
### Create Client
|
|
### Create Client
|
| ... | @@ -252,19 +313,4 @@ To list all clients assigned to a company, join system.client via owning_client |
... | @@ -252,19 +313,4 @@ To list all clients assigned to a company, join system.client via owning_client |
|
|
"prefetch" : "owning_client",
|
|
"prefetch" : "owning_client",
|
|
|
"join" : {"owning_client" : "assignment__core_customer__assigned_client"}}
|
|
"join" : {"owning_client" : "assignment__core_customer__assigned_client"}}
|
|
|
}
|
|
}
|
|
|
```
|
|
``` |
|
|
|
|
\ No newline at end of file |
|
|
### Add Admin to Client
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
#!json
|
|
|
|
|
|
|
|
|
|
# POST {{url}}/data/system/assignment/transitions/create
|
|
|
|
|
{
|
|
|
|
|
"agenda": 10,
|
|
|
|
|
"assigned_client": 34
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Remove Admin for Client |
|
|
|
\ No newline at end of file |
|
|