2023-10-25 10:21:18 +10:00
|
|
|
|
using PARR.EsppApi.Settings;
|
|
|
|
|
|
using System.Globalization;
|
2023-10-24 12:10:19 +10:00
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PARR.EsppApi.Models
|
2023-10-19 15:59:57 +10:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Модель наряда из еспп
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class EsppOrder
|
|
|
|
|
|
{
|
2023-10-24 12:10:19 +10:00
|
|
|
|
[JsonPropertyName("recordid")]
|
2023-10-23 13:50:43 +10:00
|
|
|
|
public string Number { get; set; } = string.Empty;
|
2023-10-25 10:21:18 +10:00
|
|
|
|
|
2023-10-24 12:10:19 +10:00
|
|
|
|
[JsonPropertyName("assignment")]
|
2023-10-23 13:50:43 +10:00
|
|
|
|
public string? WorkGroup { get; set; }
|
2023-10-25 10:21:18 +10:00
|
|
|
|
|
2023-10-24 12:10:19 +10:00
|
|
|
|
[JsonPropertyName("status")]
|
|
|
|
|
|
public string Status { get; set; } = string.Empty;
|
2023-10-25 10:21:18 +10:00
|
|
|
|
|
2023-10-24 12:10:19 +10:00
|
|
|
|
[JsonPropertyName("title")]
|
|
|
|
|
|
public string ShortName { get; set; } = string.Empty;
|
2023-10-25 10:21:18 +10:00
|
|
|
|
|
2023-10-24 12:10:19 +10:00
|
|
|
|
[JsonPropertyName("templateName")]
|
|
|
|
|
|
public string TemplateName { get; set; } = string.Empty;
|
2023-10-25 10:21:18 +10:00
|
|
|
|
|
|
|
|
|
|
[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));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:59:57 +10:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-10-24 12:10:19 +10:00
|
|
|
|
|