Elwig: Add ITime/XTime to entities and allow to export/import CTime/MTime
All checks were successful
Test / Run tests (push) Successful in 2m30s
All checks were successful
Test / Run tests (push) Successful in 2m30s
This commit is contained in:
@ -18,8 +18,8 @@ namespace Elwig.Models.Dtos {
|
||||
("DefaultKg", "Ort", null, 40),
|
||||
("SortId", "Sorte", null, 10),
|
||||
("Weight", "Menge", "kg", 20),
|
||||
("CreatedTimestamp", "Angemeldet", null, 35),
|
||||
("ModifiedTimestamp", "Geändert", null, 35),
|
||||
("CreatedAt", "Angemeldet", null, 35),
|
||||
("ModifiedAt", "Geändert", null, 35),
|
||||
("Status", "Status", null, 20),
|
||||
];
|
||||
|
||||
@ -47,8 +47,8 @@ namespace Elwig.Models.Dtos {
|
||||
public string? DefaultKg;
|
||||
public string SortId;
|
||||
public string Variety;
|
||||
public DateTime CreatedTimestamp;
|
||||
public DateTime? ModifiedTimestamp;
|
||||
public DateTime CreatedAt;
|
||||
public DateTime? ModifiedAt;
|
||||
public int Weight;
|
||||
public string? Status;
|
||||
|
||||
@ -65,10 +65,10 @@ namespace Elwig.Models.Dtos {
|
||||
DefaultKg = m.DefaultKg?.Name;
|
||||
SortId = a.SortId;
|
||||
Variety = a.Variety.Name;
|
||||
CreatedTimestamp = a.CreatedTimestamp;
|
||||
ModifiedTimestamp = a.ModifiedTimestamp == a.CreatedTimestamp ? null : a.ModifiedTimestamp;
|
||||
CreatedAt = a.CreatedAt;
|
||||
ModifiedAt = a.ModifiedAt == a.CreatedAt ? null : a.ModifiedAt;
|
||||
Weight = a.Weight;
|
||||
Status = s.AncmtTo == null ? null : a.CreatedTimestamp >= s.AncmtTo ? "verspät." : "ok";
|
||||
Status = s.AncmtTo == null ? null : a.CreatedAt >= s.AncmtTo ? "verspät." : "ok";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,14 +41,36 @@ namespace Elwig.Models.Entities {
|
||||
public string? Comment { get; set; }
|
||||
|
||||
[Column("ctime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long CTime { get; private set; }
|
||||
public long CTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime CreatedTimestamp => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
public DateTime CreatedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
set => CTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("mtime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long MTime { get; private set; }
|
||||
public long MTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime ModifiedTimestamp => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
public DateTime ModifiedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
set => MTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("xtime")]
|
||||
public long? XTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ExportedAt {
|
||||
get => XTime == null ? null : DateTimeOffset.FromUnixTimeSeconds(XTime.Value).LocalDateTime;
|
||||
set => XTime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("itime")]
|
||||
public long? ITime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ImportedAt {
|
||||
get => ITime == null ? null : DateTimeOffset.FromUnixTimeSeconds(ITime.Value).LocalDateTime;
|
||||
set => ITime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[ForeignKey("MgNr")]
|
||||
public virtual Member Member { get; private set; } = null!;
|
||||
|
@ -84,14 +84,36 @@ namespace Elwig.Models.Entities {
|
||||
}
|
||||
|
||||
[Column("ctime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long CTime { get; private set; }
|
||||
public long CTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime CreatedTimestamp => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
public DateTime CreatedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
set => CTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("mtime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long MTime { get; private set; }
|
||||
public long MTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime ModifiedTimestamp => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
public DateTime ModifiedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
set => MTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("xtime")]
|
||||
public long? XTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ExportedAt {
|
||||
get => XTime == null ? null : DateTimeOffset.FromUnixTimeSeconds(XTime.Value).LocalDateTime;
|
||||
set => XTime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("itime")]
|
||||
public long? ITime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ImportedAt {
|
||||
get => ITime == null ? null : DateTimeOffset.FromUnixTimeSeconds(ITime.Value).LocalDateTime;
|
||||
set => ITime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[ForeignKey("Year, AvNr, MgNr")]
|
||||
public virtual PaymentMember Payment { get; private set; } = null!;
|
||||
|
@ -62,14 +62,36 @@ namespace Elwig.Models.Entities {
|
||||
public string? Comment { get; set; }
|
||||
|
||||
[Column("ctime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long CTime { get; private set; }
|
||||
public long CTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime CreatedTimestamp => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
public DateTime CreatedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
set => CTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("mtime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long MTime { get; private set; }
|
||||
public long MTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime ModifiedTimestamp => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
public DateTime ModifiedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
set => MTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("xtime")]
|
||||
public long? XTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ExportedAt {
|
||||
get => XTime == null ? null : DateTimeOffset.FromUnixTimeSeconds(XTime.Value).LocalDateTime;
|
||||
set => XTime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("itime")]
|
||||
public long? ITime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ImportedAt {
|
||||
get => ITime == null ? null : DateTimeOffset.FromUnixTimeSeconds(ITime.Value).LocalDateTime;
|
||||
set => ITime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[ForeignKey("Year")]
|
||||
public virtual Season Season { get; private set; } = null!;
|
||||
|
@ -27,14 +27,36 @@ namespace Elwig.Models.Entities {
|
||||
public required string Type { get; set; }
|
||||
|
||||
[Column("ctime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long CTime { get; private set; }
|
||||
public long CTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime CreatedTimestamp => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
public DateTime CreatedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
set => CTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("mtime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long MTime { get; private set; }
|
||||
public long MTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime ModifiedTimestamp => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
public DateTime ModifiedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
set => MTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("xtime")]
|
||||
public long? XTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ExportedAt {
|
||||
get => XTime == null ? null : DateTimeOffset.FromUnixTimeSeconds(XTime.Value).LocalDateTime;
|
||||
set => XTime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("itime")]
|
||||
public long? ITime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ImportedAt {
|
||||
get => ITime == null ? null : DateTimeOffset.FromUnixTimeSeconds(ITime.Value).LocalDateTime;
|
||||
set => ITime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[ForeignKey("Year, DsNr")]
|
||||
public virtual DeliverySchedule Schedule { get; private set; } = null!;
|
||||
|
@ -129,14 +129,36 @@ namespace Elwig.Models.Entities {
|
||||
public string? Comment { get; set; }
|
||||
|
||||
[Column("ctime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long CTime { get; private set; }
|
||||
public long CTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime CreatedTimestamp => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
public DateTime CreatedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
set => CTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("mtime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long MTime { get; private set; }
|
||||
public long MTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime ModifiedTimestamp => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
public DateTime ModifiedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
set => MTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("xtime")]
|
||||
public long? XTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ExportedAt {
|
||||
get => XTime == null ? null : DateTimeOffset.FromUnixTimeSeconds(XTime.Value).LocalDateTime;
|
||||
set => XTime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("itime")]
|
||||
public long? ITime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ImportedAt {
|
||||
get => ITime == null ? null : DateTimeOffset.FromUnixTimeSeconds(ITime.Value).LocalDateTime;
|
||||
set => ITime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[InverseProperty(nameof(DeliveryPartModifier.Part))]
|
||||
public virtual ICollection<DeliveryPartModifier> PartModifiers { get; private set; } = null!;
|
||||
|
@ -145,14 +145,36 @@ namespace Elwig.Models.Entities {
|
||||
public AT_Kg? DefaultKg => DefaultWbKg?.AtKg;
|
||||
|
||||
[Column("ctime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long CTime { get; private set; }
|
||||
public long CTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime CreatedTimestamp => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
public DateTime CreatedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
set => CTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("mtime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long MTime { get; private set; }
|
||||
public long MTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime ModifiedTimestamp => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
public DateTime ModifiedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
set => MTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("xtime")]
|
||||
public long? XTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ExportedAt {
|
||||
get => XTime == null ? null : DateTimeOffset.FromUnixTimeSeconds(XTime.Value).LocalDateTime;
|
||||
set => XTime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("itime")]
|
||||
public long? ITime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ImportedAt {
|
||||
get => ITime == null ? null : DateTimeOffset.FromUnixTimeSeconds(ITime.Value).LocalDateTime;
|
||||
set => ITime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[ForeignKey("ZwstId")]
|
||||
public virtual Branch? Branch { get; private set; }
|
||||
|
@ -46,14 +46,36 @@ namespace Elwig.Models.Entities {
|
||||
public required string Data { get; set; }
|
||||
|
||||
[Column("ctime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long CTime { get; private set; }
|
||||
public long CTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime CreatedTimestamp => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
public DateTime CreatedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(CTime).LocalDateTime;
|
||||
set => CTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("mtime"), DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
public long MTime { get; private set; }
|
||||
public long MTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime ModifiedTimestamp => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
public DateTime ModifiedAt {
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(MTime).LocalDateTime;
|
||||
set => MTime = ((DateTimeOffset)value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("xtime")]
|
||||
public long? XTime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ExportedAt {
|
||||
get => XTime == null ? null : DateTimeOffset.FromUnixTimeSeconds(XTime.Value).LocalDateTime;
|
||||
set => XTime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[Column("itime")]
|
||||
public long? ITime { get; set; }
|
||||
[NotMapped]
|
||||
public DateTime? ImportedAt {
|
||||
get => ITime == null ? null : DateTimeOffset.FromUnixTimeSeconds(ITime.Value).LocalDateTime;
|
||||
set => ITime = value == null ? null : ((DateTimeOffset)value.Value.ToUniversalTime()).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
[ForeignKey("Year")]
|
||||
public virtual Season Season { get; private set; } = null!;
|
||||
|
Reference in New Issue
Block a user