fix issues

This commit is contained in:
2026-01-02 00:21:24 +01:00
parent 79913bb45e
commit 8693dde21e
46 changed files with 1680 additions and 302 deletions

View File

@@ -115,15 +115,21 @@ export class CloseAdminVoteSessionUseCase {
/**
* Create rating events from vote outcome
* Events are created for the admin being voted on
* Per plans: no events are created for tie outcomes
*/
private async createRatingEvents(session: any, outcome: any): Promise<number> {
let eventsCreated = 0;
// Don't create events for tie outcomes
if (outcome.outcome === 'tie') {
return 0;
}
// Use RatingEventFactory to create vote outcome events
const voteInput = {
userId: session.adminId, // The admin being voted on
voteSessionId: session.id,
outcome: (outcome.outcome === 'positive' ? 'positive' : 'negative') as 'positive' | 'negative',
outcome: outcome.outcome as 'positive' | 'negative',
voteCount: outcome.count.total,
eligibleVoterCount: outcome.eligibleVoterCount,
percentPositive: outcome.percentPositive,