(feat): Adds phone number to Customer

This commit is contained in:
Oliver Windall Juhl
2020-09-09 16:55:34 +02:00
committed by GitHub
parent f0b602faf0
commit e3d8eea3cd
11 changed files with 125 additions and 19 deletions
@@ -17,6 +17,15 @@ export const customers = {
billingAddress: {},
password_hash: "123456789",
},
customerWithPhone: {
_id: IdMap.getId("customerWithPhone"),
email: "oliver@medusa.com",
first_name: "Oliver",
last_name: "Juhl",
billingAddress: {},
password_hash: "123456789",
phone: "12345678",
},
}
export const CustomerModelMock = {
@@ -29,6 +38,9 @@ export const CustomerModelMock = {
if (query.email === "oliver@medusa.com") {
return Promise.resolve(customers.testCustomer)
}
if (query.phone === "12345678") {
return Promise.resolve(customers.customerWithPhone)
}
if (query._id === IdMap.getId("testCustomer")) {
return Promise.resolve(customers.testCustomer)
}
+1
View File
@@ -17,6 +17,7 @@ class CustomerModel extends BaseModel {
payment_methods: { type: [mongoose.Schema.Types.Mixed], default: [] },
shipping_addresses: { type: [AddressSchema], default: [] },
password_hash: { type: String },
phone: { type: String, default: "" },
has_account: { type: Boolean, default: false },
orders: { type: [String], default: [] },
metadata: { type: mongoose.Schema.Types.Mixed, default: {} },