Update the MontaryComponent
Add a comment to the factor property:
The factor is multiplied to the base value to provide the actual value to apply (stored in the amount property) - e.g. a 25% discount would have 0.25 in the factor, with the amount containing base * 0.25. Then when adding all the components together the base and tax (and other components) will be combined to create the total value.
Include some additional narrative guidance:
When using the MonetaryComponent in resources it usually has multiple cardinality which enables the provision of the various components that contribute to the total cost of an item, and also total of an invoice (or other).
Each component "type" has a different impact on the contribution.
Typically this will be something like this example demonstrates:
Type |
Code |
Factor |
Amount |
Description |
base |
|
|
$100 |
This is the base amount of the item before any taxes/discounts etc are applied |
discount |
pre-pay |
-0.25 |
-$25 |
A 25% discount is applied to the item
(which will be deducted from the base amount)
The amount here is the calculated value based on the base*factor (any rounding is therefore explicit as to what is used) |
discount |
staff |
|
-$10 |
All staff get a $10 fixed value discount
(not a percentage value) |
deduction |
|
|
|
todo |
surcharge |
|
|
$50 |
The surcharge might have just an explicit amount to add to the total |
tax |
state |
.10 |
$10 |
This is applied after all the other items |
tax |
local |
.02 |
|
|
The total amount is not in the components, but is in dedicated properties such as Invoice.totalNet.
TODO: Should the factor/amount be -ve for types that reduce the amount? Or does the type indicate that?
Update the ChargeItemDefinition/ChargeItem/Invoice
Should there always be a base component?
Any other narrative stuff we should include?