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 Bakeries API lets customers browse active bakeries, bakers manage their own storefront, and admins administer the full catalog. All write operations require authentication; read endpoints for the public catalog are open.

Bakery object

id
string
Unique Firestore document ID.
name
string
Display name of the bakery.
description
string
Short description.
address
string
Street address.
lat
number
Latitude coordinate.
lng
number
Longitude coordinate.
phone
string
Contact phone number.
logoUrl
string
Firebase Storage URL for the logo image.
bannerUrl
string
Firebase Storage URL for the banner image.
isOpen
boolean
Whether the bakery is currently accepting orders.
openTime
string
Opening time in HH:mm format, e.g. “07:00”.
closeTime
string
Closing time in HH:mm format, e.g. “20:00”.
rating
number
Average review rating (0–5), recalculated on each new review.
totalReviews
integer
Total number of reviews.
status
string
One of ACTIVE, INACTIVE, SUSPENDED.
ownerId
string
Firebase UID of the baker who owns this bakery.
createdAt
integer
Creation timestamp in epoch milliseconds.

GET /api/v1/bakeries

Returns all bakeries with status = ACTIVE. Auth required: No
curl http://localhost:8080/api/v1/bakeries
Response: ApiResponse<List<Bakery>>

GET /api/v1/bakeries/nearby

Returns active bakeries within a given radius, sorted by distance. Auth required: No
lat
number
required
User’s latitude.
lng
number
required
User’s longitude.
radius
number
Search radius in kilometers. Default: 5.
curl "http://localhost:8080/api/v1/bakeries/nearby?lat=4.6097&lng=-74.0817&radius=3"
Response: ApiResponse<List<{ bakery: Bakery, distanceKm: Double }>>

GET /api/v1/bakeries/all

Returns all bakeries including INACTIVE and SUSPENDED ones. Auth required: Yes — ADMIN
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/bakeries/all

GET /api/v1/bakeries/

Returns a single bakery by ID. Auth required: Yes (any role)
id
string
required
Bakery Firestore document ID.
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/bakeries/abc123

GET /api/v1/bakeries/me

Returns the authenticated baker’s own bakery. Auth required: Yes — BAKER
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/bakeries/me

PATCH /api/v1/bakeries/me

Updates the authenticated baker’s bakery. All fields optional; only provided fields are changed. Bakers cannot change their own status. Auth required: Yes — BAKER
{
  "name": "La Panadería Nueva",
  "description": "Pan artesanal fresco",
  "phone": "+57 300 000 0000",
  "openTime": "06:00",
  "closeTime": "21:00"
}
curl -X PATCH \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"La Panadería Nueva"}' \
  http://localhost:8080/api/v1/bakeries/me

PATCH /api/v1/bakeries/me/open

Toggles the bakery open or closed. Validates that the current time (America/Bogota) falls within the bakery’s openTimecloseTime window before allowing isOpen: true. Auth required: Yes — BAKER
{ "isOpen": true }
curl -X PATCH \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"isOpen":true}' \
  http://localhost:8080/api/v1/bakeries/me/open
Opening outside scheduled hours returns a 400 error.

POST /api/v1/bakeries

Creates a new bakery. The ownerId must be a user with the BAKER role. Auth required: Yes — ADMIN
name
string
required
Bakery name.
description
string
required
Short description.
address
string
required
Street address.
lat
number
required
Latitude.
lng
number
required
Longitude.
phone
string
required
Contact phone.
openTime
string
required
Opening time, HH:mm.
closeTime
string
required
Closing time, HH:mm.
ownerId
string
required
Firebase UID of the BAKER owner.

PATCH /api/v1/bakeries/

Admin can update any field including status. Auth required: Yes — ADMIN
id
string
required
Bakery ID.

DELETE /api/v1/bakeries/

Deletes a bakery and clears the bakeryId from the owner’s user profile. Auth required: Yes — ADMIN
id
string
required
Bakery ID.
curl -X DELETE \
  -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/bakeries/abc123

Build docs developers (and LLMs) love