Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomerBalance ¶
type CustomerBalance struct {
mixin.Model[CustomerBalance]
CustomerId string `json:"customerId"`
Currency currency.Type `json:"currency" orm:"default:usd"`
Balance int64 `json:"balance"` // cents, positive = credit
}
CustomerBalance tracks a customer's stored-value balance per currency. Positive balance = credit available to settle invoices.
func New ¶
func New(db *datastore.Datastore) *CustomerBalance
func (*CustomerBalance) Save ¶
func (cb *CustomerBalance) Save() (ps []datastore.Property, err error)
func (*CustomerBalance) Validator ¶
func (cb *CustomerBalance) Validator() *val.Validator
Click to show internal directories.
Click to hide internal directories.