Files
commerce/models/fixtures/plan.go
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

41 lines
723 B
Go
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package fixtures
import (
"github.com/zap-proto/zip"
"github.com/hanzoai/commerce/models/deprecated/plan"
"github.com/hanzoai/commerce/models/types/currency"
. "github.com/hanzoai/commerce/types"
)
var Plan = New("plan", func(c *zip.Ctx) *plan.Plan {
// Get namespaced db
db := getNamespaceDb(c)
// Doge shirt
pln := plan.New(db)
pln.Slug = "much-shirts"
pln.GetOrCreate("Slug=", pln.Slug)
pln.Name = "Much Monthly Shirt"
pln.Description = `wow
      such shirt
much tee
nice shop
 so hip
    so doge
`
pln.Price = 2000
pln.Currency = currency.USD
pln.Interval = Monthly
pln.IntervalCount = 1
// manually configured in test environment
pln.MustPut()
return pln
})