from app.models import Contact
from app.schemas import ContactCreate

async def create_contact(db, contact_data: ContactCreate) -> Contact:
    contact = Contact(**contact_data.dict())
    db.add(contact)
    await db.commit()
    await db.refresh(contact)
    return contact
