fix: Accept filters in softDelete + fulfillment location clean-up (#7198)

This commit is contained in:
Oli Juhl
2024-05-03 16:32:07 +00:00
committed by GitHub
parent 1366e2efad
commit 2f7b53488d
20 changed files with 232 additions and 114 deletions
@@ -6,6 +6,7 @@ import moduleSchema from "./schema"
export const LinkableKeys = {
stock_location_id: StockLocation.name,
location_id: StockLocation.name,
}
const entityLinkableKeysMap: MapToConfig = {}
@@ -21,10 +22,7 @@ export const entityNameToLinkableKeysMap: MapToConfig = entityLinkableKeysMap
export const joinerConfig: ModuleJoinerConfig = {
serviceName: Modules.STOCK_LOCATION,
primaryKeys: ["id"],
linkableKeys: {
stock_location_id: StockLocation.name,
location_id: StockLocation.name,
},
linkableKeys: LinkableKeys,
schema: moduleSchema,
alias: [
{
@@ -1,16 +1,18 @@
import {
DALUtils,
Searchable,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import {
BeforeCreate,
Entity,
Filter,
ManyToOne,
OnInit,
PrimaryKey,
Property,
} from "@mikro-orm/core"
import {
createPsqlIndexStatementHelper,
generateEntityId,
Searchable,
} from "@medusajs/utils"
import { StockLocationAddress } from "./stock-location-address"
@@ -21,6 +23,7 @@ const StockLocationDeletedAtIndex = createPsqlIndexStatementHelper({
})
@Entity()
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export class StockLocation {
@PrimaryKey({ columnType: "text" })
id: string