Commit d42828d2 authored by Clint.Network's avatar Clint.Network

Add amount to participation and retrieve all Participation object

parent 4e0bc775
...@@ -4,7 +4,7 @@ namespace Stratis.Guru.Models ...@@ -4,7 +4,7 @@ namespace Stratis.Guru.Models
{ {
public interface IParticipation public interface IParticipation
{ {
void StoreParticipation(string ticket, string nickname, string address); void StoreParticipation(string ticket, string nickname, string address, double amount);
List<string> GetPlayers(string draw); List<Participation> GetPlayers(string draw);
} }
} }
\ No newline at end of file
...@@ -12,5 +12,6 @@ namespace Stratis.Guru.Models ...@@ -12,5 +12,6 @@ namespace Stratis.Guru.Models
public BsonDateTime CreationDate { get; set; } public BsonDateTime CreationDate { get; set; }
public string Nickname { get; internal set; } public string Nickname { get; internal set; }
public string Draw { get; internal set; } public string Draw { get; internal set; }
public double Amount { get; internal set; }
} }
} }
\ No newline at end of file
...@@ -16,9 +16,9 @@ namespace Stratis.Guru.Models ...@@ -16,9 +16,9 @@ namespace Stratis.Guru.Models
_draws = draws; _draws = draws;
} }
public List<string> GetPlayers(string draw) => _databaseContext.Participations.Find(x => x.Draw.Equals(draw)).ToList().Select(x => x.Nickname).Distinct().ToList(); public List<Participation> GetPlayers(string draw) => _databaseContext.Participations.Find(x => x.Draw.Equals(draw)).ToList();
public void StoreParticipation(string ticket, string nickname, string address) public void StoreParticipation(string ticket, string nickname, string address, double amount)
{ {
_databaseContext.Participations.InsertOne(new Participation _databaseContext.Participations.InsertOne(new Participation
{ {
...@@ -26,7 +26,8 @@ namespace Stratis.Guru.Models ...@@ -26,7 +26,8 @@ namespace Stratis.Guru.Models
Ticket = ticket, Ticket = ticket,
Nickname = nickname, Nickname = nickname,
WithdrawAddress = address, WithdrawAddress = address,
Draw = _draws.GetLastDraw() Draw = _draws.GetLastDraw(),
Amount = amount
}); });
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment