adminorder

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package adminorder implements the admin-side order management subdomain of the billing module. Only the module facade may reach it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivationEnqueuer

type ActivationEnqueuer interface {
	EnqueueActivation(ctx context.Context, orderNo string) error
}

ActivationEnqueuer mirrors the facade's activation queue port.

type DailyReport added in v1.15.16

type DailyReport struct {
	Date     time.Time
	Orders   int64
	Amount   int64
	ByPlan   []DailyReportLine
	ByMethod []DailyReportLine
}

DailyReport summarises the orders settled on one day. Amounts stay in minor units; formatting belongs to whoever renders the report.

type DailyReportLine added in v1.15.16

type DailyReportLine struct {
	Name   string
	Orders int64
	Amount int64
}

DailyReportLine is one plan or payment-method row of the daily report.

type PlanNameReader added in v1.15.16

type PlanNameReader interface {
	FindOne(ctx context.Context, id int64) (*subscribe.Subscribe, error)
}

PlanNameReader is the read port onto the subscription domain's plan catalogue, used to label the daily report's plan breakdown.

type Service

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

func NewService

func NewService(orders repository.OrderRepo, payments repository.PaymentRepo, tx Transactor, queue ActivationEnqueuer, plans PlanNameReader) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, req *dto.CreateOrderRequest) error

func (*Service) DailyReport added in v1.15.16

func (s *Service) DailyReport(ctx context.Context, date time.Time) (*DailyReport, error)

DailyReport totals a day's settled orders and resolves plan ids to names so the caller only has to format the result.

func (*Service) List

func (*Service) UpdateStatus

func (s *Service) UpdateStatus(ctx context.Context, req *dto.UpdateOrderStatusRequest) error

type Transactor

type Transactor interface {
	InBillingTx(ctx context.Context, fn func(repository.BillingStore) error) error
}

Transactor mirrors the facade's billing-scoped transaction port.

Jump to

Keyboard shortcuts

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