DeliveryAncmtList: Add status to indicate late ancmts

This commit is contained in:
2024-09-02 23:10:37 +02:00
parent 6627ab6d12
commit 141086673f
5 changed files with 29 additions and 9 deletions

View File

@ -17,6 +17,9 @@ namespace Elwig.Models.Dtos {
("Name2", "Vorname", null, 40),
("SortId", "Sorte", null, 10),
("Weight", "Gewicht", "kg", 20),
("CreatedTimestamp", "Angemeldet", null, 35),
("ModifiedTimestamp", "Geändert", null, 35),
("Status", "Status", null, 20),
];
public DeliveryAncmtListData(IEnumerable<DeliveryAncmtListRow> rows, List<string> filterNames) :
@ -42,7 +45,10 @@ namespace Elwig.Models.Dtos {
public string AdministrativeName;
public string SortId;
public string Variety;
public DateTime CreatedTimestamp;
public DateTime? ModifiedTimestamp;
public int Weight;
public string? Status;
public DeliveryAncmtListRow(DeliveryAncmt a) {
var s = a.Schedule;
@ -56,7 +62,10 @@ namespace Elwig.Models.Dtos {
AdministrativeName = m.AdministrativeName;
SortId = a.SortId;
Variety = a.Variety.Name;
CreatedTimestamp = a.CreatedTimestamp;
ModifiedTimestamp = a.ModifiedTimestamp == a.CreatedTimestamp ? null : a.ModifiedTimestamp;
Weight = a.Weight;
Status = s.AncmtTo == null ? null : a.CreatedTimestamp >= s.AncmtTo ? "verspät." : "ok";
}
}
}