service

package
v1.0.0-beta.228 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

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
}

func (Config) Validate

func (c Config) Validate() error

type FeatureFlags

type FeatureFlags struct {
	EnableFlatFeeInAdvanceProrating bool
	EnableFlatFeeInArrearsProrating bool
	EnableCreditThenInvoice         bool
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Service, error)

func (*Service) GetSyncStates

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 (*Service) SynchronizeSubscriptionAndInvoiceCustomer

func (s *Service) SynchronizeSubscriptionAndInvoiceCustomer(ctx context.Context, subs subscription.SubscriptionView, asOf time.Time) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL