Documentation ¶
Index ¶
- Constants
- func ApplyDateRangeFilter(context api.InterfaceApplicationContext, collection db.InterfaceDBCollection) error
- func ValidateStartAndEndDate(startDate time.Time, endDate time.Time) error
- type CustomerActivityByOrders
- type CustomerActivityBySales
- type CustomerActivityItem
- type ProductPerf
- type ProductPerfItem
- type StatItem
- type StatsBySales
Constants ¶
View Source
const ( ConstErrorModule = "reporting" ConstErrorLevel = 6 )
Package global constants
Variables ¶
This section is empty.
Functions ¶
func ApplyDateRangeFilter ¶
func ApplyDateRangeFilter(context api.InterfaceApplicationContext, collection db.InterfaceDBCollection) error
Types ¶
type CustomerActivityByOrders ¶
type CustomerActivityByOrders []CustomerActivityItem
CustomerActivityByOrders is a array of CustomerActivityItems to be sorted by order count.
func (CustomerActivityByOrders) Len ¶
func (a CustomerActivityByOrders) Len() int
func (CustomerActivityByOrders) Less ¶
func (a CustomerActivityByOrders) Less(i, j int) bool
func (CustomerActivityByOrders) Swap ¶
func (a CustomerActivityByOrders) Swap(i, j int)
type CustomerActivityBySales ¶
type CustomerActivityBySales []CustomerActivityItem
CustomerActivityBySales is an array of CustomerActivityItems to be sorted by total sales.
func (CustomerActivityBySales) Len ¶
func (a CustomerActivityBySales) Len() int
func (CustomerActivityBySales) Less ¶
func (a CustomerActivityBySales) Less(i, j int) bool
func (CustomerActivityBySales) Swap ¶
func (a CustomerActivityBySales) Swap(i, j int)
type CustomerActivityItem ¶
type CustomerActivityItem struct { Email string `json:"email"` Name string `json:"name"` TotalSales float64 `json:"total_sales"` TotalOrders int `json:"total_orders"` AverageSales float64 `json:"avg_sales"` EarliestPurchase time.Time `json:"earliest_purchase"` LatestPurchase time.Time `json:"latest_purchase"` }
CustomerActivityItem is a container for visitor stats over time
type ProductPerf ¶
type ProductPerf []ProductPerfItem
ProductPerf is an array of sales by item structs, ProductPerfItem, to be sorted
func (ProductPerf) Len ¶
func (a ProductPerf) Len() int
func (ProductPerf) Less ¶
func (a ProductPerf) Less(i, j int) bool
func (ProductPerf) Swap ¶
func (a ProductPerf) Swap(i, j int)
type ProductPerfItem ¶
type ProductPerfItem struct { Name string `json:"name"` Sku string `json:"sku"` GrossSales float64 `json:"gross_sales"` UnitsSold int `json:"units_sold"` }
ProductPerfItem is a container for sales by item reporting
type StatItem ¶
type StatItem struct { Key string `json:"key"` Name string `json:"name"` TotalSales float64 `json:"total_sales"` TotalOrders int `json:"total_orders"` AverageSales float64 `json:"avg_sales"` }
StatItem is a container for sales data by product sku over time.
type StatsBySales ¶
type StatsBySales []StatItem
StatsBySales is a array to be sorted of StatItems by sales totals over time.
func (StatsBySales) Len ¶
func (a StatsBySales) Len() int
func (StatsBySales) Less ¶
func (a StatsBySales) Less(i, j int) bool
func (StatsBySales) Swap ¶
func (a StatsBySales) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.