GitHub

MockOrderItem

class

import { MockOrderItem } from '@daffodil/order/driver/magento/2-4-1/testing'

class MockOrderItem implements MagentoOrderItem {
  __typename: MagentoOrderItemTypenames = MagentoOrderItemTypenames.OrderItem
  quantity_canceled: faker.number.int({ min: 1, max: 1000 }) = faker.number.int({ min: 1, max: 1000 })
  quantity_invoiced: faker.number.int({ min: 1, max: 1000 }) = faker.number.int({ min: 1, max: 1000 })
  quantity_ordered: faker.number.int({ min: 1, max: 1000 }) = faker.number.int({ min: 1, max: 1000 })
  quantity_refunded: faker.number.int({ min: 1, max: 1000 }) = faker.number.int({ min: 1, max: 1000 })
  quantity_returned: faker.number.int({ min: 1, max: 1000 }) = faker.number.int({ min: 1, max: 1000 })
  quantity_shipped: faker.number.int({ min: 1, max: 1000 }) = faker.number.int({ min: 1, max: 1000 })
  product_sku: faker.string.alphanumeric(20) = faker.string.alphanumeric(20)
  product_type: MagentoOrderItemType = MagentoOrderItemType.Simple
  selected_options: any[] = []
  entered_options: any[] = []
  status: faker.lorem.word() = faker.lorem.word()
  product_sale_price: MagentoMoney = this.moneyFactory.create()
  product_name: faker.lorem.word() = faker.lorem.word()
  product_url_key: faker.lorem.word() = faker.lorem.word()
  discounts: MagentoDiscount[] = this.createDiscounts()
}