支持 direct/warehouse 分轨、代发进度与库位排序、国内单号检索及到仓关联订单;扩展 SKU/店铺代发与库存绑定扣减能力。 Co-authored-by: Cursor <cursoragent@cursor.com>
487 lines
11 KiB
C#
487 lines
11 KiB
C#
using System.ComponentModel.DataAnnotations;
|
||
using Oms.Application.Dtos.Orders;
|
||
|
||
namespace Oms.Application.Dtos.PlatformStore;
|
||
|
||
public class PlatformStorePageInput
|
||
{
|
||
public int Page { get; set; } = 1;
|
||
|
||
public int PageSize { get; set; } = 30;
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
public string? PlatformCode { get; set; }
|
||
|
||
public string? StoreNickname { get; set; }
|
||
|
||
public string? ExpirationFilter { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOutput
|
||
{
|
||
public int Id { get; set; }
|
||
|
||
public int CustomerId { get; set; }
|
||
|
||
public string? CustomerName { get; set; }
|
||
|
||
public string? CustomerCode { get; set; }
|
||
|
||
public string PlatformCode { get; set; } = string.Empty;
|
||
|
||
public string PlatformName { get; set; } = string.Empty;
|
||
|
||
public string StoreNickname { get; set; } = string.Empty;
|
||
|
||
public string? PlatformAccount { get; set; }
|
||
|
||
public string? SiteCountry { get; set; }
|
||
|
||
public string AuthStatus { get; set; } = string.Empty;
|
||
|
||
public DateTime? AuthTime { get; set; }
|
||
|
||
public DateTime? TokenExpireTime { get; set; }
|
||
|
||
public bool IsAutoFulfill { get; set; }
|
||
|
||
public string? Remark { get; set; }
|
||
|
||
public DateTime CreateTime { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreSaveInput
|
||
{
|
||
public int Id { get; set; }
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
public string PlatformCode { get; set; } = string.Empty;
|
||
|
||
[Required]
|
||
public string StoreNickname { get; set; } = string.Empty;
|
||
|
||
public string? PlatformAccount { get; set; }
|
||
|
||
public string? SiteCountry { get; set; }
|
||
|
||
public bool IsAutoFulfill { get; set; }
|
||
|
||
public string? Remark { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreAuthUrlInput
|
||
{
|
||
[Required]
|
||
public string PlatformCode { get; set; } = string.Empty;
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
/// <summary>自定义店铺昵称(OAuth 平台必填;续期不改名)</summary>
|
||
public string? StoreNickname { get; set; }
|
||
|
||
/// <summary>开户站,如 Lazada cb/sg;Temu US</summary>
|
||
public string? SiteCountry { get; set; }
|
||
|
||
/// <summary>Temu 授权码</summary>
|
||
public string? AuthorizationCode { get; set; }
|
||
|
||
/// <summary>可选覆盖回调地址;默认用配置 FrontendBaseUrl + /oauth/platform-store/{plat}</summary>
|
||
public string? RedirectUri { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreAuthUrlOutput
|
||
{
|
||
/// <summary>平台授权 URL;Temu 成功落库后返回 "/"</summary>
|
||
public string AuthUrl { get; set; } = string.Empty;
|
||
|
||
public string Message { get; set; } = string.Empty;
|
||
|
||
/// <summary>透传给回调页的 state(TikTok 等)</summary>
|
||
public string? State { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreAuthCallbackInput
|
||
{
|
||
[Required]
|
||
public string PlatformCode { get; set; } = string.Empty;
|
||
|
||
[Required]
|
||
public string Code { get; set; } = string.Empty;
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
/// <summary>优先用 state 还原;也可由前端 localStorage 传入</summary>
|
||
public string? State { get; set; }
|
||
|
||
public string? StoreNickname { get; set; }
|
||
|
||
public string? SiteCountry { get; set; }
|
||
|
||
/// <summary>Shopee 店铺授权</summary>
|
||
public long? ShopId { get; set; }
|
||
|
||
/// <summary>Shopee 主账号授权</summary>
|
||
public long? MainAccountId { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreAuthCallbackOutput
|
||
{
|
||
public int BoundCount { get; set; }
|
||
|
||
public string Message { get; set; } = string.Empty;
|
||
|
||
public List<PlatformStoreOutput> Stores { get; set; } = [];
|
||
}
|
||
|
||
public class PlatformStoreIdsInput
|
||
{
|
||
[Required]
|
||
public List<int> Ids { get; set; } = [];
|
||
}
|
||
|
||
// --- Store Order ---
|
||
|
||
public class PlatformStoreOrderListInput : PlatformStorePageInput
|
||
{
|
||
public int? StoreId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 平台编码:tiktok / temu / shopee / lazada;空或 all 表示全部。
|
||
/// </summary>
|
||
public string? PlatformCode { get; set; }
|
||
|
||
/// <summary>
|
||
/// 履约状态:pending / toShip / shipped / canceled / suspended / completed;空或 all 表示全部。
|
||
/// </summary>
|
||
public string? FulfillStatus { get; set; }
|
||
|
||
public string? PlatformOrderNo { get; set; }
|
||
|
||
public bool? IsSuspended { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderLineOutput
|
||
{
|
||
public int Id { get; set; }
|
||
|
||
public string? PlatformLineId { get; set; }
|
||
|
||
public string? PlatformSku { get; set; }
|
||
|
||
public string? ProductName { get; set; }
|
||
|
||
public string? ProductImageUrl { get; set; }
|
||
|
||
public string? VariantText { get; set; }
|
||
|
||
public decimal? UnitPrice { get; set; }
|
||
|
||
public int Quantity { get; set; }
|
||
|
||
public string? Currency { get; set; }
|
||
|
||
public bool IsShipExcluded { get; set; }
|
||
|
||
public int? MappedSkuId { get; set; }
|
||
|
||
public string? MappedSkuCode { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderOutput
|
||
{
|
||
public int Id { get; set; }
|
||
|
||
public int CustomerId { get; set; }
|
||
|
||
public string? CustomerName { get; set; }
|
||
|
||
public string? CustomerCode { get; set; }
|
||
|
||
public int StoreId { get; set; }
|
||
|
||
public string StoreNickname { get; set; } = string.Empty;
|
||
|
||
public string PlatformCode { get; set; } = string.Empty;
|
||
|
||
public string PlatformOrderNo { get; set; } = string.Empty;
|
||
|
||
public string? OrderCountry { get; set; }
|
||
|
||
public string? RecipientName { get; set; }
|
||
|
||
public string? RecipientCompany { get; set; }
|
||
|
||
public string? RecipientPhone { get; set; }
|
||
|
||
public string? RecipientTelePhone { get; set; }
|
||
|
||
public string? RecipientEmail { get; set; }
|
||
|
||
public string? RecipientCountry { get; set; }
|
||
|
||
public string? RecipientProvince { get; set; }
|
||
|
||
public string? RecipientCity { get; set; }
|
||
|
||
public string? RecipientZipCode { get; set; }
|
||
|
||
public string? RecipientAddress1 { get; set; }
|
||
|
||
public string? RecipientAddress2 { get; set; }
|
||
|
||
public int? ItemCount { get; set; }
|
||
|
||
public decimal? TotalAmount { get; set; }
|
||
|
||
public string? Currency { get; set; }
|
||
|
||
public DateTime? PlatformOrderTime { get; set; }
|
||
|
||
public string FulfillStatus { get; set; } = string.Empty;
|
||
|
||
public string? PlatformStatusLabel { get; set; }
|
||
|
||
public string? ShippingLabelNo { get; set; }
|
||
|
||
public string? ShippingLabelUrl { get; set; }
|
||
|
||
public bool IsMultiLabel { get; set; }
|
||
|
||
public string? CustomTags { get; set; }
|
||
|
||
public bool IsSuspended { get; set; }
|
||
|
||
public int? WarehouseId { get; set; }
|
||
|
||
public int? LinkedOrderId { get; set; }
|
||
|
||
public string? LinkedServiceNo { get; set; }
|
||
|
||
/// <summary>列表摘要:首个商品名称。</summary>
|
||
public string? FirstProductName { get; set; }
|
||
|
||
/// <summary>列表摘要:首个商品图片。</summary>
|
||
public string? FirstProductImageUrl { get; set; }
|
||
|
||
public DateTime? LastSyncTime { get; set; }
|
||
|
||
public List<PlatformStoreOrderLineOutput> Lines { get; set; } = [];
|
||
}
|
||
|
||
public class PlatformStoreOrderSummaryOutput
|
||
{
|
||
public int Pending { get; set; }
|
||
|
||
public int ToShip { get; set; }
|
||
|
||
public int Shipped { get; set; }
|
||
|
||
public int Canceled { get; set; }
|
||
|
||
public int Suspended { get; set; }
|
||
|
||
public int Completed { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderIdInput
|
||
{
|
||
[Required]
|
||
public int Id { get; set; }
|
||
|
||
public int? CustomerId { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderIdsInput
|
||
{
|
||
[Required]
|
||
public List<int> Ids { get; set; } = [];
|
||
|
||
public int? CustomerId { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderMatchInventoryInput
|
||
{
|
||
[Required]
|
||
public int Id { get; set; }
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
public int? WarehouseId { get; set; }
|
||
|
||
public string? ProductCode { get; set; }
|
||
|
||
public string? TrackNo { get; set; }
|
||
|
||
public OrderParcelReceiverInput? Receiver { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchMatchInventoryInput
|
||
{
|
||
[Required]
|
||
public List<int> Ids { get; set; } = [];
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
public int? WarehouseId { get; set; }
|
||
|
||
public string? ProductCode { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchMatchItemOutput
|
||
{
|
||
public int Id { get; set; }
|
||
|
||
public string PlatformOrderNo { get; set; } = string.Empty;
|
||
|
||
public bool Success { get; set; }
|
||
|
||
public string Message { get; set; } = string.Empty;
|
||
|
||
public int? LinkedOrderId { get; set; }
|
||
|
||
public string? ServiceNo { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchMatchInventoryOutput
|
||
{
|
||
public int SuccessCount { get; set; }
|
||
|
||
public int FailCount { get; set; }
|
||
|
||
public List<PlatformStoreOrderBatchMatchItemOutput> Items { get; set; } = [];
|
||
}
|
||
|
||
public class PlatformStoreOrderMatchInventoryOutput
|
||
{
|
||
public bool Success { get; set; }
|
||
|
||
public string Message { get; set; } = string.Empty;
|
||
|
||
public int? LinkedOrderId { get; set; }
|
||
|
||
public string? ServiceNo { get; set; }
|
||
|
||
public string? ClientNo { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchCreateLogisticsInput
|
||
{
|
||
[Required]
|
||
public string ProductCode { get; set; } = string.Empty;
|
||
|
||
public int? WarehouseId { get; set; }
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
[Required]
|
||
public List<PlatformStoreOrderBatchCreateItemInput> Items { get; set; } = [];
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchCreateFulfillInput
|
||
{
|
||
[Required]
|
||
public string ProductCode { get; set; } = string.Empty;
|
||
|
||
[Required]
|
||
public int WarehouseId { get; set; }
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
[Required]
|
||
public List<PlatformStoreOrderBatchCreateItemInput> Items { get; set; } = [];
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchCreateItemInput
|
||
{
|
||
[Required]
|
||
public int StoreOrderId { get; set; }
|
||
|
||
public OrderParcelReceiverInput? Receiver { get; set; }
|
||
|
||
public List<OrderStockBindSaveItemInput> BindItems { get; set; } = [];
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchCreateLogisticsOutput
|
||
{
|
||
public string BatchNo { get; set; } = string.Empty;
|
||
|
||
public int SuccessCount { get; set; }
|
||
|
||
public int FailCount { get; set; }
|
||
|
||
public List<PlatformStoreOrderBatchMatchItemOutput> Items { get; set; } = [];
|
||
}
|
||
|
||
public class PlatformStoreOrderToggleSuspendInput
|
||
{
|
||
[Required]
|
||
public int Id { get; set; }
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
public bool IsSuspended { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderPullInput
|
||
{
|
||
[Required]
|
||
public List<int> StoreIds { get; set; } = [];
|
||
|
||
public int? CustomerId { get; set; }
|
||
|
||
public List<string> OrderStatuses { get; set; } = [];
|
||
|
||
public DateTime? TimeStart { get; set; }
|
||
|
||
public DateTime? TimeEnd { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchActionItemOutput
|
||
{
|
||
public int? Id { get; set; }
|
||
|
||
public int? StoreId { get; set; }
|
||
|
||
public string? StoreNickname { get; set; }
|
||
|
||
public string? PlatformOrderNo { get; set; }
|
||
|
||
public bool Success { get; set; }
|
||
|
||
public string Message { get; set; } = string.Empty;
|
||
|
||
public int AffectedCount { get; set; }
|
||
|
||
public string? FulfillStatus { get; set; }
|
||
|
||
public string? ShippingLabelNo { get; set; }
|
||
|
||
public string? ShippingLabelUrl { get; set; }
|
||
}
|
||
|
||
public class PlatformStoreOrderBatchActionOutput
|
||
{
|
||
public bool Success { get; set; } = true;
|
||
|
||
public string Message { get; set; } = string.Empty;
|
||
|
||
public int SuccessCount { get; set; }
|
||
|
||
public int FailCount { get; set; }
|
||
|
||
public List<PlatformStoreOrderBatchActionItemOutput> Items { get; set; } = [];
|
||
}
|
||
|
||
public class PlatformStoreOrderActionOutput
|
||
{
|
||
public bool Success { get; set; } = true;
|
||
|
||
public string Message { get; set; } = string.Empty;
|
||
|
||
public string? ShippingLabelNo { get; set; }
|
||
|
||
public string? ShippingLabelUrl { get; set; }
|
||
}
|