feat(core-flows, dashboard, fulfillment, fulfillment-manual, utils, types): create shipping options with calculated prices (#10495)

**What**
- support creating SO with calculated price
- support updating SO for both types of pricing
- update `validateShippingOptionPricesStep` to handle both SO price_types
- add the `validateShippingOptionsForPriceCalculation` method to `FulfillementModule`
- add `canCalculate` and `calculatePrice` to fulfillment provider service service / interface / manual provider
- disable SO pricing edit on Admin if SO price type is calculated

---

CLOSES CMRC-776
This commit is contained in:
Frane Polić
2024-12-11 09:38:44 +01:00
committed by GitHub
parent fad85a9d29
commit d8a92dbb2d
13 changed files with 253 additions and 53 deletions

View File

@@ -47,7 +47,10 @@ import {
isOptionEnabledInStore,
isReturnOption,
} from "../../../../../lib/shipping-options"
import { FulfillmentSetType } from "../../../common/constants"
import {
FulfillmentSetType,
ShippingOptionPriceType,
} from "../../../common/constants"
type LocationGeneralSectionProps = {
location: HttpTypes.AdminStockLocation
@@ -167,6 +170,8 @@ function ShippingOption({
{
label: t("stockLocations.shippingOptions.pricing.action"),
icon: <CurrencyDollar />,
disabled:
option.price_type === ShippingOptionPriceType.Calculated,
to: `/settings/locations/${locationId}/fulfillment-set/${fulfillmentSetId}/service-zone/${option.service_zone_id}/shipping-option/${option.id}/pricing`,
},
],