using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.WarehouseExecutionSystem.Models
{
///
/// 緊急應變請求類別
///
public class TW017EmergencyEventRequestDto : CommonMessage
{
///
/// 緊急事件類別
///
///
/// 0 = Earthquake
/// 1 = Fire
///
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)]
public EmergencyEvent EventType { get; set; }
///
/// 取得緊急應變請求
///
/// 交易名稱
/// 緊急事件類別
/// 緊急應變請求
public static TW017EmergencyEventRequestDto Get(TransactionName transName, EmergencyEvent eventType)
{
return new TW017EmergencyEventRequestDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
EventType = eventType
};
}
}
///
/// 緊急應變回應類別
///
public class FW018EmergencyEventResponseDto : CommonMessage
{
///
/// 緊急事件類別
///
///
/// 0 = Earthquake
/// 1 = Fire
///
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)]
public EmergencyEvent EventType { get; set; }
///
/// 結果代碼
///
///
/// 0 = Success
/// 1 = Failed
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
public EmergencyEventResultCode ResultCode { get; set; }
///
/// 取得緊急應變回應
///
/// 交易名稱
/// 事件類別
/// 結果代碼
/// 緊急應變回應
public static FW018EmergencyEventResponseDto Get(TransactionName transName, EmergencyEvent eventType, EmergencyEventResultCode resultCode)
{
return new FW018EmergencyEventResponseDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
EventType = eventType,
ResultCode = resultCode
};
}
}
}