feat: handle CPU in plan form and details #2280
Merged
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.
Context
CPU stands for Custom Pricing Units.
We recently added the possibility to add a custom pricing unit in the app's settings (hidden via a FE Feature Flag) #2275
We're moving forward with this feature by introducing those CPU deeper in the codebase.
Description
This PR allow to setup a CPU at the plan level.
This new CPU, once selected on a charge, is called
appliedPricingUnit
.When sent to the BE it only contains
code
,conversionRate
. However when manipulated in the app we add extra arguments (at form init or when adding a new charge to theformikProps
).Those arguments helps us determining some internal logic for display and data formatting.
shortName
type
The 3rd commit could be hard to review but it's mostly display adjustments. All logic stands in the first 2 ones.
Happy to help for the review in any ways!
Fixes LAGO-882