Viewer to Server

This commit is contained in:
2023-02-16 15:17:31 -07:00
parent 5c50078c04
commit a25dc93610
968 changed files with 16395 additions and 2385 deletions

View File

@ -0,0 +1,37 @@
using System.Text.Json;
namespace OI.Metrology.Shared.ViewModels;
// [JsonConstructor]
public record ServiceShopOrder(string Id,
string Name,
string[] BookingNames,
string Type,
string State,
string ItemNumber,
DateTime CreatedDate,
DateTime DecidedDate,
string Recipient,
string Requestor)
{
internal ServiceShopOrder(Models.Order order) :
this(order.Id,
order.Name,
order.Bookings is null || !order.Bookings.Any() ? Array.Empty<string>() : order.Bookings.Select(l => l.Name).ToArray(),
order.Type,
order.State,
order.ItemNumber,
order.CreatedDate,
order.DecidedDate,
order.Recipient,
order.Requestor)
{ }
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
}