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
42 lines
1.8 KiB
Go
42 lines
1.8 KiB
Go
package events
|
|
|
|
// Standard commerce event subjects for NATS/JetStream.
|
|
const (
|
|
SubjectOrderCreated = "commerce.order.created"
|
|
SubjectOrderCompleted = "commerce.order.completed"
|
|
SubjectOrderCanceled = "commerce.order.canceled"
|
|
SubjectOrderRefunded = "commerce.order.refunded"
|
|
SubjectCheckoutStarted = "commerce.checkout.started"
|
|
SubjectCheckoutFailed = "commerce.checkout.failed"
|
|
SubjectPaymentReceived = "commerce.payment.received"
|
|
SubjectCartUpdated = "commerce.cart.updated"
|
|
SubjectProductViewed = "commerce.product.viewed"
|
|
|
|
// Catalog lifecycle. A created/updated product is what closes the
|
|
// commerce→content loop: the content lane consumes product.created to
|
|
// auto-render the product's ecom asset (design == slug). Prefixed
|
|
// `commerce.` like every other subject so the COMMERCE stream
|
|
// (StreamSubjects `commerce.>`) captures them.
|
|
SubjectProductCreated = "commerce.product.created"
|
|
SubjectProductUpdated = "commerce.product.updated"
|
|
|
|
// Referral events
|
|
SubjectReferralLinkCreated = "commerce.referral.link_created"
|
|
SubjectReferralClaimed = "commerce.referral.claimed"
|
|
SubjectReferralCreditGranted = "commerce.referral.credit_granted"
|
|
SubjectReferralCommissionEarned = "commerce.referral.commission_earned"
|
|
SubjectReferralPayoutSent = "commerce.referral.payout_sent"
|
|
SubjectReferralTierUpgraded = "commerce.referral.tier_upgraded"
|
|
|
|
// Contributor events
|
|
SubjectContributorRegistered = "commerce.contributor.registered"
|
|
SubjectContributorPayoutCalc = "commerce.contributor.payout_calculated"
|
|
SubjectContributorPayoutSent = "commerce.contributor.payout_sent"
|
|
)
|
|
|
|
// StreamName is the JetStream stream for commerce events.
|
|
const StreamName = "COMMERCE"
|
|
|
|
// StreamSubjects defines what subjects the COMMERCE stream captures.
|
|
var StreamSubjects = []string{"commerce.>"}
|