Skip to content

Commit e26c631

Browse files
e1011YashK2005claude
authored
Admin dash form pages (#83)
## Notion ticket link <!-- Please replace with your ticket's URL --> [Ticket Name](https://www.notion.so/uwblueprintexecs/Task-Board-db95cd7b93f245f78ee85e3a8a6a316d) <!-- Give a quick summary of the implementation details, provide design justifications if necessary --> ## Implementation description * <!-- What should the reviewer do to verify your changes? Describe expected results and include screenshots when appropriate --> ## Steps to test 1. <!-- Draw attention to the substantial parts of your PR or anything you'd like a second opinion on --> ## What should reviewers focus on? * ## Checklist - [ ] My PR name is descriptive and in imperative tense - [ ] My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits - [ ] I have run the appropriate linter(s) - [ ] I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR --------- Co-authored-by: YashK2005 <[email protected]> Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent 9d3cc28 commit e26c631

File tree

65 files changed

+9747
-654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+9747
-654
lines changed

backend/app/models/FormSubmission.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
import uuid
2+
from enum import Enum as PyEnum
23

3-
from sqlalchemy import Column, DateTime, ForeignKey, func
4+
from sqlalchemy import Column, DateTime, Enum, ForeignKey, func
45
from sqlalchemy.dialects.postgresql import JSONB, UUID
56
from sqlalchemy.orm import relationship
67

78
from .Base import Base
89

910

11+
class FormSubmissionStatus(str, PyEnum):
12+
"""Status of a form submission in the approval workflow."""
13+
14+
PENDING_APPROVAL = "pending_approval"
15+
APPROVED = "approved"
16+
REJECTED = "rejected"
17+
18+
1019
class FormSubmission(Base):
1120
__tablename__ = "form_submissions"
1221

@@ -15,6 +24,17 @@ class FormSubmission(Base):
1524
user_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=False)
1625
submitted_at = Column(DateTime(timezone=True), default=func.now())
1726
answers = Column(JSONB, nullable=False) # raw payload
27+
status = Column(
28+
Enum(
29+
"pending_approval",
30+
"approved",
31+
"rejected",
32+
name="form_submission_status",
33+
create_type=False, # Type already exists from migration
34+
),
35+
nullable=False,
36+
default="pending_approval",
37+
)
1838

1939
# Relationships
2040
form = relationship("Form")

backend/app/models/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from .Base import Base
1212
from .Experience import Experience
1313
from .Form import Form
14-
from .FormSubmission import FormSubmission
14+
from .FormSubmission import FormSubmission, FormSubmissionStatus
1515
from .Match import Match
1616
from .MatchStatus import MatchStatus
1717
from .Quality import Quality
@@ -43,6 +43,7 @@
4343
"RankingPreference",
4444
"Form",
4545
"FormSubmission",
46+
"FormSubmissionStatus",
4647
"FormStatus",
4748
"Language",
4849
"Task",

0 commit comments

Comments
 (0)