Documentation
¶
Index ¶
- func ExecuteTriggerWithAllowInStates(states ...billing.InvoiceStatus) executeTriggerApplyOptionFunc
- func ExecuteTriggerWithEditCallback(cb editCallbackFunc) executeTriggerApplyOptionFunc
- func ExecuteTriggerWithIncludeDeletedLines(includeDeletedLines bool) executeTriggerApplyOptionFunc
- type Config
- type InvoiceStateMachine
- func (m *InvoiceStateMachine) AdvanceUntilStateStable(ctx context.Context) error
- func (m *InvoiceStateMachine) CanFire(ctx context.Context, trigger billing.InvoiceTrigger) (bool, error)
- func (m *InvoiceStateMachine) FireAndActivate(ctx context.Context, trigger billing.InvoiceTrigger) error
- func (m *InvoiceStateMachine) HandleInvoiceTrigger(ctx context.Context, trigger billing.InvoiceTriggerInput) error
- func (m *InvoiceStateMachine) StatusDetails(ctx context.Context) (billing.InvoiceStatusDetails, error)
- func (m *InvoiceStateMachine) TriggerFailed(ctx context.Context) error
- type InvoiceStateMachineCallback
- type Service
- func (s *Service) AdvanceInvoice(ctx context.Context, input billing.AdvanceInvoiceInput) (billing.Invoice, error)
- func (s *Service) ApproveInvoice(ctx context.Context, input billing.ApproveInvoiceInput) (billing.Invoice, error)
- func (s *Service) CreatePendingInvoiceLines(ctx context.Context, input billing.CreatePendingInvoiceLinesInput) (*billing.CreatePendingInvoiceLinesResult, error)
- func (s *Service) CreateProfile(ctx context.Context, input billing.CreateProfileInput) (*billing.Profile, error)
- func (s *Service) DeleteCustomerOverride(ctx context.Context, input billing.DeleteCustomerOverrideInput) error
- func (s *Service) DeleteInvoice(ctx context.Context, input billing.DeleteInvoiceInput) error
- func (s *Service) DeleteProfile(ctx context.Context, input billing.DeleteProfileInput) error
- func (s *Service) DeleteSplitLineGroup(ctx context.Context, input billing.DeleteSplitLineGroupInput) error
- func (s *Service) GenerateInvoiceSequenceNumber(ctx context.Context, in billing.SequenceGenerationInput, ...) (string, error)
- func (s Service) GetAdvancementStrategy() billing.AdvancementStrategy
- func (s *Service) GetCustomerOverride(ctx context.Context, input billing.GetCustomerOverrideInput) (billing.CustomerOverrideWithDetails, error)
- func (s *Service) GetDefaultProfile(ctx context.Context, input billing.GetDefaultProfileInput) (*billing.Profile, error)
- func (s *Service) GetInvoiceByID(ctx context.Context, input billing.GetInvoiceByIdInput) (billing.Invoice, error)
- func (s *Service) GetLinesForSubscription(ctx context.Context, input billing.GetLinesForSubscriptionInput) ([]billing.LineOrHierarchy, error)
- func (s *Service) GetProfile(ctx context.Context, input billing.GetProfileInput) (*billing.Profile, error)
- func (s *Service) GetSplitLineGroup(ctx context.Context, input billing.GetSplitLineGroupInput) (billing.SplitLineHierarchy, error)
- func (s Service) InvoiceCalculator() invoicecalc.Calculator
- func (s *Service) InvoicePendingLines(ctx context.Context, input billing.InvoicePendingLinesInput) ([]billing.Invoice, error)
- func (s *Service) IsAppUsed(ctx context.Context, appID app.AppID) error
- func (s *Service) ListCustomerOverrides(ctx context.Context, input billing.ListCustomerOverridesInput) (billing.ListCustomerOverridesResult, error)
- func (s *Service) ListInvoices(ctx context.Context, input billing.ListInvoicesInput) (billing.ListInvoicesResponse, error)
- func (s *Service) ListProfiles(ctx context.Context, input billing.ListProfilesInput) (billing.ListProfilesResult, error)
- func (s *Service) ProvisionDefaultBillingProfile(ctx context.Context, namespace string) error
- func (s *Service) RecalculateGatheringInvoices(ctx context.Context, input billing.RecalculateGatheringInvoicesInput) error
- func (s *Service) RetryInvoice(ctx context.Context, input billing.RetryInvoiceInput) (billing.Invoice, error)
- func (s Service) SimulateInvoice(ctx context.Context, input billing.SimulateInvoiceInput) (billing.Invoice, error)
- func (s *Service) SnapshotLineQuantity(ctx context.Context, input billing.SnapshotLineQuantityInput) (*billing.Line, error)
- func (s *Service) SnapshotQuantities(ctx context.Context, input billing.SnapshotQuantitiesInput) (billing.Invoice, error)
- func (s *Service) SyncDraftInvoice(ctx context.Context, input billing.SyncDraftInvoiceInput) (billing.Invoice, error)
- func (s *Service) SyncIssuingInvoice(ctx context.Context, input billing.SyncIssuingInvoiceInput) (billing.Invoice, error)
- func (s *Service) TriggerInvoice(ctx context.Context, input billing.InvoiceTriggerServiceInput) error
- func (s *Service) UpdateInvoice(ctx context.Context, input billing.UpdateInvoiceInput) (billing.Invoice, error)
- func (s *Service) UpdateInvoiceFields(ctx context.Context, input billing.UpdateInvoiceFieldsInput) error
- func (s *Service) UpdateProfile(ctx context.Context, input billing.UpdateProfileInput) (*billing.Profile, error)
- func (s *Service) UpdateSplitLineGroup(ctx context.Context, input billing.UpdateSplitLineGroupInput) (billing.SplitLineGroup, error)
- func (s *Service) UpsertCustomerOverride(ctx context.Context, input billing.UpsertCustomerOverrideInput) (billing.CustomerOverrideWithDetails, error)
- func (s *Service) UpsertValidationIssues(ctx context.Context, input billing.UpsertValidationIssuesInput) error
- func (s Service) WithAdvancementStrategy(strategy billing.AdvancementStrategy) billing.Service
- func (s Service) WithInvoiceCalculator(calc invoicecalc.Calculator) *Service
- func (s *Service) WithInvoiceStateMachine(ctx context.Context, invoice billing.Invoice, cb InvoiceStateMachineCallback) (billing.Invoice, error)
- func (s *Service) WithLock(ctx context.Context, customerID customer.CustomerID, ...) error
- func (s *Service) WithLockedNamespaces(namespaces []string) billing.Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteTriggerWithAllowInStates ¶
func ExecuteTriggerWithAllowInStates(states ...billing.InvoiceStatus) executeTriggerApplyOptionFunc
func ExecuteTriggerWithEditCallback ¶
func ExecuteTriggerWithEditCallback(cb editCallbackFunc) executeTriggerApplyOptionFunc
func ExecuteTriggerWithIncludeDeletedLines ¶
func ExecuteTriggerWithIncludeDeletedLines(includeDeletedLines bool) executeTriggerApplyOptionFunc
Types ¶
type Config ¶
type Config struct {
Adapter billing.Adapter
CustomerService customer.Service
AppService app.Service
Logger *slog.Logger
FeatureService feature.FeatureConnector
MeterService meter.Service
StreamingConnector streaming.Connector
Publisher eventbus.Publisher
AdvancementStrategy billing.AdvancementStrategy
FSNamespaceLockdown []string
MaxParallelQuantitySnapshots int
}
type InvoiceStateMachine ¶
type InvoiceStateMachine struct {
Invoice billing.Invoice
Calculator invoicecalc.Calculator
StateMachine *stateless.StateMachine
Logger *slog.Logger
Publisher eventbus.Publisher
Service *Service
FSNamespaceLockdown []string
}
func (*InvoiceStateMachine) AdvanceUntilStateStable ¶
func (m *InvoiceStateMachine) AdvanceUntilStateStable(ctx context.Context) error
func (*InvoiceStateMachine) CanFire ¶
func (m *InvoiceStateMachine) CanFire(ctx context.Context, trigger billing.InvoiceTrigger) (bool, error)
func (*InvoiceStateMachine) FireAndActivate ¶
func (m *InvoiceStateMachine) FireAndActivate(ctx context.Context, trigger billing.InvoiceTrigger) error
FireAndActivate fires the trigger and activates the new state, if activation fails it automatically transitions to the failed state and activates that. In addition to the activation a calculation is always performed to ensure that the invoice is up to date.
func (*InvoiceStateMachine) HandleInvoiceTrigger ¶
func (m *InvoiceStateMachine) HandleInvoiceTrigger(ctx context.Context, trigger billing.InvoiceTriggerInput) error
func (*InvoiceStateMachine) StatusDetails ¶
func (m *InvoiceStateMachine) StatusDetails(ctx context.Context) (billing.InvoiceStatusDetails, error)
func (*InvoiceStateMachine) TriggerFailed ¶
func (m *InvoiceStateMachine) TriggerFailed(ctx context.Context) error
type InvoiceStateMachineCallback ¶
type InvoiceStateMachineCallback func(context.Context, *InvoiceStateMachine) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AdvanceInvoice ¶
func (*Service) ApproveInvoice ¶
func (*Service) CreatePendingInvoiceLines ¶
func (s *Service) CreatePendingInvoiceLines(ctx context.Context, input billing.CreatePendingInvoiceLinesInput) (*billing.CreatePendingInvoiceLinesResult, error)
func (*Service) CreateProfile ¶
func (*Service) DeleteCustomerOverride ¶
func (*Service) DeleteInvoice ¶
func (*Service) DeleteProfile ¶
func (*Service) DeleteSplitLineGroup ¶
func (*Service) GenerateInvoiceSequenceNumber ¶
func (s *Service) GenerateInvoiceSequenceNumber(ctx context.Context, in billing.SequenceGenerationInput, def billing.SequenceDefinition) (string, error)
func (Service) GetAdvancementStrategy ¶
func (s Service) GetAdvancementStrategy() billing.AdvancementStrategy
func (*Service) GetCustomerOverride ¶
func (s *Service) GetCustomerOverride(ctx context.Context, input billing.GetCustomerOverrideInput) (billing.CustomerOverrideWithDetails, error)
func (*Service) GetDefaultProfile ¶
func (*Service) GetInvoiceByID ¶
func (*Service) GetLinesForSubscription ¶
func (s *Service) GetLinesForSubscription(ctx context.Context, input billing.GetLinesForSubscriptionInput) ([]billing.LineOrHierarchy, error)
func (*Service) GetProfile ¶
func (*Service) GetSplitLineGroup ¶
func (s *Service) GetSplitLineGroup(ctx context.Context, input billing.GetSplitLineGroupInput) (billing.SplitLineHierarchy, error)
func (Service) InvoiceCalculator ¶
func (s Service) InvoiceCalculator() invoicecalc.Calculator
func (*Service) InvoicePendingLines ¶
func (*Service) ListCustomerOverrides ¶
func (s *Service) ListCustomerOverrides(ctx context.Context, input billing.ListCustomerOverridesInput) (billing.ListCustomerOverridesResult, error)
func (*Service) ListInvoices ¶
func (s *Service) ListInvoices(ctx context.Context, input billing.ListInvoicesInput) (billing.ListInvoicesResponse, error)
func (*Service) ListProfiles ¶
func (s *Service) ListProfiles(ctx context.Context, input billing.ListProfilesInput) (billing.ListProfilesResult, error)
func (*Service) ProvisionDefaultBillingProfile ¶
func (*Service) RecalculateGatheringInvoices ¶
func (*Service) RetryInvoice ¶
func (Service) SimulateInvoice ¶
func (*Service) SnapshotLineQuantity ¶
func (*Service) SnapshotQuantities ¶
func (*Service) SyncDraftInvoice ¶
func (*Service) SyncIssuingInvoice ¶
func (*Service) TriggerInvoice ¶
func (*Service) UpdateInvoice ¶
func (*Service) UpdateInvoiceFields ¶
func (*Service) UpdateProfile ¶
func (*Service) UpdateSplitLineGroup ¶
func (s *Service) UpdateSplitLineGroup(ctx context.Context, input billing.UpdateSplitLineGroupInput) (billing.SplitLineGroup, error)
func (*Service) UpsertCustomerOverride ¶
func (s *Service) UpsertCustomerOverride(ctx context.Context, input billing.UpsertCustomerOverrideInput) (billing.CustomerOverrideWithDetails, error)
func (*Service) UpsertValidationIssues ¶
func (Service) WithAdvancementStrategy ¶
func (s Service) WithAdvancementStrategy(strategy billing.AdvancementStrategy) billing.Service
func (Service) WithInvoiceCalculator ¶
func (s Service) WithInvoiceCalculator(calc invoicecalc.Calculator) *Service
func (*Service) WithInvoiceStateMachine ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
lineservice package contains the implementation of the LineAdapter interface which acts as a adapter between the specific line types and the billing service.
|
lineservice package contains the implementation of the LineAdapter interface which acts as a adapter between the specific line types and the billing service. |
Click to show internal directories.
Click to hide internal directories.