using System.ComponentModel.DataAnnotations;
namespace CampusErrand.Models.Dtos;
///
/// 创建订单请求
///
public class CreateOrderRequest
{
/// 订单类型:Pickup, Delivery, Help, Purchase, Food
[Required(ErrorMessage = "订单类型不能为空")]
public string OrderType { get; set; } = string.Empty;
/// 物品名称/要做的事情
[MaxLength(256)]
public string ItemName { get; set; } = string.Empty;
/// 取货/代取地点
[MaxLength(256)]
public string? PickupLocation { get; set; }
/// 送达地点
[Required(ErrorMessage = "送达地点不能为空")]
[MaxLength(256)]
public string DeliveryLocation { get; set; } = string.Empty;
/// 备注信息
[MaxLength(512)]
public string? Remark { get; set; }
/// 联系手机号
[Required(ErrorMessage = "手机号不能为空")]
[MaxLength(20)]
public string Phone { get; set; } = string.Empty;
/// 跑腿佣金
public decimal Commission { get; set; }
/// 商品总金额(万能帮/代购/美食街)
public decimal? GoodsAmount { get; set; }
/// 美食街订单菜品列表
public List? FoodItems { get; set; }
}
///
/// 美食街订单菜品项请求
///
public class FoodOrderItemRequest
{
public int ShopId { get; set; }
public int DishId { get; set; }
public int Quantity { get; set; }
public decimal UnitPrice { get; set; }
}
///
/// 订单响应
///
public class OrderResponse
{
public int Id { get; set; }
public string OrderNo { get; set; } = string.Empty;
public int OwnerId { get; set; }
public int? RunnerId { get; set; }
public string OrderType { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public string ItemName { get; set; } = string.Empty;
public string? PickupLocation { get; set; }
public string DeliveryLocation { get; set; } = string.Empty;
public string? Remark { get; set; }
/// 手机号(未接单时对非单主隐藏)
public string? Phone { get; set; }
public decimal Commission { get; set; }
public decimal? GoodsAmount { get; set; }
public decimal TotalAmount { get; set; }
public string? CompletionProof { get; set; }
public bool IsReviewed { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? AcceptedAt { get; set; }
public DateTime? CompletedAt { get; set; }
/// 跑腿昵称
public string? RunnerNickname { get; set; }
/// 跑腿头像
public string? RunnerAvatar { get; set; }
/// 单主头像
public string? OwnerAvatar { get; set; }
/// 跑腿 UID
public int? RunnerUid { get; set; }
/// 跑腿手机号(认证时填写的手机号,仅单主可见)
public string? RunnerPhone { get; set; }
/// 平台抽成(订单完成后可见)
public decimal? PlatformFee { get; set; }
/// 跑腿实得佣金(订单完成后可见)
public decimal? NetEarning { get; set; }
/// IM 群组 ID
public string? ImGroupId { get; set; }
public List? FoodItems { get; set; }
}
///
/// 美食街订单菜品项响应
///
public class FoodOrderItemResponse
{
public int Id { get; set; }
public int ShopId { get; set; }
public string ShopName { get; set; } = string.Empty;
public int DishId { get; set; }
public string DishName { get; set; } = string.Empty;
public string? DishPhoto { get; set; }
public int Quantity { get; set; }
public decimal UnitPrice { get; set; }
}
///
/// 订单大厅列表项响应
///
public class OrderHallItemResponse
{
public int Id { get; set; }
public string OrderNo { get; set; } = string.Empty;
public string OrderType { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
/// 物品名称/要做的事情
public string? ItemName { get; set; }
/// 取货/代取地点
public string? PickupLocation { get; set; }
/// 送达地点
public string DeliveryLocation { get; set; } = string.Empty;
/// 备注信息
public string? Remark { get; set; }
/// 跑腿佣金
public decimal Commission { get; set; }
/// 垫付商品金额(代购/美食街)
public decimal? GoodsAmount { get; set; }
/// 涉及门店数量(美食街)
public int? ShopCount { get; set; }
/// 菜品数量(美食街)
public int? DishItemCount { get; set; }
public DateTime CreatedAt { get; set; }
}
///
/// 接单请求响应
///
public class AcceptOrderResponse
{
public int Id { get; set; }
public string OrderNo { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public int RunnerId { get; set; }
public DateTime AcceptedAt { get; set; }
}
///
/// 跑腿提交完成请求
///
public class CompleteOrderRequest
{
/// 完成凭证图片(选填)
public string? CompletionProof { get; set; }
}
///
/// 我的订单/我的接单列表项响应
///
public class OrderListItemResponse
{
public int Id { get; set; }
public string OrderNo { get; set; } = string.Empty;
public int OwnerId { get; set; }
public int? RunnerId { get; set; }
public string OrderType { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public string ItemName { get; set; } = string.Empty;
public string? PickupLocation { get; set; }
public string DeliveryLocation { get; set; } = string.Empty;
public string? Remark { get; set; }
public decimal Commission { get; set; }
public decimal? GoodsAmount { get; set; }
public decimal TotalAmount { get; set; }
public bool IsReviewed { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? AcceptedAt { get; set; }
public DateTime? CompletedAt { get; set; }
}
///
/// 管理端取消订单请求
///
public class AdminCancelOrderRequest
{
/// 取消原因
public string Reason { get; set; } = string.Empty;
}