creditvoid

package
v1.0.0-beta.231 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const AnnotationCreditVoidRecordID = "ledger.credit_void.record_id"

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	CreateRecords(ctx context.Context, input CreateRecordsInput) error
	ListRecords(ctx context.Context, input ListRecordsInput) ([]Record, error)
}

type Config

type Config struct {
	Adapter            Adapter
	Ledger             ledger.Ledger
	Dependencies       transactions.ResolverDependencies
	Breakage           breakage.Service
	AccountLocker      ledger.AccountLocker
	TransactionManager transaction.Creator
}

func (Config) Validate

func (c Config) Validate() error

type CreateRecordsInput

type CreateRecordsInput struct {
	Records []Record
}

func (CreateRecordsInput) Validate

func (i CreateRecordsInput) Validate() error

type ListRecordsInput

type ListRecordsInput struct {
	CustomerID customer.CustomerID
	Currency   *currencyx.Code
	AsOf       time.Time
	Route      ledger.RouteFilter
}

type ListVoidedCreditImpactsInput

type ListVoidedCreditImpactsInput struct {
	CustomerID customer.CustomerID
	Currency   *currencyx.Code
	AsOf       time.Time
	After      *ledger.TransactionCursor
	Before     *ledger.TransactionCursor
	Limit      int
	Route      ledger.RouteFilter
}

func (ListVoidedCreditImpactsInput) Validate

func (i ListVoidedCreditImpactsInput) Validate() error

type ListVoidedCreditImpactsResult

type ListVoidedCreditImpactsResult struct {
	Items   []VoidImpact
	HasMore bool
}

type NoopService

type NoopService struct{}

NoopService is wired when credits are disabled.

type Record

type Record struct {
	ID        models.NamespacedID
	Amount    alpacadecimal.Decimal
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	CustomerID customer.CustomerID
	Currency   currencyx.Code
	VoidedAt   time.Time

	SourceChargeID string

	VoidTransactionGroupID string
	VoidTransactionID      string

	FBOSubAccountID        string
	ReceivableSubAccountID string

	Annotations models.Annotations
}

func (Record) Validate

func (r Record) Validate() error

type Service

type Service interface {
	VoidCreditPurchase(ctx context.Context, input VoidCreditPurchaseInput) (VoidCreditPurchaseResult, error)
	ListVoidedCreditImpacts(ctx context.Context, input ListVoidedCreditImpactsInput) (ListVoidedCreditImpactsResult, error)
}

func NewNoopService

func NewNoopService() Service

func NewService

func NewService(config Config) (Service, error)

type VoidCreditPurchaseInput

type VoidCreditPurchaseInput struct {
	CustomerID  customer.CustomerID
	ChargeID    string
	Currency    currencyx.Code
	Annotations models.Annotations
}

func (VoidCreditPurchaseInput) Validate

func (i VoidCreditPurchaseInput) Validate() error

type VoidCreditPurchaseResult

type VoidCreditPurchaseResult struct {
	VoidedAt           time.Time
	Amount             alpacadecimal.Decimal
	TransactionGroupID string
}

type VoidImpact

type VoidImpact struct {
	ID          models.NamespacedID
	CreatedAt   time.Time
	VoidedAt    time.Time
	CustomerID  customer.CustomerID
	Currency    currencyx.Code
	Amount      alpacadecimal.Decimal
	Annotations models.Annotations
}

func (VoidImpact) Cursor

func (i VoidImpact) Cursor() ledger.TransactionCursor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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