from fastapi import FastAPI from models import ProductPayload from typing import Optional from bulk_processing import process_bulk_data app = FastAPI() @app.get("/") def read_root() -> dict: return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Optional[str] = None) -> dict: return {"item_id": item_id, "q": q} @app.post("/bulkupload/post") def create_products(data: dict, params: dict) -> dict: """Create products from the bulk upload data. Args: data (dict): The bulk upload data. params (dict): The parameters to use for processing. Returns: dict/json: A report about the received data. """ process_bulk_data(data, params) return {"received_data": data}