Flow Diagram
Process Steps
1. Request Initiation
- Course must have
can_request set to true
- Customer selects course to request
- System presents product request questions
- Questions can be checkbox or other types
- Questions may have multiple correct answers
- Some questions are marked as 'affected' for evaluation
2. Question Answering
- Customer answers provided questions
- System stores:
- Customer information
- Selected product details
- Questions with answers
- Request date
- Request status set to PENDING
3. Evaluation Process
Automated Review (ProductRequestQuestionJob)
- Runs daily to check pending requests
- Evaluates requests older than
request_question_period_results days
- For each request:
- Checks answers for affected questions
- Calculates correct answers count
- Compares with required threshold
Acceptance Process
- If correct answers meet threshold:
- Status updated to ACCEPTED
- Email sent to customer with acceptance
- Customer can add course to cart
Rejection Process
- If answers below threshold:
- Status updated to REJECTED
- Email sent to customer with rejection
- Customer must wait before new attempt
4. Request Lifecycle Management
EndedProductRequestQuestionJob
- Runs daily to manage request lifecycle
- Checks requests older than
request_question_period_reorder days
- Updates status from PENDING/REJECTED to ENDED
- Allows customers to submit new requests
Key Components
Models
- ProductRequest: Stores request details and status
- ProductRequestQuestion: Defines questions and their properties
- ProductRequestAnswer: Stores possible answers and correct flags
Status Transitions
- PENDING: Initial state after submission
- ACCEPTED: Successful evaluation
- REJECTED: Failed evaluation
- ENDED: Final state, allowing new attempts
Configuration
request_question_period_results: Days before evaluation
request_question_period_reorder: Days before allowing new attempt