feat: add dashboard statistics functionality #55
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive backend implementation for dashboard statistics, including business logic, data transfer objects, repository interface extensions, and dependency injection for new dashboard functionality. The most important changes are grouped below.
Dashboard Statistics Feature Implementation
DashboardUseCaseininternal/application/usecase/dashboard_usecase.goto aggregate key dashboard metrics (revenue, orders, customers, products, etc.) for a given time period, including logic for period-over-period comparison.internal/domain/dto/dashboard.gofor dashboard stats requests, responses, and summary types for recent orders and top products.Repository Interface Extensions
OrderRepository,ProductRepository, andUserRepositoryinterfaces to support dashboard statistics queries such as total revenue, total orders, customer counts, new customers, product counts, and low stock products. [1] [2] [3]Dependency Injection and Handler Integration
Documentation
docs/dashboard_api_examples.mddocumenting the new dashboard API endpoint, request/response formats, and error handling.Repository Implementation Adjustments
Other Minor Changes
tygocode generation command. [1] [2]