
- Set up project structure with FastAPI framework - Create database models for users, employees, departments, and job titles - Implement JWT authentication and authorization system - Set up SQLite database with SQLAlchemy ORM - Add Alembic migrations for database versioning - Create CRUD API endpoints for employee management - Implement category-based search functionality - Add OpenAPI documentation and health check endpoint - Update README with comprehensive setup and usage instructions
13 lines
512 B
Python
13 lines
512 B
Python
from sqlalchemy import Column, String, DateTime, Text
|
|
from sqlalchemy.sql import func
|
|
from uuid import uuid4
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class JobTitle(Base):
|
|
id = Column(String, primary_key=True, index=True, default=lambda: str(uuid4()))
|
|
title = Column(String, index=True, nullable=False, unique=True)
|
|
description = Column(Text, nullable=True)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |