summarize bank accounts
This commit is contained in:
26
ReallifeGamemode.Server/Entities/BankAccount.cs
Normal file
26
ReallifeGamemode.Server/Entities/BankAccount.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using ReallifeGamemode.Server.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public abstract class BankAccount
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[StringLength(12)]
|
||||
public string Bic { get; set; }
|
||||
|
||||
[StringLength(32)]
|
||||
public string Iban { get; set; }
|
||||
|
||||
public virtual int Balance { get; set; }
|
||||
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -9,15 +9,12 @@ using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public class BusinessBankAccount : IBankAccount
|
||||
public class BusinessBankAccount : BankAccount, IBankAccount
|
||||
{
|
||||
[NotMapped]
|
||||
private int _balance;
|
||||
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public int Balance
|
||||
public override int Balance
|
||||
{
|
||||
get => _balance;
|
||||
set
|
||||
|
||||
@@ -13,19 +13,11 @@ using System.Text;
|
||||
*/
|
||||
namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public class FactionBankAccount : IBankAccount
|
||||
public class FactionBankAccount : BankAccount, IBankAccount
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Faction")]
|
||||
public int FactionId { get; set; }
|
||||
|
||||
public Faction Faction { get; set; }
|
||||
[StringLength(12)]
|
||||
public string Bic { get; set; }
|
||||
[StringLength(32)]
|
||||
public string Iban { get; set; }
|
||||
public int Balance { get; set; }
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,8 @@ using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public class GroupBankAccount : IBankAccount
|
||||
public class GroupBankAccount : BankAccount, IBankAccount
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
|
||||
public Group Group { get; set; }
|
||||
|
||||
public int Balance { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,22 +13,17 @@ using System.Linq;
|
||||
|
||||
namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public class UserBankAccount : IBankAccount
|
||||
public class UserBankAccount : BankAccount, IBankAccount
|
||||
{
|
||||
[NotMapped]
|
||||
private int _balance;
|
||||
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("User")]
|
||||
public int UserId { get; set; }
|
||||
|
||||
public User User { get; set; }
|
||||
[StringLength(12)]
|
||||
public string Bic { get; set; }
|
||||
[StringLength(32)]
|
||||
public string Iban { get; set; }
|
||||
public int Balance
|
||||
|
||||
public override int Balance
|
||||
{
|
||||
get => _balance;
|
||||
set
|
||||
@@ -40,6 +35,5 @@ namespace ReallifeGamemode.Server.Entities
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user