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
}
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.
func (NoopService) ListVoidedCreditImpacts ¶
func (NoopService) ListVoidedCreditImpacts(context.Context, ListVoidedCreditImpactsInput) (ListVoidedCreditImpactsResult, error)
func (NoopService) VoidCreditPurchase ¶
func (NoopService) VoidCreditPurchase(context.Context, VoidCreditPurchaseInput) (VoidCreditPurchaseResult, error)
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
}
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 ¶
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
Click to show internal directories.
Click to hide internal directories.