Skip to content

Overview

This page provides all the routes accessible under school administrator namespace.

Feat: Holiday Calendar

Route: /school/${schoolId}/admin/holiday-calendar

Features

  • Displays the calendar holidays.
  • Marks a date as a holiday.
  • Removes a date from the list of holidays.

Components

  1. HolidayCalendar: Displays the holidays calendar. Adds, displays and deletes the holidays.
    • Location: /src/lib/components/school-admin/HolidayCalendar.svelte'

API Calls

  1. GET - /api/v1/school/calendar_days/search_and_filter?q[date_gteq]=${startDate}&q[date_lteq]=${endDate}Z&q[sorts]=date%20asc&per_page=100, fetcehs the list of holidays.
  2. POST - /api/v1/school/calendar_days/${dateId}, marks a date as a holiday.
  3. PATCH - /api/v1/school/calendar_days/${dateId}, removes the date as a holiday.

Discussion

  1. Fetches the calendar holidays using the API call 1.
  2. Marks a date as holiday using the API call 2.
  3. Delets the holiday using the API call 3.

Tab: School Staff

Route: /school/${schoolId}/admin/school-staff

Features

  • Fetches the list of users (administrators).
  • Archives the users.
  • Redirects to /school/${schoolId}/admin/school-staff/create-staff?kind=${accessRole}&role= in order to create a new user.

Components

  1. TopTabs: Displays all the users under various accesses.
    • Location: /src/lib/components/shared/TopTabs.svelte'
  2. AddStaffCard: Adds a new staff.
    • Location: /src/lib/components/school-admin/AddStaffCard.svelte
  3. SchoolStaffCard: Displays the list of staff.
    • Location: /src/lib/components/school-admin/SchoolStaffCard.svelte

API Calls

  1. GET - /api/v1/school/profiles/search_and_filter?all=true&per_page=75&page=1&q[user_name_cont]=&q[is_archived_eq]=false&q[is_testing_eq]=false&q[accesses_role_eq]=${accessRole}, fetches the list of users under each access role.
  2. PATCH - /api/v1/school/profiles/${userId}, archives the users.

Discussion

  1. Fetches the list of users available using the API call 1.
  2. Archives or unarchives the users using the API call 2.

Route: /school/${schoolId}/admin/school-staff/create-staff?kind=${accessRole}&role=

Features

  • Creates a new user.

API Calls

  1. POST - /api/v1/users, creates a new user.
  2. GET - /users?per_page=1000&email=${emailId}, fetches the newly created user details.
  3. POST - /api/v1/school/profiles?all=true, creates a user profile.
  4. POST - /api/v1/school/accesses, creates a new access.

Discussion

Route: /school/${schoolId}/admin/school-staff/${userId}?kind=${accessRole}&role=${accessName}

Features

  • Updates the user.

API Call

  1. GET - /api/v1/users/${userId}, fetches the user details.
  2. PATCH - /api/v1/users/${userId}, updates the user.

Discussion

  1. Fetches the user details using the API call 1.
  2. Updates the user info using the API call 2.

Tab: Classrooms

Route: /school/${schoolId}/admin/classrooms

Features

  • Displays all the classrooms data.
  • Edits the order of the classrooms.
  • Displays all the users and accesses of a classroom.
  • Redirects to /school/8a2c0d37-944f-4829-8dc1-4697ecb084a0/admin/classrooms/${classroomId}/create-access?role=${accessRole}, in order to create a new access for a user.

Components

  1. AddStaffCard: Adds a new staff.
    • Location: /src/lib/components/school-admin/AddStaffCard.svelte'
  2. SchoolStaffCard: Displays the list of users.
    • Location: /src/lib/components/school-admin/SchoolStaffCard.svelte'

API Calls

  1. GET - /api/v1/school/classrooms?per_page=200, fetches all the classroom details.
  2. GET - /api/v1/school/profiles?all=true&classroom_id=${classroomId}, fetches all the users in the classroom.

Discussion

  1. Fetches all the classroom details and the users in each classroom using the API calls 1 & 2.

Route: /school/${schoolId}/admin/classrooms/${classroomId}/create-access?role=${accessRole}

Features

  • Adds or removes access to or from the selected users.

API Calls

  1. GET - /api/v1/school/profiles/search_and_filter?all=true&per_page=75&page=1&q[user_name_cont]=&q[is_archived_eq]=false&q[is_testing_eq]=false&q[accesses_role_eq]=${accessRole}, fetches all the users available for the role.
  2. POST - /api/v1/school/accesses/batch_create, creates access for the selected users.
  3. POST - /api/v1/school/accesses/batch_destroy, removes access for the selected users.

Discussion

  1. Fetches all the users and their access roles data using the API call 1.
  2. Creates and deletes access for the users using the API calls 2 & 3.

Route: /school/${schoolId}/admin/classrooms/create-classroom

Features

  • Creates or deletes a classroom.

Components

  1. ClassRow: shows the classroom row with grades.
    • Location: /src/lib/components/school-admin/ClassRow.svelte'
  2. EmptyClassRow: displays an empty row.
    • Location: /src/lib/components/school-admin/EmptyClassRow.svelte'

API Calls

  1. POST - /api/v1/school/classrooms/batch_create, creates a classroom.
  2. POST - /api/v1/school/classrooms/batch_destroy, deletes new classroom.

Discussion

  1. Creates and deletes a classroom usng the API calls 1 & 2.

Tab: Materials Library

Refer Tab: Material Library. All the features and API calls are similar.

Tab: All Students

Route: /school/${schoolId}/admin/students

Features

  • Displays all the students of all the classrooms including unassigned.
  • Archives or unarchives a student.
  • Downloads all the students data.
  • Searches the student as per the queryString.

API Calls

  1. PATCH - /api/v1/school/students/${studentId}, archives or unarchives a student.
  2. GET - /api/v1/school/students?is_archived=${true or false}&per_page=50&page=1, fetches all the archived and unarchived students data.
  3. GET - /api/v1/school/students?is_archived=true&name=4{queryString}&per_page=50&page=1, fetches the student as per the query string.
  4. GET - /api/v1/schools/me, fetches the school data.

Discussion

  1. Archives or unarchives a student using the API call 1.
  2. Fetches all the archived and unarchived students using the API call 2.
  3. Fetches the student as per the query string using the API call 3.

Tab: Reports

Route: /school/${schoolId}/admin/reports

Features

  • Displays all the reports.
  • Creates a report.
  • Archives the report.
  • Refer Feat: Classroom Reports, the features and API calls are similar.

API Calls

  1. GET - /api/v1/school/reports?is_archived=false&page=1, fetches all the rerports.
  2. PATCH - /api/v1/school/reports/${reportId}, archives the report.
  3. POST - api/v1/school/reports/${reportId}/prepare_report, creates a new report.
  4. GET - /api/v1/school/reports/${reportId}, fetches the report details.

Discussion

  1. Fetches and archives the reports using the API calls 1 & 2.
  2. Creates a new report and fetches the details using the API call 3 & 4 respectively.
  3. Refer Feat: Classroom Reports, the features and API calls are similar.