> ## 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 Instructional Framework Builder

>  This API allows authenticated users to trigger the content generation process for a lesson plan. 

 **How to Use:** 
 1. Call `POST /lesson-plan/v1/instructional-framework-builder/{lesson_plan_id}` with the finalized finalize meta data. 
 2. The API validates the lesson plan ID, checks that the finalize meta data step is completed, and ensures content generation is not already in progress or completed. 
 3. On success, the system updates the finalize meta data, triggers the content generation process asynchronously, and returns a success message. 

 **Example Scenario:**

 A teacher wants to generate content for a lesson plan: 
 - They submit the finalized meta data using this API. 
 - The system validates the lesson plan and finalize meta step status. 
 - If valid, the system updates the finalize meta and starts the content generation process. 
 - The teacher receives a message confirming the content generation process has been initiated. 



## OpenAPI

````yaml POST /lesson-plan/v1/instructional-framework-builder/{lesson_plan_id}
openapi: 3.0.1
info:
  title: Evaluation Report API
  description: An API for retrieving evaluation reports.
  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/instructional-framework-builder/{lesson_plan_id}:
    post:
      summary: Trigger content generation for a lesson plan.
      operationId: generateLessonPlanContent
      parameters:
        - name: lesson_plan_id
          in: path
          required: true
          description: UUID of the lesson plan to generate content for.
          schema:
            type: string
            format: uuid
      requestBody:
        description: >-
          Community-focused alignment data required to drive content generation.
          Includes recommended materials, instructional strategies, and detailed
          instructional blocks.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                alignment:
                  type: object
                  description: >-
                    Alignment details that specify materials, strategies, and
                    instructional blocks.
                  properties:
                    materials_options:
                      type: array
                      description: List of recommended materials for the lesson plan.
                      items:
                        type: object
                        properties:
                          ai_recommendations:
                            type: array
                            description: AI-generated material suggestions.
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: Material name.
                                description:
                                  type: string
                                  description: Material description.
                          additional_recommendations:
                            type: array
                            description: Additional human-curated material suggestions.
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: Additional material name.
                                description:
                                  type: string
                                  description: Additional material description.
                    instructional_strategies_options:
                      type: array
                      description: >-
                        Recommended instructional strategies for delivering the
                        lesson.
                      items:
                        type: object
                        properties:
                          ai_recommendations:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: Strategy name.
                                description:
                                  type: string
                                  description: Strategy description.
                          additional_recommendations:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: Additional strategy name.
                                description:
                                  type: string
                                  description: Additional strategy description.
                    instructional_blocks:
                      type: object
                      description: >-
                        Structured lesson flow with duration, component options,
                        and formative questions.
                      properties:
                        introduction:
                          type: object
                          description: Introductory activities for the lesson.
                          properties:
                            component_options:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                    description: Component name.
                                  description:
                                    type: string
                                    description: Component description.
                            formative_questions:
                              type: array
                              items:
                                type: string
                              description: Questions to assess initial understanding.
                            duration:
                              type: integer
                              description: Duration in minutes.
                        development:
                          type: object
                          description: Main development phase of the lesson.
                          properties:
                            component_options:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  description:
                                    type: string
                            formative_questions:
                              type: array
                              items:
                                type: string
                            duration:
                              type: integer
                        guided_practice:
                          type: object
                          description: Activities for guided practice with teacher support.
                          properties:
                            component_options:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  description:
                                    type: string
                            formative_questions:
                              type: array
                              items:
                                type: string
                            duration:
                              type: integer
                        independent_practice:
                          type: object
                          description: Independent student practice activities.
                          properties:
                            component_options:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  description:
                                    type: string
                            formative_questions:
                              type: array
                              items:
                                type: string
                            duration:
                              type: integer
                        closure:
                          type: object
                          description: Closure activities to summarize and reflect.
                          properties:
                            component_options:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  description:
                                    type: string
                            formative_questions:
                              type: array
                              items:
                                type: string
                            duration:
                              type: integer
                        summative_assessment:
                          type: object
                          description: Final assessment of student understanding.
                          properties:
                            component_options:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  description:
                                    type: string
                            formative_questions:
                              type: array
                              items:
                                type: string
                            duration:
                              type: integer
                  required:
                    - materials_options
                    - instructional_strategies_options
                    - instructional_blocks
              required:
                - alignment
            example:
              alignment:
                materials_options:
                  - ai_recommendations:
                      - name: Community Role Cards
                        description: >-
                          Visual cards depicting various community roles help
                          clarify roles and responsibilities.
                      - name: Environmental Care Kits
                        description: >-
                          Hands-on kits with composting and waste management
                          tools facilitate practical learning.
                      - name: Festival Storybooks
                        description: >-
                          Books illustrating community celebrations support
                          understanding of shared traditions.
                    additional_recommendations:
                      - name: Storytelling Props
                        description: >-
                          Props for role-play enhance engagement in community
                          role activities.
                      - name: Local Institution Photos
                        description: >-
                          Images of schools, hospitals, and markets provide
                          real-life context for community institutions.
                instructional_strategies_options:
                  - ai_recommendations:
                      - name: Role-Play Activities
                        description: >-
                          Engages students actively to understand community
                          roles and teamwork.
                      - name: Group Discussions
                        description: >-
                          Facilitates strategic questioning and sharing of
                          perspectives.
                      - name: Hands-on Environmental Projects
                        description: >-
                          Applies learning through practical composting or
                          clean-up tasks.
                    additional_recommendations:
                      - name: Storytelling Sessions
                        description: >-
                          Promotes empathy and social understanding through
                          narrative.
                      - name: Interactive Q&A
                        description: >-
                          Encourages student participation and formative
                          assessment through questioning.
                instructional_blocks:
                  introduction:
                    component_options:
                      - name: Storytelling on Community Roles
                        description: >-
                          Introduces community members and roles using relatable
                          stories.
                      - name: Visual Presentation of Community
                        description: >-
                          Shows images and videos illustrating community
                          settings.
                    formative_questions:
                      - What community roles do you see in your family?
                      - Can you name someone who helps in your school?
                    duration: 10
                  development:
                    component_options:
                      - name: Role-Play of Community Helpers
                        description: Students act out roles to understand responsibilities.
                      - name: Discussion on Cooperation
                        description: >-
                          Guided talk about working together during festivals
                          and community events.
                    formative_questions:
                      - How do people help each other during festivals?
                      - Why is teamwork important in our community?
                    duration: 15
                  guided_practice:
                    component_options:
                      - name: Group Composting Activity
                        description: >-
                          Students participate in composting to learn
                          environmental care.
                      - name: Waste Sorting Exercise
                        description: >-
                          Hands-on sorting of recyclable and non-recyclable
                          materials.
                    formative_questions:
                      - What materials can we compost?
                      - How does composting help the soil?
                    duration: 15
                  independent_practice:
                    component_options:
                      - name: Community Institution Mapping
                        description: >-
                          Students create maps highlighting local institutions
                          and their functions.
                      - name: Celebration Sharing Session
                        description: Students share stories about festivals and traditions.
                    formative_questions:
                      - Which community institutions do you visit often?
                      - How do festivals make you feel part of the community?
                    duration: 10
                  closure:
                    component_options:
                      - name: Group Reflection
                        description: >-
                          Students discuss what they learned about community
                          roles and care.
                      - name: Question and Answer Review
                        description: Teacher-led Q&A to summarize key concepts.
                    formative_questions:
                      - What is one important role in your community?
                      - How can you help keep your neighborhood clean?
                    duration: 5
                  summative_assessment:
                    component_options:
                      - name: Matching Roles to Responsibilities
                        description: Students match community members to their roles.
                      - name: Explain Importance of Cooperation
                        description: >-
                          Oral or written explanation of teamwork in community
                          events.
                      - name: Demonstrate Composting Benefits
                        description: >-
                          Students describe or show composting process and its
                          impact.
                      - name: List Community Institutions and Functions
                        description: Students list institutions and explain their roles.
                      - name: Discuss Shared Traditions
                        description: Students talk about how celebrations foster belonging.
                    formative_questions: []
                    duration: 5
      responses:
        '200':
          description: Content generation job enqueued successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        message:
                          type: string
              example:
                detail:
                  - id: 78f0974d-d2df-42f4-8c06-073ed43482f5
                    message: Content generation initiated successfully.
        '400':
          description: Validation error or invalid request.
        '404':
          description: Lesson plan not found.
        '500':
          description: Internal server error.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````