subscriptionsync

package
v1.0.0-beta.226 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	SyncStateAdapter

	entutils.TxCreator
}

type EventHandler

type EventHandler interface {
	HandleCancelledEvent(ctx context.Context, event *subscription.CancelledEvent) error
	HandleSubscriptionSyncEvent(ctx context.Context, event *subscription.SubscriptionSyncEvent) error
	HandleInvoiceCreation(ctx context.Context, event *billing.InvoiceCreatedEvent) error
}

type GetSyncStatesInput

type GetSyncStatesInput = []models.NamespacedID

type InvalidateSyncStateInput

type InvalidateSyncStateInput = models.NamespacedID

type Service

type Service interface {
	EventHandler
	SyncService
	SyncStateService
}

type SyncService

type SyncService interface {
	SynchronizeSubscriptionAndInvoiceCustomer(ctx context.Context, subs subscription.SubscriptionView, asOf time.Time) error
	SynchronizeSubscription(ctx context.Context, subs subscription.SubscriptionView, asOf time.Time) error
}

type SyncState

type SyncState struct {
	SubscriptionID models.NamespacedID
	HasBillables   bool
	SyncedAt       time.Time
	NextSyncAfter  *time.Time
}

type SyncStateAdapter

type SyncStateAdapter interface {
	InvalidateSyncState(ctx context.Context, input InvalidateSyncStateInput) error
	GetSyncStates(ctx context.Context, input GetSyncStatesInput) ([]SyncState, error)
	UpsertSyncState(ctx context.Context, input UpsertSyncStateInput) error
}

type SyncStateService

type SyncStateService interface {
	GetSyncStates(ctx context.Context, input GetSyncStatesInput) ([]SyncState, error)
}

type UpsertSyncStateInput

type UpsertSyncStateInput = SyncState

func (UpsertSyncStateInput) Validate

func (i UpsertSyncStateInput) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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