feat: add endpoint and logic for retrieving top exported components, including SQL queries, models, and service integration

This commit is contained in:
Tran Anh Tuan
2026-05-14 11:02:09 +07:00
parent 96bc22942b
commit cee0186225
12 changed files with 431 additions and 4 deletions

View File

@@ -66,3 +66,13 @@ func ToDomainTransactionChartRow(r db.GetTransactionChartDataRow) models.Transac
TotalQuantity: r.TotalQuantity,
}
}
func ToDomainTopExportedComponent(r db.GetTopExportedComponentsRow) models.TopExportedComponent {
return models.TopExportedComponent{
ID: r.ID,
Name: r.Name,
Unit: r.Unit,
ComponentTypeName: r.ComponentTypeName.String,
TotalExported: r.TotalExported,
}
}