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

readonly property
type:
StockMovementType

productVariant

property

quantity

property
type:
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

readonly property
type:

constructor

method
type:
(input: DeepPartial<Allocation>) => Allocation

orderLine

property
type:
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

readonly property
type:

constructor

method
type:
(input: DeepPartial<Cancellation>) => Cancellation

orderItem

property
type:
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

readonly property
type:

constructor

method
type:
(input: DeepPartial<Release>) => Release

orderItem

property
type:
OrderItem

Sale

Package: @vendure/core File: sale.entity.ts

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

readonly property
type:

constructor

method
type:
(input: DeepPartial<Sale>) => Sale

orderLine

property
type:
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

readonly property
type:

constructor

method
type:
(input: DeepPartial<StockAdjustment>) => StockAdjustment