billingworkersubscription

package
v1.0.0-beta.187 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BillingService billing.Service
	TxCreator      transaction.Creator
	Logger         *slog.Logger
}

func (Config) Validate

func (c Config) Validate() error

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Handler, error)

func (*Handler) SyncronizeSubscription

func (h *Handler) SyncronizeSubscription(ctx context.Context, subs subscription.SubscriptionView, asOf time.Time) error

type PhaseIterator

type PhaseIterator struct {
	// contains filtered or unexported fields
}

func NewPhaseIterator

func NewPhaseIterator(subs subscription.SubscriptionView, phaseKey string) (*PhaseIterator, error)

func (*PhaseIterator) Generate

func (it *PhaseIterator) Generate(iterationEnd time.Time) ([]subscriptionItemWithPeriod, error)

func (*PhaseIterator) GetMinimumBillableTime

func (it *PhaseIterator) GetMinimumBillableTime() time.Time

GetMinimumBillableTime returns the minimum time that we can bill for the phase (e.g. the first time we would be yielding a line item)

func (*PhaseIterator) HasInvoicableItems

func (it *PhaseIterator) HasInvoicableItems() bool

func (*PhaseIterator) PhaseEnd

func (it *PhaseIterator) PhaseEnd() *time.Time

func (*PhaseIterator) PhaseStart

func (it *PhaseIterator) PhaseStart() time.Time

func (*PhaseIterator) ResolvePhaseData

func (it *PhaseIterator) ResolvePhaseData(subs subscription.SubscriptionView, phaseKey string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL