usecase
import "github.com/prescriptoo/prescriptoo-api/services/subscription/internal/usecase"Package usecase contains single-task use case implementations. Legacy prototype definitions in this file are unmounted; production uses the billing implementation.
Index
- type ArchiveBillingPlanUseCase
- type Billing
- func (b *Billing) ArchiveBillingPlan(ctx context.Context, in p.ArchiveBillingPlanInput) (*p.Empty, error)
- func (b *Billing) CheckCapacity(ctx context.Context, organizationID string, members, doctors int) error
- func (b *Billing) CreateBillingInvoice(ctx context.Context, in p.CreateBillingInvoiceInput) (result *p.Invoice, err error)
- func (b *Billing) CreateBillingPlan(ctx context.Context, in p.CreateBillingPlanInput) (result *p.Plan, err error)
- func (b *Billing) CreateBillingSubscription(ctx context.Context, in p.CreateBillingSubscriptionInput) (result *p.Subscription, err error)
- func (b *Billing) CurrentSubscriptions(ctx context.Context, ids []string) (map[string]p.CurrentSubscription, error)
- func (b *Billing) DeleteBillingSubscription(ctx context.Context, in p.DeleteBillingSubscriptionInput) (*p.Empty, error)
- func (b *Billing) EditBillingInvoice(ctx context.Context, in p.EditBillingInvoiceInput) (result *p.Invoice, err error)
- func (b *Billing) EditBillingPlan(ctx context.Context, in p.EditBillingPlanInput) (result *p.Plan, err error)
- func (b *Billing) EditBillingSubscription(ctx context.Context, in p.EditBillingSubscriptionInput) (result *p.Subscription, err error)
- func (b *Billing) ExtendBillingSubscription(ctx context.Context, in p.ExtendBillingSubscriptionInput) (result *p.Subscription, err error)
- func (b *Billing) GetBillingInvoice(ctx context.Context, in p.GetBillingInvoiceInput) (*p.Invoice, error)
- func (b *Billing) GetBillingPayment(ctx context.Context, in p.GetBillingPaymentInput) (*p.Payment, error)
- func (b *Billing) GetBillingPlan(ctx context.Context, in p.GetBillingPlanInput) (*p.Plan, error)
- func (b *Billing) GetBillingSubscription(ctx context.Context, in p.GetBillingSubscriptionInput) (*p.Subscription, error)
- func (b *Billing) GetPublicPlan(ctx context.Context, in p.GetPublicPlanInput) (*p.Plan, error)
- func (b *Billing) IsActiveSubscription(ctx context.Context, organizationID string) (bool, error)
- func (b *Billing) IssueBillingInvoice(ctx context.Context, in p.IssueBillingInvoiceInput) (result *p.Invoice, err error)
- func (b *Billing) ListBillingInvoices(ctx context.Context, in p.ListBillingInvoicesInput) (*p.Page[p.Invoice], error)
- func (b *Billing) ListBillingPayments(ctx context.Context, in p.ListBillingPaymentsInput) (*p.Page[p.Payment], error)
- func (b *Billing) ListBillingPlans(ctx context.Context, in p.ListBillingPlansInput) (*p.Page[p.Plan], error)
- func (b *Billing) ListBillingSubscriptions(ctx context.Context, in p.ListBillingSubscriptionsInput) (*p.Page[p.Subscription], error)
- func (b *Billing) ListInvoicePayments(ctx context.Context, in p.ListInvoicePaymentsInput) (*p.Page[p.Payment], error)
- func (b *Billing) ListPublicPlans(ctx context.Context, in p.ListPublicPlansInput) (*p.Page[p.Plan], error)
- func (b *Billing) ListSubscriptionInvoices(ctx context.Context, in p.ListSubscriptionInvoicesInput) (*p.Page[p.Invoice], error)
- func (b *Billing) OrganizationInvoices(ctx context.Context, organizationID string, q p.Query) (*p.Page[p.OrganizationInvoice], error)
- func (b *Billing) OrganizationSubscription(ctx context.Context, organizationID string) (*p.Subscription, error)
- func (b *Billing) RecordBillingPayment(ctx context.Context, in p.RecordBillingPaymentInput) (result *p.Payment, err error)
- func (b *Billing) VoidBillingInvoice(ctx context.Context, in p.VoidBillingInvoiceInput) (result *p.Invoice, err error)
- func (b *Billing) VoidBillingPayment(ctx context.Context, in p.VoidBillingPaymentInput) (result *p.Payment, err error)
- type CancelSubscriptionUseCase
- type CreateBillingInvoiceUseCase
- type CreateBillingPlanUseCase
- type CreateBillingSubscriptionUseCase
- type CreatePlanDTO
- type CreatePlanUseCase
- type DeleteBillingSubscriptionUseCase
- type EditBillingInvoiceUseCase
- type EditBillingPlanUseCase
- type EditBillingSubscriptionUseCase
- type ExtendBillingSubscriptionUseCase
- type GetBillingInvoiceUseCase
- type GetBillingPaymentUseCase
- type GetBillingPlanUseCase
- type GetBillingSubscriptionUseCase
- type GetPublicPlanUseCase
- type GetSubscriptionUseCase
- type IssueBillingInvoiceUseCase
- type ListBillingInvoicesUseCase
- type ListBillingPaymentsUseCase
- type ListBillingPlansUseCase
- type ListBillingSubscriptionsUseCase
- type ListInvoicePaymentsUseCase
- type ListPlansUseCase
- type ListPublicPlansUseCase
- type ListSubscriptionInvoicesUseCase
- type RecordBillingPaymentUseCase
- type SubscribeDTO
- type SubscribeUseCase
- type VoidBillingInvoiceUseCase
- type VoidBillingPaymentUseCase
type ArchiveBillingPlanUseCase
ArchiveBillingPlanUseCase owns one subscription operation.
type ArchiveBillingPlanUseCase struct{ Billing *Billing }func NewArchiveBillingPlanUseCase
func NewArchiveBillingPlanUseCase(billing ...*Billing) *ArchiveBillingPlanUseCaseNewArchiveBillingPlanUseCase constructs the operation with its selected billing dependencies.
func (*ArchiveBillingPlanUseCase) Execute
func (uc *ArchiveBillingPlanUseCase) Execute(ctx context.Context, input p.ArchiveBillingPlanInput) (*p.Empty, error)Execute runs the operation through its injected application service.
type Billing
Billing owns manual agreement, invoice and payment lifecycle decisions. Clock is injected so every decision uses trusted server time and is testable.
type Billing struct {
Store ports.BillingStore
Reader ports.BillingReader
Clock func() time.Time
}func (*Billing) ArchiveBillingPlan
func (b *Billing) ArchiveBillingPlan(ctx context.Context, in p.ArchiveBillingPlanInput) (*p.Empty, error)ArchiveBillingPlan disables future assignments while retaining historical terms.
func (*Billing) CheckCapacity
func (b *Billing) CheckCapacity(ctx context.Context, organizationID string, members, doctors int) errorCheckCapacity rejects effective limits below the supplied active relationship counts.
func (*Billing) CreateBillingInvoice
func (b *Billing) CreateBillingInvoice(ctx context.Context, in p.CreateBillingInvoiceInput) (result *p.Invoice, err error)CreateBillingInvoice creates an idempotent audited draft charge.
func (*Billing) CreateBillingPlan
func (b *Billing) CreateBillingPlan(ctx context.Context, in p.CreateBillingPlanInput) (result *p.Plan, err error)CreateBillingPlan creates an audited offering with a unique immutable slug.
func (*Billing) CreateBillingSubscription
func (b *Billing) CreateBillingSubscription(ctx context.Context, in p.CreateBillingSubscriptionInput) (result *p.Subscription, err error)CreateBillingSubscription snapshots an organization agreement under the shared capacity lock.
func (*Billing) CurrentSubscriptions
func (b *Billing) CurrentSubscriptions(ctx context.Context, ids []string) (map[string]p.CurrentSubscription, error)CurrentSubscriptions batches authoritative agreement projections without fixture fallback.
func (*Billing) DeleteBillingSubscription
func (b *Billing) DeleteBillingSubscription(ctx context.Context, in p.DeleteBillingSubscriptionInput) (*p.Empty, error)DeleteBillingSubscription records terminal soft cancellation and retains financial history.
func (*Billing) EditBillingInvoice
func (b *Billing) EditBillingInvoice(ctx context.Context, in p.EditBillingInvoiceInput) (result *p.Invoice, err error)EditBillingInvoice changes only draft charge details under the invoice lock.
func (*Billing) EditBillingPlan
func (b *Billing) EditBillingPlan(ctx context.Context, in p.EditBillingPlanInput) (result *p.Plan, err error)EditBillingPlan updates catalog terms without rewriting assigned snapshots.
func (*Billing) EditBillingSubscription
func (b *Billing) EditBillingSubscription(ctx context.Context, in p.EditBillingSubscriptionInput) (result *p.Subscription, err error)EditBillingSubscription updates negotiated terms and explicitly controlled access state.
func (*Billing) ExtendBillingSubscription
func (b *Billing) ExtendBillingSubscription(ctx context.Context, in p.ExtendBillingSubscriptionInput) (result *p.Subscription, err error)ExtendBillingSubscription extends dates while preserving elapsed read-only state.
func (*Billing) GetBillingInvoice
func (b *Billing) GetBillingInvoice(ctx context.Context, in p.GetBillingInvoiceInput) (*p.Invoice, error)GetBillingInvoice reads an authorized billing resource by its identifier.
func (*Billing) GetBillingPayment
func (b *Billing) GetBillingPayment(ctx context.Context, in p.GetBillingPaymentInput) (*p.Payment, error)GetBillingPayment reads an authorized billing resource by its identifier.
func (*Billing) GetBillingPlan
func (b *Billing) GetBillingPlan(ctx context.Context, in p.GetBillingPlanInput) (*p.Plan, error)GetBillingPlan reads an authorized billing resource by its identifier.
func (*Billing) GetBillingSubscription
func (b *Billing) GetBillingSubscription(ctx context.Context, in p.GetBillingSubscriptionInput) (*p.Subscription, error)GetBillingSubscription reads an authorized billing resource by its identifier.
func (*Billing) GetPublicPlan
func (b *Billing) GetPublicPlan(ctx context.Context, in p.GetPublicPlanInput) (*p.Plan, error)GetPublicPlan reads an authorized billing resource by its identifier.
func (*Billing) IsActiveSubscription
func (b *Billing) IsActiveSubscription(ctx context.Context, organizationID string) (bool, error)IsActiveSubscription is the sole shared eligibility predicate. It never mutates state.
func (*Billing) IssueBillingInvoice
func (b *Billing) IssueBillingInvoice(ctx context.Context, in p.IssueBillingInvoiceInput) (result *p.Invoice, err error)IssueBillingInvoice freezes a draft charge and opens it for manual collection.
func (*Billing) ListBillingInvoices
func (b *Billing) ListBillingInvoices(ctx context.Context, in p.ListBillingInvoicesInput) (*p.Page[p.Invoice], error)ListBillingInvoices returns authorized billing history with scoped cursor pagination.
func (*Billing) ListBillingPayments
func (b *Billing) ListBillingPayments(ctx context.Context, in p.ListBillingPaymentsInput) (*p.Page[p.Payment], error)ListBillingPayments returns authorized billing history with scoped cursor pagination.
func (*Billing) ListBillingPlans
func (b *Billing) ListBillingPlans(ctx context.Context, in p.ListBillingPlansInput) (*p.Page[p.Plan], error)ListBillingPlans returns authorized billing history with scoped cursor pagination.
func (*Billing) ListBillingSubscriptions
func (b *Billing) ListBillingSubscriptions(ctx context.Context, in p.ListBillingSubscriptionsInput) (*p.Page[p.Subscription], error)ListBillingSubscriptions returns authorized billing history with scoped cursor pagination.
func (*Billing) ListInvoicePayments
func (b *Billing) ListInvoicePayments(ctx context.Context, in p.ListInvoicePaymentsInput) (*p.Page[p.Payment], error)ListInvoicePayments returns authorized billing history with scoped cursor pagination.
func (*Billing) ListPublicPlans
func (b *Billing) ListPublicPlans(ctx context.Context, in p.ListPublicPlansInput) (*p.Page[p.Plan], error)ListPublicPlans returns authorized billing history with scoped cursor pagination.
func (*Billing) ListSubscriptionInvoices
func (b *Billing) ListSubscriptionInvoices(ctx context.Context, in p.ListSubscriptionInvoicesInput) (*p.Page[p.Invoice], error)ListSubscriptionInvoices returns authorized billing history with scoped cursor pagination.
func (*Billing) OrganizationInvoices
func (b *Billing) OrganizationInvoices(ctx context.Context, organizationID string, q p.Query) (*p.Page[p.OrganizationInvoice], error)OrganizationInvoices returns only issued customer-facing billing history.
func (*Billing) OrganizationSubscription
func (b *Billing) OrganizationSubscription(ctx context.Context, organizationID string) (*p.Subscription, error)OrganizationSubscription returns the latest agreement for a caller-validated tenant scope.
func (*Billing) RecordBillingPayment
func (b *Billing) RecordBillingPayment(ctx context.Context, in p.RecordBillingPaymentInput) (result *p.Payment, err error)RecordBillingPayment records received money idempotently and updates invoice totals.
func (*Billing) VoidBillingInvoice
func (b *Billing) VoidBillingInvoice(ctx context.Context, in p.VoidBillingInvoiceInput) (result *p.Invoice, err error)VoidBillingInvoice retains a corrected charge after validating zero recorded payments.
func (*Billing) VoidBillingPayment
func (b *Billing) VoidBillingPayment(ctx context.Context, in p.VoidBillingPaymentInput) (result *p.Payment, err error)VoidBillingPayment retains the original received facts and recalculates settlement.
type CancelSubscriptionUseCase
CancelSubscriptionUseCase handles canceling a subscription.
type CancelSubscriptionUseCase struct {
// contains filtered or unexported fields
}func NewCancelSubscriptionUseCase
func NewCancelSubscriptionUseCase(repo ports.SubscriptionRepository) *CancelSubscriptionUseCaseNewCancelSubscriptionUseCase instantiates a new CancelSubscriptionUseCase.
func (*CancelSubscriptionUseCase) Execute
func (uc *CancelSubscriptionUseCase) Execute(ctx context.Context, subID string) errorExecute cancels a subscription.
type CreateBillingInvoiceUseCase
CreateBillingInvoiceUseCase owns one subscription operation.
type CreateBillingInvoiceUseCase struct{ Billing *Billing }func NewCreateBillingInvoiceUseCase
func NewCreateBillingInvoiceUseCase(billing ...*Billing) *CreateBillingInvoiceUseCaseNewCreateBillingInvoiceUseCase constructs the operation with its selected billing dependencies.
func (*CreateBillingInvoiceUseCase) Execute
func (uc *CreateBillingInvoiceUseCase) Execute(ctx context.Context, input p.CreateBillingInvoiceInput) (*p.Invoice, error)Execute runs the operation through its injected application service.
type CreateBillingPlanUseCase
CreateBillingPlanUseCase owns one subscription operation.
type CreateBillingPlanUseCase struct{ Billing *Billing }func NewCreateBillingPlanUseCase
func NewCreateBillingPlanUseCase(billing ...*Billing) *CreateBillingPlanUseCaseNewCreateBillingPlanUseCase constructs the operation with its selected billing dependencies.
func (*CreateBillingPlanUseCase) Execute
func (uc *CreateBillingPlanUseCase) Execute(ctx context.Context, input p.CreateBillingPlanInput) (*p.Plan, error)Execute runs the operation through its injected application service.
type CreateBillingSubscriptionUseCase
CreateBillingSubscriptionUseCase owns one subscription operation.
type CreateBillingSubscriptionUseCase struct{ Billing *Billing }func NewCreateBillingSubscriptionUseCase
func NewCreateBillingSubscriptionUseCase(billing ...*Billing) *CreateBillingSubscriptionUseCaseNewCreateBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.
func (*CreateBillingSubscriptionUseCase) Execute
func (uc *CreateBillingSubscriptionUseCase) Execute(ctx context.Context, input p.CreateBillingSubscriptionInput) (*p.Subscription, error)Execute runs the operation through its injected application service.
type CreatePlanDTO
CreatePlanDTO contains parameters to create a plan.
type CreatePlanDTO struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
PriceCents int64 `json:"price_cents"`
Interval domain.BillingInterval `json:"interval"`
Features map[string]any `json:"features"`
IsPublic bool `json:"is_public"`
}type CreatePlanUseCase
CreatePlanUseCase handles plan creation.
type CreatePlanUseCase struct {
// contains filtered or unexported fields
}func NewCreatePlanUseCase
func NewCreatePlanUseCase(repo ports.PlanRepository) *CreatePlanUseCaseNewCreatePlanUseCase instantiates a new CreatePlanUseCase.
func (*CreatePlanUseCase) Execute
func (uc *CreatePlanUseCase) Execute(ctx context.Context, dto CreatePlanDTO) (*domain.Plan, error)Execute creates a new plan.
type DeleteBillingSubscriptionUseCase
DeleteBillingSubscriptionUseCase owns one subscription operation.
type DeleteBillingSubscriptionUseCase struct{ Billing *Billing }func NewDeleteBillingSubscriptionUseCase
func NewDeleteBillingSubscriptionUseCase(billing ...*Billing) *DeleteBillingSubscriptionUseCaseNewDeleteBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.
func (*DeleteBillingSubscriptionUseCase) Execute
func (uc *DeleteBillingSubscriptionUseCase) Execute(ctx context.Context, input p.DeleteBillingSubscriptionInput) (*p.Empty, error)Execute runs the operation through its injected application service.
type EditBillingInvoiceUseCase
EditBillingInvoiceUseCase owns one subscription operation.
type EditBillingInvoiceUseCase struct{ Billing *Billing }func NewEditBillingInvoiceUseCase
func NewEditBillingInvoiceUseCase(billing ...*Billing) *EditBillingInvoiceUseCaseNewEditBillingInvoiceUseCase constructs the operation with its selected billing dependencies.
func (*EditBillingInvoiceUseCase) Execute
func (uc *EditBillingInvoiceUseCase) Execute(ctx context.Context, input p.EditBillingInvoiceInput) (*p.Invoice, error)Execute runs the operation through its injected application service.
type EditBillingPlanUseCase
EditBillingPlanUseCase owns one subscription operation.
type EditBillingPlanUseCase struct{ Billing *Billing }func NewEditBillingPlanUseCase
func NewEditBillingPlanUseCase(billing ...*Billing) *EditBillingPlanUseCaseNewEditBillingPlanUseCase constructs the operation with its selected billing dependencies.
func (*EditBillingPlanUseCase) Execute
func (uc *EditBillingPlanUseCase) Execute(ctx context.Context, input p.EditBillingPlanInput) (*p.Plan, error)Execute runs the operation through its injected application service.
type EditBillingSubscriptionUseCase
EditBillingSubscriptionUseCase owns one subscription operation.
type EditBillingSubscriptionUseCase struct{ Billing *Billing }func NewEditBillingSubscriptionUseCase
func NewEditBillingSubscriptionUseCase(billing ...*Billing) *EditBillingSubscriptionUseCaseNewEditBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.
func (*EditBillingSubscriptionUseCase) Execute
func (uc *EditBillingSubscriptionUseCase) Execute(ctx context.Context, input p.EditBillingSubscriptionInput) (*p.Subscription, error)Execute runs the operation through its injected application service.
type ExtendBillingSubscriptionUseCase
ExtendBillingSubscriptionUseCase owns one subscription operation.
type ExtendBillingSubscriptionUseCase struct{ Billing *Billing }func NewExtendBillingSubscriptionUseCase
func NewExtendBillingSubscriptionUseCase(billing ...*Billing) *ExtendBillingSubscriptionUseCaseNewExtendBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.
func (*ExtendBillingSubscriptionUseCase) Execute
func (uc *ExtendBillingSubscriptionUseCase) Execute(ctx context.Context, input p.ExtendBillingSubscriptionInput) (*p.Subscription, error)Execute runs the operation through its injected application service.
type GetBillingInvoiceUseCase
GetBillingInvoiceUseCase owns one subscription operation.
type GetBillingInvoiceUseCase struct{ Billing *Billing }func NewGetBillingInvoiceUseCase
func NewGetBillingInvoiceUseCase(billing ...*Billing) *GetBillingInvoiceUseCaseNewGetBillingInvoiceUseCase constructs the operation with its selected billing dependencies.
func (*GetBillingInvoiceUseCase) Execute
func (uc *GetBillingInvoiceUseCase) Execute(ctx context.Context, input p.GetBillingInvoiceInput) (*p.Invoice, error)Execute runs the operation through its injected application service.
type GetBillingPaymentUseCase
GetBillingPaymentUseCase owns one subscription operation.
type GetBillingPaymentUseCase struct{ Billing *Billing }func NewGetBillingPaymentUseCase
func NewGetBillingPaymentUseCase(billing ...*Billing) *GetBillingPaymentUseCaseNewGetBillingPaymentUseCase constructs the operation with its selected billing dependencies.
func (*GetBillingPaymentUseCase) Execute
func (uc *GetBillingPaymentUseCase) Execute(ctx context.Context, input p.GetBillingPaymentInput) (*p.Payment, error)Execute runs the operation through its injected application service.
type GetBillingPlanUseCase
GetBillingPlanUseCase owns one subscription operation.
type GetBillingPlanUseCase struct{ Billing *Billing }func NewGetBillingPlanUseCase
func NewGetBillingPlanUseCase(billing ...*Billing) *GetBillingPlanUseCaseNewGetBillingPlanUseCase constructs the operation with its selected billing dependencies.
func (*GetBillingPlanUseCase) Execute
func (uc *GetBillingPlanUseCase) Execute(ctx context.Context, input p.GetBillingPlanInput) (*p.Plan, error)Execute runs the operation through its injected application service.
type GetBillingSubscriptionUseCase
GetBillingSubscriptionUseCase owns one subscription operation.
type GetBillingSubscriptionUseCase struct{ Billing *Billing }func NewGetBillingSubscriptionUseCase
func NewGetBillingSubscriptionUseCase(billing ...*Billing) *GetBillingSubscriptionUseCaseNewGetBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.
func (*GetBillingSubscriptionUseCase) Execute
func (uc *GetBillingSubscriptionUseCase) Execute(ctx context.Context, input p.GetBillingSubscriptionInput) (*p.Subscription, error)Execute runs the operation through its injected application service.
type GetPublicPlanUseCase
GetPublicPlanUseCase owns one subscription operation.
type GetPublicPlanUseCase struct{ Billing *Billing }func NewGetPublicPlanUseCase
func NewGetPublicPlanUseCase(billing ...*Billing) *GetPublicPlanUseCaseNewGetPublicPlanUseCase constructs the operation with its selected billing dependencies.
func (*GetPublicPlanUseCase) Execute
func (uc *GetPublicPlanUseCase) Execute(ctx context.Context, input p.GetPublicPlanInput) (*p.Plan, error)Execute runs the operation through its injected application service.
type GetSubscriptionUseCase
GetSubscriptionUseCase handles retrieving an organization's subscription.
type GetSubscriptionUseCase struct {
// contains filtered or unexported fields
}func NewGetSubscriptionUseCase
func NewGetSubscriptionUseCase(repo ports.SubscriptionRepository) *GetSubscriptionUseCaseNewGetSubscriptionUseCase instantiates a new GetSubscriptionUseCase.
func (*GetSubscriptionUseCase) Execute
func (uc *GetSubscriptionUseCase) Execute(ctx context.Context, orgID string) (*domain.Subscription, error)Execute retrieves the subscription for an organization.
type IssueBillingInvoiceUseCase
IssueBillingInvoiceUseCase owns one subscription operation.
type IssueBillingInvoiceUseCase struct{ Billing *Billing }func NewIssueBillingInvoiceUseCase
func NewIssueBillingInvoiceUseCase(billing ...*Billing) *IssueBillingInvoiceUseCaseNewIssueBillingInvoiceUseCase constructs the operation with its selected billing dependencies.
func (*IssueBillingInvoiceUseCase) Execute
func (uc *IssueBillingInvoiceUseCase) Execute(ctx context.Context, input p.IssueBillingInvoiceInput) (*p.Invoice, error)Execute runs the operation through its injected application service.
type ListBillingInvoicesUseCase
ListBillingInvoicesUseCase owns one subscription operation.
type ListBillingInvoicesUseCase struct{ Billing *Billing }func NewListBillingInvoicesUseCase
func NewListBillingInvoicesUseCase(billing ...*Billing) *ListBillingInvoicesUseCaseNewListBillingInvoicesUseCase constructs the operation with its selected billing dependencies.
func (*ListBillingInvoicesUseCase) Execute
func (uc *ListBillingInvoicesUseCase) Execute(ctx context.Context, input p.ListBillingInvoicesInput) (*p.Page[p.Invoice], error)Execute runs the operation through its injected application service.
type ListBillingPaymentsUseCase
ListBillingPaymentsUseCase owns one subscription operation.
type ListBillingPaymentsUseCase struct{ Billing *Billing }func NewListBillingPaymentsUseCase
func NewListBillingPaymentsUseCase(billing ...*Billing) *ListBillingPaymentsUseCaseNewListBillingPaymentsUseCase constructs the operation with its selected billing dependencies.
func (*ListBillingPaymentsUseCase) Execute
func (uc *ListBillingPaymentsUseCase) Execute(ctx context.Context, input p.ListBillingPaymentsInput) (*p.Page[p.Payment], error)Execute runs the operation through its injected application service.
type ListBillingPlansUseCase
ListBillingPlansUseCase owns one subscription operation.
type ListBillingPlansUseCase struct{ Billing *Billing }func NewListBillingPlansUseCase
func NewListBillingPlansUseCase(billing ...*Billing) *ListBillingPlansUseCaseNewListBillingPlansUseCase constructs the operation with its selected billing dependencies.
func (*ListBillingPlansUseCase) Execute
func (uc *ListBillingPlansUseCase) Execute(ctx context.Context, input p.ListBillingPlansInput) (*p.Page[p.Plan], error)Execute runs the operation through its injected application service.
type ListBillingSubscriptionsUseCase
ListBillingSubscriptionsUseCase owns one subscription operation.
type ListBillingSubscriptionsUseCase struct{ Billing *Billing }func NewListBillingSubscriptionsUseCase
func NewListBillingSubscriptionsUseCase(billing ...*Billing) *ListBillingSubscriptionsUseCaseNewListBillingSubscriptionsUseCase constructs the operation with its selected billing dependencies.
func (*ListBillingSubscriptionsUseCase) Execute
func (uc *ListBillingSubscriptionsUseCase) Execute(ctx context.Context, input p.ListBillingSubscriptionsInput) (*p.Page[p.Subscription], error)Execute runs the operation through its injected application service.
type ListInvoicePaymentsUseCase
ListInvoicePaymentsUseCase owns one subscription operation.
type ListInvoicePaymentsUseCase struct{ Billing *Billing }func NewListInvoicePaymentsUseCase
func NewListInvoicePaymentsUseCase(billing ...*Billing) *ListInvoicePaymentsUseCaseNewListInvoicePaymentsUseCase constructs the operation with its selected billing dependencies.
func (*ListInvoicePaymentsUseCase) Execute
func (uc *ListInvoicePaymentsUseCase) Execute(ctx context.Context, input p.ListInvoicePaymentsInput) (*p.Page[p.Payment], error)Execute runs the operation through its injected application service.
type ListPlansUseCase
ListPlansUseCase handles listing public plans.
type ListPlansUseCase struct {
// contains filtered or unexported fields
}func NewListPlansUseCase
func NewListPlansUseCase(repo ports.PlanRepository) *ListPlansUseCaseNewListPlansUseCase instantiates a new ListPlansUseCase.
func (*ListPlansUseCase) Execute
func (uc *ListPlansUseCase) Execute(ctx context.Context) ([]*domain.Plan, error)Execute lists all public plans.
type ListPublicPlansUseCase
ListPublicPlansUseCase owns one subscription operation.
type ListPublicPlansUseCase struct{ Billing *Billing }func NewListPublicPlansUseCase
func NewListPublicPlansUseCase(billing ...*Billing) *ListPublicPlansUseCaseNewListPublicPlansUseCase constructs the operation with its selected billing dependencies.
func (*ListPublicPlansUseCase) Execute
func (uc *ListPublicPlansUseCase) Execute(ctx context.Context, input p.ListPublicPlansInput) (*p.Page[p.Plan], error)Execute runs the operation through its injected application service.
type ListSubscriptionInvoicesUseCase
ListSubscriptionInvoicesUseCase owns one subscription operation.
type ListSubscriptionInvoicesUseCase struct{ Billing *Billing }func NewListSubscriptionInvoicesUseCase
func NewListSubscriptionInvoicesUseCase(billing ...*Billing) *ListSubscriptionInvoicesUseCaseNewListSubscriptionInvoicesUseCase constructs the operation with its selected billing dependencies.
func (*ListSubscriptionInvoicesUseCase) Execute
func (uc *ListSubscriptionInvoicesUseCase) Execute(ctx context.Context, input p.ListSubscriptionInvoicesInput) (*p.Page[p.Invoice], error)Execute runs the operation through its injected application service.
type RecordBillingPaymentUseCase
RecordBillingPaymentUseCase owns one subscription operation.
type RecordBillingPaymentUseCase struct{ Billing *Billing }func NewRecordBillingPaymentUseCase
func NewRecordBillingPaymentUseCase(billing ...*Billing) *RecordBillingPaymentUseCaseNewRecordBillingPaymentUseCase constructs the operation with its selected billing dependencies.
func (*RecordBillingPaymentUseCase) Execute
func (uc *RecordBillingPaymentUseCase) Execute(ctx context.Context, input p.RecordBillingPaymentInput) (*p.Payment, error)Execute runs the operation through its injected application service.
type SubscribeDTO
SubscribeDTO contains parameters to create a subscription.
type SubscribeDTO struct {
OrganizationID string `json:"organization_id"`
PlanID string `json:"plan_id"`
TrialDays int `json:"trial_days"`
}type SubscribeUseCase
SubscribeUseCase handles creating a subscription.
type SubscribeUseCase struct {
// contains filtered or unexported fields
}func NewSubscribeUseCase
func NewSubscribeUseCase(subRepo ports.SubscriptionRepository, planRepo ports.PlanRepository) *SubscribeUseCaseNewSubscribeUseCase instantiates a new SubscribeUseCase.
func (*SubscribeUseCase) Execute
func (uc *SubscribeUseCase) Execute(ctx context.Context, dto SubscribeDTO) (*domain.Subscription, error)Execute creates a new subscription.
type VoidBillingInvoiceUseCase
VoidBillingInvoiceUseCase owns one subscription operation.
type VoidBillingInvoiceUseCase struct{ Billing *Billing }func NewVoidBillingInvoiceUseCase
func NewVoidBillingInvoiceUseCase(billing ...*Billing) *VoidBillingInvoiceUseCaseNewVoidBillingInvoiceUseCase constructs the operation with its selected billing dependencies.
func (*VoidBillingInvoiceUseCase) Execute
func (uc *VoidBillingInvoiceUseCase) Execute(ctx context.Context, input p.VoidBillingInvoiceInput) (*p.Invoice, error)Execute runs the operation through its injected application service.
type VoidBillingPaymentUseCase
VoidBillingPaymentUseCase owns one subscription operation.
type VoidBillingPaymentUseCase struct{ Billing *Billing }func NewVoidBillingPaymentUseCase
func NewVoidBillingPaymentUseCase(billing ...*Billing) *VoidBillingPaymentUseCaseNewVoidBillingPaymentUseCase constructs the operation with its selected billing dependencies.
func (*VoidBillingPaymentUseCase) Execute
func (uc *VoidBillingPaymentUseCase) Execute(ctx context.Context, input p.VoidBillingPaymentInput) (*p.Payment, error)Execute runs the operation through its injected application service.
Generated by gomarkdoc