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:
- Create an interview with future start_time, end_time, and submission_deadline.
- Wait until start_time or submission_deadline is in the past, or insert such an interview
directly in DB.
- 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.
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:
REPRODUCTION:
directly in DB.
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.