Update UI result

This commit is contained in:
Aditya Siregar
2025-08-16 01:51:37 +07:00
parent 228f6a78c9
commit 104cd987e9
7 changed files with 109 additions and 16 deletions
@@ -119,4 +119,22 @@ func (r *VoteEventRepositoryImpl) GetVoteResults(ctx context.Context, eventID uu
}
return resultMap, nil
}
func (r *VoteEventRepositoryImpl) GetVotedCount(ctx context.Context, eventID uuid.UUID) (int64, error) {
var count int64
err := r.db.WithContext(ctx).
Model(&entities.Vote{}).
Where("vote_event_id = ?", eventID).
Count(&count).Error
return count, err
}
func (r *VoteEventRepositoryImpl) GetTotalActiveUsersCount(ctx context.Context) (int64, error) {
var count int64
err := r.db.WithContext(ctx).
Model(&entities.User{}).
Where("is_active = ?", true).
Count(&count).Error
return count, err
}