package com.alttd.altitudeweb.database.votingplugin;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Optional;
import java.util.UUID;

public interface VotingPluginUsersMapper {

    @Select("""
             SELECT
                 LastVotes as lastVotes,
                 BestDayVoteStreak as bestDailyStreak,
                 BestWeekVoteStreak as bestWeeklyStreak,
                 BestMonthVoteStreak as bestMonthlyStreak,
                 DayVoteStreak as dailyStreak,
                 WeekVoteStreak as weeklyStreak,
                 MonthVoteStreak as monthlyStreak,
                 DailyTotal as totalVotesToday,
                 WeeklyTotal as totalVotesThisWeek,
                 MonthTotal as totalVotesThisMonth,
                 AllTimeTotal as totalVotesAllTime
             FROM votingplugin.VotingPlugin_Users
             WHERE uuid = #{uuid}
            """)
    Optional<VotingStatsRow> getStatsByUuid(@Param("uuid") UUID uuid);
}
