{ "openapi": "3.1.0", "info": { "title": "MATOS CLAP", "version": "1.1.0" }, "paths": { "/health": { "get": { "summary": "Health Check", "operationId": "health_check", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/auth/login": { "get": { "tags": [ "auth" ], "summary": "Cla Login", "operationId": "auth_cla_login", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/auth/cla/callback": { "get": { "tags": [ "auth" ], "summary": "Cla Callback", "operationId": "auth_cla_callback", "parameters": [ { "name": "ticket", "in": "query", "required": true, "schema": { "type": "string", "title": "Ticket" } } ], "responses": { "302": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/auth/logout": { "post": { "tags": [ "auth" ], "summary": "Logout", "operationId": "auth_logout", "parameters": [ { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "302": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/categories/": { "get": { "tags": [ "categories" ], "summary": "Get Categories", "operationId": "categories_get_categories", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CategoryPublic" }, "title": "Response Categories Get Categories" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "categories" ], "summary": "Create Category", "operationId": "categories_create_category", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CategoryPost" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CategoryPublic" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/categories/{category_id}": { "get": { "tags": [ "categories" ], "summary": "Get Category By Id", "operationId": "categories_get_category_by_id", "parameters": [ { "name": "category_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Category Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CategoryPublic" } } } }, "404": { "description": "Category not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "categories" ], "summary": "Update Category", "operationId": "categories_update_category", "parameters": [ { "name": "category_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Category Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CategoryPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CategoryPublic" } } } }, "404": { "description": "Category not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "categories" ], "summary": "Delete Category", "operationId": "categories_delete_category", "parameters": [ { "name": "category_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Category Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "204": { "description": "Successful Response" }, "404": { "description": "Category not found" }, "409": { "description": "Category still used by catalogs" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/catalogs/": { "get": { "tags": [ "catalogs" ], "summary": "Get Catalogs", "operationId": "catalogs_get_catalogs", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CatalogPublic" }, "title": "Response Catalogs Get Catalogs" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "catalogs" ], "summary": "Create Catalog", "operationId": "catalogs_create_catalog", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogPost" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogPublic" } } } }, "404": { "description": "Category not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/catalogs/{catalog_id}": { "get": { "tags": [ "catalogs" ], "summary": "Get Catalog By Id", "operationId": "catalogs_get_catalog_by_id", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Catalog Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogPublic" } } } }, "404": { "description": "Catalog not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "catalogs" ], "summary": "Update Catalog", "operationId": "catalogs_update_catalog", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Catalog Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogPublic" } } } }, "404": { "description": "Catalog or referenced category not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "catalogs" ], "summary": "Delete Catalog", "operationId": "catalogs_delete_catalog", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Catalog Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "204": { "description": "Successful Response" }, "404": { "description": "Catalog not found" }, "409": { "description": "Catalog still used by items or requests" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/catalogs/{catalog_id}/images": { "post": { "tags": [ "catalogs" ], "summary": "Upload Catalog Image", "description": "Add an image to a catalog reference's gallery.", "operationId": "catalogs_upload_catalog_image", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Catalog Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_catalogs_upload_catalog_image" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogImagePublic" } } } }, "404": { "description": "Catalog not found" }, "422": { "description": "Unsupported or oversized image" } } } }, "/api/catalogs/{catalog_id}/images/{image_id}": { "delete": { "tags": [ "catalogs" ], "summary": "Delete Catalog Image", "description": "Remove one image from a catalog's gallery.", "operationId": "catalogs_delete_catalog_image", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Catalog Id" } }, { "name": "image_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Image Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "204": { "description": "Successful Response" }, "404": { "description": "Image not found on this catalog" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/catalogs/{catalog_id}/images/order": { "put": { "tags": [ "catalogs" ], "summary": "Reorder Catalog Images", "description": "Reorder a catalog's gallery to match the given list of image IDs.", "operationId": "catalogs_reorder_catalog_images", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Catalog Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogImageOrder" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogPublic" } } } }, "404": { "description": "Catalog not found" }, "422": { "description": "image_ids must match the catalog's existing images" } } } }, "/api/catalogs/{catalog_id}/available-items": { "get": { "tags": [ "catalogs" ], "summary": "Get Catalog Items Availability", "description": "Return items split by availability for the requested date range.\n\nAn item is **available** if it is not deleted, has availability status\n``AVAILABLE``, and is not loaned for any part of [start_date, end_date].\nAll other non-deleted items are returned in the **unavailable** list\nso an admin can still force-assign them.", "operationId": "catalogs_get_catalog_items_availability", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Catalog Id" } }, { "name": "start_date", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time", "title": "Start Date" } }, { "name": "end_date", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time", "title": "End Date" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ItemAvailabilityResponse" } } } }, "404": { "description": "Catalog not found" }, "422": { "description": "Invalid date range" } } } }, "/api/items/": { "get": { "tags": [ "items" ], "summary": "Get Items", "operationId": "items_get_items", "parameters": [ { "name": "availability", "in": "query", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/Availability" }, { "type": "null" } ], "title": "Availability" } }, { "name": "condition", "in": "query", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/Condition" }, { "type": "null" } ], "title": "Condition" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ItemPublic" }, "title": "Response Items Get Items" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "items" ], "summary": "Create Item", "operationId": "items_create_item", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ItemPost" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ItemPublic" } } } }, "404": { "description": "Referenced catalog not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/items/{item_id}": { "get": { "tags": [ "items" ], "summary": "Get Item By Id", "operationId": "items_get_item_by_id", "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Item Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ItemPublic" } } } }, "404": { "description": "Item not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "items" ], "summary": "Update Item", "operationId": "items_update_item", "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Item Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ItemPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ItemPublic" } } } }, "404": { "description": "Item or referenced catalog not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "items" ], "summary": "Delete Item", "operationId": "items_delete_item", "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Item Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "204": { "description": "Successful Response" }, "404": { "description": "Item not found" }, "409": { "description": "Item is part of an active or scheduled loan" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/items/{item_id}/history": { "get": { "tags": [ "items" ], "summary": "Get Item History", "description": "Custody history of an item: every loan it was part of, most recent first.", "operationId": "items_get_item_history", "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Item Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ItemHistoryEntry" }, "title": "Response Items Get Item History" } } } }, "404": { "description": "Item not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/users/": { "get": { "tags": [ "users" ], "summary": "Get Users", "operationId": "users_get_users", "parameters": [ { "name": "access_level", "in": "query", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/AccessLevel" }, { "type": "null" } ], "title": "Access Level" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "exclusiveMinimum": 0, "default": 50, "title": "Limit" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "default": 0, "title": "Page" } }, { "name": "search", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Search" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedResponse_UserPublic_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/users/me": { "get": { "tags": [ "users" ], "summary": "Get Me", "operationId": "users_get_me", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPublic" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/users/{user_id}": { "get": { "tags": [ "users" ], "summary": "Get User By Id", "operationId": "users_get_user_by_id", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "User Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPublic" } } } }, "404": { "description": "User not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "users" ], "summary": "Update User", "operationId": "users_update_user", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "User Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPublic" } } } }, "404": { "description": "User not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/requests/": { "get": { "tags": [ "requests" ], "summary": "Get Requests", "operationId": "requests_get_requests", "parameters": [ { "name": "borrower_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Borrower Id" } }, { "name": "processed", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Processed" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "exclusiveMinimum": 0, "default": 50, "title": "Limit" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "default": 0, "title": "Page" } }, { "name": "search", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Search" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedResponse_RequestPublic_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "requests" ], "summary": "Create Request", "operationId": "requests_create_request", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RequestPost" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RequestPublic" } } } }, "403": { "description": "Attempt to create request for another user" }, "404": { "description": "Borrower or catalog not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/requests/{request_id}/recommendations": { "get": { "tags": [ "requests" ], "summary": "Get Request Recommendations", "operationId": "requests_get_request_recommendations", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Request Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RequestRecommendationsResponse" } } } }, "404": { "description": "Request not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/requests/{request_id}": { "get": { "tags": [ "requests" ], "summary": "Get Request By Id", "operationId": "requests_get_request_by_id", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Request Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RequestPublic" } } } }, "404": { "description": "Request not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "requests" ], "summary": "Update Request", "operationId": "requests_update_request", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Request Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RequestPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RequestPublic" } } } }, "403": { "description": "Not allowed to edit this request" }, "404": { "description": "Request not found" }, "409": { "description": "Request can no longer be edited" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "requests" ], "summary": "Delete Request", "operationId": "requests_delete_request", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Request Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "204": { "description": "Successful Response" }, "403": { "description": "Not allowed to delete this request" }, "404": { "description": "Request not found" }, "409": { "description": "Request can no longer be deleted" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/loans/": { "get": { "tags": [ "loans" ], "summary": "Get Loans", "operationId": "loans_get_loans", "parameters": [ { "name": "borrower_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Borrower Id" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/LoanStatus" }, { "type": "null" } ], "title": "Status" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "exclusiveMinimum": 0, "default": 50, "title": "Limit" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "default": 0, "title": "Page" } }, { "name": "search", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Search" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedResponse_LoanPublic_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "loans" ], "summary": "Create Loan", "operationId": "loans_create_loan", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPost" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPostResponse" } } } }, "404": { "description": "Referenced user, request, or item not found" }, "422": { "description": "Invalid payload" } } } }, "/api/loans/timeline": { "get": { "tags": [ "loans" ], "summary": "Get Loans Timeline", "description": "Get all loans overlapping a date range for calendar/timeline display.\n\nReturns loans that have any overlap with [start_date, end_date], including:\n- Loans that start before and end during the range\n- Loans entirely within the range\n- Loans that start during and end after the range\n- Loans that span the entire range", "operationId": "loans_get_loans_timeline", "parameters": [ { "name": "start_date", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time", "description": "Start of the date range", "title": "Start Date" }, "description": "Start of the date range" }, { "name": "end_date", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time", "description": "End of the date range", "title": "End Date" }, "description": "End of the date range" }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanTimelineResponse" } } } }, "422": { "description": "Invalid date range" } } } }, "/api/loans/{loan_id}": { "get": { "tags": [ "loans" ], "summary": "Get Loan By Id", "operationId": "loans_get_loan_by_id", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Loan Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPublic" } } } }, "404": { "description": "Loan not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "loans" ], "summary": "Update Loan", "operationId": "loans_update_loan", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Loan Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPublic" } } } }, "404": { "description": "Loan not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "loans" ], "summary": "Delete Loan", "operationId": "loans_delete_loan", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Loan Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "204": { "description": "Successful Response" }, "404": { "description": "Loan not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/loans/{loan_id}/partial-return": { "post": { "tags": [ "loans" ], "summary": "Partial Return Loan Items", "operationId": "loans_partial_return_loan_items", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Loan Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPartialReturnPost" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPublic" } } } }, "404": { "description": "Loan not found" }, "409": { "description": "Loan not started or already returned" }, "422": { "description": "Invalid partial return payload" } } } }, "/api/loans/{loan_id}/return": { "post": { "tags": [ "loans" ], "summary": "Return Loan", "operationId": "loans_return_loan", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Loan Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanReturnPost" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPublic" } } } }, "404": { "description": "Loan not found" }, "409": { "description": "Loan not started or already returned" }, "422": { "description": "Invalid return payload" } } } }, "/api/io/catalogs/export": { "get": { "tags": [ "import-export" ], "summary": "Export Catalogs", "operationId": "import-export_export_catalogs", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/io/categories/export": { "get": { "tags": [ "import-export" ], "summary": "Export Categories", "operationId": "import-export_export_categories", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/io/items/export": { "get": { "tags": [ "import-export" ], "summary": "Export Items", "operationId": "import-export_export_items", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/io/categories/import": { "post": { "tags": [ "import-export" ], "summary": "Import Categories", "operationId": "import-export_import_categories", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_import-export_import_categories" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportResult" } } } }, "422": { "description": "Validation errors (one message per faulty line)" } } } }, "/api/io/catalogs/import": { "post": { "tags": [ "import-export" ], "summary": "Import Catalogs", "operationId": "import-export_import_catalogs", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_import-export_import_catalogs" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportResult" } } } }, "422": { "description": "Validation errors (one message per faulty line)" } } } }, "/api/io/items/import": { "post": { "tags": [ "import-export" ], "summary": "Import Items", "operationId": "import-export_import_items", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_import-export_import_items" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportResult" } } } }, "422": { "description": "Validation errors (one message per faulty line)" } } } } }, "components": { "schemas": { "AccessLevel": { "type": "string", "enum": [ "user", "clap", "manager", "admin" ], "title": "AccessLevel", "description": "Represents the access level of a user." }, "Availability": { "type": "string", "enum": [ "available", "maintenance", "retired" ], "title": "Availability", "description": "Represents the availability status of an item." }, "Body_catalogs_upload_catalog_image": { "properties": { "file": { "type": "string", "contentMediaType": "application/octet-stream", "title": "File" } }, "type": "object", "required": [ "file" ], "title": "Body_catalogs_upload_catalog_image" }, "Body_import-export_import_catalogs": { "properties": { "file": { "type": "string", "contentMediaType": "application/octet-stream", "title": "File" } }, "type": "object", "required": [ "file" ], "title": "Body_import-export_import_catalogs" }, "Body_import-export_import_categories": { "properties": { "file": { "type": "string", "contentMediaType": "application/octet-stream", "title": "File" } }, "type": "object", "required": [ "file" ], "title": "Body_import-export_import_categories" }, "Body_import-export_import_items": { "properties": { "file": { "type": "string", "contentMediaType": "application/octet-stream", "title": "File" } }, "type": "object", "required": [ "file" ], "title": "Body_import-export_import_items" }, "CatalogBrief": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "image_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Image Path" } }, "type": "object", "required": [ "id", "name" ], "title": "CatalogBrief" }, "CatalogImageOrder": { "properties": { "image_ids": { "items": { "type": "integer" }, "type": "array", "title": "Image Ids" } }, "type": "object", "required": [ "image_ids" ], "title": "CatalogImageOrder" }, "CatalogImagePublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "image_path": { "type": "string", "title": "Image Path" }, "position": { "type": "integer", "title": "Position" } }, "type": "object", "required": [ "id", "image_path", "position" ], "title": "CatalogImagePublic" }, "CatalogPatch": { "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "category_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Category Id" } }, "type": "object", "title": "CatalogPatch" }, "CatalogPost": { "properties": { "name": { "type": "string", "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "category_id": { "type": "integer", "title": "Category Id" } }, "type": "object", "required": [ "name", "category_id" ], "title": "CatalogPost" }, "CatalogPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "category": { "$ref": "#/components/schemas/CategoryPublic" }, "image_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Image Path" }, "images": { "items": { "$ref": "#/components/schemas/CatalogImagePublic" }, "type": "array", "title": "Images", "default": [] } }, "type": "object", "required": [ "id", "name", "category" ], "title": "CatalogPublic" }, "CategoryPatch": { "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" } }, "type": "object", "title": "CategoryPatch" }, "CategoryPost": { "properties": { "name": { "type": "string", "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" } }, "type": "object", "required": [ "name" ], "title": "CategoryPost" }, "CategoryPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" } }, "type": "object", "required": [ "id", "name" ], "title": "CategoryPublic" }, "Condition": { "type": "string", "enum": [ "new", "good", "degraded" ], "title": "Condition", "description": "Represents the condition of an item in the inventory." }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "ImportResult": { "properties": { "created": { "type": "integer", "title": "Created" }, "updated": { "type": "integer", "title": "Updated" } }, "type": "object", "required": [ "created", "updated" ], "title": "ImportResult" }, "ItemAvailabilityResponse": { "properties": { "available": { "items": { "$ref": "#/components/schemas/ItemPublic" }, "type": "array", "title": "Available" }, "unavailable": { "items": { "$ref": "#/components/schemas/ItemPublic" }, "type": "array", "title": "Unavailable" } }, "type": "object", "required": [ "available", "unavailable" ], "title": "ItemAvailabilityResponse" }, "ItemBrief": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" } }, "type": "object", "required": [ "id", "name" ], "title": "ItemBrief" }, "ItemHistoryEntry": { "properties": { "loan_id": { "type": "integer", "title": "Loan Id" }, "borrower": { "$ref": "#/components/schemas/UserBrief" }, "assignee": { "$ref": "#/components/schemas/UserBrief" }, "start_date": { "type": "string", "format": "date-time", "title": "Start Date" }, "end_date": { "type": "string", "format": "date-time", "title": "End Date" }, "actual_start_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Start Date" }, "actual_return_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Return Date" }, "return_condition": { "anyOf": [ { "$ref": "#/components/schemas/Condition" }, { "type": "null" } ] }, "status": { "$ref": "#/components/schemas/LoanStatus" } }, "type": "object", "required": [ "loan_id", "borrower", "assignee", "start_date", "end_date", "status" ], "title": "ItemHistoryEntry", "description": "One stint of an item in a borrower's hands, derived from a loan." }, "ItemPatch": { "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "catalog_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Catalog Id" }, "condition": { "anyOf": [ { "$ref": "#/components/schemas/Condition" }, { "type": "null" } ] }, "availability": { "anyOf": [ { "$ref": "#/components/schemas/Availability" }, { "type": "null" } ] }, "deposit_cents": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Deposit Cents" } }, "type": "object", "title": "ItemPatch" }, "ItemPost": { "properties": { "name": { "type": "string", "title": "Name" }, "catalog_id": { "type": "integer", "title": "Catalog Id" }, "condition": { "$ref": "#/components/schemas/Condition" }, "availability": { "$ref": "#/components/schemas/Availability", "default": "available" }, "deposit_cents": { "type": "integer", "title": "Deposit Cents", "default": 0 } }, "type": "object", "required": [ "name", "catalog_id", "condition" ], "title": "ItemPost" }, "ItemPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "catalog": { "$ref": "#/components/schemas/CatalogBrief" }, "condition": { "$ref": "#/components/schemas/Condition" }, "availability": { "$ref": "#/components/schemas/Availability" }, "deposit_cents": { "type": "integer", "title": "Deposit Cents" } }, "type": "object", "required": [ "id", "name", "catalog", "condition", "availability", "deposit_cents" ], "title": "ItemPublic" }, "LoanPartialReturnItem": { "properties": { "item_id": { "type": "integer", "title": "Item Id" }, "return_condition": { "anyOf": [ { "$ref": "#/components/schemas/Condition" }, { "type": "null" } ] } }, "type": "object", "required": [ "item_id" ], "title": "LoanPartialReturnItem" }, "LoanPartialReturnPost": { "properties": { "items": { "items": { "$ref": "#/components/schemas/LoanPartialReturnItem" }, "type": "array", "minItems": 1, "title": "Items" } }, "type": "object", "required": [ "items" ], "title": "LoanPartialReturnPost" }, "LoanPatch": { "properties": { "borrower_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Borrower Id" }, "start_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Start Date" }, "end_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "End Date" }, "total_deposit_cents": { "anyOf": [ { "type": "integer", "minimum": 0.0 }, { "type": "null" } ], "title": "Total Deposit Cents" }, "actual_start_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Start Date" }, "actual_return_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Return Date" }, "retained_deposit_cents": { "anyOf": [ { "type": "integer", "minimum": 0.0 }, { "type": "null" } ], "title": "Retained Deposit Cents" }, "comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comments" }, "item_ids": { "anyOf": [ { "items": { "type": "integer" }, "type": "array", "minItems": 1 }, { "type": "null" } ], "title": "Item Ids" } }, "type": "object", "title": "LoanPatch" }, "LoanPost": { "properties": { "borrower_id": { "type": "integer", "title": "Borrower Id" }, "assignee_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Assignee Id" }, "start_date": { "type": "string", "format": "date-time", "title": "Start Date" }, "end_date": { "type": "string", "format": "date-time", "title": "End Date" }, "total_deposit_cents": { "type": "integer", "minimum": 0.0, "title": "Total Deposit Cents", "default": 0 }, "request_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Request Id" }, "comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comments" }, "item_ids": { "items": { "type": "integer" }, "type": "array", "minItems": 1, "title": "Item Ids" } }, "type": "object", "required": [ "borrower_id", "start_date", "end_date", "item_ids" ], "title": "LoanPost" }, "LoanPostResponse": { "properties": { "loan": { "$ref": "#/components/schemas/LoanPublic" }, "warnings": { "items": { "$ref": "#/components/schemas/LoanPostWarning" }, "type": "array", "title": "Warnings" } }, "type": "object", "required": [ "loan", "warnings" ], "title": "LoanPostResponse" }, "LoanPostWarning": { "properties": { "code": { "type": "string", "title": "Code" }, "message": { "type": "string", "title": "Message" }, "item_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Item Id" } }, "type": "object", "required": [ "code", "message" ], "title": "LoanPostWarning" }, "LoanPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "borrower": { "$ref": "#/components/schemas/UserBrief" }, "assignee": { "$ref": "#/components/schemas/UserBrief" }, "status": { "$ref": "#/components/schemas/LoanStatus" }, "start_date": { "type": "string", "format": "date-time", "title": "Start Date" }, "end_date": { "type": "string", "format": "date-time", "title": "End Date" }, "total_deposit_cents": { "type": "integer", "title": "Total Deposit Cents" }, "actual_start_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Start Date" }, "actual_return_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Return Date" }, "retained_deposit_cents": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Retained Deposit Cents" }, "request_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Request Id" }, "comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comments" }, "loaned_items": { "items": { "$ref": "#/components/schemas/LoanedItemPublic" }, "type": "array", "title": "Loaned Items" } }, "type": "object", "required": [ "id", "borrower", "assignee", "status", "start_date", "end_date", "total_deposit_cents", "loaned_items" ], "title": "LoanPublic" }, "LoanReturnItemCondition": { "properties": { "item_id": { "type": "integer", "title": "Item Id" }, "return_condition": { "$ref": "#/components/schemas/Condition" } }, "type": "object", "required": [ "item_id", "return_condition" ], "title": "LoanReturnItemCondition" }, "LoanReturnPost": { "properties": { "retained_deposit_cents": { "type": "integer", "minimum": 0.0, "title": "Retained Deposit Cents" }, "item_return_conditions": { "items": { "$ref": "#/components/schemas/LoanReturnItemCondition" }, "type": "array", "title": "Item Return Conditions" }, "comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comments" } }, "type": "object", "required": [ "retained_deposit_cents" ], "title": "LoanReturnPost" }, "LoanStatus": { "type": "string", "enum": [ "scheduled", "active", "returned" ], "title": "LoanStatus", "description": "Represents the status of a loan." }, "LoanTimelineEntry": { "properties": { "loan_id": { "type": "integer", "title": "Loan Id" }, "borrower": { "$ref": "#/components/schemas/UserBrief" }, "assignee": { "$ref": "#/components/schemas/UserBrief" }, "start_date": { "type": "string", "format": "date-time", "title": "Start Date" }, "end_date": { "type": "string", "format": "date-time", "title": "End Date" }, "actual_start_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Start Date" }, "actual_return_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Return Date" }, "status": { "$ref": "#/components/schemas/LoanStatus" }, "items": { "items": { "$ref": "#/components/schemas/ItemBrief" }, "type": "array", "title": "Items" } }, "type": "object", "required": [ "loan_id", "borrower", "assignee", "start_date", "end_date", "status", "items" ], "title": "LoanTimelineEntry", "description": "A loan entry for calendar/timeline display." }, "LoanTimelineResponse": { "properties": { "start_date": { "type": "string", "format": "date-time", "title": "Start Date" }, "end_date": { "type": "string", "format": "date-time", "title": "End Date" }, "loans": { "items": { "$ref": "#/components/schemas/LoanTimelineEntry" }, "type": "array", "title": "Loans" } }, "type": "object", "required": [ "start_date", "end_date", "loans" ], "title": "LoanTimelineResponse", "description": "Response for loans timeline query." }, "LoanedItemPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "item": { "$ref": "#/components/schemas/ItemBrief" }, "actual_return_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Actual Return Date" }, "return_condition": { "anyOf": [ { "$ref": "#/components/schemas/Condition" }, { "type": "null" } ] } }, "type": "object", "required": [ "id", "item" ], "title": "LoanedItemPublic" }, "PaginatedResponse_LoanPublic_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/LoanPublic" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "limit": { "type": "integer", "title": "Limit" }, "page": { "type": "integer", "title": "Page" }, "search": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Search" } }, "type": "object", "required": [ "items", "total", "limit", "page", "search" ], "title": "PaginatedResponse[LoanPublic]" }, "PaginatedResponse_RequestPublic_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/RequestPublic" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "limit": { "type": "integer", "title": "Limit" }, "page": { "type": "integer", "title": "Page" }, "search": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Search" } }, "type": "object", "required": [ "items", "total", "limit", "page", "search" ], "title": "PaginatedResponse[RequestPublic]" }, "PaginatedResponse_UserPublic_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/UserPublic" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" }, "limit": { "type": "integer", "title": "Limit" }, "page": { "type": "integer", "title": "Page" }, "search": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Search" } }, "type": "object", "required": [ "items", "total", "limit", "page", "search" ], "title": "PaginatedResponse[UserPublic]" }, "RequestPatch": { "properties": { "phone_number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Phone Number" }, "start_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Start Date" }, "end_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "End Date" }, "reason": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reason" }, "status": { "anyOf": [ { "$ref": "#/components/schemas/RequestStatus" }, { "type": "null" } ] } }, "type": "object", "title": "RequestPatch" }, "RequestPost": { "properties": { "borrower_id": { "type": "integer", "title": "Borrower Id" }, "phone_number": { "type": "string", "title": "Phone Number" }, "start_date": { "type": "string", "format": "date-time", "title": "Start Date" }, "end_date": { "type": "string", "format": "date-time", "title": "End Date" }, "reason": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reason" }, "requested_catalogs": { "items": { "$ref": "#/components/schemas/RequestedCatalogPost" }, "type": "array", "title": "Requested Catalogs" } }, "type": "object", "required": [ "borrower_id", "phone_number", "start_date", "end_date", "requested_catalogs" ], "title": "RequestPost" }, "RequestPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "borrower": { "$ref": "#/components/schemas/UserBrief" }, "phone_number": { "type": "string", "title": "Phone Number" }, "start_date": { "type": "string", "format": "date-time", "title": "Start Date" }, "end_date": { "type": "string", "format": "date-time", "title": "End Date" }, "reason": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reason" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "processed": { "type": "boolean", "title": "Processed" }, "refused": { "type": "boolean", "title": "Refused" }, "status": { "$ref": "#/components/schemas/RequestStatus" }, "loan_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Loan Id" }, "requested_catalogs": { "items": { "$ref": "#/components/schemas/RequestedCatalogPublic" }, "type": "array", "title": "Requested Catalogs" } }, "type": "object", "required": [ "id", "borrower", "phone_number", "start_date", "end_date", "created_at", "processed", "refused", "status", "requested_catalogs" ], "title": "RequestPublic" }, "RequestRecommendationItem": { "properties": { "item_id": { "type": "integer", "title": "Item Id" }, "item_name": { "type": "string", "title": "Item Name" }, "availability": { "$ref": "#/components/schemas/Availability" }, "has_date_conflict": { "type": "boolean", "title": "Has Date Conflict" }, "warning": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Warning" } }, "type": "object", "required": [ "item_id", "item_name", "availability", "has_date_conflict" ], "title": "RequestRecommendationItem" }, "RequestRecommendationsResponse": { "properties": { "request_id": { "type": "integer", "title": "Request Id" }, "start_date": { "type": "string", "format": "date-time", "title": "Start Date" }, "end_date": { "type": "string", "format": "date-time", "title": "End Date" }, "recommendations": { "items": { "$ref": "#/components/schemas/RequestedCatalogRecommendation" }, "type": "array", "title": "Recommendations" } }, "type": "object", "required": [ "request_id", "start_date", "end_date", "recommendations" ], "title": "RequestRecommendationsResponse" }, "RequestStatus": { "type": "string", "enum": [ "pending", "refused", "approved" ], "title": "RequestStatus", "description": "Represents the status of a request." }, "RequestedCatalogPost": { "properties": { "catalog_id": { "type": "integer", "title": "Catalog Id" }, "quantity": { "type": "integer", "title": "Quantity", "default": 1 } }, "type": "object", "required": [ "catalog_id" ], "title": "RequestedCatalogPost" }, "RequestedCatalogPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "catalog_id": { "type": "integer", "title": "Catalog Id" }, "catalog": { "$ref": "#/components/schemas/CatalogBrief" }, "quantity": { "type": "integer", "title": "Quantity" } }, "type": "object", "required": [ "id", "catalog_id", "catalog", "quantity" ], "title": "RequestedCatalogPublic" }, "RequestedCatalogRecommendation": { "properties": { "requested_catalog_id": { "type": "integer", "title": "Requested Catalog Id" }, "catalog": { "$ref": "#/components/schemas/CatalogBrief" }, "requested_quantity": { "type": "integer", "title": "Requested Quantity" }, "recommended_item_ids": { "items": { "type": "integer" }, "type": "array", "title": "Recommended Item Ids" }, "candidate_items": { "items": { "$ref": "#/components/schemas/RequestRecommendationItem" }, "type": "array", "title": "Candidate Items" }, "warnings": { "items": { "type": "string" }, "type": "array", "title": "Warnings" } }, "type": "object", "required": [ "requested_catalog_id", "catalog", "requested_quantity", "recommended_item_ids", "candidate_items" ], "title": "RequestedCatalogRecommendation" }, "UserBrief": { "properties": { "id": { "type": "integer", "title": "Id" }, "username": { "type": "string", "title": "Username" }, "name": { "type": "string", "title": "Name" }, "access_level": { "$ref": "#/components/schemas/AccessLevel" } }, "type": "object", "required": [ "id", "username", "name", "access_level" ], "title": "UserBrief" }, "UserPatch": { "properties": { "access_level": { "$ref": "#/components/schemas/AccessLevel" } }, "type": "object", "required": [ "access_level" ], "title": "UserPatch" }, "UserPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "username": { "type": "string", "title": "Username" }, "name": { "type": "string", "title": "Name" }, "email": { "type": "string", "format": "email", "title": "Email" }, "access_level": { "$ref": "#/components/schemas/AccessLevel" } }, "type": "object", "required": [ "id", "username", "name", "email", "access_level" ], "title": "UserPublic" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" } } } }