-
- All Implemented Interfaces:
-
com.telenav.commerce.foodservice.api.IFoodCommerceApi
public final class FoodCommerce implements IFoodCommerceApi
Class responsible for retrieving the needed data in order to make a food flow.
-
-
Constructor Summary
Constructors Constructor Description FoodCommerce(IHttpApi retrofitApi)
-
Method Summary
Modifier and Type Method Description Unit
setConfiguration(SdkConfiguration configuration)
Updates the IHttpApi instance with the given configuration to be used in the communication with commerce service. CommerceResponse<List<Brand>>
getBrands()
Returns a list of brands available for food. CommerceResponse<List<FoodStore>>
getFoodStores(GeoLocation location, String brandId)
Returns a list of available food stores around the given location and for the given brand. CommerceResponse<List<FoodStore>>
getFoodStoresAlongRoute(GeoLocation location, String brandId, List<GeoLocation> routePoints)
Returns a list of available food stores around the given location, along the provided route, and for the given brand. CommerceResponse<FoodStore>
getDefaultStore(GeoLocation location, String brandId, String merchantKey, List<GeoLocation> routePoints)
Returns a store that matches the default store alg described belowIf there is no previous order history with the merchant(brand) If free drive If there is a store within 'food search radius' and store if open -> Select nearest store. CommerceResponse<List<FoodOrderInformation>>
getFoodHistory(Boolean onlyActive)
Retrieves user's food orders. -
-
Method Detail
-
setConfiguration
Unit setConfiguration(SdkConfiguration configuration)
Updates the IHttpApi instance with the given configuration to be used in the communication with commerce service.
- Parameters:
configuration
- to be used
-
getFoodStores
CommerceResponse<List<FoodStore>> getFoodStores(GeoLocation location, String brandId)
Returns a list of available food stores around the given location and for the given brand.
- Parameters:
location
- the coordinates around which the search should be done.brandId
- the id of the Brand for which the search should be done.
-
getFoodStoresAlongRoute
CommerceResponse<List<FoodStore>> getFoodStoresAlongRoute(GeoLocation location, String brandId, List<GeoLocation> routePoints)
Returns a list of available food stores around the given location, along the provided route, and for the given brand.
- Parameters:
location
- the coordinates around which the search should be done.brandId
- the id of the Brand for which the search should be done.routePoints
- list of route GeoLocation objects representing the route points
-
getDefaultStore
CommerceResponse<FoodStore> getDefaultStore(GeoLocation location, String brandId, String merchantKey, List<GeoLocation> routePoints)
Returns a store that matches the default store alg described below
If there is no previous order history with the merchant(brand) If free drive If there is a store within 'food search radius' and store if open -> Select nearest store. If active navigation if there is a store within 'X' minutes (X <= 10) of detour time from current route; store is open. Driving time from CVP and store is less than 'Y' mins (Y = 60) -> select the store that is closest (driving time) to the user and has a detour of less X mins x and y should be configurable without a client change (no new deploy on the cloud)
If there is previous order history with the merchant if Free drive select the nearest open store from all available order history within 'search radius' if no order history store is open and available within the search radius -> select the nearest open store If active navigation - use the same logic as no order history.
- Parameters:
location
- the coordinates around which the search should be done.brandId
- the id of the Brand for which the search should be done.routePoints
- list of route GeoLocation objects representing the route points
-
getFoodHistory
CommerceResponse<List<FoodOrderInformation>> getFoodHistory(Boolean onlyActive)
Retrieves user's food orders.
- Parameters:
onlyActive
- set if request should return only active items
-
-
-
-