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
41 lines
723 B
Go
41 lines
723 B
Go
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
|
||
})
|