refactor(core,ai): 调整模块导入路径并移除废弃文件 - 修复 scheduler.py 中的导入路径错误,将 reports.service 改为 reports.services - 移除废弃的 app/core/background/task_queue.py 文件 - 移除废弃的 app/modules/ai_agent/adapters.py 文件 - 修复 ai_memory/service.py 中的导入路径错误,将 events.service 改为 events.services ```
31 lines
1.5 KiB
Python
31 lines
1.5 KiB
Python
from datetime import date, datetime
|
|
|
|
from sqlalchemy import Date, DateTime, Integer, String, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.database import Base
|
|
from app.modules.business.constants import (
|
|
SourceSystem,
|
|
StatusValue,
|
|
)
|
|
from app.modules.business.models.common import TimestampMixin
|
|
|
|
|
|
class AttendanceRecord(Base, TimestampMixin):
|
|
__tablename__ = "attendance_records"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
code: Mapped[str] = mapped_column(String(64), unique=True, index=True)
|
|
employee_name: Mapped[str] = mapped_column(String(128), index=True)
|
|
employee_id: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
|
|
department: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
|
|
project_code: Mapped[str | None] = mapped_column(String(64), nullable=True, index=True)
|
|
work_date: Mapped[date] = mapped_column(Date, index=True)
|
|
check_in_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
|
check_out_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
|
status: Mapped[str] = mapped_column(String(64), default=StatusValue.NORMAL_CN, index=True)
|
|
location: Mapped[str | None] = mapped_column(String(255), nullable=True)
|
|
source_system: Mapped[str] = mapped_column(String(64), default=SourceSystem.INTERNAL)
|
|
external_id: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
|
|
note: Mapped[str | None] = mapped_column(Text, nullable=True)
|