autocommit 13-07-2024-09-56

This commit is contained in:
Jasen Qin 2024-07-13 09:56:30 +10:00
parent d1324f9f6e
commit f819c3b75f
2 changed files with 50 additions and 6 deletions

View File

@ -1,3 +1,48 @@
# Make poetry stop complaining
This is here to prevent poetry from complaining
```mermaid
graph TB
subgraph Frontend[Frontend - Kivy]
Dashboard[Main Dashboard]
POSInterface[POS Interface]
InventoryUI[Inventory Management]
ReportingUI[Reporting Interface]
Settings[Settings and Configuration]
end
subgraph Backend[Backend - FastAPI]
API[RESTful API]
Auth[Authentication & Authorization]
InventoryMgmt[Inventory Management]
OrderMgmt[Order Management]
ReportingAnalytics[Reporting & Analytics]
Integration[Third-party Integrations]
end
subgraph Database[Database]
MongoDB[(MongoDB)]
end
subgraph ExternalSystems[External Systems]
PaymentGateway[Payment Gateway]
AccountingSoftware[Accounting Software]
ECommerce[E-commerce Platform]
end
Frontend -->|API Calls| Backend
Backend -->|Query/Update| Database
Backend -->|Integrate| ExternalSystems
Frontend -->|Real-time Updates| Backend
classDef frontend fill:#3498db,stroke:#333,stroke-width:2px;
classDef backend fill:#2ecc71,stroke:#333,stroke-width:2px;
classDef database fill:#f39c12,stroke:#333,stroke-width:2px;
classDef external fill:#e74c3c,stroke:#333,stroke-width:2px;
class Dashboard,POSInterface,InventoryUI,ReportingUI,Settings frontend;
class API,Auth,InventoryMgmt,OrderMgmt,ReportingAnalytics,Integration backend;
class MongoDB database;
class PaymentGateway,AccountingSoftware,ECommerce external;
```

View File

@ -18,7 +18,9 @@ client = MongoClient("mongodb://localhost:27017")
db = client["pos_system"]
logger.debug("MongoDB connection established")
# -----=========
# Models
# ---------======
class Item(BaseModel):
@ -46,7 +48,9 @@ class Order(BaseModel):
logger.debug("Data models defined")
# API Routes
# -----=========
# API ROUTES
# ---------======
@app.post("/items/")
@ -98,9 +102,6 @@ async def delete_item(item_id: str):
logger.warning(f"Item with ID {item_id} not found for deletion")
raise HTTPException(status_code=404, detail="Item not found")
# Similar CRUD operations for deals and orders
@app.get("/inventory/")
async def get_inventory():
logger.debug("Received request to get inventory")
@ -120,5 +121,3 @@ if __name__ == "__main__":
logger.info("Starting the FastAPI application")
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
# Add more routes as needed for reporting, analytics, etc.