Documentation
¶
Overview ¶
Package adminorder implements the admin-side order management subdomain of the billing module. Only the module facade may reach it.
Index ¶
- type ActivationEnqueuer
- type DailyReport
- type DailyReportLine
- type PlanNameReader
- type Service
- func (s *Service) Create(ctx context.Context, req *dto.CreateOrderRequest) error
- func (s *Service) DailyReport(ctx context.Context, date time.Time) (*DailyReport, error)
- func (s *Service) List(ctx context.Context, req *dto.GetOrderListRequest) (*dto.GetOrderListResponse, error)
- func (s *Service) UpdateStatus(ctx context.Context, req *dto.UpdateOrderStatusRequest) error
- type Transactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationEnqueuer ¶
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
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) DailyReport ¶ added in v1.15.16
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 (s *Service) List(ctx context.Context, req *dto.GetOrderListRequest) (*dto.GetOrderListResponse, error)
func (*Service) UpdateStatus ¶
type Transactor ¶
type Transactor interface {
InBillingTx(ctx context.Context, fn func(repository.BillingStore) error) error
}
Transactor mirrors the facade's billing-scoped transaction port.