Class GetPriceTask
java.lang.Object
ch.tocco.nice2.optional.webshop.api.tasks.GetPriceTask
- All Implemented Interfaces:
PersistTask<GetPriceParams,
BigDecimal>
Task to get the price of an article.
An optional GetPriceParams object is used as parameter
- article = article entity
- priceCategory = Optional Price_category entity. If it is not given (e.g params.get().getPriceCategory().isPresent() == false) the default priceCategory is used
- priceReturnType = PriceReturnType which defines whether the NETTO, BRUTTO or VAT amount should be returned
Return value:
- Nullable BigDecimal representing the price
-
Constructor Summary
ConstructorDescriptionGetPriceTask
(CurrentArticlePriceService currentArticlePriceService, VatCalculationService vatCalculationService) -
Method Summary
Modifier and TypeMethodDescription@Nullable BigDecimal
run
(Optional<GetPriceParams> params, CommandContext commandContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.exec.PersistTask
andThenDo, compose, compose2, composeWhen, discardResult, expand, expand, getDescription, ifElse, orWhen, orWhenNot, passWhen, passWhenNot, skipErrors, unwrap
-
Constructor Details
-
GetPriceTask
public GetPriceTask(CurrentArticlePriceService currentArticlePriceService, VatCalculationService vatCalculationService)
-
-
Method Details
-
run
@Nullable public @Nullable BigDecimal run(Optional<GetPriceParams> params, CommandContext commandContext) throws Exception - Specified by:
run
in interfacePersistTask<GetPriceParams,
BigDecimal> - Throws:
Exception
-