StockMovement
StockMovement
A StockMovement is created whenever stock of a particular ProductVariant goes in or out.
Signature
class StockMovement extends VendureEntity {
readonly @Column({ nullable: false, type: 'varchar' })
readonly type: StockMovementType;
@ManyToOne(type => ProductVariant, variant => variant.stockMovements)
productVariant: ProductVariant;
@Column()
quantity: number;
}
Extends
Members
type
StockMovementType
productVariant
ProductVariant
quantity
number
Allocation
An Allocation is created for each ProductVariant in an Order when the checkout is completed (as configured by the StockAllocationStrategy. This prevents stock being sold twice.
Signature
class Allocation extends StockMovement {
readonly readonly type = StockMovementType.ALLOCATION;
constructor(input: DeepPartial<Allocation>)
@ManyToOne(type => OrderLine)
orderLine: OrderLine;
}
Extends
Members
type
constructor
(input: DeepPartial<Allocation>) => Allocation
orderLine
OrderLine
Cancellation
A Cancellation is created when OrderItems from a fulfilled Order are cancelled.
Signature
class Cancellation extends StockMovement {
readonly readonly type = StockMovementType.CANCELLATION;
constructor(input: DeepPartial<Cancellation>)
@ManyToOne(type => OrderItem, orderItem => orderItem.cancellation)
orderItem: OrderItem;
}
Extends
Members
type
constructor
(input: DeepPartial<Cancellation>) => Cancellation
orderItem
OrderItem
Release
A Release is created when OrderItems which have been allocated (but not yet fulfilled) are cancelled.
Signature
class Release extends StockMovement {
readonly readonly type = StockMovementType.RELEASE;
constructor(input: DeepPartial<Release>)
@ManyToOne(type => OrderItem)
orderItem: OrderItem;
}
Extends
Members
type
constructor
(input: DeepPartial<Release>) => Release
orderItem
OrderItem
Sale
A Sale is created when OrderItems are fulfilled.
Signature
class Sale extends StockMovement {
readonly readonly type = StockMovementType.SALE;
constructor(input: DeepPartial<Sale>)
@ManyToOne(type => OrderLine)
orderLine: OrderLine;
}
Extends
Members
type
constructor
(input: DeepPartial<Sale>) => Sale
orderLine
OrderLine
StockAdjustment
A StockAdjustment is created when the stockOnHand
level of a ProductVariant is manually adjusted.
Signature
class StockAdjustment extends StockMovement {
readonly readonly type = StockMovementType.ADJUSTMENT;
constructor(input: DeepPartial<StockAdjustment>)
}
Extends
Members
type
constructor
(input: DeepPartial<StockAdjustment>) => StockAdjustment