Documentation
¶
Index ¶
- func Query(db *datastore.Datastore) datastore.Query
- type CustomerBalance
- func (cb *CustomerBalance) Defaults()
- func (cb *CustomerBalance) Init(db *datastore.Datastore)
- func (cb CustomerBalance) Kind() string
- func (cb *CustomerBalance) Load(ps []datastore.Property) (err error)
- func (cb *CustomerBalance) Save() (ps []datastore.Property, err error)
- func (cb *CustomerBalance) Validator() *val.Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomerBalance ¶
type CustomerBalance struct {
mixin.Model
CustomerId string `json:"customerId"`
Currency currency.Type `json:"currency"`
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) Defaults ¶
func (cb *CustomerBalance) Defaults()
func (*CustomerBalance) Init ¶
func (cb *CustomerBalance) Init(db *datastore.Datastore)
func (CustomerBalance) Kind ¶
func (cb CustomerBalance) Kind() string
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.