-
Notifications
You must be signed in to change notification settings - Fork 943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flexible pricing UI #1310
Merged
Merged
Flexible pricing UI #1310
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kpuputti
force-pushed
the
flexible-pricing-ui
branch
3 times, most recently
from
June 16, 2020 11:40
0c5d2ed
to
77a1c09
Compare
kpuputti
force-pushed
the
flexible-pricing-ui
branch
from
June 16, 2020 11:53
77a1c09
to
9768c7f
Compare
kpuputti
force-pushed
the
flexible-pricing-ui
branch
from
June 17, 2020 19:28
162e9e4
to
4f15ad8
Compare
ovan
reviewed
Jun 17, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Some minor comments/questions about the code. Let's discuss the process name if we haven't yet committed to that.
kpuputti
force-pushed
the
flexible-pricing-ui
branch
2 times, most recently
from
June 18, 2020 12:55
7b61eb0
to
a407d9f
Compare
kpuputti
force-pushed
the
flexible-pricing-ui
branch
from
June 18, 2020 13:01
a407d9f
to
3f82827
Compare
sktoiva
approved these changes
Jun 18, 2020
and remove unnecessary copy-pasted code.
…ne-item-price-calculation Add rounding to privilate-line-item price estimations
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This PR combines #1305 and #1309 as well as new changes.)
This PR adds opt-in support for flexible pricing and privileged transitions. Privileged transitions are transaction process transitions that need to be run from a secure context, i.e. the backend.
The opt-in UI 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 theListingPage
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 inserver/api-util/lineItems.js
that will become the main customization point for describing pricing when privileged transitions are the default.Using privileged transitions
If you want to opt-in to marking some of the transitions as privileged, you can edit the
isPrivileged
function insrc/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 inserver/api-util/lineItems.js
will become the main customization point to describe the pricing in a transaction.TODO