Group the locations
Orou starts with the way the group thinks about locations. The Parakou companies have two locations that count as “Parakou hub”. He creates the group with Create a location group. Later he renames it with Rename a location group, and he browses the groups, with the number of locations each one holds, with List location groups and View a location group. Groups matter because the steps of a stock transfer point to a group, not to one location. See Plan and run stock transfers. When a group is no longer needed, he removes it with Delete a location group. A group still holding locations, or still used by a transfer or a trip, is refused.Register locations and vehicles
Orou registers the Parakou location with Create a location or vehicle, choosing the type “location” and its group. He registers the 20-tonne truck driven by Gildas Akpovi the same way, with the type “vehicle”. A vehicle has no group. He can share the new site with some companies right away, or later. He then adds details with Set location or vehicle details: for a location its address, city and volumes, for a truck its plate number, driver, load volume and weight, insurance expiry date and fuel type. To find a site again he uses List locations and vehicles and View a location or vehicle. When the truck is sold or the location closes, Delete a location or vehicle removes it, along with its sharing and its details. Edit a location or vehicle renames it, or moves a location to another group.Share a site with companies
The Natitingou company needs to receive goods at the Parakou hub. Orou opens the location and shares it with that company using Share a site with companies. From then on, the company sees the location and can use it, for example as a transfer step. List companies sharing a site shows who has access. If the agreement ends, Stop sharing a site cuts the access. Stock and transfers that already refer to the site are not touched.The rules
- A location must belong to a location group of the organization. A vehicle must not have one. A location cannot be moved out of its group: it must always keep one.
- A site name must be unique in the organization. The name of a deleted site cannot be reused.
- A location group name must be unique in the organization. A deleted group is gone for good.
- A location group cannot be deleted while it holds a location (deleted ones included), while a transfer step refers to it, or while a trip stop points to it.
- A location cannot join a group, leave a group or be deleted while the group is used by a step of a running transfer.
- Sharing, and sharing again: a company that already has access cannot be added a second time. A company whose access was removed can be given access again.
- To remove a sharing, you give the identifier of the sharing link, not the identifier of the company.
- When listing sites, you must give the type (location or vehicle). Permissions are checked for that type, so a member can be allowed to list vehicles and not locations.
- Each action has its own permission for locations and another for vehicles, and the company must hold it too.
- Details accept only the keys that suit the type. A measure and its unit go together: a volume needs its volume unit, a weight needs its weight unit. Keys not sent are left as they are.
All the actions of this topic
- List locations and vehicles: Browse the organization’s locations (shops, warehouses) and vehicles, optionally filtered by name or type.
- Create a location or vehicle: Registers a new location or vehicle, optionally grouped and shared with some companies.
- View a location or vehicle: Shows the details of one location or vehicle.
- Edit a location or vehicle: Renames a location or vehicle, or moves a location to another location group. Company sharing and details are managed by other endpoints.
- Delete a location or vehicle: Removes a location or vehicle, along with its company sharing and its details.
- List companies sharing a site: Shows which companies of the organization may use a given location or vehicle.
- Share a site with companies: Makes a location or vehicle available to one or more companies of the organization.
- Stop sharing a site: Removes a company’s access to a location or vehicle.
- Set location or vehicle details: Saves descriptive details of a location or vehicle (for example capacity or measurements) in one call, creating or updating each key sent; the answer lists the casted values of the keys that are not null.
- List location groups: Lists the groups used to organise locations, with how many locations each holds.
- Create a location group: Adds a named group for organising locations.
- View a location group: Shows one location group.
- Rename a location group: Changes the name of a location group.
- Delete a location group: Deletes a location group that nothing uses.