lineengine

package
v1.0.0-beta.236 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 22 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 {
	SplitLineGroupAdapter        SplitLineGroupAdapter
	RatingService                rating.Service
	FeatureMeterResolver         *billingfeaturemeterservice.Resolver
	StreamingConnector           streaming.Connector
	MaxParallelQuantitySnapshots int
}

func (Config) Validate

func (c Config) Validate() error

type Engine

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

func New

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

func (*Engine) AreLinesBillableAsOf

func (*Engine) BuildStandardInvoiceLines

func (e *Engine) BuildStandardInvoiceLines(ctx context.Context, input billing.BuildStandardInvoiceLinesInput) (billing.StandardLines, error)

func (*Engine) BuildStandardLinesForGatheringPreview

func (e *Engine) BuildStandardLinesForGatheringPreview(ctx context.Context, input billing.BuildStandardInvoiceLinesInput) (billing.StandardLines, error)

func (*Engine) GetLineEngineType

func (e *Engine) GetLineEngineType() billing.LineEngineType

func (*Engine) OnCollectionCompleted

func (e *Engine) OnCollectionCompleted(ctx context.Context, input billing.OnCollectionCompletedInput) (billing.StandardLines, error)

func (*Engine) OnInvoiceFinalizing

func (e *Engine) OnInvoiceFinalizing(_ context.Context, input billing.OnInvoiceFinalizingInput) (billing.StandardLines, error)

func (*Engine) OnInvoiceIssued

func (e *Engine) OnInvoiceIssued(_ context.Context, _ billing.OnInvoiceIssuedInput) error

func (*Engine) OnMutableStandardLinesDeletedBySystem

func (e *Engine) OnMutableStandardLinesDeletedBySystem(_ context.Context, _ billing.OnMutableStandardLinesDeletedInput) error

func (*Engine) OnPaymentAuthorized

func (e *Engine) OnPaymentAuthorized(_ context.Context, _ billing.OnPaymentAuthorizedInput) error

func (*Engine) OnPaymentSettled

func (e *Engine) OnPaymentSettled(_ context.Context, _ billing.OnPaymentSettledInput) error

func (*Engine) OnStandardInvoiceCreated

func (e *Engine) OnStandardInvoiceCreated(_ context.Context, input billing.OnStandardInvoiceCreatedInput) (billing.StandardLines, error)

func (*Engine) OnUnsupportedCreditNote

func (e *Engine) OnUnsupportedCreditNote(_ context.Context, _ billing.OnUnsupportedCreditNoteInput) error

func (*Engine) RateStandardLines

func (e *Engine) RateStandardLines(lines billing.StandardLines) (billing.StandardLines, error)

RateStandardLines rates supplied snapshots on cloned legacy lines, retaining child and discount identity. It performs no snapshotting or persistence and returns calculated lines alongside typed rating issues of any severity.

func (*Engine) RecalculateStandardLine

func (e *Engine) RecalculateStandardLine(ctx context.Context, input RecalculateStandardLineInput) (*billing.StandardLine, error)

RecalculateStandardLine completes a mutable legacy line on a clone. Snapshot failures return no replacement; rating issues accompany the calculated result. Immutable-invoice comparisons must continue using SnapshotLineQuantity.

func (*Engine) ResolveSplitLineGroupHeaders

func (e *Engine) ResolveSplitLineGroupHeaders(ctx context.Context, ns string, lines billing.StandardLines) error

func (*Engine) SnapshotLineQuantities

func (e *Engine) SnapshotLineQuantities(ctx context.Context, invoice billing.StandardInvoice, lines billing.StandardLines) error

func (*Engine) SnapshotLineQuantity

func (e *Engine) SnapshotLineQuantity(ctx context.Context, input SnapshotLineQuantityInput) (*billing.StandardLine, error)

func (*Engine) ValidateMutableInvoiceLineEditViaAPI

func (e *Engine) ValidateMutableInvoiceLineEditViaAPI(_ context.Context, input billing.OnMutableInvoiceUpdateInput) error

type RecalculateStandardLineInput

type RecalculateStandardLineInput struct {
	Invoice *billing.StandardInvoice
	Line    *billing.StandardLine
}

func (RecalculateStandardLineInput) Validate

func (i RecalculateStandardLineInput) Validate() error

type SnapshotLineQuantityInput

type SnapshotLineQuantityInput struct {
	Invoice *billing.StandardInvoice
	Line    *billing.StandardLine
}

func (SnapshotLineQuantityInput) Validate

func (i SnapshotLineQuantityInput) Validate() error

type SplitLineGroupAdapter

type SplitLineGroupAdapter interface {
	CreateSplitLineGroup(ctx context.Context, input billing.CreateSplitLineGroupAdapterInput) (billing.SplitLineGroup, error)
	GetSplitLineGroupHeaders(ctx context.Context, input billing.GetSplitLineGroupHeadersInput) (billing.SplitLineGroupHeaders, error)
}

Jump to

Keyboard shortcuts

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