> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crazygoldfish.com/llms.txt
> Use this file to discover all available pages before exploring further.

# POST - Lesson Plan Feedback

>  This API allows authenticated users to create feedback entries for a lesson plan. 

 **How to Use:** 
 - Call `POST /lesson-plan/v1/feedback/{lesson_plan_id}` with the feedback details including rating, comment, feedback type, and optional fields. 
 - The API validates that the lesson plan exists and creates a new feedback entry. 

 **Request Body Parameters:** 
 - **rating** (optional): Integer between 1 and 5, representing the rating for the lesson plan. 
 - **comment** (required): Text feedback or comment about the lesson plan. 
 - **feedback_type** (required): Type of feedback ( May be one of them: `general`, `content`, `quality`, `suggestion`). 
 - **feedback_data** (optional): Structured feedback data as a JSON object for additional context. 
 - **step_name** (optional): Specific step name if the feedback is for a particular step in the lesson plan. 
 - **component_name** (optional): Specific component name if the feedback is for a particular component. 



## OpenAPI

````yaml POST /lesson-plan/v1/feedback/{lesson_plan_id}
openapi: 3.0.1
info:
  title: Lesson Plan Feedback API
  description: An API for creating feedback entries for lesson plans.
  version: 1.0.0
servers:
  - url: https://api-staging.crazygoldfish.com
    description: SandBox endpoint
  - url: https://api.crazygoldfish.com
    description: Prod End Point
security: []
paths:
  /lesson-plan/v1/feedback/{lesson_plan_id}:
    post:
      tags:
        - Lesson Plan
      summary: Create Lesson Plan Feedback
      description: >-
        Creates a new feedback entry for a lesson plan. The API validates that
        the lesson plan exists and creates a feedback entry with the provided
        rating, comment, feedback type, and optional fields.
      operationId: createLessonPlanFeedback
      parameters:
        - name: lesson_plan_id
          in: path
          description: Unique identifier of the lesson plan
          required: true
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackRequest'
            example:
              rating: 4
              comment: >-
                The lesson plan is well-structured and covers all key concepts.
                However, I suggest adding more interactive activities.
              feedback_type: suggestion
              feedback_data:
                strengths:
                  - Clear objectives
                  - Good pacing
                improvements:
                  - Add more examples
                  - Include assessment rubric
              step_name: Introduction
              component_name: Learning Objectives
      responses:
        '201':
          description: Feedback created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
              example:
                detail:
                  - id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    msg: Feedback created successfully.
        '400':
          description: >-
            Bad Request - Validation error. The feedback_type must be one of:
            general, content, quality, suggestion. Rating must be between 1 and
            5 if provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail:
                  - msg: >-
                      feedback_type must be one of ['general', 'content',
                      'quality', 'suggestion']
        '401':
          description: Unauthorized - Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail:
                  - msg: Authentication credentials were not provided.
        '404':
          description: Not Found - Lesson plan with the specified ID does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail:
                  - msg: >-
                      Lesson plan with id 550e8400-e29b-41d4-a716-446655440000
                      not found.
        '500':
          description: Internal Server Error - Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail:
                  - msg: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    FeedbackRequest:
      type: object
      properties:
        rating:
          type: integer
          minimum: 1
          maximum: 5
          description: Rating from 1 to 5
          example: 4
        comment:
          type: string
          description: Text feedback/comment about the lesson plan
          example: >-
            The lesson plan is well-structured and covers all key concepts.
            However, I suggest adding more interactive activities.
        feedback_type:
          type: string
          enum:
            - general
            - content
            - quality
            - suggestion
          description: >-
            Type of feedback. Must be one of: general (general feedback),
            content (content-specific feedback), quality (quality feedback),
            suggestion (suggestions for improvement)
          example: suggestion
        feedback_data:
          type: object
          description: Structured feedback data as a JSON object for additional context
          additionalProperties: true
          example:
            strengths:
              - Clear objectives
              - Good pacing
            improvements:
              - Add more examples
              - Include assessment rubric
        step_name:
          type: string
          description: >-
            Specific step name if feedback is for a particular step in the
            lesson plan
          example: Introduction
        component_name:
          type: string
          description: Specific component name if feedback is for a particular component
          example: Learning Objectives
      required:
        - comment
        - feedback_type
    FeedbackResponse:
      type: object
      properties:
        detail:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: Unique identifier of the created feedback entry
                example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
              msg:
                type: string
                description: Success message
                example: Feedback created successfully.
            required:
              - id
              - msg
      required:
        - detail
    ErrorResponse:
      type: object
      properties:
        detail:
          type: array
          items:
            type: object
            properties:
              msg:
                type: string
                description: Error message
                example: Lesson plan with id {lesson_plan_id} not found.
            required:
              - msg
      required:
        - detail
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````