StockLevel
StockLevel
A StockLevel represents the number of a particular ProductVariant which are available at a particular StockLocation.
Signature
class StockLevel extends VendureEntity implements HasCustomFields {
constructor(input: DeepPartial<StockLevel>)
@Index()
@ManyToOne(type => ProductVariant, productVariant => productVariant.stockLevels, { onDelete: 'CASCADE' })
productVariant: ProductVariant;
@EntityId()
productVariantId: ID;
@Index()
@ManyToOne(type => StockLocation, { onDelete: 'CASCADE' })
stockLocation: StockLocation;
@EntityId()
stockLocationId: ID;
@Column()
stockOnHand: number;
@Column()
stockAllocated: number;
@Column(type => CustomStockLevelFields)
customFields: CustomStockLevelFields;
}
-
Extends:
VendureEntity
-
Implements:
HasCustomFields