44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using PARR.EsppApi.Settings;
|
|
using System.Globalization;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace PARR.EsppApi.Models
|
|
{
|
|
/// <summary>
|
|
/// Модель наряда из еспп
|
|
/// </summary>
|
|
public class EsppOrder
|
|
{
|
|
[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));
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|