mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 05:57:00 +01:00
- getDashboardStats: add 4 prev-month queries (parallel in same Promise.allSettled) - MissionDelta type: devicesProcessed/devicesSold/itHilfeCompleted/workshopAttendees - DashboardStats.delta: this month minus last month for each mission metric - MissionMetrics: DeltaBadge component shows +N (green) / -N (red) / ±0 (grey) - Migration: activity_feed table with actor_id, action, subject_type/id/label - activityFeed Drizzle schema in misc.ts - logActivity() helper — fire-and-forget, never throws - TeamActivityFeed server component — last 10 events joined with users - Monatsueberblick accepts children prop; 'lead' mode renders TeamActivityFeed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
659 B
SQL
16 lines
659 B
SQL
-- Team activity feed — lightweight event log for the dashboard
|
|
-- Written to from service functions after successful actions.
|
|
-- Read by TeamActivityFeed server component for 'lead' dashboard mode.
|
|
|
|
CREATE TABLE IF NOT EXISTS "activity_feed" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
"actor_id" uuid NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
|
|
"action" text NOT NULL,
|
|
"subject_type" text,
|
|
"subject_id" text,
|
|
"subject_label" text,
|
|
"created_at" timestamptz NOT NULL DEFAULT now()
|
|
);--> statement-breakpoint
|
|
|
|
CREATE INDEX IF NOT EXISTS "idx_activity_feed_created" ON "activity_feed"("created_at" DESC);--> statement-breakpoint
|