using System.Text.Json.Serialization;
using TakeoutSaaS.Domain.Orders.Enums;
using TakeoutSaaS.Shared.Abstractions.Serialization;

namespace TakeoutSaaS.Application.App.Orders.Dto;

/// <summary>
/// 订单状态流转 DTO。
/// </summary>
public sealed class OrderStatusHistoryDto
{
    /// <summary>
    /// 记录 ID。
    /// </summary>
    [JsonConverter(typeof(SnowflakeIdJsonConverter))]
    public long Id { get; init; }

    /// <summary>
    /// 订单 ID。
    /// </summary>
    [JsonConverter(typeof(SnowflakeIdJsonConverter))]
    public long OrderId { get; init; }

    /// <summary>
    /// 状态。
    /// </summary>
    public OrderStatus Status { get; init; }

    /// <summary>
    /// 操作人。
    /// </summary>
    [JsonConverter(typeof(SnowflakeIdJsonConverter))]
    public long? OperatorId { get; init; }

    /// <summary>
    /// 备注。
    /// </summary>
    public string? Notes { get; init; }

    /// <summary>
    /// 时间。
    /// </summary>
    public DateTime OccurredAt { get; init; }
}
