Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type FeatureFlags
- type Service
- func (s *Service) GetSyncStates(ctx context.Context, input subscriptionsync.GetSyncStatesInput) ([]subscriptionsync.SyncState, error)
- func (s *Service) HandleCancelledEvent(ctx context.Context, event *subscription.CancelledEvent) error
- func (s *Service) HandleDeletedEvent(ctx context.Context, event *subscription.DeletedEvent) error
- func (s *Service) HandleInvoiceCreation(ctx context.Context, event *billing.StandardInvoiceCreatedEvent) error
- func (s *Service) HandleSubscriptionSyncEvent(ctx context.Context, event *subscription.SubscriptionSyncEvent) error
- func (s *Service) SyncByID(ctx context.Context, subscriptionID models.NamespacedID, asOf time.Time, ...) error
- func (s *Service) SyncByIDAndInvoiceCustomer(ctx context.Context, subscriptionID models.NamespacedID, asOf time.Time) error
- func (s *Service) SyncByView(ctx context.Context, view subscription.SubscriptionView, asOf time.Time, ...) error
- func (s *Service) SyncByViewAndInvoiceCustomer(ctx context.Context, view subscription.SubscriptionView, asOf time.Time) error
- type SubscriptionReferenceType
Constants ¶
View Source
const (
SubscriptionSyncComponentName billing.ComponentName = "subscription-sync"
)
Variables ¶
View Source
var SubscriptionReferenceTypes = []SubscriptionReferenceType{ SubscriptionReferenceTypeID, SubscriptionReferenceTypeView, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BillingService billing.Service
// ChargesService is required for credit-only sync and charge-based provisioning.
ChargesService charges.Service
SubscriptionService subscription.Service
SubscriptionSyncAdapter subscriptionsync.Adapter
FeatureFlags FeatureFlags
ForceAsyncInvoicePendingLines bool
Logger *slog.Logger
Tracer trace.Tracer
FeatureGate *featuregate.FeatureGateChecker
}
type FeatureFlags ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) GetSyncStates ¶
func (s *Service) GetSyncStates(ctx context.Context, input subscriptionsync.GetSyncStatesInput) ([]subscriptionsync.SyncState, error)
func (*Service) HandleCancelledEvent ¶
func (s *Service) HandleCancelledEvent(ctx context.Context, event *subscription.CancelledEvent) error
HandleCancelledEvent is a handler for the subscription cancel event, it will make sure that we synchronize the
func (*Service) HandleDeletedEvent ¶
func (s *Service) HandleDeletedEvent(ctx context.Context, event *subscription.DeletedEvent) error
HandleDeletedEvent is a handler for the subscription deleted event, it will make sure that we synchronize the subscription and invoice customer.
func (*Service) HandleInvoiceCreation ¶
func (s *Service) HandleInvoiceCreation(ctx context.Context, event *billing.StandardInvoiceCreatedEvent) error
HandleInvoiceCreation is a handler for the invoice creation event, it will make sure that we are backfilling the items consumed by invoice creation into the gathering invoice.
func (*Service) HandleSubscriptionSyncEvent ¶
func (s *Service) HandleSubscriptionSyncEvent(ctx context.Context, event *subscription.SubscriptionSyncEvent) error
func (*Service) SyncByID ¶
func (s *Service) SyncByID(ctx context.Context, subscriptionID models.NamespacedID, asOf time.Time, opts ...subscriptionsync.SynchronizeSubscriptionOption) error
func (*Service) SyncByIDAndInvoiceCustomer ¶
func (*Service) SyncByView ¶
func (s *Service) SyncByView(ctx context.Context, view subscription.SubscriptionView, asOf time.Time, opts ...subscriptionsync.SynchronizeSubscriptionOption) error
func (*Service) SyncByViewAndInvoiceCustomer ¶
func (s *Service) SyncByViewAndInvoiceCustomer(ctx context.Context, view subscription.SubscriptionView, asOf time.Time) error
type SubscriptionReferenceType ¶
type SubscriptionReferenceType string
const ( SubscriptionReferenceTypeID SubscriptionReferenceType = "id" SubscriptionReferenceTypeView SubscriptionReferenceType = "view" )
func (SubscriptionReferenceType) Validate ¶
func (t SubscriptionReferenceType) Validate() error
Click to show internal directories.
Click to hide internal directories.