openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: Hatoon Bakery API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: menu description: Menu items and categories - name: ratings description: Item ratings - name: orders description: Orders and catering scheduling paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /menu-items: get: operationId: listMenuItems tags: [menu] summary: List all menu items parameters: - name: category in: query required: false schema: type: string responses: "200": description: List of menu items content: application/json: schema: type: array items: $ref: "#/components/schemas/MenuItem" /menu-items/{id}: get: operationId: getMenuItem tags: [menu] summary: Get a single menu item parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Menu item content: application/json: schema: $ref: "#/components/schemas/MenuItem" "404": description: Not found /menu/categories: get: operationId: listCategories tags: [menu] summary: List all menu categories with item counts responses: "200": description: Category list content: application/json: schema: type: array items: $ref: "#/components/schemas/Category" /menu/featured: get: operationId: getFeaturedItems tags: [menu] summary: Get top-rated featured items for homepage responses: "200": description: Featured items content: application/json: schema: type: array items: $ref: "#/components/schemas/MenuItem" /menu-items/{id}/ratings: get: operationId: getMenuItemRatings tags: [ratings] summary: Get ratings for a menu item parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Ratings list content: application/json: schema: type: array items: $ref: "#/components/schemas/Rating" /ratings: post: operationId: createRating tags: [ratings] summary: Submit a rating for a menu item requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RatingInput" responses: "201": description: Rating created content: application/json: schema: $ref: "#/components/schemas/Rating" "400": description: Validation error /orders: post: operationId: createOrder tags: [orders] summary: Create a new order (regular, bulk, or catering) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/OrderInput" responses: "201": description: Order created content: application/json: schema: $ref: "#/components/schemas/Order" "400": description: Validation error /orders/summary: get: operationId: getOrderSummary tags: [orders] summary: Get order summary stats responses: "200": description: Order summary content: application/json: schema: $ref: "#/components/schemas/OrderSummary" components: schemas: HealthStatus: type: object properties: status: type: string required: - status MenuItem: type: object required: [id, name, description, category, price, isAvailable, averageRating, ratingCount] properties: id: type: integer name: type: string description: type: string category: type: string price: type: number imageUrl: type: ["string", "null"] isAvailable: type: boolean averageRating: type: number ratingCount: type: integer Category: type: object required: [name, itemCount] properties: name: type: string itemCount: type: integer Rating: type: object required: [id, menuItemId, stars, createdAt] properties: id: type: integer menuItemId: type: integer stars: type: integer comment: type: ["string", "null"] reviewerName: type: ["string", "null"] createdAt: type: string RatingInput: type: object required: [menuItemId, stars] properties: menuItemId: type: integer stars: type: integer comment: type: string reviewerName: type: string OrderItem: type: object required: [menuItemId, quantity, price, name] properties: menuItemId: type: integer quantity: type: integer price: type: number name: type: string OrderInput: type: object required: [customerName, customerEmail, customerPhone, items, orderType] properties: customerName: type: string customerEmail: type: string customerPhone: type: string orderType: type: string enum: [regular, bulk, catering] scheduledDate: type: ["string", "null"] eventDescription: type: ["string", "null"] guestCount: type: ["integer", "null"] specialRequests: type: ["string", "null"] items: type: array items: $ref: "#/components/schemas/OrderItem" Order: type: object required: [id, customerName, customerEmail, customerPhone, orderType, status, totalPrice, createdAt, items] properties: id: type: integer customerName: type: string customerEmail: type: string customerPhone: type: string orderType: type: string scheduledDate: type: ["string", "null"] eventDescription: type: ["string", "null"] guestCount: type: ["integer", "null"] specialRequests: type: ["string", "null"] status: type: string totalPrice: type: number createdAt: type: string items: type: array items: $ref: "#/components/schemas/OrderItem" OrderSummary: type: object required: [totalOrders, pendingOrders, cateringOrders, bulkOrders] properties: totalOrders: type: integer pendingOrders: type: integer cateringOrders: type: integer bulkOrders: type: integer