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,6 +2,7 @@ using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
namespace Elwig.Models {
[Table("payment_variant"), PrimaryKey("Year", "AvNr")]
@ -66,6 +67,10 @@ namespace Elwig.Models {
[Column("bucket_9_name")]
public string? Bucket9Name { get; set; }
[NotMapped]
public string[] BucketNames => (new string?[] { Bucket1Name, Bucket2Name, Bucket3Name, Bucket4Name, Bucket5Name, Bucket6Name, Bucket7Name, Bucket8Name, Bucket9Name })
.Where(n => n != null).Select(n => n ?? "").ToArray();
[Column("comment")]
public string? Comment { get; set; }
@ -77,5 +82,8 @@ namespace Elwig.Models {
[InverseProperty("Variant")]
public virtual ISet<PaymentMember> MemberPayments { get; private set; }
[InverseProperty("Variant")]
public virtual ISet<Credit> Credits { get; private set; }
}
}