Files
zeekay 1943f1c093 Hanzo Commerce
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans,
usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0.

Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
2026-09-23 21:52:16 -07:00

54 lines
1.3 KiB
Go

package tokensale
import (
"github.com/hanzoai/commerce/datastore"
"github.com/hanzoai/commerce/models/mixin"
// "github.com/hanzoai/commerce/models/payment"
// "github.com/hanzoai/commerce/models/types/pricing"
"github.com/hanzoai/commerce/models/wallet"
"github.com/hanzoai/orm"
)
func init() { orm.Register[TokenSale]("tokensale") }
type TokenSale struct {
mixin.Model[TokenSale]
// Auditor Wallet
wallet.WalletHolder `json:"-"`
Name string `json:"name"`
TotalTokens int `json:"totalTokens"`
// // Fee structure for this tokensale
// Fees pricing.Fees `json:"fees" datastore:",noindex"`
// // Partner fees (private, should be up to partner to disclose)
// Partners []pricing.Partner `json:"-" datastore:",noindex"`
// Slug string `json:"slug"`
// SupportedPaymentTypes []payment.Type `json:"supportedPaymentTypes`
// Passphrase for the wallet accounts the order controls, never send to the client
WalletPassphrase string `json:"-"`
}
// func (ts TokenSale) Pricing() (*pricing.Fees, []pricing.Partner) {
// // Ensure our id is set on fees used
// fees := ts.Fees
// fees.Id = ts.Id()
// return &fees, ts.Partners
// }
func New(db *datastore.Datastore) *TokenSale {
ts := new(TokenSale)
ts.Init(db)
return ts
}
func Query(db *datastore.Datastore) datastore.Query {
return db.Query("tokensale")
}