Table of Contents

Interface IStockService

Namespace
Rescope.Commerce.Core.Services
Assembly
Rescope.Commerce.Core.dll
public interface IStockService

Methods

GetStock(string, int)

Task<int> GetStock(string sku, int valueIfDisabled = 0)

Parameters

sku string
valueIfDisabled int

Returns

Task<int>

GetStockInfo(IEnumerable<string>)

Task<IEnumerable<Stock>> GetStockInfo(IEnumerable<string> skus)

Parameters

skus IEnumerable<string>

Returns

Task<IEnumerable<Stock>>

GetStockInfo(string)

Task<Stock?> GetStockInfo(string sku)

Parameters

sku string

Returns

Task<Stock>

GetTotalStock(IProduct, int)

Task<int> GetTotalStock(IProduct product, int valueIfDisabled = 0)

Parameters

product IProduct
valueIfDisabled int

Returns

Task<int>

GetTotalStock(IEnumerable<string>, int)

Task<int> GetTotalStock(IEnumerable<string> skus, int valueIfDisabled = 0)

Parameters

skus IEnumerable<string>
valueIfDisabled int

Returns

Task<int>

GetTrackingEnabled(string)

Task<bool> GetTrackingEnabled(string sku)

Parameters

sku string

Returns

Task<bool>

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

sku string
reduceBy int

Returns

Task<int?>

Remaining stock, null if tracking is disable

SetShouldSellWithNoStock(string, bool)

Task SetShouldSellWithNoStock(string sku, bool enabled)

Parameters

sku string
enabled bool

Returns

Task

SetStock(string, int)

Task SetStock(string sku, int stock)

Parameters

sku string
stock int

Returns

Task

SetTrackingEnabled(string, bool)

Task SetTrackingEnabled(string sku, bool enabled)

Parameters

sku string
enabled bool

Returns

Task