Line items ********** What are line items? ==================== The rated document that is produced at the product scope is a line item. The amount is calculated depending on the pricing mechanism associated with the product. For flat rate products a line item is rated by multiplying the quantity by the price. For event based products rated events are summed up to compute the total. Within bframe, line items are then used to calculate invoice totals. Why are line items important? ============================= Line items are the preferred method to provide billing transparency. Showing how invoice totals were calculated per product often is enough for a customer to understand the bill. From a reporting perspective line items are helpful for product specific analysis. Each line item is for a timeframe, contract and product combination. This is useful because usage is aggregated making the reports easy to query. How are line items modeled? =========================== Fixed pricing must occur at the line item scope. It can not be divided any further and can only be calculated in reference to an individual product. Usage based pricing can be calculated at the line item or event scope. Summing all related rated events or calculating usage directly and multiplying the price are both possible and accurate. bframe makes use of rated events to create event based line items. This offers full granularity and auditability to operators. The tradeoff associated with this design is the additional computation and storage overhead. In the case of a business model not requiring event based products, rated events can be ignored. The platform fee in the Wikipedia pricing scheme is a specific example of a fixed charge line item. This is exhibited below for the customer "Papergirl". .. csv-table:: Line items :file: /_static/ex_tables/ex_10_3_a.csv :class: bmodel-table :header-rows: 1 .. csv-table:: Invoices :file: /_static/ex_tables/ex_10_3_b.csv :class: bmodel-table :header-rows: 1 .. TODO2 (might be good to talk about how we group... e.g. invoice_delivery, etc) .. TODO2 (might be good to talk about how we handle effective_at and edits / amends like i am pretty sure we create two?)