Package de.hybris.platform.order
Interface ZoneDeliveryModeService
-
- All Superinterfaces:
DeliveryModeService
- All Known Implementing Classes:
DefaultZoneDeliveryModeService
public interface ZoneDeliveryModeService extends DeliveryModeService
Service around theZoneDeliveryModeModel. You may find more info about delivery modes here. The service allows findingZoneDeliveryModeModelby code. Service returns also specific delivery costs for specified zone, currency and delivery mode.- Spring Bean ID:
- zoneDeliveryModeService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<ZoneModel>getAllZones()Gets allZoneModels.java.util.Collection<CurrencyModel>getCurrencies(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)Gets all currencies for which values are defined in the zone and in the delivery mode.ZoneDeliveryModeValueModelgetDeliveryValue(ZoneModel zone, CurrencyModel currency, java.lang.Double min, ZoneDeliveryModeModel zoneDeliveryMode)Gets specificZoneDeliveryModeValueModelfor the given zone, currency, minimum value, and zone delivery mode.java.util.Map<java.lang.Double,java.lang.Double>getDeliveryValues(CurrencyModel currency, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)Gets all delivery cost values for the currency in the zone and with the specific delivery mode.ZoneModelgetZoneForCode(java.lang.String code)Gets theZoneModelwith the specified code.java.util.Collection<ZoneModel>getZonesForZoneDeliveryMode(ZoneDeliveryModeModel zoneDeliveryMode)Gets all zones for which price values are defined in the delivery mode.booleanisUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode)Checks whether theZoneDeliveryModeModeluses the order subtotal as calculation base.booleanisZoneAllowed(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)Checks whether the zone is allowed to be used for adding new values to the delivery mode.ZoneDeliveryModeValueModelsetDeliveryCost(CurrencyModel currency, java.lang.Double min, java.lang.Double value, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)Sets the delivery cost for the given zone, currency, minimum value, and zone delivery mode.voidsetUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode)Sets the special price property name for theZoneDeliveryModeModelconveniently.-
Methods inherited from interface de.hybris.platform.order.DeliveryModeService
getAllDeliveryModes, getDeliveryModeForCode, getSupportedDeliveryModes
-
-
-
-
Method Detail
-
getZoneForCode
ZoneModel getZoneForCode(java.lang.String code)
Gets theZoneModelwith the specified code.- Parameters:
code- the zone code- Returns:
- the found
ZoneModelwith the specified code
-
getAllZones
java.util.Collection<ZoneModel> getAllZones()
Gets allZoneModels.- Returns:
- a
Collectionof allZoneModels
-
getZonesForZoneDeliveryMode
java.util.Collection<ZoneModel> getZonesForZoneDeliveryMode(ZoneDeliveryModeModel zoneDeliveryMode)
Gets all zones for which price values are defined in the delivery mode.- Parameters:
zoneDeliveryMode- the zone delivery mode- Returns:
- all
ZoneModels for the delivery mode
-
getCurrencies
java.util.Collection<CurrencyModel> getCurrencies(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)
Gets all currencies for which values are defined in the zone and in the delivery mode.- Parameters:
zone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- all found
CurrencyModels
-
isZoneAllowed
boolean isZoneAllowed(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)
Checks whether the zone is allowed to be used for adding new values to the delivery mode. This is necessary because two zones may share countries so the delivery mode can no longer calculate distinct prices for a specific country.- Parameters:
zone- the zone to be checkedzoneDeliveryMode- the zone delivery mode- Returns:
- true if the zone is allowed for the delivery mode, false otherwise
-
getDeliveryValues
java.util.Map<java.lang.Double,java.lang.Double> getDeliveryValues(CurrencyModel currency, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode)
Gets all delivery cost values for the currency in the zone and with the specific delivery mode.- Parameters:
currency- the currencyzone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- All delivery cost values consisting of minimum threshold value and cost value.
-
getDeliveryValue
ZoneDeliveryModeValueModel getDeliveryValue(ZoneModel zone, CurrencyModel currency, java.lang.Double min, ZoneDeliveryModeModel zoneDeliveryMode)
Gets specificZoneDeliveryModeValueModelfor the given zone, currency, minimum value, and zone delivery mode.- Parameters:
zone- the zonecurrency- the currencymin- the minimum valuezoneDeliveryMode- the zone delivery mode- Returns:
- found
ZoneDeliveryModeValueModel
-
setDeliveryCost
ZoneDeliveryModeValueModel setDeliveryCost(CurrencyModel currency, java.lang.Double min, java.lang.Double value, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode) throws DeliveryModeInterceptorException
Sets the delivery cost for the given zone, currency, minimum value, and zone delivery mode. Creates a newZoneDeliveryModeValueModelif noZoneDeliveryModeValueModelcan be found.- Parameters:
currency- the currencymin- the minimum valuevalue- the delivery cost valuezone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- changed
ZoneDeliveryModeValueModelwith new delivery cost value or the createdZoneDeliveryModeValueModel - Throws:
DeliveryModeInterceptorException- if there is ambiguous zone for theZoneDeliveryModeModel
-
setUsingPrice
void setUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode)
Sets the special price property name for theZoneDeliveryModeModelconveniently. If the property is set, theZoneDeliveryModeModelwould use order's subtotal as calculation base.- Parameters:
zoneDeliveryMode- the zone delivery mode
-
isUsingPrice
boolean isUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode)
Checks whether theZoneDeliveryModeModeluses the order subtotal as calculation base.- Parameters:
zoneDeliveryMode- the zone delivery mode
-
-