Files
GMW/services/backend/src/modules/dashboard/dashboard.service.ts
T
asepharyana 9a2fa999bf fix(voice): proper shadcn select dropdowns + top reactors leaderboard
- ui/select: trigger default w-full h-9 (was w-fit h-8 — selects rendered
  tiny/misaligned); callers keep size override via className
- VoiceConnectionCard: labeled full-width h-10 selects (Server/Guild +
  Voice Channel), guild icon + name in options, channel type icon +
  'no akses' tag, empty states, htmlFor/id a11y wiring
- GuildSelector sidebar + messages channel filter bumped to match
- Backend GET /api/dashboard/reactors: top users by net reactions given
  (adds-removes) + messages_reacted + emojis_used
- Reactions tab: second 'Top reaktor' leaderboard panel
2026-08-05 11:29:56 +07:00

59 lines
1.6 KiB
TypeScript

import { createChildLogger } from "@/shared/logger/index";
import { dashboardRepository } from "./dashboard.repository.js";
const logger = createChildLogger("dashboard.service");
export interface ListUsersQuery {
limit: number;
cursor?: string;
search?: string;
}
export class DashboardService {
async getStats() {
logger.debug("Fetching dashboard stats");
return dashboardRepository.getStats();
}
async getActivity(days: number) {
logger.debug({ days }, "Fetching dashboard activity");
return dashboardRepository.getActivity(days);
}
async listUsers(query: ListUsersQuery) {
logger.debug({ query }, "Listing dashboard users");
return dashboardRepository.listUsers(query);
}
async getUserDetail(userId: string) {
logger.debug({ userId }, "Fetching user detail");
return dashboardRepository.getUserDetail(userId);
}
async listChannels(query: {
limit: number;
search?: string;
guildId?: string;
}) {
logger.debug({ query }, "Listing dashboard channels");
return dashboardRepository.listChannels(query);
}
async getChannelDetail(channelId: string) {
logger.debug({ channelId }, "Fetching channel detail");
return dashboardRepository.getChannelDetail(channelId);
}
async getTopReactions(limit: number) {
logger.debug({ limit }, "Fetching top reactions");
return dashboardRepository.getTopReactions(limit);
}
async getTopReactors(limit: number) {
logger.debug({ limit }, "Fetching top reactors");
return dashboardRepository.getTopReactors(limit);
}
}
export const dashboardService = new DashboardService();