fix issues
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user