Skip to content

GET /interviews/{interview_id} fails for valid interviews after their scheduled times pass #86

@harshitanagpal05

Description

@harshitanagpal05

PROBLEM:
CustomInterviewResponse inherits from CustomInterviewCreate, so it also inherits the create-time
validator that requires start_time, end_time, and submission_deadline to be in the future.

That validation is correct when creating an interview, but wrong when reading an existing
interview. Once an interview starts or its deadline passes, the organization may no longer be able
to fetch full interview details.

RELEVANT CODE:

  • backend/app/schemas/interview.py:34
  • backend/app/schemas/interview.py:74
  • backend/app/routers/interview.py:153

REPRODUCTION:

  1. Create an interview with future start_time, end_time, and submission_deadline.
  2. Wait until start_time or submission_deadline is in the past, or insert such an interview
    directly in DB.
  3. Call:

GET /interviews/{interview_id}
Authorization: Bearer <org_token>

ACTUAL RESULT
The API can raise:

BadRequestError: start_time must be in the future

or similar validation errors.

EXPECTED RESULT:
Organizations should be able to view their own interview details even after the interview starts,
ends, or the application deadline passes.

SUGGESTED FIX:
Separate create schemas from response schemas. Keep the future-date validator only on
CustomInterviewCreate, and make CustomInterviewResponse inherit from a neutral base schema without
create-time validation.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions