v6.0.0
What's new?
This release adds support for more flexible pricing and privileged transitions. Privileged transitions are transaction process transitions that need to be run from a secure context, i.e. the backend. Privileged transitions are a new feature that your transaction process needs to take into use. However, you can opt-out by reversing changes in PR #1314.
This support for privileged transitions adds integration to the FTW API endpoints added in #1301 .
Transaction line items
The line items that define the pricing of a transaction are now defined securely in the backend. This means that privileged transitions can safely define the line items in the backend based on the booking data, and the pricing can be fully customized in FTW. This means changing commissions, adding extra line items for discounts, etc.
Important note
The EstimatedBreakdownMaybe
component that is used in the ListingPage
will no longer internally define the pricing line items. Instead, the /api/transaction-line-items
endpoint will be used to fetch the line items.
This means that the same place that defines the line items for privileged transitions is also used for the price estimation. This also means that any pricing customizations will need to be migrated to the transactionLineItems
function in server/api-util/lineItems.js
that will become the main customization point for describing pricing when privileged transitions are the default.
Note 2: If you have just changed bookingUnitType
from 'line-item/night' to 'line-item/day', you need to make that change also in this server setup: server/api-util/lineItems.js.
Using privileged transitions
If you want to change privileged transitions or opt-out of those, you can edit the isPrivileged
function in src/util/transaction.js
and add the transitions there. After that, those transitions will automatically go through the backend.
Note that we will provide more specific documentation for this when the privileged transitions become the default. Also note that using privileged transitions requires a process change with Flex CLI.
Customizing pricing
As mentioned earlier, the transactionLineItems
function in server/api-util/lineItems.js
will become the main customization point to describe the pricing in a transaction.
Development
The command yarn run dev
now starts a server that serves the /api/*
endpoints of the Node server. This way you can enjoy code hot reload while developing your pricing logic.
Changes
- [change] Use privileged transitions for price calculation by default and update the process alias. #1314
- [add] Add client secret enquiry to 'yarn run config' script #1313
- [change] Add UI support for flexible pricing and privileged transitions. Note that this requires updating the booking breakdown estimation code that is now done in the backend. #1310
- [add] Add local API endpoints for flexible pricing and privileged transitions #1301
- [fix] yarn run dev-backend was expecting NODE_ENV. #1303