feat: add dashboard summary endpoint and related models, queries, and services

This commit is contained in:
Tran Anh Tuan
2026-05-13 17:53:32 +07:00
parent b815111b8f
commit 383bed757d
12 changed files with 928 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package models
type TotalComponentStats struct {
TotalTypes int64 `json:"totalTypes"`
TotalQuantity int64 `json:"totalQuantity"`
}
type AbnormalAlert struct {
Status string `json:"status"`
Count int64 `json:"count"`
}
type TodayInvoiceCount struct {
Type string `json:"type"`
Count int64 `json:"count"`
}
type ContainerStats struct {
TotalContainers int64 `json:"totalContainers"`
EmptyContainers int64 `json:"emptyContainers"`
}
type DashboardSummary struct {
TotalComponents TotalComponentStats `json:"totalComponents"`
PendingInvoices int64 `json:"pendingInvoices"`
LowStockComponents int64 `json:"lowStockComponents"`
AbnormalAlerts []AbnormalAlert `json:"abnormalAlerts"`
TodayInvoices []TodayInvoiceCount `json:"todayInvoices"`
EmptyContainers ContainerStats `json:"emptyContainers"`
}