This document describes the new budget request workflow, comments system, and reference data features added to the M&E system.
Teams can now request budgets for activities, and the finance team can review, approve, edit, or return them.
Track budget flow from program level down to activity level with automatic remaining budget calculations.
Extended comments table to support more entity types including approvals, checklists, expenses, and risks.
- Locations: Hierarchical structure (Country β County β Sub-County β Ward β Parish)
- Goal Categories: 12 organizational goal categories aligned with SDGs
- Strategic Goals: Organizational strategic objectives
Tracks budget requests from teams for activities.
Key Fields:
activity_id- Activity requesting budgetrequested_amount- Amount requestedapproved_amount- Amount approved by financestatus- draft, submitted, under_review, approved, rejected, returned_for_amendmentfinance_notes- Notes from finance teamamendment_notes- Required changes for returned requestsrejection_reason- Why request was rejected
Tracks budget flow from one level to another.
Key Fields:
source_type/source_id- Where money comes from (program_budget, sub_program, component)target_type/target_id- Where money goes to (sub_program, component, activity)allocated_amount- Amount allocatedspent_amount- Amount spentcommitted_amount- Amount committedremaining_amount- Auto-calculated remaining budget
Activity-level budget tracking with spending.
Key Fields:
allocated_budget- Total allocated to activityapproved_budget- Approved through requestsspent_budget- Actually spentcommitted_amount- Committed but not spentremaining_budget- Auto-calculated
Now supports:
activity,goal,sub_program,component(existing)approval,finance_approval,budget_request(new)checklist,expense,risk(new)parent_comment_id- For threaded discussions
POST /api/budget-requests
{
"activity_id": 123,
"requested_amount": 50000.00,
"justification": "Budget needed for training materials and venue",
"breakdown": {
"materials": 20000,
"venue": 15000,
"facilitators": 15000
},
"priority": "high"
}Status: submitted
Finance team has 4 options:
PUT /api/budget-requests/:id/approve
{
"approved_amount": 45000.00,
"finance_notes": "Approved with slight reduction on venue costs"
}Status: approved β Budget automatically allocated to activity
PUT /api/budget-requests/:id/reject
{
"rejection_reason": "No budget available in this fiscal year"
}Status: rejected
PUT /api/budget-requests/:id/return
{
"amendment_notes": "Please provide detailed breakdown of materials costs and reduce venue budget"
}Status: returned_for_amendment
PUT /api/budget-requests/:id/edit
{
"requested_amount": 40000.00,
"justification": "Updated after discussion with team",
"finance_notes": "Adjusted based on available budget"
}Status: under_review
When approved, the system automatically:
- Creates/updates
activity_budgetsrecord - Sets
approved_budget= approved amount - Creates
budget_allocationsrecord linking source to activity - Tracks remaining budget as expenses are recorded
The system tracks budget flow and automatically calculates remaining amounts:
Remaining Budget = Approved Budget - Spent Budget - Committed Budget
- Program Budget: KES 1,000,000
- Allocated to Sub-Program: KES 300,000
- Program remaining: KES 700,000
- Allocated to Component: KES 150,000
- Sub-program remaining: KES 150,000
- Allocated to Activity: KES 50,000
- Component remaining: KES 100,000
- Activity Spends: KES 20,000
- Activity remaining: KES 30,000
All calculations are automatic using database triggers and generated columns.
Comments now support more entities:
{
"entity_type": "finance_approval",
"entity_id": 456,
"comment_text": "Approved with conditions - see attached documentation",
"comment_type": "approval_feedback",
"user_id": 1
}{
"entity_type": "checklist",
"entity_id": 789,
"comment_text": "This item needs supervisor review before marking complete",
"comment_type": "observation",
"user_id": 2
}{
"entity_type": "budget_request",
"entity_id": 123,
"comment_text": "Please revise the materials budget breakdown",
"comment_type": "general",
"user_id": 3
}{
"entity_type": "activity",
"entity_id": 100,
"parent_comment_id": 50, // Reply to comment #50
"comment_text": "I agree, we should adjust the timeline",
"comment_type": "general",
"user_id": 4
}Hierarchical structure populated with Kenya data:
Kenya (country)
βββ Nairobi (county)
β βββ Westlands (sub_county)
β βββ Kibra (sub_county)
β β βββ Laini Saba (ward)
β β βββ Lindi (ward)
β β βββ Makina (ward)
β βββ Dagoretti North (sub_county)
βββ Mombasa (county)
βββ Kisumu (county)
- Poverty Reduction
- Food Security & Nutrition
- Health & Well-being
- Quality Education
- Gender Equality
- WASH
- Economic Growth
- Infrastructure Development
- Peace & Justice
- Climate Action
- Protection
- Community Empowerment
Auto-created for each category with targets for 2027.
# Create budget workflow tables
mysql -u root -p me_clickup_system < database/migrations/add_budget_request_workflow.sql
# Populate reference data
mysql -u root -p me_clickup_system < database/migrations/populate_reference_data.sqlThe routes are automatically loaded on server restart:
cd backend
npm run devYou should see:
π° Registering Budget Request Workflow routes...
β
Budget Requests routes registered at /api/budget-requests
GET /api/budget-requests- List all requests (with filters)POST /api/budget-requests- Create new requestPUT /api/budget-requests/:id/approve- Approve requestPUT /api/budget-requests/:id/reject- Reject requestPUT /api/budget-requests/:id/return- Return for amendmentsPUT /api/budget-requests/:id/edit- Edit request (finance only)
POST /api/budget-requests/allocate- Allocate budget from one level to anotherGET /api/budget-requests/activity/:activityId/budget- Get activity budget summary
Create UI component for teams to submit budget requests with:
- Activity selection
- Amount input
- Justification text area
- Budget breakdown editor (JSON)
- Priority selection
Create finance dashboard showing:
- Pending requests list
- Request details view
- Approve/Reject/Return/Edit actions
- Comments/notes interface
Add to activity detail page:
- Current budget status
- Allocated vs Spent vs Remaining
- Request new budget button
- Budget request history
Create UI for finance to allocate budgets:
- Source selection (program/sub-program/component)
- Target selection (activity)
- Amount input
- Allocation notes
Finance Module Access Required:
- View all budget requests:
READpermission - Approve/Reject requests:
APPROVEpermission - Edit requests:
UPDATEpermission - Allocate budgets:
CREATEpermission
Activity Managers:
- Can create budget requests for their activities
- Can view status of their requests
- Can resubmit after amendments
- Transparency: All budget requests are tracked and auditable
- Efficiency: Automated workflow reduces manual processes
- Control: Finance team has full control with multiple review options
- Accuracy: Automatic budget calculations prevent errors
- Visibility: Teams can see budget status in real-time
- Accountability: Complete audit trail of all budget decisions
- Check
activity_budgetstable has record for activity - Verify
budget_allocationsrecord was created - Check for database triggers
- Verify
entity_typematches one of the allowed ENUM values - Check
entity_idexists in the referenced table - Ensure user has permission to view entity
- Check
parent_idreferences are correct - Verify foreign key constraints are in place
- Run location verification query
Last Updated: 2026-01-06 Version: 1.0 Status: Ready for Frontend Development