openapi: 3.1.0 info: title: Api version: 0.1.0 description: Hardware Store Inventory API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: inventory description: Inventory management - name: categories description: Category management 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" /inventory: get: operationId: listInventoryItems tags: [inventory] summary: List inventory items description: Returns all inventory items, optionally filtered parameters: - name: search in: query required: false schema: type: string description: Search by name or SKU - name: category in: query required: false schema: type: string description: Filter by category - name: lowStock in: query required: false schema: type: boolean description: Filter items with quantity below reorderPoint responses: "200": description: List of inventory items content: application/json: schema: type: array items: $ref: "#/components/schemas/InventoryItem" post: operationId: createInventoryItem tags: [inventory] summary: Create inventory item requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateInventoryItemBody" responses: "201": description: Created item content: application/json: schema: $ref: "#/components/schemas/InventoryItem" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /inventory/{id}: get: operationId: getInventoryItem tags: [inventory] summary: Get inventory item parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Inventory item content: application/json: schema: $ref: "#/components/schemas/InventoryItem" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" put: operationId: updateInventoryItem tags: [inventory] summary: Update inventory item parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateInventoryItemBody" responses: "200": description: Updated item content: application/json: schema: $ref: "#/components/schemas/InventoryItem" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" delete: operationId: deleteInventoryItem tags: [inventory] summary: Delete inventory item parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted successfully "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /categories: get: operationId: listCategories tags: [categories] summary: List all categories responses: "200": description: List of categories content: application/json: schema: type: array items: $ref: "#/components/schemas/Category" post: operationId: createCategory tags: [categories] summary: Create category requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateCategoryBody" responses: "201": description: Created category content: application/json: schema: $ref: "#/components/schemas/Category" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" components: schemas: HealthStatus: type: object properties: status: type: string required: - status InventoryItem: type: object properties: id: type: integer sku: type: string name: type: string description: type: string nullable: true categoryId: type: integer nullable: true categoryName: type: string nullable: true quantity: type: integer reorderPoint: type: integer unitPrice: type: number supplier: type: string nullable: true location: type: string nullable: true createdAt: type: string format: date-time updatedAt: type: string format: date-time required: - id - sku - name - quantity - reorderPoint - unitPrice - createdAt - updatedAt CreateInventoryItemBody: type: object properties: sku: type: string name: type: string description: type: string nullable: true categoryId: type: integer nullable: true quantity: type: integer reorderPoint: type: integer unitPrice: type: number supplier: type: string nullable: true location: type: string nullable: true required: - sku - name - quantity - reorderPoint - unitPrice UpdateInventoryItemBody: type: object properties: sku: type: string name: type: string description: type: string nullable: true categoryId: type: integer nullable: true quantity: type: integer reorderPoint: type: integer unitPrice: type: number supplier: type: string nullable: true location: type: string nullable: true Category: type: object properties: id: type: integer name: type: string description: type: string nullable: true itemCount: type: integer required: - id - name - itemCount CreateCategoryBody: type: object properties: name: type: string description: type: string nullable: true required: - name ErrorResponse: type: object properties: error: type: string details: type: string nullable: true required: - error