2025-06-20 05:51:38 +00:00

24 lines
1007 B
Python

# app/models/user.py
"""
HealthSync Motivator Batch 사용자 모델 (user_service.user)
"""
from pydantic import BaseModel, Field
from datetime import datetime, date
from typing import Optional
class User(BaseModel):
"""사용자 모델 (user_service.user 테이블)"""
member_serial_number: int = Field(..., description="회원 일련번호")
google_id: str = Field(..., max_length=255, description="구글 ID")
name: str = Field(..., max_length=100, description="사용자 이름")
birth_date: date = Field(..., description="생년월일")
occupation: Optional[str] = Field(None, max_length=50, description="직업")
created_at: datetime = Field(..., description="생성일시")
updated_at: datetime = Field(..., description="수정일시")
last_login_at: Optional[datetime] = Field(None, description="마지막 로그인")
class Config:
json_encoders = {
datetime: lambda v: v.isoformat(),
date: lambda v: v.isoformat()
}