Interface IStockService
public interface IStockService
Methods
GetStock(string, int)
Task<int> GetStock(string sku, int valueIfDisabled = 0)
Parameters
Returns
GetStockInfo(IEnumerable<string>)
Task<IEnumerable<Stock>> GetStockInfo(IEnumerable<string> skus)
Parameters
skus
IEnumerable<string>
Returns
GetStockInfo(string)
Task<Stock?> GetStockInfo(string sku)
Parameters
sku
string
Returns
GetTotalStock(IProduct, int)
Task<int> GetTotalStock(IProduct product, int valueIfDisabled = 0)
Parameters
Returns
GetTotalStock(IEnumerable<string>, int)
Task<int> GetTotalStock(IEnumerable<string> skus, int valueIfDisabled = 0)
Parameters
skus
IEnumerable<string>valueIfDisabled
int
Returns
GetTrackingEnabled(string)
Task<bool> GetTrackingEnabled(string sku)
Parameters
sku
string
Returns
ReduceStock(string, int)
Reduces stock by specified quantity and returns remaining stock. Remaining stock can go negative even if out-of-stock selling is disabled.
Task<int?> ReduceStock(string sku, int reduceBy = 1)
Parameters
Returns
SetShouldSellWithNoStock(string, bool)
Task SetShouldSellWithNoStock(string sku, bool enabled)
Parameters
Returns
SetStock(string, int)
Task SetStock(string sku, int stock)
Parameters
Returns
SetTrackingEnabled(string, bool)
Task SetTrackingEnabled(string sku, bool enabled)