mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-21 15:27:15 +00:00
Migration from Amazon MWS to Selling Partner API
This commit is contained in:
103
src/bnhtrade.Core/Model/Product/ProductInfo.cs
Normal file
103
src/bnhtrade.Core/Model/Product/ProductInfo.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Model.Product
|
||||
{
|
||||
public class ProductInfo
|
||||
{
|
||||
private string titleBody;
|
||||
|
||||
public ProductInfo(string title, int categoryId, int procurementControlId = 1)
|
||||
{
|
||||
Title = title;
|
||||
ProductCategoryID = categoryId;
|
||||
ProductProcurementControlID = procurementControlId;
|
||||
}
|
||||
|
||||
public int ProductID { get; set; }
|
||||
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
if (titleBody != null)
|
||||
{
|
||||
if (TitleSuffix == null) { return titleBody; }
|
||||
else { return titleBody + " (" + TitleSuffix + ")"; }
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
titleBody = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string TitleSuffix { get; set; }
|
||||
|
||||
public int ProductCategoryID { get; set; }
|
||||
|
||||
public int? ProductCategorySubID { get; set; }
|
||||
|
||||
//public int? ProductImageID { get; set; }
|
||||
|
||||
public DateTime? ReleaseDate { get; set; }
|
||||
|
||||
public bool ReleaseDateIsSet
|
||||
{
|
||||
get { return ReleaseDate != null; }
|
||||
}
|
||||
|
||||
public decimal? RecommendedRetailPrice { get; set; }
|
||||
|
||||
public decimal? MaxPrice { get; set; }
|
||||
|
||||
public string AmazonASIN { get; set; }
|
||||
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
public decimal? PackageWeightKilogram { get; set; }
|
||||
|
||||
public decimal? PackageDimensionHeightMeter { get; private set; }
|
||||
|
||||
public decimal? PackageDimensionWidthMeter { get; private set; }
|
||||
|
||||
public decimal? PackageDimensionLengthMeter { get; private set; }
|
||||
|
||||
public int? CatId { get; set; }
|
||||
|
||||
public int ProductProcurementControlID { get; set; }
|
||||
|
||||
public bool? ManualCompetativePriceUpdate { get; set; }
|
||||
|
||||
public bool? AmazonBuyBoxActive { get; set; }
|
||||
|
||||
public DateTime? AmazonBuyBoxActiveUpdated { get; set; }
|
||||
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public bool IsDraft { get; set; }
|
||||
|
||||
public DateTime RecordCreated { get; set; }
|
||||
|
||||
public DateTime RecordModified { get; set; }
|
||||
|
||||
public void SetPackageDimension (decimal heightMeter, decimal widthMeter, decimal lengthMeter)
|
||||
{
|
||||
if (heightMeter <= 0 || widthMeter <=0 || lengthMeter <= 0)
|
||||
{
|
||||
throw new Exception("Dimension must be greater than 0");
|
||||
}
|
||||
|
||||
PackageDimensionHeightMeter = heightMeter;
|
||||
PackageDimensionWidthMeter = widthMeter;
|
||||
PackageDimensionLengthMeter = lengthMeter;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user