Models: Add Credit

This commit is contained in:
2023-09-12 21:40:04 +02:00
parent 30aaa64f59
commit 5ad8c88319
7 changed files with 284 additions and 17 deletions

View File

@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models {
[Table("payment_member"), PrimaryKey("Year", "AvNr", "MgNr"), Index("Year", "TgNr", IsUnique = true)]
[Table("payment_member"), PrimaryKey("Year", "AvNr", "MgNr")]
public class PaymentMember {
[Column("year")]
public int Year { get; set; }
@ -16,9 +16,6 @@ namespace Elwig.Models {
[Column("amount")]
public long AmountValue { get; set; }
[Column("tgnr")]
public int? TgNr { get; set; }
[NotMapped]
public decimal Amount {
get => Variant.Season.DecFromDb(AmountValue);
@ -30,5 +27,8 @@ namespace Elwig.Models {
[ForeignKey("MgNr")]
public virtual Member Member { get; private set; }
[InverseProperty("Payment")]
public virtual Credit? Credit { get; private set; }
}
}