back photo + event tags and persons

This commit is contained in:
2025-08-10 20:07:40 +02:00
parent 0cc8bddfa1
commit f61b48fa4b
46 changed files with 1438 additions and 189 deletions

View File

@@ -0,0 +1,36 @@
namespace back.DataModels;
public class RankingModel
{
private int totalVotes;
private int upVotes;
private int downVotes;
public RankingModel(int totalVotes, int upVotes = 0, int downVotes = 0)
{
this.totalVotes = totalVotes;
this.upVotes = upVotes;
this.downVotes = downVotes;
}
public void DownVote()
{
downVotes++;
totalVotes++;
}
public void UpVote()
{
upVotes++;
totalVotes++;
}
public double Score
{
get
{
if (totalVotes == 0) return 0;
return (double)(upVotes - downVotes) / totalVotes;
}
}
}