# RE Workflow - Developer Action Checklist
## Week-by-Week Task List for Developers

**Current Week:** Week 2  
**Target Launch:** End of December 2025

---

## 🔥 WEEK 2 (THIS WEEK) - Complete Foundation

### Backend Developer Tasks (3 days)

#### Day 1: Database Setup
- [ ] Install PostgreSQL 16
- [ ] Create database `re_workflow_db`
- [ ] Run schema SQL from `RE_Workflow_Complete_Project_Setup.md` (lines 980-1427)
- [ ] Verify all 15 tables created
- [ ] Test database connection
- [ ] ✅ Deliverable: Database ready

#### Day 2: Express & Middleware
- [ ] Complete `src/app.ts` (Express setup)
- [ ] Configure helmet, cors, body-parser
- [ ] Setup Winston logger
- [ ] Create error handler middleware
- [ ] Test `/health` endpoint
- [ ] ✅ Deliverable: Server running

#### Day 3: Sequelize Models
- [ ] Configure Sequelize connection
- [ ] Create models:
  - [ ] User.ts
  - [ ] WorkflowRequest.ts
  - [ ] ApprovalLevel.ts
  - [ ] Participant.ts
  - [ ] Document.ts
  - [ ] WorkNote.ts
  - [ ] Activity.ts
  - [ ] Notification.ts
  - [ ] TATTracking.ts
  - [ ] ConclusionRemark.ts
- [ ] Define model associations
- [ ] Test queries
- [ ] ✅ Deliverable: ORM working

---

### Frontend Developer Tasks (4 days)

#### Day 1: Complete UI Extraction
- [ ] Finish remaining 20% of Figma components
- [ ] Fix any styling bugs
- [ ] Test mobile responsive (320px - 1920px)
- [ ] Ensure all dummy data displays
- [ ] ✅ Deliverable: 100% UI extraction

#### Day 2-3: Redux Store Setup (CRITICAL)
- [ ] Create `src/redux/store.ts`
- [ ] Create `src/redux/hooks.ts`
- [ ] Create slices:
  - [ ] authSlice.ts
  - [ ] workflowSlice.ts
  - [ ] approvalSlice.ts
  - [ ] notificationSlice.ts
  - [ ] documentSlice.ts
  - [ ] workNoteSlice.ts
  - [ ] participantSlice.ts
  - [ ] uiSlice.ts
- [ ] Configure Redux DevTools
- [ ] Setup Redux persist
- [ ] ✅ Deliverable: Redux working

#### Day 4: Axios API Layer (CRITICAL)
- [ ] Create `src/services/api.ts` (Axios instance)
- [ ] Setup request interceptor (add JWT)
- [ ] Setup response interceptor (handle errors)
- [ ] Create service files:
  - [ ] auth.service.ts
  - [ ] workflow.service.ts
  - [ ] approval.service.ts
  - [ ] document.service.ts
  - [ ] notification.service.ts
  - [ ] workNote.service.ts
  - [ ] participant.service.ts
  - [ ] dashboard.service.ts
  - [ ] user.service.ts
- [ ] Create PrivateRoute component
- [ ] ✅ Deliverable: API layer ready

---

## WEEK 3: SSO Authentication

### Backend (2 days)
- [ ] Configure SSO Bridge (config/sso.ts)
- [ ] Implement SSO callback handler
- [ ] User sync from Active Directory
- [ ] Generate JWT tokens
- [ ] Auth middleware
- [ ] APIs:
  - [ ] GET /api/v1/auth/login (redirect to SSO)
  - [ ] GET /api/v1/auth/callback (handle SSO)
  - [ ] POST /api/v1/auth/logout
  - [ ] GET /api/v1/auth/me
  - [ ] GET /api/v1/users/search

### Frontend (1.5 days)
- [ ] Create SSO callback page
- [ ] Handle token from SSO
- [ ] Store JWT in Redux + localStorage
- [ ] Implement protected routes
- [ ] Add logout button in header
- [ ] Fetch and display user profile

---

## WEEK 4-5: Workflow Creation Wizard

### Backend (1 week)
- [ ] POST /api/v1/workflows (create workflow)
- [ ] POST /api/v1/workflows/:id/approvals (add level)
- [ ] POST /api/v1/workflows/:id/participants (add spectator)
- [ ] POST /api/v1/workflows/:id/documents (upload file)
- [ ] PATCH /api/v1/workflows/:id/submit (submit workflow)
- [ ] GET /api/v1/workflows (list with filters)
- [ ] TAT calculation logic (working days vs calendar days)

### Frontend (1.5 weeks)
- [ ] Step 1: Template selection → Redux
- [ ] Step 2: Basic info (title, description, priority) → Redux + validation
- [ ] Step 3: Approval workflow builder
  - [ ] Dynamic levels (add/remove)
  - [ ] User @mention search
  - [ ] TAT calculation (real-time)
  - [ ] Approval flow summary
- [ ] Step 4: Spectators (@mention)
- [ ] Step 5: Document upload (react-dropzone)
- [ ] Step 6: Review & submit
- [ ] Multi-step API submission flow

**Most Time-Consuming:** Step 3 (approval builder) - 2-3 days

---

## WEEK 6-7: Approvals & TAT Tracking

### Backend (1.5 weeks)
- [ ] PATCH /api/v1/workflows/:id/approvals/:levelId/approve
- [ ] PATCH /api/v1/workflows/:id/approvals/:levelId/reject
- [ ] Approval state machine logic
- [ ] TAT monitoring cron job (runs every 30 min)
- [ ] Notification system (8 notification types)
- [ ] Activity logging service

### Frontend (2 weeks)
- [ ] My Requests page (tabs, search, filter, pagination)
- [ ] Open/Closed Requests pages
- [ ] Request Detail page:
  - [ ] Overview tab
  - [ ] Workflow tab (approval timeline)
  - [ ] Documents tab (preview, download)
  - [ ] Activity tab (timeline)
- [ ] TAT progress bar (color-coded)
- [ ] Approve/Reject modals (with validation)
- [ ] Notification bell with dropdown

**Most Time-Consuming:** Request detail page with all tabs - 3-4 days

---

## WEEK 8: Documents & Work Notes

### Backend (3 days)
- [ ] Document storage (GCP Cloud Storage)
- [ ] Document APIs (upload, download, preview)
- [ ] Work notes APIs
- [ ] @mention parsing and notifications
- [ ] Emoji reactions

### Frontend (2 days)
- [ ] Connect work notes to backend (already has UI + emoji!)
- [ ] Connect document upload with progress bar
- [ ] PDF/image preview modal
- [ ] File download functionality

**Advantage:** Work notes UI already complete!

---

## WEEK 9: Dashboard & AI

### Backend (3 days)
- [ ] Dashboard statistics APIs
- [ ] OpenAI/Gemini integration
- [ ] AI conclusion generation
- [ ] Workflow closure API

### Frontend (3 days)
- [ ] Dashboard with charts (Recharts)
- [ ] Conclusion display & edit
- [ ] Close workflow functionality
- [ ] Search & filter components

---

## WEEK 10: Testing & Deployment

### Backend (4 days)
- [ ] Unit tests (Jest + ts-jest)
- [ ] Integration tests (Supertest)
- [ ] Swagger documentation
- [ ] Performance optimization
- [ ] Docker + CI/CD
- [ ] Deploy to GCP

### Frontend (4 days)
- [ ] Component tests (Vitest)
- [ ] Integration tests
- [ ] Loading states everywhere
- [ ] Error boundaries
- [ ] Production build
- [ ] Docker + CI/CD
- [ ] Deploy to GCP

---

## 🎯 Daily Developer Checklist

### Before Starting Any Task:
- [ ] Is the prerequisite task complete?
- [ ] Do I have all required information?
- [ ] Is the backend API ready (for frontend tasks)?

### While Working:
- [ ] Following TypeScript strict mode
- [ ] Adding proper error handling
- [ ] Adding loading states
- [ ] Writing clean, commented code
- [ ] Testing as I build

### Before Marking Complete:
- [ ] Feature works end-to-end
- [ ] Handles errors gracefully
- [ ] Responsive on mobile
- [ ] Code reviewed
- [ ] Committed to Git

---

## 📞 Quick Communication

### Blockers:
- Backend waiting on SSO details? → Continue with non-auth features
- Frontend waiting on APIs? → Work on UI polish, validations, Redux

### Daily Standup (15 min):
1. What did I complete yesterday?
2. What am I working on today?
3. Any blockers or questions?

---

**Last Updated:** October 23, 2025  
**Next Review:** Weekly (every Friday)

