recognizer

package
v1.0.0-beta.230 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 13 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 {
	Ledger             ledger.Ledger
	Dependencies       transactions.ResolverDependencies
	Lineage            lineage.Service
	TransactionManager transaction.Creator
}

func (Config) Validate

func (c Config) Validate() error

type NoopService

type NoopService struct{}

NoopService returns zero results for all operations. Useful for tests that don't exercise revenue recognition.

type RecognizeEarningsInput

type RecognizeEarningsInput struct {
	CustomerID customer.CustomerID
	At         time.Time
	Currency   currencyx.Code
}

RecognizeEarningsInput is the input for RecognizeEarnings.

func (RecognizeEarningsInput) Validate

func (i RecognizeEarningsInput) Validate() error

type RecognizeEarningsResult

type RecognizeEarningsResult struct {
	RecognizedAmount alpacadecimal.Decimal
	LedgerGroupID    string
}

RecognizeEarningsResult contains the result of a recognition run.

type Service

type Service interface {
	RecognizeEarnings(ctx context.Context, in RecognizeEarningsInput) (RecognizeEarningsResult, error)
}

Service recognizes customer accrued value as earnings.

Important current scope limitation: this recognizer only recognizes credit-backed accrued value. Eligibility is currently derived from charge credit-realization lineage segments, currently `real_credit` and `advance_backfilled`. Though Invoice backed values should be recognizable (as they have cb, tax, etc...) it is not yet supported.

A later, provenance based recognition rewrite will solve this.

func NewService

func NewService(config Config) (Service, error)

Jump to

Keyboard shortcuts

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