feat: Search by billing_address and shipping_address on Order model (#12814)
* feat: Search by billing_address and shipping_address on Order model **What** Added `.searchable()` method to the `shipping_address` and `billing_address` relationships in the `Order` model, enabling search functionality. **Why** Previously searching via `shipping_address` and `billing_address` was not supported, limiting the ability to find orders based on shipping or billing address information. Resolves SUP-1838 * Update integration tests to include billing_address and non-existing addresses.
This commit is contained in:
@@ -27,12 +27,14 @@ const _Order = model
|
||||
mappedBy: undefined,
|
||||
foreignKey: true,
|
||||
})
|
||||
.searchable()
|
||||
.nullable(),
|
||||
billing_address: model
|
||||
.hasOne<any>(() => OrderAddress, {
|
||||
mappedBy: undefined,
|
||||
foreignKey: true,
|
||||
})
|
||||
.searchable()
|
||||
.nullable(),
|
||||
summary: model.hasMany<any>(() => OrderSummary, {
|
||||
mappedBy: "order",
|
||||
|
||||
Reference in New Issue
Block a user