Documentation
¶
Index ¶
- func ItemAsFlatFeeCharge(in Item) (flatfee.Charge, error)
- func ItemAsLine(in Item) (billing.GenericInvoiceLine, error)
- func ItemAsSplitLineHierarchy(in Item) (*billing.SplitLineHierarchy, error)
- func ItemAsUsageBasedCharge(in Item) (usagebased.Charge, error)
- type FlatFeeChargeGetter
- type Invoices
- type Item
- type ItemType
- type LineGetter
- type Loader
- type SplitLineHierarchyGetter
- type State
- type UsageBasedChargeGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ItemAsFlatFeeCharge ¶
ItemAsFlatFeeCharge returns the wrapped flat-fee charge when the persisted item is flat-fee-backed.
func ItemAsLine ¶
func ItemAsLine(in Item) (billing.GenericInvoiceLine, error)
ItemAsLine returns the wrapped line when the persisted item is line-backed.
func ItemAsSplitLineHierarchy ¶
func ItemAsSplitLineHierarchy(in Item) (*billing.SplitLineHierarchy, error)
ItemAsSplitLineHierarchy returns the wrapped hierarchy when the persisted item is hierarchy-backed.
func ItemAsUsageBasedCharge ¶
func ItemAsUsageBasedCharge(in Item) (usagebased.Charge, error)
ItemAsUsageBasedCharge returns the wrapped usage-based charge when the persisted item is usage-based.
Types ¶
type FlatFeeChargeGetter ¶
type Item ¶
type Item interface {
ID() models.NamespacedID
Type() ItemType
ChildUniqueReferenceID() *string
ServicePeriod() timeutil.ClosedPeriod
IsSubscriptionManaged() bool
HasLastLineAnnotation(annotation string) bool
}
func NewChargeItemFromChargeType ¶
func NewChargeItemFromChargeType(chargeType meta.ChargeType, usageBasedCharge *usagebased.Charge, flatFeeCharge *flatfee.Charge) (Item, error)
func NewItemFromLineOrHierarchy ¶
func NewItemFromLineOrHierarchy(lineOrHierarchy billing.LineOrHierarchy) (Item, error)
type LineGetter ¶
type LineGetter interface {
GetLine() billing.GenericInvoiceLine
}
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func (Loader) LoadForSubscription ¶
func (l Loader) LoadForSubscription(ctx context.Context, subs subscription.Subscription) (State, error)
type SplitLineHierarchyGetter ¶
type SplitLineHierarchyGetter interface {
GetSplitLineHierarchy() *billing.SplitLineHierarchy
}
type UsageBasedChargeGetter ¶
type UsageBasedChargeGetter interface {
GetUsageBasedCharge() usagebased.Charge
}
Click to show internal directories.
Click to hide internal directories.