Money.Subscription.Change (Money v5.23.0)
View SourceDefines the structure of a plan changeset.
:first_interval_startswhich is the start date of the first interval for the new plan:first_billing_amountis the amount to be billed, net of any credit, at the:first_interval_starts:next_interval_startsis the start date of the next interval after the first interval including anycredit_days_applied:credit_amountis the amount of unconsumed credit of the current plan:credit_amount_appliedis the amount of credit applied to the new plan. If the:prorateoption is:price(the default) the:first_billing_amountis the plan:pricereduced by the:credit_amount_applied. If the:prorateoption is:periodthen the:first_billing_amountis the planpriceand the:next_interval_dateis extended by the:credit_days_appliedinstead.:credit_days_appliedis the number of days credit applied to the first interval by adding days to the:first_interval_startsdate.:credit_period_endsis the date on which any applied credit is consumed ornil:carry_forwardis any amount of credit carried forward to a subsequent period. If non-zero this amount is a negativeMoney.t. It is non-zero when the credit amount for the current plan is greater than the price of the new plan. In this case the:first_billing_amountis zero.
Summary
Functions
A struct defining the changes between two plans.
Types
@type t() :: %Money.Subscription.Change{ carry_forward: Money.t(), credit_amount: Money.t(), credit_amount_applied: Money.t(), credit_days_applied: non_neg_integer(), credit_period_ends: Date.t(), first_billing_amount: Money.t(), first_interval_starts: Date.t(), next_interval_starts: Date.t() }
A plan change record struct.