using static ServiceShared.Models.Database.Results;
namespace ServiceShared.Models.Database
{
public class Status
{
///
/// SHA512 - Hash of Plz Geburtsdatum Sampleid (PK)
///
public string pgs { get; set; }
///
/// UDID - PK (Unique Device ID)
///
public string udid { get; set; }
///
/// Flag for push available
///
public bool available { get; set; }
///
/// Timestamp for available
///
public string available_ts { get; set; }
///
/// Flag for picked up (if mobile app has already picked up the results)
///
public bool picked_up { get; set; }
///
/// Timestamp for picked up
///
public string picked_up_ts { get; set; }
///
/// Flag for push notification
///
public bool notified { get; set; }
///
/// Timestamp for notified
///
public string notified_ts { get; set; }
///
/// Results status
///
public string results_status { get; set; }
///
/// Result message
///
public string results_message { get; set; }
///
///Incoming direction
///
public string incoming_direction { get; set; }
///
/// Created date of results object(this)
///
public string created { get; set; }
///
/// SHA512 Checksum of file content(base64)
///
public string file_checksum { get; set; }
///
/// Default constructor for Status
/// Importent for json serializer
///
public Status()
{
}
///
/// Constructor for Status
///
/// Results object, that should be converted to the Status
public Status(Results results)
{
this.pgs = results.PGS;
this.udid = results.UDID;
this.available = results.Available;
this.available_ts = (results.AvailableTS.HasValue ? results.AvailableTS.Value.ToString("yyyy-MM-dd HH:mm:ss") : null);
this.picked_up = results.PickedUp;
this.picked_up_ts = (results.PickedUpTS.HasValue ? results.PickedUpTS.Value.ToString("yyyy-MM-dd HH:mm:ss") : null);
this.notified = results.Notified;
this.notified_ts = (results.NotifiedTS.HasValue ? results.NotifiedTS.Value.ToString("yyyy-MM-dd HH:mm:ss") : null);
this.file_checksum = results.FileChecksum;
this.created = results.Created.ToString("yyyy-MM-dd HH:mm:ss");
this.results_status = results.Status.ToString();
}
}
}