Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A abocar
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • cct
  • abocar
  • Wiki
  • Vehicles

Vehicles · Changes

Page history
Update Vehicles authored Oct 07, 2021 by Andrea Pavlovic's avatar Andrea Pavlovic
Show whitespace changes
Inline Side-by-side
Vehicles.md
View page @ fe3879ca
......@@ -51,3 +51,42 @@ POST https://garage.abocar.at/plugins/vehicle_reown
"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
Clone repository
  • Customers
  • Home
  • Queries
  • Test_Setup
  • Vehicles
  • v2