Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExistingRevertedUsage = fmt.Errorf("a reverted usage cannot be reverted again") ErrRevertAmountExceeds = fmt.Errorf("revert amount is greater than the usage amount") )
Functions ¶
This section is empty.
Types ¶
type CreditService ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(transactionService CreditService) *Service
type Usage ¶
type Usage struct { ID string CustomerID string // Source is the source app or event that caused the transaction Source string Description string // UserID is the user who initiated the transaction UserID string // Type is the type of usage, it can be credit or feature // if credit, the amount is the amount of credits that were consumed // if feature, the amount is the amount of features that were used Type Type Amount int64 CreatedAt time.Time Metadata metadata.Metadata }
Click to show internal directories.
Click to hide internal directories.