Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi-Backend/llms.txt

Use this file to discover all available pages before exploring further.

The Stats API provides analytics dashboards for bakers and admins. Baker stats cover their own bakery; admin stats aggregate the entire platform. All monetary values and counts exclude cancelled orders.

GET /api/v1/stats/bakery

Returns statistics for the authenticated baker’s bakery. All calculations use the America/Bogota timezone. Auth required: Yes — BAKER
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/stats/bakery
Response fields:
bakeryId
string
The bakery ID.
totalOrders
integer
Lifetime non-cancelled orders.
totalRevenue
number
Lifetime revenue.
averageOrderValue
number
Average order value.
ordersToday
integer
Orders placed today.
revenueToday
number
Revenue earned today.
ordersThisWeek
integer
Orders this week.
revenueThisWeek
number
Revenue this week.
topProducts
ProductStat[]
Top 5 products by units sold.
ordersByHour
object
Map of hour (0–23) to order count.
ordersByStatus
object
Map of OrderStatus to count.

GET /api/v1/stats/admin

Returns platform-wide statistics. Auth required: Yes — ADMIN
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/stats/admin
Response fields:
totalBakeries
integer
Total bakeries on the platform.
activeBakeries
integer
Bakeries with ACTIVE status.
totalUsers
integer
Total registered users.
totalOrders
integer
Lifetime non-cancelled orders.
totalRevenue
number
Lifetime platform revenue.
ordersToday
integer
Orders placed today.
revenueToday
number
Revenue today.
topBakeries
BakeryStat[]
Top 10 bakeries by revenue.

Build docs developers (and LLMs) love