Skip to content

usecase ​

go
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 ​

ArchiveBillingPlanUseCase owns one subscription operation.

go
type ArchiveBillingPlanUseCase struct{ Billing *Billing }

func NewArchiveBillingPlanUseCase ​

go
func NewArchiveBillingPlanUseCase(billing ...*Billing) *ArchiveBillingPlanUseCase

NewArchiveBillingPlanUseCase constructs the operation with its selected billing dependencies.

func (*ArchiveBillingPlanUseCase) Execute ​

go
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.

go
type Billing struct {
    Store  ports.BillingStore
    Reader ports.BillingReader
    Clock  func() time.Time
}

func (*Billing) ArchiveBillingPlan ​

go
func (b *Billing) ArchiveBillingPlan(ctx context.Context, in p.ArchiveBillingPlanInput) (*p.Empty, error)

ArchiveBillingPlan disables future assignments while retaining historical terms.

func (*Billing) CheckCapacity ​

go
func (b *Billing) CheckCapacity(ctx context.Context, organizationID string, members, doctors int) error

CheckCapacity rejects effective limits below the supplied active relationship counts.

func (*Billing) CreateBillingInvoice ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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 ​

go
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.

go
type CancelSubscriptionUseCase struct {
    // contains filtered or unexported fields
}

func NewCancelSubscriptionUseCase ​

go
func NewCancelSubscriptionUseCase(repo ports.SubscriptionRepository) *CancelSubscriptionUseCase

NewCancelSubscriptionUseCase instantiates a new CancelSubscriptionUseCase.

func (*CancelSubscriptionUseCase) Execute ​

go
func (uc *CancelSubscriptionUseCase) Execute(ctx context.Context, subID string) error

Execute cancels a subscription.

type CreateBillingInvoiceUseCase ​

CreateBillingInvoiceUseCase owns one subscription operation.

go
type CreateBillingInvoiceUseCase struct{ Billing *Billing }

func NewCreateBillingInvoiceUseCase ​

go
func NewCreateBillingInvoiceUseCase(billing ...*Billing) *CreateBillingInvoiceUseCase

NewCreateBillingInvoiceUseCase constructs the operation with its selected billing dependencies.

func (*CreateBillingInvoiceUseCase) Execute ​

go
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.

go
type CreateBillingPlanUseCase struct{ Billing *Billing }

func NewCreateBillingPlanUseCase ​

go
func NewCreateBillingPlanUseCase(billing ...*Billing) *CreateBillingPlanUseCase

NewCreateBillingPlanUseCase constructs the operation with its selected billing dependencies.

func (*CreateBillingPlanUseCase) Execute ​

go
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.

go
type CreateBillingSubscriptionUseCase struct{ Billing *Billing }

func NewCreateBillingSubscriptionUseCase ​

go
func NewCreateBillingSubscriptionUseCase(billing ...*Billing) *CreateBillingSubscriptionUseCase

NewCreateBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.

func (*CreateBillingSubscriptionUseCase) Execute ​

go
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.

go
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.

go
type CreatePlanUseCase struct {
    // contains filtered or unexported fields
}

func NewCreatePlanUseCase ​

go
func NewCreatePlanUseCase(repo ports.PlanRepository) *CreatePlanUseCase

NewCreatePlanUseCase instantiates a new CreatePlanUseCase.

func (*CreatePlanUseCase) Execute ​

go
func (uc *CreatePlanUseCase) Execute(ctx context.Context, dto CreatePlanDTO) (*domain.Plan, error)

Execute creates a new plan.

type DeleteBillingSubscriptionUseCase ​

DeleteBillingSubscriptionUseCase owns one subscription operation.

go
type DeleteBillingSubscriptionUseCase struct{ Billing *Billing }

func NewDeleteBillingSubscriptionUseCase ​

go
func NewDeleteBillingSubscriptionUseCase(billing ...*Billing) *DeleteBillingSubscriptionUseCase

NewDeleteBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.

func (*DeleteBillingSubscriptionUseCase) Execute ​

go
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.

go
type EditBillingInvoiceUseCase struct{ Billing *Billing }

func NewEditBillingInvoiceUseCase ​

go
func NewEditBillingInvoiceUseCase(billing ...*Billing) *EditBillingInvoiceUseCase

NewEditBillingInvoiceUseCase constructs the operation with its selected billing dependencies.

func (*EditBillingInvoiceUseCase) Execute ​

go
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.

go
type EditBillingPlanUseCase struct{ Billing *Billing }

func NewEditBillingPlanUseCase ​

go
func NewEditBillingPlanUseCase(billing ...*Billing) *EditBillingPlanUseCase

NewEditBillingPlanUseCase constructs the operation with its selected billing dependencies.

func (*EditBillingPlanUseCase) Execute ​

go
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.

go
type EditBillingSubscriptionUseCase struct{ Billing *Billing }

func NewEditBillingSubscriptionUseCase ​

go
func NewEditBillingSubscriptionUseCase(billing ...*Billing) *EditBillingSubscriptionUseCase

NewEditBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.

func (*EditBillingSubscriptionUseCase) Execute ​

go
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.

go
type ExtendBillingSubscriptionUseCase struct{ Billing *Billing }

func NewExtendBillingSubscriptionUseCase ​

go
func NewExtendBillingSubscriptionUseCase(billing ...*Billing) *ExtendBillingSubscriptionUseCase

NewExtendBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.

func (*ExtendBillingSubscriptionUseCase) Execute ​

go
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.

go
type GetBillingInvoiceUseCase struct{ Billing *Billing }

func NewGetBillingInvoiceUseCase ​

go
func NewGetBillingInvoiceUseCase(billing ...*Billing) *GetBillingInvoiceUseCase

NewGetBillingInvoiceUseCase constructs the operation with its selected billing dependencies.

func (*GetBillingInvoiceUseCase) Execute ​

go
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.

go
type GetBillingPaymentUseCase struct{ Billing *Billing }

func NewGetBillingPaymentUseCase ​

go
func NewGetBillingPaymentUseCase(billing ...*Billing) *GetBillingPaymentUseCase

NewGetBillingPaymentUseCase constructs the operation with its selected billing dependencies.

func (*GetBillingPaymentUseCase) Execute ​

go
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.

go
type GetBillingPlanUseCase struct{ Billing *Billing }

func NewGetBillingPlanUseCase ​

go
func NewGetBillingPlanUseCase(billing ...*Billing) *GetBillingPlanUseCase

NewGetBillingPlanUseCase constructs the operation with its selected billing dependencies.

func (*GetBillingPlanUseCase) Execute ​

go
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.

go
type GetBillingSubscriptionUseCase struct{ Billing *Billing }

func NewGetBillingSubscriptionUseCase ​

go
func NewGetBillingSubscriptionUseCase(billing ...*Billing) *GetBillingSubscriptionUseCase

NewGetBillingSubscriptionUseCase constructs the operation with its selected billing dependencies.

func (*GetBillingSubscriptionUseCase) Execute ​

go
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.

go
type GetPublicPlanUseCase struct{ Billing *Billing }

func NewGetPublicPlanUseCase ​

go
func NewGetPublicPlanUseCase(billing ...*Billing) *GetPublicPlanUseCase

NewGetPublicPlanUseCase constructs the operation with its selected billing dependencies.

func (*GetPublicPlanUseCase) Execute ​

go
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.

go
type GetSubscriptionUseCase struct {
    // contains filtered or unexported fields
}

func NewGetSubscriptionUseCase ​

go
func NewGetSubscriptionUseCase(repo ports.SubscriptionRepository) *GetSubscriptionUseCase

NewGetSubscriptionUseCase instantiates a new GetSubscriptionUseCase.

func (*GetSubscriptionUseCase) Execute ​

go
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.

go
type IssueBillingInvoiceUseCase struct{ Billing *Billing }

func NewIssueBillingInvoiceUseCase ​

go
func NewIssueBillingInvoiceUseCase(billing ...*Billing) *IssueBillingInvoiceUseCase

NewIssueBillingInvoiceUseCase constructs the operation with its selected billing dependencies.

func (*IssueBillingInvoiceUseCase) Execute ​

go
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.

go
type ListBillingInvoicesUseCase struct{ Billing *Billing }

func NewListBillingInvoicesUseCase ​

go
func NewListBillingInvoicesUseCase(billing ...*Billing) *ListBillingInvoicesUseCase

NewListBillingInvoicesUseCase constructs the operation with its selected billing dependencies.

func (*ListBillingInvoicesUseCase) Execute ​

go
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.

go
type ListBillingPaymentsUseCase struct{ Billing *Billing }

func NewListBillingPaymentsUseCase ​

go
func NewListBillingPaymentsUseCase(billing ...*Billing) *ListBillingPaymentsUseCase

NewListBillingPaymentsUseCase constructs the operation with its selected billing dependencies.

func (*ListBillingPaymentsUseCase) Execute ​

go
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.

go
type ListBillingPlansUseCase struct{ Billing *Billing }

func NewListBillingPlansUseCase ​

go
func NewListBillingPlansUseCase(billing ...*Billing) *ListBillingPlansUseCase

NewListBillingPlansUseCase constructs the operation with its selected billing dependencies.

func (*ListBillingPlansUseCase) Execute ​

go
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.

go
type ListBillingSubscriptionsUseCase struct{ Billing *Billing }

func NewListBillingSubscriptionsUseCase ​

go
func NewListBillingSubscriptionsUseCase(billing ...*Billing) *ListBillingSubscriptionsUseCase

NewListBillingSubscriptionsUseCase constructs the operation with its selected billing dependencies.

func (*ListBillingSubscriptionsUseCase) Execute ​

go
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.

go
type ListInvoicePaymentsUseCase struct{ Billing *Billing }

func NewListInvoicePaymentsUseCase ​

go
func NewListInvoicePaymentsUseCase(billing ...*Billing) *ListInvoicePaymentsUseCase

NewListInvoicePaymentsUseCase constructs the operation with its selected billing dependencies.

func (*ListInvoicePaymentsUseCase) Execute ​

go
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.

go
type ListPlansUseCase struct {
    // contains filtered or unexported fields
}

func NewListPlansUseCase ​

go
func NewListPlansUseCase(repo ports.PlanRepository) *ListPlansUseCase

NewListPlansUseCase instantiates a new ListPlansUseCase.

func (*ListPlansUseCase) Execute ​

go
func (uc *ListPlansUseCase) Execute(ctx context.Context) ([]*domain.Plan, error)

Execute lists all public plans.

type ListPublicPlansUseCase ​

ListPublicPlansUseCase owns one subscription operation.

go
type ListPublicPlansUseCase struct{ Billing *Billing }

func NewListPublicPlansUseCase ​

go
func NewListPublicPlansUseCase(billing ...*Billing) *ListPublicPlansUseCase

NewListPublicPlansUseCase constructs the operation with its selected billing dependencies.

func (*ListPublicPlansUseCase) Execute ​

go
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.

go
type ListSubscriptionInvoicesUseCase struct{ Billing *Billing }

func NewListSubscriptionInvoicesUseCase ​

go
func NewListSubscriptionInvoicesUseCase(billing ...*Billing) *ListSubscriptionInvoicesUseCase

NewListSubscriptionInvoicesUseCase constructs the operation with its selected billing dependencies.

func (*ListSubscriptionInvoicesUseCase) Execute ​

go
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.

go
type RecordBillingPaymentUseCase struct{ Billing *Billing }

func NewRecordBillingPaymentUseCase ​

go
func NewRecordBillingPaymentUseCase(billing ...*Billing) *RecordBillingPaymentUseCase

NewRecordBillingPaymentUseCase constructs the operation with its selected billing dependencies.

func (*RecordBillingPaymentUseCase) Execute ​

go
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.

go
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.

go
type SubscribeUseCase struct {
    // contains filtered or unexported fields
}

func NewSubscribeUseCase ​

go
func NewSubscribeUseCase(subRepo ports.SubscriptionRepository, planRepo ports.PlanRepository) *SubscribeUseCase

NewSubscribeUseCase instantiates a new SubscribeUseCase.

func (*SubscribeUseCase) Execute ​

go
func (uc *SubscribeUseCase) Execute(ctx context.Context, dto SubscribeDTO) (*domain.Subscription, error)

Execute creates a new subscription.

type VoidBillingInvoiceUseCase ​

VoidBillingInvoiceUseCase owns one subscription operation.

go
type VoidBillingInvoiceUseCase struct{ Billing *Billing }

func NewVoidBillingInvoiceUseCase ​

go
func NewVoidBillingInvoiceUseCase(billing ...*Billing) *VoidBillingInvoiceUseCase

NewVoidBillingInvoiceUseCase constructs the operation with its selected billing dependencies.

func (*VoidBillingInvoiceUseCase) Execute ​

go
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.

go
type VoidBillingPaymentUseCase struct{ Billing *Billing }

func NewVoidBillingPaymentUseCase ​

go
func NewVoidBillingPaymentUseCase(billing ...*Billing) *VoidBillingPaymentUseCase

NewVoidBillingPaymentUseCase constructs the operation with its selected billing dependencies.

func (*VoidBillingPaymentUseCase) Execute ​

go
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

Documentation follows the source. Planned contracts are marked explicitly.