| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- import {
- AccountRegistrationEvent,
- Customer,
- IdentifierChangeRequestEvent,
- Order,
- OrderItem,
- OrderLine,
- OrderStateTransitionEvent,
- PasswordResetEvent,
- ProductVariant,
- User,
- } from '@vendure/core';
- export const mockOrderStateTransitionEvent = new OrderStateTransitionEvent(
- 'ArrangingPayment',
- 'PaymentSettled',
- {} as any,
- new Order({
- id: '6',
- createdAt: '2018-10-31T15:18:29.261Z',
- updatedAt: '2018-10-31T15:24:17.000Z',
- code: 'T3EPGJKTVZPBD6Z9',
- state: 'ArrangingPayment',
- active: true,
- customer: new Customer({
- id: '3',
- firstName: 'Test',
- lastName: 'Customer',
- emailAddress: 'test@test.com',
- }),
- lines: [
- new OrderLine({
- id: '5',
- featuredAsset: {
- preview: 'http://localhost:3000/assets/alexandru-acea-686569-unsplash__preview.jpg',
- },
- productVariant: new ProductVariant({
- id: '2',
- name: 'Curvy Monitor 24 inch',
- sku: 'C24F390',
- }),
- items: [
- new OrderItem({
- id: '6',
- unitPrice: 14374,
- unitPriceIncludesTax: true,
- taxRate: 20,
- pendingAdjustments: [],
- }),
- ],
- }),
- new OrderLine({
- id: '6',
- featuredAsset: {
- preview: 'http://localhost:3000/assets/vincent-botta-736919-unsplash__preview.jpg',
- },
- productVariant: new ProductVariant({
- id: '4',
- name: 'Hard Drive 1TB',
- sku: 'IHD455T1',
- }),
- items: [
- new OrderItem({
- id: '7',
- unitPrice: 3799,
- unitPriceIncludesTax: true,
- taxRate: 20,
- pendingAdjustments: [],
- }),
- ],
- }),
- ],
- subTotal: 18173,
- subTotalBeforeTax: 15144,
- shipping: 1000,
- shippingMethod: {
- code: 'express-flat-rate',
- description: 'Express Shipping',
- id: '2',
- },
- shippingAddress: {
- fullName: 'Test Customer',
- company: '',
- streetLine1: '6000 Pagac Land',
- streetLine2: '',
- city: 'Port Kirsten',
- province: 'Avon',
- postalCode: 'ZU32 9CP',
- country: 'Cabo Verde',
- phoneNumber: '',
- },
- payments: [],
- pendingAdjustments: [],
- }),
- );
- export const mockAccountRegistrationEvent = new AccountRegistrationEvent(
- {} as any,
- new User({
- verified: false,
- verificationToken: 'MjAxOC0xMS0xM1QxNToxNToxNC42ODda_US2U6UK1WZC7NDAX',
- identifier: 'test@test.com',
- }),
- );
- export const mockPasswordResetEvent = new PasswordResetEvent(
- {} as any,
- new User({
- identifier: 'test@test.com',
- passwordResetToken: 'MjAxOS0wNC0xNVQxMzozMDozOC43MjFa_MA2FR6HRZBW7JWD6',
- }),
- );
- export const mockEmailAddressChangeEvent = new IdentifierChangeRequestEvent(
- {} as any,
- new User({
- identifier: 'old-address@test.com',
- pendingIdentifier: 'new-address@test.com',
- identifierChangeToken: 'MjAxOS0wNC0xNVQxMzozMDozOC43MjFa_MA2FR6HRZBW7JWD6',
- }),
- );
|