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; } /// 自定义店铺昵称(OAuth 平台必填;续期不改名) public string? StoreNickname { get; set; } /// 开户站,如 Lazada cb/sg;Temu US public string? SiteCountry { get; set; } /// Temu 授权码 public string? AuthorizationCode { get; set; } /// 可选覆盖回调地址;默认用配置 FrontendBaseUrl + /oauth/platform-store/{plat} public string? RedirectUri { get; set; } } public class PlatformStoreAuthUrlOutput { /// 平台授权 URL;Temu 成功落库后返回 "/" public string AuthUrl { get; set; } = string.Empty; public string Message { get; set; } = string.Empty; /// 透传给回调页的 state(TikTok 等) 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; } /// 优先用 state 还原;也可由前端 localStorage 传入 public string? State { get; set; } public string? StoreNickname { get; set; } public string? SiteCountry { get; set; } /// Shopee 店铺授权 public long? ShopId { get; set; } /// Shopee 主账号授权 public long? MainAccountId { get; set; } } public class PlatformStoreAuthCallbackOutput { public int BoundCount { get; set; } public string Message { get; set; } = string.Empty; public List Stores { get; set; } = []; } public class PlatformStoreIdsInput { [Required] public List Ids { get; set; } = []; } // --- Store Order --- public class PlatformStoreOrderListInput : PlatformStorePageInput { public int? StoreId { get; set; } /// /// 平台编码:tiktok / temu / shopee / lazada;空或 all 表示全部。 /// public string? PlatformCode { get; set; } /// /// 履约状态:pending / toShip / shipped / canceled / suspended / completed;空或 all 表示全部。 /// 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; } /// 列表摘要:首个商品名称。 public string? FirstProductName { get; set; } /// 列表摘要:首个商品图片。 public string? FirstProductImageUrl { get; set; } public DateTime? LastSyncTime { get; set; } public List 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 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 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 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 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 Items { get; set; } = []; } public class PlatformStoreOrderBatchCreateItemInput { [Required] public int StoreOrderId { get; set; } public OrderParcelReceiverInput? Receiver { get; set; } public List 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 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 StoreIds { get; set; } = []; public int? CustomerId { get; set; } public List 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 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; } }