(feat): Adds phone number to Customer
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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: {} },
|
||||
|
||||
Reference in New Issue
Block a user