Phase 3.2 WS2: Mitra request activity log + control center page
- DB migration: add active_session_count column + mitra_notified index - Constants: add MISSED to NotificationResponse - Pairing service: record active_session_count on notification creation, use MISSED (not IGNORED) when another mitra accepts first - New mitra-activity.service.js: getMitraActivityLog (paginated), getMitraActivitySummary (per-mitra aggregates with acceptance rate) - New mitra-activity.routes.js: GET /internal/mitra-activity/log, GET /internal/mitra-activity/summary - Control center: new MitraActivityPage with summary table + detail log, filters (mitra, date range), color-coded response types, pagination - Register route in App.jsx, add "Aktivitas Mitra" nav link in Layout Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -288,6 +288,18 @@ const migrate = async () => {
|
||||
ON CONFLICT (key) DO NOTHING
|
||||
`
|
||||
|
||||
// --- Phase 3.2: Mitra Request Activity Log ---
|
||||
|
||||
await sql`
|
||||
ALTER TABLE chat_request_notifications
|
||||
ADD COLUMN IF NOT EXISTS active_session_count INT NOT NULL DEFAULT 0
|
||||
`
|
||||
|
||||
await sql`
|
||||
CREATE INDEX IF NOT EXISTS idx_chat_request_notifications_mitra_notified
|
||||
ON chat_request_notifications (mitra_id, notified_at)
|
||||
`
|
||||
|
||||
console.log('Migration complete.')
|
||||
await sql.end()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user