| ... | ... | @@ -2,8 +2,9 @@ |
|
|
|
|
|
|
|
# Query #1 List Company Members?
|
|
|
|
|
|
|
|
username: test_admin@ironapi.com
|
|
|
|
password: test_admin
|
|
|
|
- username: test_admin@ironapi.com
|
|
|
|
- password: test_admin
|
|
|
|
|
|
|
|
https://garage.abocar.at/data/assignment/core_customer/query
|
|
|
|
|
|
|
|
```
|
| ... | ... | @@ -27,5 +28,34 @@ https://garage.abocar.at/data/assignment/core_customer/query |
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
I assume, you're trying to list all clients of a company?
|
|
|
|
I assume, you're trying to list all clients of a company?
|
|
|
|
|
|
|
|
"binding_instance_of_customer" is the company itself, so you don't need to fetch that unless you want the company details. "owning_client" should be empty though, as a company does not have a login.
|
|
|
|
|
|
|
|
So, "assigned_client" is all you need.
|
|
|
|
|
|
|
|
Assuming a company with core.customer.id=5. First, fetch the core.customer.ids of the associated clients:
|
|
|
|
|
|
|
|
```
|
|
|
|
#/data/assignment/core_customer/query
|
|
|
|
{
|
|
|
|
"conds": {
|
|
|
|
"binding_instance_of_customer": 5,
|
|
|
|
"assigned_client" : {"!=":5}
|
|
|
|
},
|
|
|
|
"attrs" : {
|
|
|
|
"prefetch" : ["assigned_client"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Should you need any data of those clients from core.customer, you will have to use a seperate query with the ids returned in the previous one:
|
|
|
|
```
|
|
|
|
#/data/core/customer/query
|
|
|
|
{
|
|
|
|
"conds": {
|
|
|
|
"me.id" : {"-in": [142]},
|
|
|
|
"me.is_client" : true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
``` |
|
|
\ No newline at end of file |