feat(esppApi): Добавлено поле ExpirationDate в модель EsppOrder
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using PARR.EsppApi.Settings;
|
||||
using System.Globalization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PARR.EsppApi.Models
|
||||
@@ -10,14 +11,33 @@ namespace PARR.EsppApi.Models
|
||||
{
|
||||
[JsonPropertyName("recordid")]
|
||||
public string Number { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("assignment")]
|
||||
public string? WorkGroup { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public string Status { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("title")]
|
||||
public string ShortName { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("templateName")]
|
||||
public string TemplateName { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("expirationDate")]
|
||||
public string ExpirationDate { get; set; } = string.Empty;
|
||||
|
||||
public DateTimeOffset ExpirationDateUTC
|
||||
{
|
||||
get
|
||||
{
|
||||
var dateTime = DateTime.ParseExact(ExpirationDate, "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture);
|
||||
var utc = dateTime.AddHours(-EsppUserTimeZoneSettings.TimeZone);
|
||||
|
||||
return new DateTimeOffset(utc, new TimeSpan(0));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user