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
}
type NoopService ¶
type NoopService struct{}
NoopService returns zero results for all operations. Useful for tests that don't exercise revenue recognition.
func (NoopService) RecognizeEarnings ¶
func (NoopService) RecognizeEarnings(context.Context, RecognizeEarningsInput) (RecognizeEarningsResult, error)
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.