[WIP] Tara
Test / Run tests (push) Successful in 2m45s

This commit is contained in:
2026-09-14 10:32:14 +02:00
parent fea779bd95
commit dbc1363213
6 changed files with 33 additions and 6 deletions
+3 -2
View File
@@ -124,7 +124,7 @@ namespace Elwig.Models.Entities {
[Column("weighing_data")]
public string? WeighingData { get; set; }
[NotMapped]
public (string? ScaleId, string? Id, int? Gross, int? Tare, int? Net, DateOnly? Date, TimeOnly? Time) WeighingInfo {
public (string? ScaleId, string? Id, int? Gross, int? Tare, int? TareCorrection, int? Net, DateOnly? Date, TimeOnly? Time) WeighingInfo {
get {
try {
var obj = JsonNode.Parse(WeighingData!)!.AsObject();
@@ -133,12 +133,13 @@ namespace Elwig.Models.Entities {
obj["id"]?.AsValue().GetValue<string>(),
obj["gross_weight"]?.AsValue().GetValue<int>(),
obj["tare_weight"]?.AsValue().GetValue<int>(),
obj["tare_correction"]?.AsValue().GetValue<int>(),
obj["net_weight"]?.AsValue().GetValue<int>(),
DateOnly.TryParseExact(obj["date"]?.AsValue().GetValue<string>(), "yyyy-MM-dd", out var d) ? d : null,
TimeOnly.TryParseExact(obj["time"]?.AsValue().GetValue<string>(), ["HH:mm:ss", "HH:mm"], out var t) ? t : null
);
} catch {
return (null, null, null, null, null, null, null);
return (null, null, null, null, null, null, null, null);
}
}
}