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

22 lines
596 B
Go

package product
import (
"github.com/hanzoai/commerce/datastore"
"github.com/hanzoai/commerce/models/types/currency"
"github.com/hanzoai/commerce/util/fake"
"github.com/hanzoai/commerce/util/slug"
)
func Fake(db *datastore.Datastore) *Product {
prod := New(db)
prod.Name = fake.ProductName()
prod.Headline = fake.Sentence()
prod.Description = prod.Headline + " " + fake.Sentences(3)
prod.Slug = slug.Slugify(prod.Name)
prod.Currency = currency.USD
prod.Price = currency.Cents(0).Fake()
// prod.Shipping = currency.Cents(0).FakeN(990)
prod.ListPrice = prod.Price * 2
return prod
}