Feat(medusa): search orders by customer phone and name (#2913)

* add support for customer first- and last names and phone

* test for querying customer first_name, last_name and phone

* add customer as prop for querying orders

* polishing before pr

* changeset
This commit is contained in:
Philip Korsholm
2022-12-29 15:20:18 +01:00
committed by GitHub
parent 726858d847
commit 645e0d0ec5
4 changed files with 93 additions and 0 deletions
@@ -9,6 +9,9 @@ import {
export type CustomerFactoryData = {
id?: string
email?: string
phone?: string
first_name?: string
last_name?: string
groups?: CustomerGroupFactoryData[]
password_hash?: string
has_account?: boolean
@@ -29,6 +32,9 @@ export const simpleCustomerFactory = async (
const c = manager.create(Customer, {
id: customerId,
email: data.email ?? faker.internet.email(),
phone: data.phone ?? faker.phone.phoneNumber(),
first_name: data.first_name ?? faker.name.firstName(),
last_name: data.last_name ?? faker.name.lastName(),
password_hash:
data.password_hash ??
"c2NyeXB0AAEAAAABAAAAAVMdaddoGjwU1TafDLLlBKnOTQga7P2dbrfgf3fB+rCD/cJOMuGzAvRdKutbYkVpuJWTU39P7OpuWNkUVoEETOVLMJafbI8qs8Qx/7jMQXkN", // password matching "test"