Phase 3.1: Add remaining local files
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
# Models package
|
||||
from app.models.user import User
|
||||
from app.models.chore import Chore
|
||||
<<<<<<< HEAD
|
||||
from app.models.chore_assignment import ChoreAssignment
|
||||
from app.models.chore_completion_log import ChoreCompletionLog
|
||||
|
||||
__all__ = ["User", "Chore", "ChoreAssignment", "ChoreCompletionLog"]
|
||||
__all__ = ["User", "Chore", "ChoreAssignment", "ChoreCompletionLog"]
|
||||
=======
|
||||
|
||||
__all__ = ["User", "Chore"]
|
||||
>>>>>>> 65c71b3d67d462fe9ecc01a1c2aa17e54b626fe2
|
||||
|
||||
@@ -33,11 +33,19 @@ class Chore(Base):
|
||||
title = Column(String(200), nullable=False)
|
||||
description = Column(String(500))
|
||||
room = Column(String(50)) # bedroom1, bedroom2, kitchen, bathroom1, etc.
|
||||
<<<<<<< HEAD
|
||||
frequency = Column(SQLEnum(ChoreFrequency, values_callable=lambda x: [e.value for e in x]), nullable=False)
|
||||
points = Column(Integer, default=0) # Points awarded for completing the chore
|
||||
image_url = Column(String(500)) # URL to chore image
|
||||
assignment_type = Column(SQLEnum(ChoreAssignmentType, values_callable=lambda x: [e.value for e in x]), default=ChoreAssignmentType.ANY_ONE) # How chore should be completed
|
||||
status = Column(SQLEnum(ChoreStatus, values_callable=lambda x: [e.value for e in x]), default=ChoreStatus.PENDING)
|
||||
=======
|
||||
frequency = Column(SQLEnum(ChoreFrequency), nullable=False)
|
||||
points = Column(Integer, default=0) # Points awarded for completing the chore
|
||||
image_url = Column(String(500)) # URL to chore image
|
||||
assignment_type = Column(SQLEnum(ChoreAssignmentType), default=ChoreAssignmentType.ANY_ONE) # How chore should be completed
|
||||
status = Column(SQLEnum(ChoreStatus), default=ChoreStatus.PENDING)
|
||||
>>>>>>> 65c71b3d67d462fe9ecc01a1c2aa17e54b626fe2
|
||||
assigned_user_id = Column(Integer, ForeignKey("users.id")) # Deprecated - use assignments instead
|
||||
due_date = Column(DateTime)
|
||||
completed_at = Column(DateTime)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
"""User model."""
|
||||
<<<<<<< HEAD
|
||||
from sqlalchemy import Boolean, Column, Integer, String, DateTime, Date
|
||||
=======
|
||||
from sqlalchemy import Boolean, Column, Integer, String, DateTime
|
||||
>>>>>>> 65c71b3d67d462fe9ecc01a1c2aa17e54b626fe2
|
||||
from sqlalchemy.orm import relationship
|
||||
from datetime import datetime
|
||||
from app.core.database import Base
|
||||
@@ -15,8 +19,11 @@ class User(Base):
|
||||
hashed_password = Column(String(200), nullable=False)
|
||||
discord_id = Column(String(100)) # For Discord integration
|
||||
profile_picture = Column(String(500)) # URL to profile picture
|
||||
<<<<<<< HEAD
|
||||
avatar_url = Column(String(500)) # URL to uploaded avatar
|
||||
birthday = Column(Date, nullable=True) # Birthday for chore logic
|
||||
=======
|
||||
>>>>>>> 65c71b3d67d462fe9ecc01a1c2aa17e54b626fe2
|
||||
is_active = Column(Boolean, default=True)
|
||||
is_admin = Column(Boolean, default=False)
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
@@ -24,5 +31,8 @@ class User(Base):
|
||||
|
||||
# Relationships (lazy loaded to avoid circular imports)
|
||||
chores = relationship("Chore", back_populates="assigned_user", lazy="select")
|
||||
<<<<<<< HEAD
|
||||
chore_assignments = relationship("ChoreAssignment", back_populates="user", lazy="select")
|
||||
chore_completion_logs = relationship("ChoreCompletionLog", foreign_keys="[ChoreCompletionLog.user_id]", back_populates="user", lazy="select")
|
||||
=======
|
||||
>>>>>>> 65c71b3d67d462fe9ecc01a1c2aa17e54b626fe2
|
||||
|
||||
Reference in New Issue
Block a user