title | isDefaultIndex | generated |
---|---|---|
StockLocation |
false |
true |
import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription';
A StockLocation represents a physical location where stock is held. For example, a warehouse or a shop.
When the stock of a ProductVariant is adjusted, the adjustment is applied to a specific StockLocation, and the stockOnHand of that ProductVariant is updated accordingly. When there are multiple StockLocations configured, the StockLocationStrategy is used to determine which StockLocation should be used for a given operation.
class StockLocation extends VendureEntity implements HasCustomFields, ChannelAware {
constructor(input: DeepPartial<StockLocation>)
@Column()
name: string;
@Column()
description: string;
@Column(type => CustomStockLocationFields)
customFields: CustomStockLocationFields;
@ManyToMany(type => Channel, channel => channel.stockLocations)
@JoinTable()
channels: Channel[];
@OneToMany(type => StockMovement, movement => movement.stockLocation)
stockMovements: StockMovement[];
}
-
Extends:
VendureEntity
-
Implements:
HasCustomFields
,ChannelAware
<MemberInfo kind="method" type={(input: DeepPartial<<a href='/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>>) => StockLocation
} />
<MemberInfo kind="property" type={string
} />
<MemberInfo kind="property" type={string
} />
<MemberInfo kind="property" type={CustomStockLocationFields
} />
<MemberInfo kind="property" type={<a href='/reference/typescript-api/entities/channel#channel'>Channel</a>[]
} />
<MemberInfo kind="property" type={<a href='/reference/typescript-api/entities/stock-movement#stockmovement'>StockMovement</a>[]
} />