Skip to main content

SKOLE-ACTV — Activities Module

Module ID: SKOLE-ACTV | Version: 1.0 | Status: Active
Products: Parent App (view + engage) · Teacher App (create/manage) · Web App (view)

1. Overview

Scope In

  • Teachers: Create, update, soft-delete activities; assign to specific student or school-wide
  • Parents: View activity feed, comment, react (like/love)
  • Pagination, type filtering, status filtering

Scope Out

  • Event RSVP / registration
  • Photo gallery per activity

2. Requirements

Functional Requirements (FR)

What the module must DO — actions, behaviors, and outcomes.
  • SKOLE-ACTV-FR001: The module shall allow teachers to create activities with title, description, type (event, announcement, achievement, homework), and status.
  • SKOLE-ACTV-FR002: The module shall enable teachers to assign activities to a specific student or make them school-wide.
  • SKOLE-ACTV-FR003: The module shall allow teachers to update and soft-delete activity records.
  • SKOLE-ACTV-FR004: The module shall provide parents with a paginated feed of school activities.
  • SKOLE-ACTV-FR005: The module shall allow filtering by activity type and status.
  • SKOLE-ACTV-FR006: The module shall perform server-side pagination for the activity feed using page and limit parameters.
  • SKOLE-ACTV-FR007: The module shall allow web admins to view all activity records for their school.

Non-Functional Requirements (NFR)

How well the module must do it — performance, security, and reliability.
  • SKOLE-ACTV-NFR001: The module shall behave predictably by defaulting pagination to page 1 and a limit of 10 items if not specified.
  • SKOLE-ACTV-NFR002: The module shall perform secure data filtering by excluding soft-deleted activities (deleted_status = 1) from all feeds.
  • SKOLE-ACTV-NFR003: The module shall maintain high availability for the parent feed as it is a primary engagement surface.

Constraints

Rules and boundaries — tech choices and platform restrictions.
  • C001: We must utilize the Engagement module for handling comments and reactions on activities because of the platform’s modular architecture.
  • C002: We must use a single activities table for all types to maintain a unified feed logic across apps.

3. Sub-modules / Backlog


4. Logical Implementation

Activity Status State Machine

Teacher Create Flow

Parent View Flow

Error Handling


5. UI Requirements

Teacher App — ActivitiesScreen

Components:

Parent App — Activities Feed

Additional Components:

Web App


6. Conditional Expressions


7. Internal Module Connections


8. External Connections


9. Database Tables

activities Key Columns


10. API Endpoints Summary


  • Auto-excludes deleted entries

PARENT-01: Activity Feed (Paginated)

Section 1: Endpoint Summary

Returns paginated feed of school activities (events, announcements, achievements) for parent’s school with filtering by type and status.

Section 2: HTTP Details

  • HTTP Method: GET
  • Endpoint URL: /parent-app/activity
  • Authentication: JWT Bearer Token (Parent)
  • Rate Limit: 100 requests per minute

Section 4: Query Parameters

Section 6: Response Schema (Success - 200)

Section 7: Error Responses

401 - Unauthorized
400 - Invalid Pagination

Section 8: Implementation Examples

JavaScript:
Python:

Section 9: Database Context

Tables:
  • activities (primary)
  • schools (join for isolation)
Query:
Indices: (skole_id, deleted_status, status), created_at DESC, activity_type

Section 10: Business Logic & Validations

Validation:
  • Page >= 1, limit <= 50
  • activity_type enum check
  • Status filter (published by default for parents)
  • Auto-excludes deleted entries
Business Logic:
  1. Scope to parent’s school (skole_id)
  2. Apply all filters
  3. Exclude deleted_status = 1 entries
  4. Count total matching
  5. Paginate and return with metadata
  • GET /parent-app/activity/:id - Single activity detail
  • GET /parent-app/activity/categories - List types

Section 12: Response Summary Table


PARENT-02: Get Activity Detail

Section 1: Endpoint Summary

Fetch complete activity details including full description, engagement stats, and comments.

Section 2: HTTP Details

  • HTTP Method: GET
  • Endpoint URL: /parent-app/activity/:id
  • Authentication: JWT (Parent)

Section 3: Path Parameters

Section 6: Response Schema (Success - 200)

Section 8: Implementation Examples

JavaScript:

Section 12: Response Summary Table


PARENT-03: List Activity Categories

Section 1: Endpoint Summary

Returns list of available activity types/categories for filtering.

Section 2: HTTP Details

  • HTTP Method: GET
  • Endpoint URL: /parent-app/activity/categories
  • Authentication: JWT (Parent)

Section 6: Response Schema (Success - 200)

Section 8: Implementation Examples

JavaScript:

Section 12: Response Summary Table


TEACH-01: List Activities

Section 1: Endpoint Summary

Teacher views all activities they’ve created with filtering and pagination.

Section 2: HTTP Details

  • HTTP Method: GET
  • Endpoint URL: /teachers-app/activity
  • Authentication: JWT (Staff)

Section 4: Query Parameters

Section 6: Response Schema (Success - 200)

Section 8: Implementation Examples

JavaScript:

Section 12: Response Summary Table


TEACH-02: Get Activity Detail

Section 1: Endpoint Summary

Fetch complete activity details for viewing/editing.

Section 2: HTTP Details

  • HTTP Method: GET
  • Endpoint URL: /teachers-app/activity/:id
  • Authentication: JWT (Staff)

Section 6: Response Schema (Success - 200)

Section 12: Response Summary Table


TEACH-03: Create Activity

Section 1: Endpoint Summary

Teacher creates new activity (event, announcement, achievement, homework) for school or specific student.

Section 2: HTTP Details

  • HTTP Method: POST
  • Endpoint URL: /teachers-app/activity
  • Authentication: JWT (Staff)

Section 5: Request Body Schema

Section 6: Response Schema (Success - 201)

Section 7: Error Responses

400 - Invalid Type

Section 8: Implementation Examples

JavaScript:

Section 12: Response Summary Table


TEACH-04: Update Activity

Section 1: Endpoint Summary

Teacher updates activity details, status, or description.

Section 2: HTTP Details

  • HTTP Method: PUT
  • Endpoint URL: /teachers-app/activity/:id
  • Authentication: JWT (Staff)

Section 5: Request Body Schema

Section 6: Response Schema (Success - 200)

Section 8: Implementation Examples

JavaScript:

Section 12: Response Summary Table


TEACH-05: Delete Activity

Section 1: Endpoint Summary

Teacher soft-deletes activity (hidden from parents, retained for audit).

Section 2: HTTP Details

  • HTTP Method: DELETE
  • Endpoint URL: /teachers-app/activity/:id
  • Authentication: JWT (Staff)

Section 6: Response Schema (Success - 200)

Section 9: Database Context

Sets deleted_status = 1, hides from all consumer APIs

Section 12: Response Summary Table


ADMIN-01: List All Activities (Web App)

Section 1: Endpoint Summary

Admin views all activities across school with global filters.

Section 2: HTTP Details

  • HTTP Method: GET
  • Endpoint URL: /web-app/activity
  • Authentication: JWT (Admin)

Section 4: Query Parameters

Section 6: Response Schema (Success - 200)

Section 12: Response Summary Table


ADMIN-02: Get Activity Detail (Web App)

Section 1: Endpoint Summary

Admin views complete activity details including creator and engagement stats.

Section 2: HTTP Details

  • HTTP Method: GET
  • Endpoint URL: /web-app/activity/:id
  • Authentication: JWT (Admin)

Section 12: Response Summary Table


ADMIN-03: Create Activity (Web App)

Section 1: Endpoint Summary

Admin creates activity on behalf of staff (system announcements, corrections).

Section 2: HTTP Details

  • HTTP Method: POST
  • Endpoint URL: /web-app/activity
  • Authentication: JWT (Admin)

Section 5: Request Body Schema

Section 6: Response Schema (Success - 201)

Section 12: Response Summary Table


ADMIN-04: Update Activity (Web App)

Section 1: Endpoint Summary

Admin updates activity details or status.

Section 2: HTTP Details

  • HTTP Method: PUT
  • Endpoint URL: /web-app/activity/:id
  • Authentication: JWT (Admin)

Section 6: Response Schema (Success - 200)

Section 12: Response Summary Table


12. Summary Table: All 12 Activity Endpoints