-
-
Notifications
You must be signed in to change notification settings - Fork 933
/
mock-events.ts
121 lines (117 loc) · 3.57 KB
/
mock-events.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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',
}),
);