reporting

package
v1.4.5-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

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

func ValidateStartAndEndDate

func ValidateStartAndEndDate(startDate time.Time, endDate time.Time) error

ValidateStartAndEndDate - date range validation

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)

Jump to

Keyboard shortcuts

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