import { prisma } from './prisma' export type ActivityType = | 'player_registration' | 'tournament_created' | 'match_completed' | 'partnership_recorded' export interface ActivityData { type: ActivityType description: string userId?: string playerId?: number eventId?: number matchId?: number } export async function logActivity(data: ActivityData) { return prisma.activity.create({ data: { type: data.type, description: data.description, userId: data.userId, playerId: data.playerId, eventId: data.eventId, matchId: data.matchId, }, }) }