Compare commits
No commits in common. "main" and "feature/activity-logs" have entirely different histories.
main
...
feature/ac
@ -162,7 +162,6 @@ type ProductAnalyticsData struct {
|
|||||||
ProductID uuid.UUID `json:"product_id"`
|
ProductID uuid.UUID `json:"product_id"`
|
||||||
ProductName string `json:"product_name"`
|
ProductName string `json:"product_name"`
|
||||||
ProductSku string `json:"product_sku"`
|
ProductSku string `json:"product_sku"`
|
||||||
ProductPrice float64 `json:"product_price"`
|
|
||||||
CategoryID uuid.UUID `json:"category_id"`
|
CategoryID uuid.UUID `json:"category_id"`
|
||||||
CategoryName string `json:"category_name"`
|
CategoryName string `json:"category_name"`
|
||||||
CategoryOrder int `json:"category_order"`
|
CategoryOrder int `json:"category_order"`
|
||||||
|
|||||||
@ -76,7 +76,6 @@ type ProductAnalytics struct {
|
|||||||
ProductID uuid.UUID `json:"product_id"`
|
ProductID uuid.UUID `json:"product_id"`
|
||||||
ProductName string `json:"product_name"`
|
ProductName string `json:"product_name"`
|
||||||
ProductSku string `json:"product_sku"`
|
ProductSku string `json:"product_sku"`
|
||||||
ProductPrice float64 `json:"product_price"`
|
|
||||||
CategoryID uuid.UUID `json:"category_id"`
|
CategoryID uuid.UUID `json:"category_id"`
|
||||||
CategoryName string `json:"category_name"`
|
CategoryName string `json:"category_name"`
|
||||||
CategoryOrder int `json:"category_order"`
|
CategoryOrder int `json:"category_order"`
|
||||||
|
|||||||
@ -172,7 +172,6 @@ type ProductAnalyticsData struct {
|
|||||||
ProductID uuid.UUID `json:"product_id"`
|
ProductID uuid.UUID `json:"product_id"`
|
||||||
ProductName string `json:"product_name"`
|
ProductName string `json:"product_name"`
|
||||||
ProductSku string `json:"product_sku"`
|
ProductSku string `json:"product_sku"`
|
||||||
ProductPrice float64 `json:"product_price"`
|
|
||||||
CategoryID uuid.UUID `json:"category_id"`
|
CategoryID uuid.UUID `json:"category_id"`
|
||||||
CategoryName string `json:"category_name"`
|
CategoryName string `json:"category_name"`
|
||||||
CategoryOrder int `json:"category_order"`
|
CategoryOrder int `json:"category_order"`
|
||||||
|
|||||||
@ -264,7 +264,6 @@ func (p *AnalyticsProcessorImpl) GetProductAnalytics(ctx context.Context, req *m
|
|||||||
ProductID: data.ProductID,
|
ProductID: data.ProductID,
|
||||||
ProductName: data.ProductName,
|
ProductName: data.ProductName,
|
||||||
ProductSku: data.ProductSku,
|
ProductSku: data.ProductSku,
|
||||||
ProductPrice: data.ProductPrice,
|
|
||||||
CategoryID: data.CategoryID,
|
CategoryID: data.CategoryID,
|
||||||
CategoryName: data.CategoryName,
|
CategoryName: data.CategoryName,
|
||||||
CategoryOrder: data.CategoryOrder,
|
CategoryOrder: data.CategoryOrder,
|
||||||
|
|||||||
@ -284,7 +284,6 @@ func (r *AnalyticsRepositoryImpl) GetProductAnalytics(ctx context.Context, organ
|
|||||||
Select(`
|
Select(`
|
||||||
p.id as product_id,
|
p.id as product_id,
|
||||||
p.name as product_name,
|
p.name as product_name,
|
||||||
p.price as product_price,
|
|
||||||
c.id as category_id,
|
c.id as category_id,
|
||||||
c.name as category_name,
|
c.name as category_name,
|
||||||
c.order as category_order,
|
c.order as category_order,
|
||||||
@ -343,7 +342,7 @@ func (r *AnalyticsRepositoryImpl) GetProductAnalytics(ctx context.Context, organ
|
|||||||
query = r.resolveOutletID(query, outletID, "o.outlet_id")
|
query = r.resolveOutletID(query, outletID, "o.outlet_id")
|
||||||
|
|
||||||
err := query.
|
err := query.
|
||||||
Group("p.id, p.name, p.price, p.cost, c.id, c.name, c.order, mahpp.hpp_per_unit").
|
Group("p.id, p.name, p.cost, c.id, c.name, c.order, mahpp.hpp_per_unit").
|
||||||
Order("revenue DESC").
|
Order("revenue DESC").
|
||||||
Limit(limit).
|
Limit(limit).
|
||||||
Scan(&results).Error
|
Scan(&results).Error
|
||||||
|
|||||||
@ -257,7 +257,6 @@ func ProductAnalyticsModelToContract(resp *models.ProductAnalyticsResponse) *con
|
|||||||
ProductID: item.ProductID,
|
ProductID: item.ProductID,
|
||||||
ProductName: item.ProductName,
|
ProductName: item.ProductName,
|
||||||
ProductSku: item.ProductSku,
|
ProductSku: item.ProductSku,
|
||||||
ProductPrice: item.ProductPrice,
|
|
||||||
CategoryID: item.CategoryID,
|
CategoryID: item.CategoryID,
|
||||||
CategoryName: item.CategoryName,
|
CategoryName: item.CategoryName,
|
||||||
CategoryOrder: item.CategoryOrder,
|
CategoryOrder: item.CategoryOrder,
|
||||||
@ -368,7 +367,6 @@ func DashboardAnalyticsModelToContract(resp *models.DashboardAnalyticsResponse)
|
|||||||
topProducts = append(topProducts, contract.ProductAnalyticsData{
|
topProducts = append(topProducts, contract.ProductAnalyticsData{
|
||||||
ProductID: item.ProductID,
|
ProductID: item.ProductID,
|
||||||
ProductName: item.ProductName,
|
ProductName: item.ProductName,
|
||||||
ProductPrice: item.ProductPrice,
|
|
||||||
CategoryID: item.CategoryID,
|
CategoryID: item.CategoryID,
|
||||||
CategoryName: item.CategoryName,
|
CategoryName: item.CategoryName,
|
||||||
QuantitySold: item.QuantitySold,
|
QuantitySold: item.QuantitySold,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user