Documentation
¶
Index ¶
- Constants
- Variables
- type Auth
- type BillingSequence
- type Costsheet
- type CreditGrant
- type CreditGrantApplication
- type CreditNote
- type CreditNoteLineItem
- type Customer
- type Entitlement
- type Environment
- type Feature
- type Invoice
- type InvoiceLineItem
- type InvoiceSequence
- type Meter
- type MeterAggregation
- type MeterFilter
- type Payment
- type PaymentAttempt
- type Plan
- type Price
- type PriceTier
- type Secret
- type Subscription
- type SubscriptionLineItem
- type SubscriptionPause
- type SubscriptionSchedule
- type SubscriptionSchedulePhase
- type Task
- type Tenant
- type TenantAddress
- type TenantBillingDetails
- type TransformQuantity
- type User
- type Wallet
- type WalletTransaction
Constants ¶
const ( Idx_tenant_environment_credit_note_number_unique = "idx_tenant_environment_credit_note_number_unique" Idx_tenant_environment_subscription_id_unique = "idx_tenant_environment_subscription_id_unique" )
Variables ¶
var Idx_tenant_environment_external_id_unique = "idx_tenant_environment_external_id_unique"
var Idx_tenant_environment_idempotency_key_unique = "idx_tenant_environment_idempotency_key_unique"
var Idx_tenant_environment_invoice_number_unique = "idx_tenant_environment_invoice_number_unique"
var Idx_tenant_environment_lookup_key = "idx_tenant_environment_lookup_key"
Functions ¶
This section is empty.
Types ¶
type BillingSequence ¶
BillingSequence holds the schema definition for the BillingSequence entity.
func (BillingSequence) Edges ¶
func (BillingSequence) Edges() []ent.Edge
Edges of the BillingSequence.
func (BillingSequence) Fields ¶
func (BillingSequence) Fields() []ent.Field
Fields of the BillingSequence.
func (BillingSequence) Indexes ¶
func (BillingSequence) Indexes() []ent.Index
Indexes of the BillingSequence.
type Costsheet ¶ added in v1.0.18
Costsheet represents the core entity for tracking cost-related configurations in the billing system. It establishes relationships between meters (what we measure) and prices (how much we charge). This entity is crucial for: 1. Determining the cost basis for billing calculations 2. Mapping usage metrics to their associated prices 3. Supporting margin and cost analysis features
func (Costsheet) Annotations ¶ added in v1.0.18
func (Costsheet) Annotations() []schema.Annotation
Annotations configures the underlying database schema. Here we explicitly set the table name to 'costsheet' (singular form) to maintain consistency with our naming conventions.
func (Costsheet) Edges ¶ added in v1.0.18
Edges defines the relationships between Costsheet and other entities. These relationships are crucial for: 1. Cost calculation workflows 2. Usage tracking 3. Price application
func (Costsheet) Indexes ¶ added in v1.0.18
Indexes improves query performance and ensures data integrity. We index: 1. tenant_id + environment_id: For fast multi-tenant, multi-environment queries 2. meter_id + price_id: For unique constraint and fast lookups
func (Costsheet) Mixin ¶ added in v1.0.18
Mixin injects common fields into the schema. We include: 1. BaseMixin: Common fields for all entities
- tenant_id: Multi-tenancy support
- status: Record status (published, draft, etc.)
- created_at, updated_at: Timestamps
- created_by, updated_by: Audit fields
2. EnvironmentMixin: Environment segregation
- environment_id: Separates data by environment (prod, staging, etc.)
type CreditGrant ¶ added in v1.0.18
CreditGrant holds the schema definition for the CreditGrant entity.
func (CreditGrant) Edges ¶ added in v1.0.18
func (CreditGrant) Edges() []ent.Edge
Edges of the CreditGrant entity.
func (CreditGrant) Fields ¶ added in v1.0.18
func (CreditGrant) Fields() []ent.Field
Fields of the CreditGrant entity.
func (CreditGrant) Indexes ¶ added in v1.0.18
func (CreditGrant) Indexes() []ent.Index
Indexes of the CreditGrant entity.
func (CreditGrant) Mixin ¶ added in v1.0.18
func (CreditGrant) Mixin() []ent.Mixin
Mixin of the CreditGrant entity.
type CreditGrantApplication ¶ added in v1.0.18
func (CreditGrantApplication) Edges ¶ added in v1.0.18
func (CreditGrantApplication) Edges() []ent.Edge
Edges of the CreditGrantApplication.
func (CreditGrantApplication) Fields ¶ added in v1.0.18
func (CreditGrantApplication) Fields() []ent.Field
Fields of the CreditGrantApplication.
func (CreditGrantApplication) Mixin ¶ added in v1.0.18
func (CreditGrantApplication) Mixin() []ent.Mixin
type CreditNote ¶ added in v1.0.18
CreditNote holds the schema definition for the CreditNote entity.
func (CreditNote) Edges ¶ added in v1.0.18
func (CreditNote) Edges() []ent.Edge
Edges of the CreditNote.
func (CreditNote) Fields ¶ added in v1.0.18
func (CreditNote) Fields() []ent.Field
Fields of the CreditNote entity.
func (CreditNote) Indexes ¶ added in v1.0.18
func (CreditNote) Indexes() []ent.Index
func (CreditNote) Mixin ¶ added in v1.0.18
func (CreditNote) Mixin() []ent.Mixin
Mixin of the CreditNote entity.
type CreditNoteLineItem ¶ added in v1.0.18
CreditNoteLineItem holds the schema definition for the CreditNoteLineItem entity.
func (CreditNoteLineItem) Edges ¶ added in v1.0.18
func (CreditNoteLineItem) Edges() []ent.Edge
Edges of the CreditNoteLineItem.
func (CreditNoteLineItem) Fields ¶ added in v1.0.18
func (CreditNoteLineItem) Fields() []ent.Field
func (CreditNoteLineItem) Mixin ¶ added in v1.0.18
func (CreditNoteLineItem) Mixin() []ent.Mixin
type Entitlement ¶
Entitlement holds the schema definition for the Entitlement entity.
type Environment ¶
Environment holds the schema definition for the Environment entity.
func (Environment) Fields ¶
func (Environment) Fields() []ent.Field
type InvoiceLineItem ¶
InvoiceLineItem holds the schema definition for the InvoiceLineItem entity.
func (InvoiceLineItem) Edges ¶
func (InvoiceLineItem) Edges() []ent.Edge
Edges of the InvoiceLineItem.
func (InvoiceLineItem) Fields ¶
func (InvoiceLineItem) Fields() []ent.Field
Fields of the InvoiceLineItem.
func (InvoiceLineItem) Indexes ¶
func (InvoiceLineItem) Indexes() []ent.Index
Indexes of the InvoiceLineItem.
func (InvoiceLineItem) Mixin ¶
func (InvoiceLineItem) Mixin() []ent.Mixin
Mixin of the InvoiceLineItem.
type InvoiceSequence ¶
InvoiceSequence holds the schema definition for the InvoiceSequence entity.
func (InvoiceSequence) Edges ¶
func (InvoiceSequence) Edges() []ent.Edge
Edges of the InvoiceSequence.
func (InvoiceSequence) Fields ¶
func (InvoiceSequence) Fields() []ent.Field
Fields of the InvoiceSequence.
func (InvoiceSequence) Indexes ¶
func (InvoiceSequence) Indexes() []ent.Index
Indexes of the InvoiceSequence.
type MeterAggregation ¶
type MeterAggregation struct {
Type types.AggregationType `json:"type"`
Field string `json:"field,omitempty"`
Multiplier decimal.Decimal `json:"multiplier,omitempty"`
}
type MeterFilter ¶
Additional types needed for JSON fields
type PaymentAttempt ¶
PaymentAttempt holds the schema definition for the PaymentAttempt entity.
func (PaymentAttempt) Fields ¶
func (PaymentAttempt) Fields() []ent.Field
Fields of the PaymentAttempt.
func (PaymentAttempt) Indexes ¶
func (PaymentAttempt) Indexes() []ent.Index
Indexes of the PaymentAttempt.
func (PaymentAttempt) Mixin ¶
func (PaymentAttempt) Mixin() []ent.Mixin
Mixin of the PaymentAttempt.
type PriceTier ¶
type PriceTier struct {
UpTo *uint64 `json:"up_to"`
UnitAmount decimal.Decimal `json:"unit_amount"`
FlatAmount *decimal.Decimal `json:"flat_amount,omitempty"`
}
Additional types needed for JSON fields
type Subscription ¶
Subscription holds the schema definition for the Subscription entity.
func (Subscription) Indexes ¶
func (Subscription) Indexes() []ent.Index
Indexes of the Subscription.
type SubscriptionLineItem ¶
SubscriptionLineItem holds the schema definition for the SubscriptionLineItem entity.
func (SubscriptionLineItem) Edges ¶
func (SubscriptionLineItem) Edges() []ent.Edge
Edges of the SubscriptionLineItem.
func (SubscriptionLineItem) Fields ¶
func (SubscriptionLineItem) Fields() []ent.Field
Fields of the SubscriptionLineItem.
func (SubscriptionLineItem) Indexes ¶
func (SubscriptionLineItem) Indexes() []ent.Index
Indexes of the SubscriptionLineItem.
func (SubscriptionLineItem) Mixin ¶
func (SubscriptionLineItem) Mixin() []ent.Mixin
Mixin of the SubscriptionLineItem.
type SubscriptionPause ¶
SubscriptionPause holds the schema definition for the SubscriptionPause entity.
func (SubscriptionPause) Edges ¶
func (SubscriptionPause) Edges() []ent.Edge
Edges of the SubscriptionPause.
func (SubscriptionPause) Fields ¶
func (SubscriptionPause) Fields() []ent.Field
Fields of the SubscriptionPause.
func (SubscriptionPause) Indexes ¶
func (SubscriptionPause) Indexes() []ent.Index
Indexes of the SubscriptionPause.
func (SubscriptionPause) Mixin ¶
func (SubscriptionPause) Mixin() []ent.Mixin
Mixin of the SubscriptionPause.
type SubscriptionSchedule ¶ added in v1.0.18
SubscriptionSchedule holds the schema definition for the SubscriptionSchedule entity.
func (SubscriptionSchedule) Edges ¶ added in v1.0.18
func (SubscriptionSchedule) Edges() []ent.Edge
Edges of the SubscriptionSchedule.
func (SubscriptionSchedule) Fields ¶ added in v1.0.18
func (SubscriptionSchedule) Fields() []ent.Field
Fields of the SubscriptionSchedule.
func (SubscriptionSchedule) Indexes ¶ added in v1.0.18
func (SubscriptionSchedule) Indexes() []ent.Index
Indexes of the SubscriptionSchedule.
func (SubscriptionSchedule) Mixin ¶ added in v1.0.18
func (SubscriptionSchedule) Mixin() []ent.Mixin
Mixin of the SubscriptionSchedule.
type SubscriptionSchedulePhase ¶ added in v1.0.18
SubscriptionSchedulePhase holds the schema definition for the SubscriptionSchedulePhase entity.
func (SubscriptionSchedulePhase) Edges ¶ added in v1.0.18
func (SubscriptionSchedulePhase) Edges() []ent.Edge
Edges of the SubscriptionSchedulePhase.
func (SubscriptionSchedulePhase) Fields ¶ added in v1.0.18
func (SubscriptionSchedulePhase) Fields() []ent.Field
Fields of the SubscriptionSchedulePhase.
func (SubscriptionSchedulePhase) Indexes ¶ added in v1.0.18
func (SubscriptionSchedulePhase) Indexes() []ent.Index
Indexes of the SubscriptionSchedulePhase.
func (SubscriptionSchedulePhase) Mixin ¶ added in v1.0.18
func (SubscriptionSchedulePhase) Mixin() []ent.Mixin
Mixin of the SubscriptionSchedulePhase.
type TenantAddress ¶ added in v1.0.0
type TenantAddress struct {
Line1 string `json:"address_line1,omitempty"`
Line2 string `json:"address_line2,omitempty"`
City string `json:"address_city,omitempty"`
State string `json:"address_state,omitempty"`
PostalCode string `json:"address_postal_code,omitempty"`
Country string `json:"address_country,omitempty"`
}
TenantAddress represents a physical address in the tenant billing details
type TenantBillingDetails ¶ added in v1.0.0
type TenantBillingDetails struct {
Email string `json:"email,omitempty"`
HelpEmail string `json:"help_email,omitempty"`
Phone string `json:"phone,omitempty"`
Address TenantAddress `json:"address,omitempty"`
}
TenantBillingDetails structure for the billing details
type TransformQuantity ¶
type WalletTransaction ¶
WalletTransaction holds the schema definition for the WalletTransaction entity.
func (WalletTransaction) Edges ¶
func (WalletTransaction) Edges() []ent.Edge
Edges of the WalletTransaction.
func (WalletTransaction) Fields ¶
func (WalletTransaction) Fields() []ent.Field
Fields of the WalletTransaction.
func (WalletTransaction) Indexes ¶
func (WalletTransaction) Indexes() []ent.Index
Indexes of the WalletTransaction.
func (WalletTransaction) Mixin ¶
func (WalletTransaction) Mixin() []ent.Mixin
Mixin of the WalletTransaction.
Source Files
¶
- auth.go
- billingsequence.go
- costsheet.go
- creditgrant.go
- creditgrantapplication.go
- creditnote.go
- creditnote_line_item.go
- customer.go
- entitlement.go
- environment.go
- feature.go
- invoice.go
- invoice_line_item.go
- invoicesequence.go
- meter.go
- payment.go
- payment_attempt.go
- plan.go
- price.go
- secret.go
- subscription.go
- subscription_line_item.go
- subscription_pause.go
- subscriptionschedule.go
- subscriptionschedulephase.go
- task.go
- tenant.go
- user.go
- wallet.go
- wallettransaction.go