feat: time tracking / work logs (create, list, summary, project summary, CLI commands)

This commit is contained in:
Zhi
2026-02-23 05:11:52 +00:00
parent 9f276464b2
commit 703103af91
4 changed files with 157 additions and 0 deletions

15
app/models/worklog.py Normal file
View File

@@ -0,0 +1,15 @@
from sqlalchemy import Column, Integer, Text, DateTime, ForeignKey, Float
from sqlalchemy.sql import func
from app.core.config import Base
class WorkLog(Base):
__tablename__ = "work_logs"
id = Column(Integer, primary_key=True, index=True)
issue_id = Column(Integer, ForeignKey("issues.id"), nullable=False)
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
hours = Column(Float, nullable=False) # Hours spent
description = Column(Text, nullable=True)
logged_date = Column(DateTime(timezone=True), nullable=False) # When the work was done
created_at = Column(DateTime(timezone=True), server_default=func.now())