Automated Action 4dc182713c Implement Small Business Inventory Management System
- Created project structure with FastAPI framework
- Set up SQLite database with SQLAlchemy ORM
- Implemented models: User, Item, Supplier, Transaction
- Created CRUD operations for all models
- Added API endpoints for all resources
- Implemented JWT authentication and authorization
- Added Alembic migration scripts
- Created health endpoint
- Updated documentation

generated with BackendIM... (backend.im)
2025-05-13 09:48:37 +00:00

15 lines
468 B
Python

from typing import List, Optional
from sqlalchemy.orm import Session
from app.crud.base import CRUDBase
from app.models.supplier import Supplier
from app.schemas.supplier import SupplierCreate, SupplierUpdate
class CRUDSupplier(CRUDBase[Supplier, SupplierCreate, SupplierUpdate]):
def get_by_name(self, db: Session, *, name: str) -> Optional[Supplier]:
return db.query(Supplier).filter(Supplier.name == name).first()
supplier = CRUDSupplier(Supplier)