Billing: Add possibility to automatically add business shares
This commit is contained in:
31
Elwig/Models/Entities/MemberHistory.cs
Normal file
31
Elwig/Models/Entities/MemberHistory.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Elwig.Models.Entities {
|
||||
[Table("member_history"), PrimaryKey("MgNr", "DateString")]
|
||||
public class MemberHistory {
|
||||
[Column("mgnr")]
|
||||
public int MgNr { get; set; }
|
||||
|
||||
[Column("date")]
|
||||
public string DateString { get; set; }
|
||||
[NotMapped]
|
||||
public DateOnly Date {
|
||||
get => DateOnly.ParseExact(DateString, "yyyy-MM-dd");
|
||||
set => value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
[Column("business_shares")]
|
||||
public int BusinessShares { get; set; }
|
||||
|
||||
[Column("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[Column("comment")]
|
||||
public string? Comment { get; set; }
|
||||
|
||||
[ForeignKey("MgNr")]
|
||||
public virtual Member Member { get; private set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user