mirror of
https://github.com/hanzoai/commerce.git
synced 2026-10-30 15:08:42 +00:00
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
49 lines
808 B
Go
49 lines
808 B
Go
package disclosure
|
|
|
|
import (
|
|
"github.com/hanzoai/commerce/models/mixin"
|
|
"github.com/hanzoai/commerce/util/search"
|
|
)
|
|
|
|
type Document struct {
|
|
mixin.DocumentSaveLoad `datastore:"-" json:"-"`
|
|
|
|
// Special Kind Facet
|
|
Kind search.Atom `search:",facet"`
|
|
|
|
Id_ string
|
|
|
|
CreatedAt float64
|
|
UpdatedAt float64
|
|
|
|
Publication string
|
|
Hash string
|
|
Type string
|
|
Receiver string
|
|
}
|
|
|
|
func (d Document) Id() string {
|
|
return string(d.Id_)
|
|
}
|
|
|
|
func (d *Document) Init() {
|
|
d.SetDocument(d)
|
|
}
|
|
|
|
func (d Disclosure) Document() mixin.Document {
|
|
|
|
doc := &Document{}
|
|
doc.Init()
|
|
doc.Kind = search.Atom(kind)
|
|
doc.Id_ = d.Id()
|
|
|
|
doc.CreatedAt = float64(d.CreatedAt.Unix())
|
|
doc.UpdatedAt = float64(d.UpdatedAt.Unix())
|
|
|
|
doc.Publication = d.Publication
|
|
doc.Type = d.Type
|
|
doc.Receiver = d.Receiver
|
|
|
|
return doc
|
|
}
|