{ "openapi": "3.1.0", "info": { "title": "MATOS CLAP", "version": "0.1.0" }, "paths": { "/": { "get": { "summary": "Read Root", "operationId": "read_root__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/categories/": { "get": { "tags": [ "categories" ], "summary": "Get Categories", "operationId": "get_categories_api_categories__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/CategoryPublic" }, "type": "array", "title": "Response Get Categories Api Categories Get" } } } } } }, "post": { "tags": [ "categories" ], "summary": "Create Category", "operationId": "create_category_api_categories__post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CategoryPost" } } }, "required": true }, "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": "get_category_by_id_api_categories__category_id__get", "parameters": [ { "name": "category_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Category 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": "update_category_api_categories__category_id__patch", "parameters": [ { "name": "category_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Category 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": "delete_category_api_categories__category_id__delete", "parameters": [ { "name": "category_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Category 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": "get_catalogs_api_catalogs__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/CatalogPublic" }, "type": "array", "title": "Response Get Catalogs Api Catalogs Get" } } } } } }, "post": { "tags": [ "catalogs" ], "summary": "Create Catalog", "operationId": "create_catalog_api_catalogs__post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogPost" } } }, "required": true }, "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": "get_catalog_by_id_api_catalogs__catalog_id__get", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Catalog 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": "update_catalog_api_catalogs__catalog_id__patch", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Catalog 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": "delete_catalog_api_catalogs__catalog_id__delete", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Catalog 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}/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": "get_catalog_items_availability_api_catalogs__catalog_id__available_items_get", "parameters": [ { "name": "catalog_id", "in": "path", "required": true, "schema": { "type": "integer", "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" } } ], "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": "get_items_api_items__get", "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" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ItemPublic" }, "title": "Response Get Items Api Items Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "items" ], "summary": "Create Item", "operationId": "create_item_api_items__post", "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": "get_item_by_id_api_items__item_id__get", "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Item 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": "update_item_api_items__item_id__patch", "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Item 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": "Soft Delete Item", "operationId": "soft_delete_item_api_items__item_id__delete", "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Item Id" } } ], "responses": { "204": { "description": "Successful Response" }, "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": "get_users_api_users__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/UserPublic" }, "type": "array", "title": "Response Get Users Api Users Get" } } } } } }, "post": { "tags": [ "users" ], "summary": "Create User", "operationId": "create_user_api_users__post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPost" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPublic" } } } }, "409": { "description": "Username or email already exists" }, "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": "get_user_by_id_api_users__user_id__get", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User 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": "update_user_api_users__user_id__patch", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User 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" }, "409": { "description": "Username or email already exists" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "users" ], "summary": "Delete User", "operationId": "delete_user_api_users__user_id__delete", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User Id" } } ], "responses": { "204": { "description": "Successful Response" }, "404": { "description": "User not found" }, "409": { "description": "User still referenced by requests or loans" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/users/{user_id}/requests": { "get": { "tags": [ "users" ], "summary": "Get User Requests", "operationId": "get_user_requests_api_users__user_id__requests_get", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User Id" } }, { "name": "processed", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Processed" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/RequestPublic" }, "title": "Response Get User Requests Api Users User Id Requests Get" } } } }, "404": { "description": "User not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/users/{user_id}/loans": { "get": { "tags": [ "users" ], "summary": "Get User Loans", "operationId": "get_user_loans_api_users__user_id__loans_get", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User Id" } }, { "name": "active", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Active" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/LoanPublic" }, "title": "Response Get User Loans Api Users User Id Loans Get" } } } }, "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": "get_requests_api_requests__get", "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" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/RequestPublic" }, "title": "Response Get Requests Api Requests Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "requests" ], "summary": "Create Request", "operationId": "create_request_api_requests__post", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RequestPost" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RequestPublic" } } } }, "404": { "description": "Borrower or catalog 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": "get_request_by_id_api_requests__request_id__get", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Request 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": "update_request_api_requests__request_id__patch", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Request 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" } } } }, "404": { "description": "Request not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "requests" ], "summary": "Delete Request", "operationId": "delete_request_api_requests__request_id__delete", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Request Id" } } ], "responses": { "204": { "description": "Successful Response" }, "404": { "description": "Request not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/loans/": { "get": { "tags": [ "loans" ], "summary": "Get Loans", "operationId": "get_loans_api_loans__get", "parameters": [ { "name": "borrower_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Borrower Id" } }, { "name": "active", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Active" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/LoanPublic" }, "title": "Response Get Loans Api Loans Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "loans" ], "summary": "Create Loan", "operationId": "create_loan_api_loans__post", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPost" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanPublic" } } } }, "404": { "description": "Referenced user, request, or item not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/loans/{loan_id}": { "get": { "tags": [ "loans" ], "summary": "Get Loan By Id", "operationId": "get_loan_by_id_api_loans__loan_id__get", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Loan 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": "update_loan_api_loans__loan_id__patch", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Loan 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": "delete_loan_api_loans__loan_id__delete", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Loan 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}/items/{loaned_item_id}": { "patch": { "tags": [ "loans" ], "summary": "Update Loaned Item", "operationId": "update_loaned_item_api_loans__loan_id__items__loaned_item_id__patch", "parameters": [ { "name": "loan_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Loan Id" } }, { "name": "loaned_item_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Loaned Item Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanedItemPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanedItemPublic" } } } }, "404": { "description": "Loan or loaned item not found" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } } }, "components": { "schemas": { "AccessLevel": { "type": "string", "enum": [ "unauthenticated", "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." }, "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" }, "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" }, "image_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Image Path" } }, "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" }, "image_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Image Path" } }, "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" } }, "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" }, "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" }, "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/CatalogPublic" }, "condition": { "$ref": "#/components/schemas/Condition" }, "availability": { "$ref": "#/components/schemas/Availability" }, "deposit_cents": { "type": "integer", "title": "Deposit Cents" }, "deleted": { "type": "boolean", "title": "Deleted" } }, "type": "object", "required": [ "id", "name", "catalog", "condition", "availability", "deposit_cents", "deleted" ], "title": "ItemPublic" }, "LoanPatch": { "properties": { "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" }, { "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" }, { "type": "null" } ], "title": "Retained Deposit Cents" }, "comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comments" } }, "type": "object", "title": "LoanPatch" }, "LoanPost": { "properties": { "borrower_id": { "type": "integer", "title": "Borrower Id" }, "assignee_id": { "type": "integer", "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", "title": "Total Deposit Cents", "default": 0 }, "request_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Request Id" }, "comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comments" }, "loaned_items": { "items": { "$ref": "#/components/schemas/LoanedItemPost" }, "type": "array", "title": "Loaned Items" } }, "type": "object", "required": [ "borrower_id", "assignee_id", "start_date", "end_date", "loaned_items" ], "title": "LoanPost" }, "LoanPublic": { "properties": { "id": { "type": "integer", "title": "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" }, "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", "start_date", "end_date", "total_deposit_cents", "loaned_items" ], "title": "LoanPublic" }, "LoanedItemPatch": { "properties": { "return_condition": { "anyOf": [ { "$ref": "#/components/schemas/Condition" }, { "type": "null" } ] } }, "type": "object", "title": "LoanedItemPatch" }, "LoanedItemPost": { "properties": { "item_id": { "type": "integer", "title": "Item Id" } }, "type": "object", "required": [ "item_id" ], "title": "LoanedItemPost" }, "LoanedItemPublic": { "properties": { "id": { "type": "integer", "title": "Id" }, "item": { "$ref": "#/components/schemas/ItemBrief" }, "return_condition": { "anyOf": [ { "$ref": "#/components/schemas/Condition" }, { "type": "null" } ] } }, "type": "object", "required": [ "id", "item" ], "title": "LoanedItemPublic" }, "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" }, "processed": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Processed" } }, "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" }, "creation_date": { "type": "string", "format": "date-time", "title": "Creation Date" }, "processed": { "type": "boolean", "title": "Processed" }, "requested_catalogs": { "items": { "$ref": "#/components/schemas/RequestedCatalogPublic" }, "type": "array", "title": "Requested Catalogs" } }, "type": "object", "required": [ "id", "borrower", "phone_number", "start_date", "end_date", "creation_date", "processed", "requested_catalogs" ], "title": "RequestPublic" }, "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" }, "UserBrief": { "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": "UserBrief" }, "UserPatch": { "properties": { "username": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Username" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "email": { "anyOf": [ { "type": "string", "format": "email" }, { "type": "null" } ], "title": "Email" }, "access_level": { "anyOf": [ { "$ref": "#/components/schemas/AccessLevel" }, { "type": "null" } ] } }, "type": "object", "title": "UserPatch" }, "UserPost": { "properties": { "username": { "type": "string", "title": "Username" }, "name": { "type": "string", "title": "Name" }, "email": { "type": "string", "format": "email", "title": "Email" }, "access_level": { "$ref": "#/components/schemas/AccessLevel", "default": "user" } }, "type": "object", "required": [ "username", "name", "email" ], "title": "UserPost" }, "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" } } } }