-
Notifications
You must be signed in to change notification settings - Fork 14
/
Task02_customers.ts
40 lines (35 loc) · 1000 Bytes
/
Task02_customers.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
import { CustomerDraft } from "@commercetools/platform-sdk";
import {
createCustomer,
getCustomerById,
getCustomerByKey,
createCustomerToken,
confirmCustomerEmail,
assignCustomerToCustomerGroup,
} from "./handson/customer";
import { log } from "./utils/logger";
const customerDraft: CustomerDraft = {
firstName: "Test",
lastName: "Tester",
email: "[email protected]",
password: "password",
key: "tt-customer",
addresses: [
{
country: "DE",
key: "tt-customer-address"
}
],
defaultBillingAddress: 0,
defaultShippingAddress: 0
};
createCustomer(customerDraft).then(log).catch(log);
// getCustomerByKey(customerDraft.key!).then(log).catch(log);
// getCustomerByKey(customerDraft.key!)
// .then(createCustomerToken)
// .then(confirmCustomerEmail)
// .then(log)
// .catch(log);
// assignCustomerToCustomerGroup(customerDraft.key!, "indoor-customers")
// .then(log)
// .catch(log);