AfRApay/AfRApay.Web/Backend/Tables/User.cs
embr 0bf9843c1f AfRApay.Web: Make transactions idempotent
First rule of networking is the network is unreliable. Sometimes things get
lost, sometimes it gets found multiple times for TCP reasons or because a
browser tries to be clever.

And when you're dealing with money, even if it's monopoly money, you don't
want a duplicated request to mean a double-debit. The easiest way to do this
is to simply include an idempotency key with each request - if that key is
repeated, the request is ignored.
2023-02-09 00:24:11 +01:00

14 lines
546 B
C#

using LinqToDB.Mapping;
#pragma warning disable CS8618
namespace AfRApay.Web.Backend.Tables;
[Table(Name = "Users")]
public class User {
[Column(Name = "ID"), PrimaryKey, Identity, NotNull] public int Id { get; set; }
[Column(Name = "Nickname"), NotNull] public string Nickname { get; set; }
[Column(Name = "Balance")] public decimal Balance { get; set; }
[Column(Name = "LastIdempotencyKey")] public string LastIdempotencyKey { get; set; }
}