feat(customer): store addresses (#6283)

- GET /customers/me/addresses
- POST /customers/me/addresses
- GET /customers/me/addresses/:address_id
- POST /customers/me/addresses/:address_id
- DELETE /customers/me/addresses/:address_id
This commit is contained in:
Sebastian Rindom
2024-02-01 10:11:52 +00:00
committed by GitHub
parent fab1799841
commit a28822e0d4
11 changed files with 823 additions and 20 deletions
@@ -0,0 +1,22 @@
import { ICustomerModuleService, IAuthModuleService } from "@medusajs/types"
export const createAuthenticatedCustomer = async (
customerModuleService: ICustomerModuleService,
authService: IAuthModuleService
) => {
const customer = await customerModuleService.create({
first_name: "John",
last_name: "Doe",
email: "john@me.com",
})
const authUser = await authService.createAuthUser({
entity_id: "store_user",
provider_id: "test",
app_metadata: { customer_id: customer.id },
})
const jwt = await authService.generateJwtToken(authUser.id, "store")
return { customer, authUser, jwt }
}