Skip to content

Commit dc0387d

Browse files
committed
Revert "LLSC-65: Created form_status column on users table that keeps track of where the user is in terms of onboarding process. We use this to automatically redirect participants/volunteers to where they should be"
This reverts commit 3c722d0.
1 parent 3c722d0 commit dc0387d

File tree

33 files changed

+343
-1100
lines changed

33 files changed

+343
-1100
lines changed

AGENTS.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

CLAUDE.md

Lines changed: 0 additions & 180 deletions
This file was deleted.

backend/app/models/User.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
import uuid
2-
from enum import Enum as PyEnum
32

4-
from sqlalchemy import Boolean, Column, Enum as SQLEnum, ForeignKey, Integer, String
3+
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
54
from sqlalchemy.dialects.postgresql import UUID
65
from sqlalchemy.orm import relationship
76

87
from .Base import Base
98
from .Match import Match
109

1110

12-
class FormStatus(str, PyEnum):
13-
INTAKE_TODO = "intake-todo"
14-
INTAKE_SUBMITTED = "intake-submitted"
15-
RANKING_TODO = "ranking-todo"
16-
RANKING_SUBMITTED = "ranking-submitted"
17-
SECONDARY_APPLICATION_TODO = "secondary-application-todo"
18-
SECONDARY_APPLICATION_SUBMITTED = "secondary-application-submitted"
19-
COMPLETED = "completed"
20-
21-
2211
class User(Base):
2312
__tablename__ = "users"
2413
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
@@ -29,16 +18,6 @@ class User(Base):
2918
auth_id = Column(String, nullable=False)
3019
approved = Column(Boolean, default=False)
3120
active = Column(Boolean, nullable=False, default=True)
32-
form_status = Column(
33-
SQLEnum(
34-
FormStatus,
35-
name="form_status_enum",
36-
create_type=False,
37-
values_callable=lambda enum_cls: [member.value for member in enum_cls],
38-
),
39-
nullable=False,
40-
default=FormStatus.INTAKE_TODO,
41-
)
4221

4322
role = relationship("Role")
4423

backend/app/models/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .SuggestedTime import suggested_times
2222
from .TimeBlock import TimeBlock
2323
from .Treatment import Treatment
24-
from .User import FormStatus, User
24+
from .User import User
2525
from .UserData import UserData
2626

2727
# Used to avoid import errors for the models
@@ -42,7 +42,6 @@
4242
"RankingPreference",
4343
"Form",
4444
"FormSubmission",
45-
"FormStatus",
4645
]
4746

4847
log = logging.getLogger(LOGGER_NAME("models"))

backend/app/routes/auth.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ async def get_current_user(
127127
role_id=user.role_id,
128128
auth_id=user.auth_id,
129129
approved=user.approved,
130-
form_status=user.form_status,
131130
)
132131
except HTTPException:
133132
raise

backend/app/schemas/user.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ def to_role_id(cls, role: "UserRole") -> int:
3535
return role_map[role]
3636

3737

38-
class FormStatus(str, Enum):
39-
INTAKE_TODO = "intake-todo"
40-
INTAKE_SUBMITTED = "intake-submitted"
41-
RANKING_TODO = "ranking-todo"
42-
RANKING_SUBMITTED = "ranking-submitted"
43-
SECONDARY_APPLICATION_TODO = "secondary-application-todo"
44-
SECONDARY_APPLICATION_SUBMITTED = "secondary-application-submitted"
45-
COMPLETED = "completed"
46-
47-
4838
class UserBase(BaseModel):
4939
"""
5040
Base schema for user model with common attributes shared across schemas.
@@ -101,7 +91,6 @@ class UserUpdateRequest(BaseModel):
10191
email: Optional[EmailStr] = None
10292
role: Optional[UserRole] = None
10393
approved: Optional[bool] = None
104-
form_status: Optional[FormStatus] = None
10594

10695

10796
class UserCreateResponse(BaseModel):
@@ -116,7 +105,6 @@ class UserCreateResponse(BaseModel):
116105
role_id: int
117106
auth_id: str
118107
approved: bool
119-
form_status: FormStatus
120108

121109
# from_attributes enables automatic mapping from SQLAlchemy model to Pydantic model
122110
model_config = ConfigDict(from_attributes=True)
@@ -135,7 +123,6 @@ class UserResponse(BaseModel):
135123
auth_id: str
136124
approved: bool
137125
role: "RoleResponse"
138-
form_status: FormStatus
139126

140127
model_config = ConfigDict(from_attributes=True)
141128

backend/app/seeds/users.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from app.models.Experience import Experience
99
from app.models.Treatment import Treatment
10-
from app.models.User import FormStatus, User
10+
from app.models.User import User
1111
from app.models.UserData import UserData
1212
from app.utilities.form_constants import ExperienceId, TreatmentId
1313

@@ -316,7 +316,6 @@ def seed_users(session: Session) -> None:
316316
auth_id=user_info["user_data"]["auth_id"],
317317
approved=True,
318318
active=True,
319-
form_status=FormStatus.INTAKE_TODO,
320319
)
321320
session.add(user)
322321
session.flush() # Get user ID

backend/app/services/implementations/intake_form_processor.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from sqlalchemy.orm import Session
77

8-
from app.models import Experience, FormStatus, Treatment, User, UserData
8+
from app.models import Experience, Treatment, User, UserData
99

1010
logger = logging.getLogger(__name__)
1111

@@ -72,14 +72,6 @@ def process_form_submission(self, user_id: str, form_data: Dict[str, Any]) -> Us
7272
if owning_user and owning_user.email:
7373
user_data.email = owning_user.email
7474

75-
# Update form status for the owning user without regressing progress
76-
owning_user = self.db.query(User).filter(User.id == user_data.user_id).first()
77-
if owning_user and owning_user.form_status in {
78-
FormStatus.INTAKE_TODO,
79-
FormStatus.INTAKE_SUBMITTED,
80-
}:
81-
owning_user.form_status = FormStatus.INTAKE_SUBMITTED
82-
8375
# Commit all changes
8476
self.db.commit()
8577
self.db.refresh(user_data)

backend/app/services/implementations/ranking_service.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from sqlalchemy.orm import Session
44

5-
from app.models import FormStatus, Quality, User, UserData
5+
from app.models import Quality, User, UserData
66
from app.models.RankingPreference import RankingPreference
77

88

@@ -205,11 +205,4 @@ def save_preferences(self, user_auth_id: str, target: str, items: List[Dict]) ->
205205
)
206206
if normalized:
207207
self.db.bulk_save_objects(normalized)
208-
209-
if user.form_status in (
210-
FormStatus.RANKING_TODO,
211-
FormStatus.RANKING_SUBMITTED,
212-
):
213-
user.form_status = FormStatus.RANKING_SUBMITTED
214-
215208
self.db.commit()

0 commit comments

Comments
 (0)