Documentation
¶
Index ¶
- Constants
- 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) HandleInvoiceCreation(ctx context.Context, event *billing.StandardInvoiceCreatedEvent) error
- func (s *Service) HandleSubscriptionSyncEvent(ctx context.Context, event *subscription.SubscriptionSyncEvent) error
- func (s *Service) SynchronizeSubscription(ctx context.Context, subs subscription.SubscriptionView, asOf time.Time, ...) error
- func (s *Service) SynchronizeSubscriptionAndInvoiceCustomer(ctx context.Context, subs subscription.SubscriptionView, asOf time.Time) error
Constants ¶
View Source
const (
SubscriptionSyncComponentName billing.ComponentName = "subscription-sync"
)
Variables ¶
This section is empty.
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
Logger *slog.Logger
Tracer trace.Tracer
}
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) 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) SynchronizeSubscription ¶
func (s *Service) SynchronizeSubscription(ctx context.Context, subs subscription.SubscriptionView, asOf time.Time, opts ...subscriptionsync.SynchronizeSubscriptionOption) error
func (*Service) SynchronizeSubscriptionAndInvoiceCustomer ¶
func (s *Service) SynchronizeSubscriptionAndInvoiceCustomer(ctx context.Context, subs subscription.SubscriptionView, asOf time.Time) error
Click to show internal directories.
Click to hide internal directories.