Skip to content

Latest commit

 

History

History
869 lines (687 loc) · 24.2 KB

File metadata and controls

869 lines (687 loc) · 24.2 KB

📋 M&E SYSTEM IMPLEMENTATION CHECKLIST

Based on ME_System_Hierarchy_Mapping.md

Last Updated: 2025-11-25


🔴 CRITICAL HIERARCHY ALIGNMENT ISSUES

Issue #1: Duplicate Program Tables (HIGH PRIORITY)

Problem: System has BOTH programs and program_modules tables, causing hierarchy confusion

Current State:

  • program_modules table exists (CORRECT - maps to ClickUp Spaces)
  • programs table exists (REDUNDANT - duplicate structure)
  • ❌ Backend uses programs table instead of program_modules
  • ❌ Frontend calls /api/programs which queries wrong table

Expected Hierarchy (from mapping doc):

organizations (Top Level)
  ↓
program_modules (Level 1 - ClickUp Space) ← Should be using this!
  ↓
sub_programs (Level 2 - ClickUp Folder)
  ↓
project_components (Level 3 - ClickUp List)
  ↓
activities (Level 4 - ClickUp Task)

Current Implementation:

programs (WRONG TABLE) ← Backend is using this
  ↓
??? (No proper connection to sub_programs)

Fix Required:

  • Update backend to use program_modules instead of programs
  • Migrate all routes from /api/programs to /api/program-modules OR update queries
  • Update frontend to use correct API endpoints
  • Deprecate/remove programs table after migration
  • Update foreign keys if any tables reference programs

Issue #2: Additional Redundant projects Table

Problem: There's a projects table that doesn't fit the hierarchy

Current State:

  • sub_programs table exists (Level 2 - CORRECT)
  • projects table also exists (REDUNDANT - unclear purpose)

Fix Required:

  • Determine if projects table is in use
  • Migrate data if needed
  • Remove projects table to avoid confusion

✅ HIERARCHY IMPLEMENTATION STATUS

Level 1: Program Modules (ClickUp Space)

Table: program_modules Status: ✅ Database structure CORRECT | ❌ Backend implementation WRONG

Database Schema:

  • ✅ Correct table structure exists
  • ✅ Has organization_id foreign key
  • ✅ Has clickup_space_id for sync
  • ✅ Contains 5 modules as per spec:
    • Food, Water & Environment
    • Socio-Economic Empowerment
    • Gender, Youth & Peace
    • Relief & Charitable Services
    • Capacity Building

Backend Implementation:

  • ❌ Backend queries programs table instead of program_modules
  • ❌ Repository at backend/modules/programs/program.repository.js uses wrong table
  • ❌ Routes at backend/routes/programs.routes.js (if exists) need update

Frontend Implementation:

  • ✅ Programs.tsx component exists
  • ❌ Fetches from /api/programs (wrong endpoint)
  • ✅ Has statistics dashboard
  • ✅ Has Settings navigation button

Actions Required:

  • Update program.repository.js to query program_modules
  • Update all FROM programs to FROM program_modules
  • Test all program-related endpoints
  • Verify frontend displays correct data

Level 2: Sub-Programs (ClickUp Folder)

Table: sub_programs Status: ✅ IMPLEMENTED CORRECTLY

Database Schema:

  • ✅ Correct foreign key to module_id (program_modules)
  • ✅ Has clickup_folder_id for sync
  • ✅ Includes all required fields (budget, dates, manager, etc.)
  • ✅ Soft delete support (deleted_at)

Backend Implementation:

  • ✅ Backend service implemented
  • ✅ CRUD endpoints working
  • ✅ Statistics methods implemented

Frontend Implementation:

  • ✅ SubPrograms.tsx component implemented
  • ✅ Create/View/Edit functionality
  • ✅ Statistics dashboard showing program-level data
  • ✅ Breadcrumb navigation

Actions Required:

  • Verify module_id filtering works after fixing Level 1
  • Test navigation from program_modules to sub_programs

Level 3: Project Components (ClickUp List)

Table: project_components Status: ✅ IMPLEMENTED CORRECTLY

Database Schema:

  • ✅ Correct foreign key to sub_program_id
  • ✅ Has clickup_list_id for sync
  • ✅ Includes progress tracking
  • ✅ Soft delete support

Backend Implementation:

  • ✅ Backend service implemented
  • ✅ CRUD endpoints working
  • ✅ Statistics methods for sub-program level

Frontend Implementation:

  • ✅ ProjectComponents.tsx component implemented
  • ✅ Create/View/Edit functionality
  • ✅ Statistics dashboard showing sub-program statistics
  • ✅ Breadcrumb navigation

Actions Required:

  • Component implementation complete
  • Test full hierarchy navigation

Level 4: Activities (ClickUp Task)

Table: activities Status: ✅ MOSTLY IMPLEMENTED | ⚠️ Some gaps

Database Schema:

  • ✅ Correct foreign key to component_id
  • ✅ Also has project_id FK to sub_programs (for direct reference)
  • ✅ Comprehensive activity fields (location, dates, facilitators, etc.)
  • ✅ Approval workflow fields (approval_status, priority)
  • ✅ Beneficiary tracking fields
  • ✅ Budget tracking
  • ✅ Has clickup_list_id for sync (should be clickup_task_id?)
  • ❌ Activity date column added but may need index optimization
  • ✅ Soft delete support

Backend Implementation:

  • ✅ Backend service implemented
  • ✅ CRUD endpoints working
  • ✅ Approval workflow (submit/approve/reject) implemented
  • ✅ Status management
  • ✅ Statistics methods for component level
  • ✅ Workflow settings validation integrated

Frontend Implementation:

  • ✅ Activities.tsx component implemented
  • ✅ Create/View/Edit functionality via modals
  • ✅ ActivityDetailsModal with full activity details
  • ✅ AddActivityModal for creation
  • ✅ Inline status dropdown for quick changes
  • ✅ Submit for approval button
  • ✅ View/Edit/Delete actions
  • ✅ Statistics dashboard showing component statistics
  • ✅ Approval status badges
  • ✅ Filtering by status and approval status
  • ✅ Breadcrumb navigation
  • ✅ Workflow validation before edit
  • ✅ Workflow validation before status change

Actions Required:

  • Rename clickup_list_id to clickup_task_id for clarity
  • Implement sub-activities (Level 4.1)
  • Implement activity checklists UI (Level 4.2)

Level 4.1: Sub-Activities (ClickUp Subtask)

Table: sub_activities (mentioned in hierarchy doc) Status: ❌ NOT IMPLEMENTED

Database Schema:

  • ❌ Table not found in schema
  • ❓ May need to create table structure

Expected Structure:

CREATE TABLE sub_activities (
  id INT PRIMARY KEY AUTO_INCREMENT,
  parent_activity_id INT NOT NULL,
  name VARCHAR(255) NOT NULL,
  description TEXT,
  status ENUM('not-started', 'in-progress', 'completed'),
  assigned_to VARCHAR(255),
  clickup_subtask_id VARCHAR(50),
  sync_status ENUM('synced', 'pending', 'error'),
  created_at TIMESTAMP,
  updated_at TIMESTAMP,
  FOREIGN KEY (parent_activity_id) REFERENCES activities(id) ON DELETE CASCADE
);

Actions Required:

  • Create sub_activities table
  • Implement backend CRUD for sub-activities
  • Add UI to ActivityDetailsModal for managing sub-activities
  • Add ClickUp sync support

Level 4.2: Activity Checklists (ClickUp Checklist)

Table: activity_checklists Status: ✅ Database exists | ❌ UI not implemented

Database Schema:

  • ✅ Table exists with correct structure
  • ✅ Foreign key to activity_id
  • ✅ Has completion tracking (is_completed, completed_at)
  • ✅ Has clickup_checklist_id and clickup_checklist_item_id for sync
  • ✅ Order index for sorting

Backend Implementation:

  • ❌ CRUD endpoints not implemented
  • ❌ No service layer for checklists

Frontend Implementation:

  • ❌ No UI for managing checklists
  • ❌ Not shown in ActivityDetailsModal

Actions Required:

  • Create backend service for activity_checklists
  • Implement CRUD endpoints
  • Add checklist UI to ActivityDetailsModal
  • Add ability to create/edit/delete checklist items
  • Add completion tracking UI
  • Show progress based on completed items

📊 CROSS-CUTTING ENTITIES STATUS

Beneficiaries

Table: beneficiaries Status: ✅ Database exists | ❌ UI not implemented

Database Schema:

  • ✅ Comprehensive beneficiary fields
  • ✅ Demographics tracking (gender, age, age_group)
  • ✅ Location fields (parish, ward, county)
  • ✅ Vulnerability tracking
  • ✅ JSON fields for extended data

Backend Implementation:

  • ❓ Unknown if CRUD endpoints exist

Frontend Implementation:

  • ❌ No beneficiaries management UI
  • ❌ Not linked to activities yet

Actions Required:

  • Implement beneficiary management UI
  • Create beneficiary registration form
  • Link beneficiaries to activities
  • Show beneficiary list in activities
  • Implement beneficiary search and filtering

Activity-Beneficiary Links

Table: activity_beneficiaries Status: ✅ Database exists | ❌ UI not implemented

Database Schema:

  • ✅ Junction table with proper foreign keys
  • ✅ Role tracking (participant, facilitator, observer)
  • ✅ Attendance tracking

Implementation:

  • ❌ No UI for linking beneficiaries to activities
  • ❌ No attendance tracking UI

Actions Required:

  • Add beneficiary selection to activity forms
  • Implement attendance tracking UI
  • Show linked beneficiaries in ActivityDetailsModal
  • Add role assignment (participant/facilitator/observer)

Attachments & Evidence

Table: attachments Status: ✅ Database exists | ❌ UI not implemented

Database Schema:

  • ✅ Generic attachment system (entity_type, entity_id)
  • ✅ Supports multiple entity types (activity, goal, indicator, etc.)
  • ✅ File metadata (name, type, size, url)
  • ✅ Attachment categorization (photo, document, report, etc.)
  • ✅ Has clickup_attachment_id for sync

Implementation:

  • ❌ No file upload UI
  • ❌ No attachment management

Actions Required:

  • Implement file upload functionality
  • Add attachment UI to ActivityDetailsModal
  • Support photo uploads from field activities
  • Add document upload (attendance sheets, reports)
  • Implement attachment preview/download
  • Add ClickUp sync for attachments

Comments & Notes

Table: comments Status: ✅ Database exists | ❌ UI not implemented

Database Schema:

  • ✅ Generic comment system (entity_type, entity_id)
  • ✅ Comment categorization (update, challenge, lesson_learned, etc.)
  • ✅ User tracking
  • ✅ Has clickup_comment_id for sync

Implementation:

  • ❌ No comments UI
  • ❌ No activity updates/notes section

Actions Required:

  • Add comments section to ActivityDetailsModal
  • Implement comment threading
  • Add comment categorization UI
  • Show comment history
  • Add approval feedback as comments
  • Sync comments with ClickUp

Activity Expenses

Table: activity_expenses Status: ✅ Database exists | ❌ UI not implemented

Database Schema:

  • ✅ Expense tracking fields
  • ✅ Receipt tracking
  • ✅ Approval workflow
  • ✅ Category and description

Implementation:

  • ❌ No expense tracking UI
  • ❌ Not shown in activities

Actions Required:

  • Add expense tracking UI to ActivityDetailsModal
  • Implement expense entry form
  • Add receipt upload capability
  • Show total expenses vs budget
  • Implement expense approval workflow

Locations

Table: locations Status: ✅ Database exists | ❌ Not fully utilized

Database Schema:

  • ✅ Hierarchical location structure (parent_id)
  • ✅ Location types (country, county, sub_county, ward, parish)
  • ✅ GPS coordinates support
  • ✅ Boundary data (JSON)

Implementation:

  • ❌ Activities use text fields for location instead of foreign keys
  • ❌ No location management UI
  • ❌ No location hierarchy selector

Actions Required:

  • Populate locations table with Kenya geographic data
  • Create location management UI
  • Implement cascading location dropdowns
  • Update activities to use location_id instead of text fields
  • Add GPS coordinate capture
  • Implement location-based reporting

🎯 STRATEGIC GOALS & PERFORMANCE TRACKING

Goal Categories

Table: goal_categories Status: ✅ Database exists | ❌ Not implemented

Database Schema:

  • ✅ Correct foreign key to organization_id
  • ✅ Period tracking
  • ✅ Has clickup_goal_folder_id for sync

Implementation:

  • ❌ No backend implementation
  • ❌ No frontend UI

Actions Required:

  • Create goal categories management UI
  • Implement CRUD operations
  • Add period selectors (Annual, Quarterly, etc.)

Strategic Goals

Table: strategic_goals Status: ✅ Database exists | ❌ Not implemented

Expected Schema Elements:

  • Goal name and description
  • Owner/manager assignment
  • Timeline tracking
  • Progress calculation
  • Link to goal category
  • ClickUp goal sync

Actions Required:

  • Create strategic goals UI
  • Implement goal creation and management
  • Add owner assignment
  • Implement progress tracking dashboard
  • Link goals to indicators

Indicators (Targets/Key Results)

Table: indicators Status: ✅ Database exists | ❌ Not implemented

Database Schema:

  • ✅ Supports 4 indicator types (numeric, financial, binary, activity_linked)
  • ✅ Target and current value tracking
  • ✅ Progress calculation
  • ✅ Unit specification
  • ✅ Automatic vs manual tracking
  • ✅ Has clickup_target_id for sync

Implementation:

  • ❌ No backend implementation
  • ❌ No frontend UI
  • ❌ Activity linking not implemented

Actions Required:

  • Create indicator management UI
  • Implement indicator type selector
  • Add numeric indicator tracking
  • Add financial indicator tracking
  • Add binary (Yes/No) indicator tracking
  • Add activity-linked indicator auto-calculation
  • Implement progress dashboard
  • Create indicator reports

Indicator-Activity Links

Table: indicator_activity_links Status: ✅ Database exists | ❌ Not implemented

Database Schema:

  • ✅ Junction table with proper foreign keys
  • ✅ Active/inactive tracking

Actions Required:

  • Implement UI to link indicators to activities
  • Auto-calculate indicator progress from linked activities
  • Show linked indicators in activity details
  • Update indicator values when activities complete

🔄 WORKFLOW & APPROVAL SYSTEM

Activity Approval Workflow

Status: ✅ IMPLEMENTED

Current Implementation:

  • ✅ Draft → Submitted → Approved/Rejected states
  • ✅ Submit for approval button
  • ✅ Approval status badges
  • ✅ Backend endpoints for approve/reject
  • ✅ Approvals page showing pending activities

Workflow Settings:

  • ✅ Settings service with validation methods
  • ✅ Configurable workflow rules
  • ✅ Lock rejected activities (default: ON)
  • ✅ Lock approved activities option
  • ✅ Require approval before completion option
  • ✅ Settings UI page implemented
  • ✅ Validation integrated into Activities component
  • ✅ Validation integrated into ActivityDetailsModal
  • ✅ Validation integrated into Approvals component

Actions Required:

  • Add rejection reason display in activity details
  • Implement approval notifications
  • Add approval history/audit log
  • Implement multi-level approval if needed

🔗 CLICKUP SYNC INFRASTRUCTURE

Sync Configuration

Table: sync_config Status: ✅ Database exists | ❌ Not implemented

Actions Required:

  • Create sync configuration UI
  • Implement ClickUp API token management (encrypted)
  • Add webhook secret configuration
  • Test ClickUp API connection
  • Implement sync status dashboard

Sync Mapping

Table: clickup_mapping Status: ✅ Database exists | ❌ Not implemented

Database Schema:

  • ✅ Maps local entities to ClickUp entities
  • ✅ Supports all hierarchy levels
  • ✅ Mapping status tracking
  • ✅ Verification timestamp

Actions Required:

  • Implement initial sync/mapping process
  • Create mapping management UI
  • Implement sync status verification
  • Add broken mapping detection
  • Implement re-sync functionality

ClickUp Sync Logic (Priority: FUTURE)

Program Modules → ClickUp Spaces

  • Implement program_modules sync
  • Map to ClickUp Spaces
  • Sync module metadata
  • Handle bidirectional updates

Sub-Programs → ClickUp Folders

  • Implement sub_programs sync
  • Map to ClickUp Folders within Spaces
  • Sync budget and dates
  • Handle status updates

Project Components → ClickUp Lists

  • Implement project_components sync
  • Map to ClickUp Lists within Folders
  • Sync progress percentage
  • Handle component updates

Activities → ClickUp Tasks

  • Implement activities sync
  • Map to ClickUp Tasks within Lists
  • Sync all activity fields as custom fields
  • Handle approval status in ClickUp
  • Sync activity dates and locations
  • Sync beneficiary counts

Sub-Activities → ClickUp Subtasks

  • Implement sub-activity sync
  • Map to ClickUp Subtasks

Activity Checklists → ClickUp Checklists

  • Implement checklist sync
  • Map to ClickUp Checklist items
  • Sync completion status

Strategic Goals → ClickUp Goals

  • Implement goal sync
  • Map to ClickUp Goals
  • Sync progress automatically

Indicators → ClickUp Targets

  • Implement indicator sync
  • Map to ClickUp Targets/Key Results
  • Sync current values and progress

Attachments → ClickUp Attachments

  • Implement attachment sync
  • Upload files to ClickUp
  • Sync attachment metadata

Comments → ClickUp Comments

  • Implement comment sync
  • Map to ClickUp Comments
  • Handle bidirectional sync

📈 REPORTING & DASHBOARDS

Program-Level Dashboards

Status: ✅ PARTIALLY IMPLEMENTED

Current Implementation:

  • ✅ Overall statistics dashboard on Programs page
  • ✅ Sub-programs count
  • ✅ Components count
  • ✅ Activities count
  • ✅ Overall progress percentage
  • ✅ Activity status breakdown

Actions Required:

  • Add beneficiary reach statistics
  • Add budget utilization charts
  • Add geographic coverage map
  • Add trend analysis over time

Activity Reports

Status: ❌ NOT IMPLEMENTED

Actions Required:

  • Monthly activity summary report
  • Quarterly progress reports
  • Annual performance reports
  • Donor-specific reports
  • Export to Excel/PDF

Performance Tracking Reports

Status: ❌ NOT IMPLEMENTED

Actions Required:

  • Strategic goals progress dashboard
  • Indicator tracking reports
  • Target vs actual analysis
  • Trend analysis charts

M&E Reports

Status: ❌ NOT IMPLEMENTED

Actions Required:

  • Data quality assessment reports
  • Indicator achievement rates
  • Lessons learned compilation
  • Best practices documentation

🎨 USER INTERFACE ENHANCEMENTS

Navigation

Status: ✅ IMPLEMENTED

  • ✅ Breadcrumb navigation at all levels
  • ✅ Back buttons
  • ✅ Hierarchical drilling (Programs → Sub-Programs → Components → Activities)

Actions Required:

  • Add sidebar navigation
  • Add quick access menu
  • Implement search functionality across hierarchy

Responsiveness

Status: ✅ IMPLEMENTED

  • ✅ Mobile-responsive design
  • ✅ Responsive tables
  • ✅ Touch-friendly buttons
  • ✅ Responsive modals

User Experience

Status: ⚠️ NEEDS IMPROVEMENT

Actions Required:

  • Add loading states for all async operations
  • Implement toast notifications instead of alerts
  • Add confirmation dialogs with better UX
  • Implement form validation with clear error messages
  • Add success/error feedback for all operations
  • Implement keyboard shortcuts
  • Add tooltips for complex features

🔐 SECURITY & AUTHENTICATION

User Management

Table: users (mentioned in hierarchy doc) Status: ❓ UNKNOWN

Actions Required:

  • Verify users table exists
  • Implement user authentication
  • Implement role-based access control (RBAC)
  • Add user roles (Admin, M&E Officer, Field Officer, Viewer)
  • Implement permission system
  • Add user management UI

Audit Logging

Status: ❌ NOT IMPLEMENTED

Actions Required:

  • Create audit_log table
  • Log all create/update/delete operations
  • Track user actions
  • Log approval/rejection actions
  • Implement audit log viewer

📱 ADDITIONAL FEATURES

Time Tracking

Status: ❌ NOT IMPLEMENTED

Actions Required:

  • Create time_entries table
  • Implement time logging UI
  • Track staff hours on activities
  • Track volunteer hours
  • Generate time reports
  • Sync with ClickUp time tracking

Notifications

Status: ❌ NOT IMPLEMENTED

Actions Required:

  • Implement notification system
  • Email notifications for approval requests
  • Email notifications for rejections
  • Email notifications for status changes
  • In-app notifications
  • Notification preferences (from workflow settings)

📊 PRIORITY ROADMAP

Phase 1: Fix Critical Hierarchy Issues (IMMEDIATE)

  1. Fix program_modules vs programs table inconsistency
  2. Update backend to use program_modules
  3. Update frontend to use correct endpoints
  4. Test full hierarchy navigation
  5. Remove redundant tables

Phase 2: Complete Core Features (SHORT TERM)

  1. Implement sub-activities
  2. Implement activity checklists UI
  3. Implement beneficiary management
  4. Implement attachments & file uploads
  5. Implement comments system
  6. Implement expense tracking
  7. Improve location management

Phase 3: Strategic Goals & Performance Tracking (MEDIUM TERM)

  1. Implement goal categories
  2. Implement strategic goals
  3. Implement indicators (all 4 types)
  4. Implement indicator-activity linking
  5. Implement auto-calculation for activity-linked indicators
  6. Build performance dashboards

Phase 4: Reporting & Analytics (MEDIUM TERM)

  1. Build comprehensive dashboards
  2. Implement report generation
  3. Add data export functionality
  4. Implement geographic mapping
  5. Add trend analysis

Phase 5: ClickUp Integration (LONG TERM)

  1. Set up ClickUp API configuration
  2. Implement sync mapping
  3. Sync program_modules → Spaces
  4. Sync sub_programs → Folders
  5. Sync components → Lists
  6. Sync activities → Tasks
  7. Sync sub-activities → Subtasks
  8. Sync checklists
  9. Sync goals and indicators
  10. Sync attachments and comments
  11. Implement bidirectional sync
  12. Add webhook handlers
  13. Implement conflict resolution

Phase 6: Polish & Enhancement (LONG TERM)

  1. User authentication and RBAC
  2. Audit logging
  3. Time tracking
  4. Notifications system
  5. Advanced search
  6. Mobile app (if needed)
  7. Offline capability

📝 SUMMARY OF KEY ACTIONS

IMMEDIATE (Critical - Do First):

  1. ✅ Fix workflow settings initialization (COMPLETED)
  2. Fix program_modules vs programs table hierarchy mismatch
  3. ❌ Update all backend queries to use correct tables
  4. ❌ Test full hierarchy after fix

SHORT TERM (Core Features):

  1. ❌ Complete activity-level features (checklists, sub-activities)
  2. ❌ Implement beneficiary management
  3. ❌ Implement attachments and file uploads
  4. ❌ Implement comments system
  5. ❌ Improve location management with cascading dropdowns

MEDIUM TERM (Advanced Features):

  1. ❌ Implement strategic goals and performance tracking
  2. ❌ Build comprehensive reporting and dashboards
  3. ❌ Implement user authentication and RBAC

LONG TERM (Integration):

  1. ❌ Implement full ClickUp bidirectional sync
  2. ❌ Implement webhook handlers
  3. ❌ Build advanced analytics and insights

🎯 SUCCESS CRITERIA

The system will be considered complete when:

  1. ✅ All hierarchy levels properly implemented and aligned
  2. ✅ Full CRUD operations at all levels
  3. ✅ Workflow and approval system functioning
  4. ✅ Beneficiary tracking implemented
  5. ✅ Attachments and evidence management working
  6. ✅ Strategic goals and indicators tracking active
  7. ✅ Comprehensive dashboards and reports available
  8. ✅ ClickUp sync operational (bidirectional)
  9. ✅ User authentication and permissions in place
  10. ✅ System is production-ready and stable

This checklist is a living document and should be updated as implementation progresses.