| ... | ... | @@ -50,4 +50,43 @@ POST https://garage.abocar.at/plugins/vehicle_reown |
|
|
|
"vehicle_id" : 2,
|
|
|
|
"customer_id" : 5
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Queries taking reowned vehicles into account
|
|
|
|
|
|
|
|
### All Instances
|
|
|
|
|
|
|
|
To find all entries for a vin which the user has access to (so, the admin sees all existing ones, the owner(s) only one each).
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
POST https://garage.abocar.at/data/core/vehicle/query
|
|
|
|
{
|
|
|
|
"conds" : {"vin":"vin_megane"}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Current Instance
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
POST https://garage.abocar.at/data/core/vehicle/query
|
|
|
|
{
|
|
|
|
"conds" : {"vin":"vin_megane", "reowned_id" : null}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### All Maintenances
|
|
|
|
|
|
|
|
The following query will give a list of all instances with a certain vin, regardless of ownership. As an admin will have access to all maintenances, they will see all of them. A customer will only find the instances which happened during their ownership.
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
POST https://garage.abocar.at/data/core/vehicle_maintenance/query
|
|
|
|
{
|
|
|
|
"conds" : {"vehicle.vin" : "vin_megane"},
|
|
|
|
"attrs" : {
|
|
|
|
"join" : ["vehicle"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
``` |
|
|
\ No newline at end of file |