From 9750047af19ad310749a2c44e1842274204223c6 Mon Sep 17 00:00:00 2001 From: Adrien de Peretti Date: Mon, 8 Jul 2024 09:43:49 +0200 Subject: [PATCH] chore: Rename entity to model (#7977) **What** Start renaming `entity` to `model` --- packages/core/types/src/dal/entity.ts | 4 +- .../src/modules-sdk/joiner-config-builder.ts | 2 +- .../utils/src/modules-sdk/medusa-service.ts | 112 +++++++++--------- .../src/modules-sdk/types/medusa-service.ts | 112 +++++++++--------- packages/modules/cart/src/models/address.ts | 2 +- .../cart/src/models/adjustment-line.ts | 2 +- packages/modules/cart/src/models/cart.ts | 2 +- packages/modules/cart/src/models/line-item.ts | 2 +- .../cart/src/models/shipping-method.ts | 2 +- packages/modules/cart/src/models/tax-line.ts | 2 +- .../modules/customer/src/models/address.ts | 2 +- .../src/models/customer-group-customer.ts | 2 +- .../customer/src/models/customer-group.ts | 2 +- .../modules/customer/src/models/customer.ts | 2 +- .../modules/fulfillment/src/models/address.ts | 2 +- .../src/models/fulfillment-item.ts | 2 +- .../src/models/fulfillment-label.ts | 2 +- .../fulfillment/src/models/fulfillment-set.ts | 2 +- .../fulfillment/src/models/fulfillment.ts | 2 +- .../fulfillment/src/models/geo-zone.ts | 2 +- .../fulfillment/src/models/service-zone.ts | 2 +- .../src/models/shipping-option-rule.ts | 2 +- .../src/models/shipping-option-type.ts | 2 +- .../fulfillment/src/models/shipping-option.ts | 2 +- .../src/models/shipping-profile.ts | 2 +- .../src/models/inventory-item.ts | 2 +- packages/modules/order/src/models/address.ts | 2 +- .../order/src/models/adjustment-line.ts | 2 +- .../order/src/models/claim-item-image.ts | 2 +- .../modules/order/src/models/claim-item.ts | 2 +- packages/modules/order/src/models/claim.ts | 2 +- .../modules/order/src/models/exchange-item.ts | 2 +- packages/modules/order/src/models/exchange.ts | 2 +- .../modules/order/src/models/line-item.ts | 2 +- .../order/src/models/order-change-action.ts | 2 +- .../modules/order/src/models/order-change.ts | 2 +- .../modules/order/src/models/order-item.ts | 2 +- .../order/src/models/order-shipping-method.ts | 2 +- packages/modules/order/src/models/order.ts | 2 +- .../modules/order/src/models/return-item.ts | 2 +- .../modules/order/src/models/return-reason.ts | 2 +- packages/modules/order/src/models/return.ts | 2 +- .../modules/order/src/models/transaction.ts | 2 +- .../payment/src/models/payment-collection.ts | 2 +- .../modules/payment/src/models/payment.ts | 2 +- .../pricing/src/models/price-list-rule.ts | 2 +- .../modules/pricing/src/models/price-list.ts | 2 +- .../modules/pricing/src/models/price-rule.ts | 2 +- packages/modules/pricing/src/models/price.ts | 2 +- .../promotion/src/models/campaign-budget.ts | 2 +- .../modules/promotion/src/models/campaign.ts | 2 +- .../promotion/src/models/promotion-rule.ts | 2 +- .../modules/promotion/src/models/promotion.ts | 2 +- .../sales-channel/src/models/sales-channel.ts | 2 +- packages/modules/store/src/models/store.ts | 2 +- .../modules/tax/src/models/tax-rate-rule.ts | 2 +- packages/modules/tax/src/models/tax-rate.ts | 2 +- packages/modules/tax/src/models/tax-region.ts | 2 +- packages/modules/user/src/models/invite.ts | 2 +- packages/modules/user/src/models/user.ts | 2 +- 60 files changed, 171 insertions(+), 171 deletions(-) diff --git a/packages/core/types/src/dal/entity.ts b/packages/core/types/src/dal/entity.ts index 72e54d6eb5..349802836e 100644 --- a/packages/core/types/src/dal/entity.ts +++ b/packages/core/types/src/dal/entity.ts @@ -1,2 +1,2 @@ -export type EntityDateColumns = "created_at" | "updated_at" -export type SoftDeletableEntityDateColumns = "deleted_at" | EntityDateColumns +export type ModelDateColumns = "created_at" | "updated_at" +export type SoftDeletableModelDateColumns = "deleted_at" | ModelDateColumns diff --git a/packages/core/utils/src/modules-sdk/joiner-config-builder.ts b/packages/core/utils/src/modules-sdk/joiner-config-builder.ts index 7263cd9ae0..ba9c09643d 100644 --- a/packages/core/utils/src/modules-sdk/joiner-config-builder.ts +++ b/packages/core/utils/src/modules-sdk/joiner-config-builder.ts @@ -410,7 +410,7 @@ export function buildLinkConfigFromLinkableKeys< * Reversed map from linkableKeys to entity name to linkable keys * @param linkableKeys */ -export function buildEntitiesNameToLinkableKeysMap( +export function buildModelsNameToLinkableKeysMap( linkableKeys: Record ): MapToConfig { const entityLinkableKeysMap: MapToConfig = {} diff --git a/packages/core/utils/src/modules-sdk/medusa-service.ts b/packages/core/utils/src/modules-sdk/medusa-service.ts index 6c87d8ad7b..448f1529da 100644 --- a/packages/core/utils/src/modules-sdk/medusa-service.ts +++ b/packages/core/utils/src/modules-sdk/medusa-service.ts @@ -23,13 +23,13 @@ import { InjectManager, MedusaContext } from "./decorators" import { ModuleRegistrationName } from "./definition" import { BaseMethods, - EntitiesConfigTemplate, ExtractKeysFromConfig, MedusaServiceReturnType, ModelConfigurationsToConfigTemplate, - TEntityEntries, + ModelEntries, + ModelsConfigTemplate, } from "./types/medusa-service" -import { buildEntitiesNameToLinkableKeysMap } from "./joiner-config-builder" +import { buildModelsNameToLinkableKeysMap } from "./joiner-config-builder" const readMethods = ["retrieve", "list", "listAndCount"] as BaseMethods[] const writeMethods = [ @@ -47,7 +47,7 @@ const methods: BaseMethods[] = [...readMethods, ...writeMethods] */ function buildMethodNamesFromModel( modelName: string, - model: TEntityEntries[keyof TEntityEntries] + model: ModelEntries[keyof ModelEntries] ): Record { return methods.reduce((acc, method) => { let normalizedModelName: string = "" @@ -79,11 +79,11 @@ export const MedusaServiceModelObjectsSymbol = Symbol.for( export const MedusaServiceSymbol = Symbol.for("MedusaServiceSymbol") /** - * Accessible from the MedusaService, holds the entity name to linkable keys map + * Accessible from the MedusaService, holds the model name to linkable keys map * to be used for softDelete and restore methods */ -export const MedusaServiceEntityNameToLinkableKeysMapSymbol = Symbol.for( - "MedusaServiceEntityNameToLinkableKeysMapSymbol" +export const MedusaServiceModelNameToLinkableKeysMapSymbol = Symbol.for( + "MedusaServiceModelNameToLinkableKeysMapSymbol" ) /** @@ -103,7 +103,7 @@ export function isMedusaService( * * // Here the DTO's and names will be inferred from the arguments * - * const entities = { + * const models = { * Currency, * Price, * PriceList, @@ -114,21 +114,21 @@ export function isMedusaService( * RuleType, * } * - * class MyService extends ModulesSdkUtils.MedusaService(entities) {} + * class MyService extends ModulesSdkUtils.MedusaService(models) {} * - * @param entities + * @param models */ export function MedusaService< - const EntitiesConfig extends EntitiesConfigTemplate = { __empty: any }, - const TEntities extends TEntityEntries< - ExtractKeysFromConfig - > = TEntityEntries> + const ModelsConfig extends ModelsConfigTemplate = { __empty: any }, + const TModels extends ModelEntries< + ExtractKeysFromConfig + > = ModelEntries> >( - entities: TEntities + models: TModels ): MedusaServiceReturnType< - EntitiesConfig extends { __empty: any } - ? ModelConfigurationsToConfigTemplate - : EntitiesConfig + ModelsConfig extends { __empty: any } + ? ModelConfigurationsToConfigTemplate + : ModelsConfig > { const buildAndAssignMethodImpl = function ( klassPrototype: any, @@ -168,11 +168,11 @@ export function MedusaService< config?: FindConfig, sharedContext: Context = {} ): Promise { - const entities = await this.__container__[ + const models = await this.__container__[ serviceRegistrationName ].retrieve(id, config, sharedContext) - return await this.baseRepository_.serialize(entities) + return await this.baseRepository_.serialize(models) } applyMethod(methodImplementation, 2) @@ -186,8 +186,8 @@ export function MedusaService< ): Promise { const serviceData = Array.isArray(data) ? data : [data] const service = this.__container__[serviceRegistrationName] - const entities = await service.create(serviceData, sharedContext) - const response = Array.isArray(data) ? entities : entities[0] + const models = await service.create(serviceData, sharedContext) + const response = Array.isArray(data) ? models : models[0] return await this.baseRepository_.serialize(response) } @@ -203,8 +203,8 @@ export function MedusaService< ): Promise { const serviceData = Array.isArray(data) ? data : [data] const service = this.__container__[serviceRegistrationName] - const entities = await service.update(serviceData, sharedContext) - const response = Array.isArray(data) ? entities : entities[0] + const models = await service.update(serviceData, sharedContext) + const response = Array.isArray(data) ? models : models[0] return await this.baseRepository_.serialize(response) } @@ -220,9 +220,9 @@ export function MedusaService< sharedContext: Context = {} ): Promise { const service = this.__container__[serviceRegistrationName] - const entities = await service.list(filters, config, sharedContext) + const models = await service.list(filters, config, sharedContext) - return await this.baseRepository_.serialize(entities) + return await this.baseRepository_.serialize(models) } applyMethod(methodImplementation, 2) @@ -235,11 +235,11 @@ export function MedusaService< config: FindConfig = {}, sharedContext: Context = {} ): Promise { - const [entities, count] = await this.__container__[ + const [models, count] = await this.__container__[ serviceRegistrationName ].listAndCount(filters, config, sharedContext) - return [await this.baseRepository_.serialize(entities), count] + return [await this.baseRepository_.serialize(models), count] } applyMethod(methodImplementation, 2) @@ -283,16 +283,16 @@ export function MedusaService< ? primaryKeyValues : [primaryKeyValues] - const [entities, cascadedEntitiesMap] = await this.__container__[ + const [models, cascadedModelsMap] = await this.__container__[ serviceRegistrationName ].softDelete(primaryKeyValues_, sharedContext) - const softDeletedEntities = await this.baseRepository_.serialize( - entities + const softDeletedModels = await this.baseRepository_.serialize( + models ) await this.eventBusModuleService_?.emit( - softDeletedEntities.map(({ id }) => ({ + softDeletedModels.map(({ id }) => ({ eventName: `${kebabCase(modelName)}.deleted`, metadata: { source: "", action: "", object: "" }, data: { id }, @@ -301,15 +301,15 @@ export function MedusaService< // Map internal table/column names to their respective external linkable keys // eg: product.id = product_id, variant.id = variant_id - const mappedCascadedEntitiesMap = mapObjectTo( - cascadedEntitiesMap, - this[MedusaServiceEntityNameToLinkableKeysMapSymbol], + const mappedCascadedModelsMap = mapObjectTo( + cascadedModelsMap, + this[MedusaServiceModelNameToLinkableKeysMapSymbol], { pick: config.returnLinkableKeys, } ) - return mappedCascadedEntitiesMap ? mappedCascadedEntitiesMap : void 0 + return mappedCascadedModelsMap ? mappedCascadedModelsMap : void 0 } applyMethod(methodImplementation, 2) @@ -326,22 +326,22 @@ export function MedusaService< ? primaryKeyValues : [primaryKeyValues] - const [_, cascadedEntitiesMap] = await this.__container__[ + const [_, cascadedModelsMap] = await this.__container__[ serviceRegistrationName ].restore(primaryKeyValues_, sharedContext) - let mappedCascadedEntitiesMap + let mappedCascadedModelsMap // Map internal table/column names to their respective external linkable keys // eg: product.id = product_id, variant.id = variant_id - mappedCascadedEntitiesMap = mapObjectTo( - cascadedEntitiesMap, - this[MedusaServiceEntityNameToLinkableKeysMapSymbol], + mappedCascadedModelsMap = mapObjectTo( + cascadedModelsMap, + this[MedusaServiceModelNameToLinkableKeysMapSymbol], { pick: config.returnLinkableKeys, } ) - return mappedCascadedEntitiesMap ? mappedCascadedEntitiesMap : void 0 + return mappedCascadedModelsMap ? mappedCascadedModelsMap : void 0 } applyMethod(methodImplementation, 2) @@ -354,13 +354,13 @@ export function MedusaService< [MedusaServiceSymbol] = true static [MedusaServiceModelObjectsSymbol] = - entities as unknown as MedusaServiceReturnType< - EntitiesConfig extends { __empty: any } - ? ModelConfigurationsToConfigTemplate - : EntitiesConfig + models as unknown as MedusaServiceReturnType< + ModelsConfig extends { __empty: any } + ? ModelConfigurationsToConfigTemplate + : ModelsConfig >["$modelObjects"]; - [MedusaServiceEntityNameToLinkableKeysMapSymbol]: MapToConfig + [MedusaServiceModelNameToLinkableKeysMapSymbol]: MapToConfig readonly __container__: Record readonly baseRepository_: RepositoryService @@ -380,8 +380,8 @@ export function MedusaService< ? this.__container__.eventBusModuleService : undefined - this[MedusaServiceEntityNameToLinkableKeysMapSymbol] = - buildEntitiesNameToLinkableKeysMap( + this[MedusaServiceModelNameToLinkableKeysMapSymbol] = + buildModelsNameToLinkableKeysMap( this.__joinerConfig?.()?.linkableKeys ?? {} ) } @@ -404,18 +404,18 @@ export function MedusaService< * Build the retrieve/list/listAndCount/delete/softDelete/restore methods for all the other models */ - const entitiesMethods: [ + const modelsMethods: [ string, - TEntities[keyof TEntities], + TModels[keyof TModels], Record - ][] = Object.entries(entities as {}).map(([name, config]) => [ + ][] = Object.entries(models as {}).map(([name, config]) => [ name, - config as TEntities[keyof TEntities], - buildMethodNamesFromModel(name, config as TEntities[keyof TEntities]), + config as TModels[keyof TModels], + buildMethodNamesFromModel(name, config as TModels[keyof TModels]), ]) - for (let [modelName, model, modelsMethods] of entitiesMethods) { - Object.entries(modelsMethods).forEach(([method, methodName]) => { + for (let [modelName, model, modelMethods] of modelsMethods) { + Object.entries(modelMethods).forEach(([method, methodName]) => { buildAndAssignMethodImpl( AbstractModuleService_.prototype, method, diff --git a/packages/core/utils/src/modules-sdk/types/medusa-service.ts b/packages/core/utils/src/modules-sdk/types/medusa-service.ts index be03c1c6b7..f32650e434 100644 --- a/packages/core/utils/src/modules-sdk/types/medusa-service.ts +++ b/packages/core/utils/src/modules-sdk/types/medusa-service.ts @@ -36,9 +36,9 @@ export type ModelDTOConfig = { plural?: string } -export type EntitiesConfigTemplate = { [key: string]: ModelDTOConfig } +export type ModelsConfigTemplate = { [key: string]: ModelDTOConfig } -export type ModelConfigurationsToConfigTemplate = { +export type ModelConfigurationsToConfigTemplate = { [Key in keyof T]: { dto: T[Key] extends Constructor ? InstanceType : any model: T[Key] extends { model: infer MODEL } @@ -90,7 +90,7 @@ export type ExtractPluralName< > // TODO: The future expected entry will be a MODEL object but in the meantime we have to maintain backward compatibility for ouw own modules and therefore we need to support Constructor as well as this temporary object -export type TEntityEntries = Record< +export type ModelEntries = Record< Keys & string, | DmlEntity /** @@ -103,45 +103,45 @@ export type TEntityEntries = Record< | { name?: string; singular?: string; plural?: string } > -export type ExtractKeysFromConfig = EntitiesConfig extends { +export type ExtractKeysFromConfig = ModelsConfig extends { __empty: any } ? string - : keyof EntitiesConfig + : keyof ModelsConfig export type AbstractModuleService< - TEntitiesDtoConfig extends Record + TModelsDtoConfig extends Record > = { - [TEntityName in keyof TEntitiesDtoConfig as `retrieve${ExtractSingularName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `retrieve${ExtractSingularName< + TModelsDtoConfig, + TModelName >}`]: ( id: string, config?: FindConfig, sharedContext?: Context - ) => Promise + ) => Promise } & { - [TEntityName in keyof TEntitiesDtoConfig as `list${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `list${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: ( filters?: any, config?: FindConfig, sharedContext?: Context - ) => Promise + ) => Promise } & { - [TEntityName in keyof TEntitiesDtoConfig as `listAndCount${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `listAndCount${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { (filters?: any, config?: FindConfig, sharedContext?: Context): Promise< - [TEntitiesDtoConfig[TEntityName]["dto"][], number] + [TModelsDtoConfig[TModelName]["dto"][], number] > } } & { - [TEntityName in keyof TEntitiesDtoConfig as `delete${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `delete${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { ( primaryKeyValues: string | object | string[] | object[], @@ -149,9 +149,9 @@ export type AbstractModuleService< ): Promise } } & { - [TEntityName in keyof TEntitiesDtoConfig as `softDelete${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `softDelete${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { ( primaryKeyValues: string | object | string[] | object[], @@ -160,9 +160,9 @@ export type AbstractModuleService< ): Promise | void> } } & { - [TEntityName in keyof TEntitiesDtoConfig as `restore${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `restore${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { ( primaryKeyValues: string | object | string[] | object[], @@ -171,16 +171,16 @@ export type AbstractModuleService< ): Promise | void> } } & { - [TEntityName in keyof TEntitiesDtoConfig as `create${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `create${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { (...args: any[]): Promise } } & { - [TEntityName in keyof TEntitiesDtoConfig as `update${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `update${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { (...args: any[]): Promise } @@ -190,53 +190,53 @@ export type AbstractModuleService< // are not consistent accross modules /* & { - [TEntityName in keyof TEntitiesDtoConfig as `create${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `create${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { (data: any[], sharedContext?: Context): Promise< - TEntitiesDtoConfig[TEntityName]["dto"][] + TModelsDtoConfig[TModelName]["dto"][] > } } & { - [TEntityName in keyof TEntitiesDtoConfig as `create${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `create${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { (data: any, sharedContext?: Context): Promise< - TEntitiesDtoConfig[TEntityName]["dto"][] + TModelsDtoConfig[TModelName]["dto"][] > } } & { - [TEntityName in keyof TEntitiesDtoConfig as `update${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `update${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { ( - data: TEntitiesDtoConfig[TEntityName]["update"][], + data: TModelsDtoConfig[TModelName]["update"][], sharedContext?: Context - ): Promise + ): Promise } } & { - [TEntityName in keyof TEntitiesDtoConfig as `update${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `update${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { ( - data: TEntitiesDtoConfig[TEntityName]["update"], + data: TModelsDtoConfig[TModelName]["update"], sharedContext?: Context - ): Promise + ): Promise } } & { - [TEntityName in keyof TEntitiesDtoConfig as `update${ExtractPluralName< - TEntitiesDtoConfig, - TEntityName + [TModelName in keyof TModelsDtoConfig as `update${ExtractPluralName< + TModelsDtoConfig, + TModelName >}`]: { ( idOrdSelector: any, - data: TEntitiesDtoConfig[TEntityName]["update"], + data: TModelsDtoConfig[TModelName]["update"], sharedContext?: Context - ): Promise + ): Promise } }*/ diff --git a/packages/modules/cart/src/models/address.ts b/packages/modules/cart/src/models/address.ts index 0aabf6badb..662b31768e 100644 --- a/packages/modules/cart/src/models/address.ts +++ b/packages/modules/cart/src/models/address.ts @@ -14,7 +14,7 @@ import { Property, } from "@mikro-orm/core" -type OptionalAddressProps = DAL.SoftDeletableEntityDateColumns +type OptionalAddressProps = DAL.SoftDeletableModelDateColumns @Entity({ tableName: "cart_address" }) @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions) diff --git a/packages/modules/cart/src/models/adjustment-line.ts b/packages/modules/cart/src/models/adjustment-line.ts index 33c85df8d9..3c42557b41 100644 --- a/packages/modules/cart/src/models/adjustment-line.ts +++ b/packages/modules/cart/src/models/adjustment-line.ts @@ -2,7 +2,7 @@ import { DAL } from "@medusajs/types" import { BigNumber, MikroOrmBigNumberProperty } from "@medusajs/utils" import { OptionalProps, PrimaryKey, Property } from "@mikro-orm/core" -type OptionalAdjustmentLineProps = DAL.SoftDeletableEntityDateColumns +type OptionalAdjustmentLineProps = DAL.SoftDeletableModelDateColumns /** * As per the Mikro ORM docs, superclasses should use the abstract class definition diff --git a/packages/modules/cart/src/models/cart.ts b/packages/modules/cart/src/models/cart.ts index 6c403ab8f1..99a92853f1 100644 --- a/packages/modules/cart/src/models/cart.ts +++ b/packages/modules/cart/src/models/cart.ts @@ -25,7 +25,7 @@ import ShippingMethod from "./shipping-method" type OptionalCartProps = | "shipping_address" | "billing_address" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns const RegionIdIndex = createPsqlIndexStatementHelper({ name: "IDX_cart_region_id", diff --git a/packages/modules/cart/src/models/line-item.ts b/packages/modules/cart/src/models/line-item.ts index 610d63670b..5f33ac16dd 100644 --- a/packages/modules/cart/src/models/line-item.ts +++ b/packages/modules/cart/src/models/line-item.ts @@ -30,7 +30,7 @@ type OptionalLineItemProps = | "compare_at_unit_price" | "requires_shipping" | "cart" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns const CartIdIndex = createPsqlIndexStatementHelper({ name: "IDX_line_item_cart_id", diff --git a/packages/modules/cart/src/models/shipping-method.ts b/packages/modules/cart/src/models/shipping-method.ts index 07889b33c3..d22f8ce2a0 100644 --- a/packages/modules/cart/src/models/shipping-method.ts +++ b/packages/modules/cart/src/models/shipping-method.ts @@ -28,7 +28,7 @@ import ShippingMethodTaxLine from "./shipping-method-tax-line" type OptionalShippingMethodProps = | "cart" | "is_tax_inclusive" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns const CartIdIndex = createPsqlIndexStatementHelper({ name: "IDX_shipping_method_cart_id", diff --git a/packages/modules/cart/src/models/tax-line.ts b/packages/modules/cart/src/models/tax-line.ts index 2dbddd6746..f9ae6e935c 100644 --- a/packages/modules/cart/src/models/tax-line.ts +++ b/packages/modules/cart/src/models/tax-line.ts @@ -1,7 +1,7 @@ import { DAL } from "@medusajs/types" import { OptionalProps, PrimaryKey, Property } from "@mikro-orm/core" -type OptionalTaxLineProps = DAL.SoftDeletableEntityDateColumns +type OptionalTaxLineProps = DAL.SoftDeletableModelDateColumns /** * As per the Mikro ORM docs, superclasses should use the abstract class definition diff --git a/packages/modules/customer/src/models/address.ts b/packages/modules/customer/src/models/address.ts index 89d8e2dd86..15cbac743a 100644 --- a/packages/modules/customer/src/models/address.ts +++ b/packages/modules/customer/src/models/address.ts @@ -16,7 +16,7 @@ import { } from "@mikro-orm/core" import Customer from "./customer" -type OptionalAddressProps = DAL.EntityDateColumns // TODO: To be revisited when more clear +type OptionalAddressProps = DAL.ModelDateColumns // TODO: To be revisited when more clear const CustomerAddressUniqueCustomerShippingAddress = createPsqlIndexStatementHelper({ diff --git a/packages/modules/customer/src/models/customer-group-customer.ts b/packages/modules/customer/src/models/customer-group-customer.ts index bec66f38d5..509e7019f6 100644 --- a/packages/modules/customer/src/models/customer-group-customer.ts +++ b/packages/modules/customer/src/models/customer-group-customer.ts @@ -14,7 +14,7 @@ import { import Customer from "./customer" import CustomerGroup from "./customer-group" -type OptionalGroupProps = "customer_group" | "customer" | DAL.EntityDateColumns // TODO: To be revisited when more clear +type OptionalGroupProps = "customer_group" | "customer" | DAL.ModelDateColumns // TODO: To be revisited when more clear @Entity({ tableName: "customer_group_customer" }) export default class CustomerGroupCustomer { diff --git a/packages/modules/customer/src/models/customer-group.ts b/packages/modules/customer/src/models/customer-group.ts index ed590fe7e6..a6604fa31e 100644 --- a/packages/modules/customer/src/models/customer-group.ts +++ b/packages/modules/customer/src/models/customer-group.ts @@ -20,7 +20,7 @@ import { import Customer from "./customer" import CustomerGroupCustomer from "./customer-group-customer" -type OptionalGroupProps = DAL.SoftDeletableEntityDateColumns // TODO: To be revisited when more clear +type OptionalGroupProps = DAL.SoftDeletableModelDateColumns // TODO: To be revisited when more clear const CustomerGroupUniqueName = createPsqlIndexStatementHelper({ tableName: "customer_group", diff --git a/packages/modules/customer/src/models/customer.ts b/packages/modules/customer/src/models/customer.ts index 3f1aadfd8e..3f52712b94 100644 --- a/packages/modules/customer/src/models/customer.ts +++ b/packages/modules/customer/src/models/customer.ts @@ -26,7 +26,7 @@ import CustomerGroupCustomer from "./customer-group-customer" type OptionalCustomerProps = | "groups" | "addresses" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns const CustomerUniqueEmail = createPsqlIndexStatementHelper({ tableName: "customer", diff --git a/packages/modules/fulfillment/src/models/address.ts b/packages/modules/fulfillment/src/models/address.ts index ed9ba7e2c2..a5fd0b8baf 100644 --- a/packages/modules/fulfillment/src/models/address.ts +++ b/packages/modules/fulfillment/src/models/address.ts @@ -12,7 +12,7 @@ import { Property, } from "@mikro-orm/core" -type OptionalAddressProps = DAL.SoftDeletableEntityDateColumns +type OptionalAddressProps = DAL.SoftDeletableModelDateColumns const FulfillmentDeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "fulfillment_address", diff --git a/packages/modules/fulfillment/src/models/fulfillment-item.ts b/packages/modules/fulfillment/src/models/fulfillment-item.ts index 1fc297543b..70ae145eaa 100644 --- a/packages/modules/fulfillment/src/models/fulfillment-item.ts +++ b/packages/modules/fulfillment/src/models/fulfillment-item.ts @@ -20,7 +20,7 @@ import { } from "@mikro-orm/core" import Fulfillment from "./fulfillment" -type FulfillmentItemOptionalProps = DAL.SoftDeletableEntityDateColumns +type FulfillmentItemOptionalProps = DAL.SoftDeletableModelDateColumns const FulfillmentIdIndex = createPsqlIndexStatementHelper({ tableName: "fulfillment_item", diff --git a/packages/modules/fulfillment/src/models/fulfillment-label.ts b/packages/modules/fulfillment/src/models/fulfillment-label.ts index 4c9cea478d..e0babac47d 100644 --- a/packages/modules/fulfillment/src/models/fulfillment-label.ts +++ b/packages/modules/fulfillment/src/models/fulfillment-label.ts @@ -18,7 +18,7 @@ import { } from "@mikro-orm/core" import Fulfillment from "./fulfillment" -type FulfillmentLabelOptionalProps = DAL.SoftDeletableEntityDateColumns +type FulfillmentLabelOptionalProps = DAL.SoftDeletableModelDateColumns const FulfillmentIdIndex = createPsqlIndexStatementHelper({ tableName: "fulfillment_label", diff --git a/packages/modules/fulfillment/src/models/fulfillment-set.ts b/packages/modules/fulfillment/src/models/fulfillment-set.ts index c351d009ac..ddd54d04a0 100644 --- a/packages/modules/fulfillment/src/models/fulfillment-set.ts +++ b/packages/modules/fulfillment/src/models/fulfillment-set.ts @@ -20,7 +20,7 @@ import { } from "@mikro-orm/core" import ServiceZone from "./service-zone" -type FulfillmentSetOptionalProps = DAL.SoftDeletableEntityDateColumns +type FulfillmentSetOptionalProps = DAL.SoftDeletableModelDateColumns const DeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "fulfillment_set", diff --git a/packages/modules/fulfillment/src/models/fulfillment.ts b/packages/modules/fulfillment/src/models/fulfillment.ts index 499ee2684c..3fb3ede218 100644 --- a/packages/modules/fulfillment/src/models/fulfillment.ts +++ b/packages/modules/fulfillment/src/models/fulfillment.ts @@ -26,7 +26,7 @@ import FulfillmentLabel from "./fulfillment-label" import FulfillmentProvider from "./fulfillment-provider" import ShippingOption from "./shipping-option" -type FulfillmentOptionalProps = DAL.SoftDeletableEntityDateColumns +type FulfillmentOptionalProps = DAL.SoftDeletableModelDateColumns const FulfillmentDeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "fulfillment", diff --git a/packages/modules/fulfillment/src/models/geo-zone.ts b/packages/modules/fulfillment/src/models/geo-zone.ts index fd22c37996..a9cd0d0c11 100644 --- a/packages/modules/fulfillment/src/models/geo-zone.ts +++ b/packages/modules/fulfillment/src/models/geo-zone.ts @@ -20,7 +20,7 @@ import { } from "@mikro-orm/core" import ServiceZone from "./service-zone" -type GeoZoneOptionalProps = DAL.SoftDeletableEntityDateColumns +type GeoZoneOptionalProps = DAL.SoftDeletableModelDateColumns const DeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "geo_zone", diff --git a/packages/modules/fulfillment/src/models/service-zone.ts b/packages/modules/fulfillment/src/models/service-zone.ts index 59eecf6e34..6d4c372aae 100644 --- a/packages/modules/fulfillment/src/models/service-zone.ts +++ b/packages/modules/fulfillment/src/models/service-zone.ts @@ -24,7 +24,7 @@ import FulfillmentSet from "./fulfillment-set" import GeoZone from "./geo-zone" import ShippingOption from "./shipping-option" -type ServiceZoneOptionalProps = DAL.SoftDeletableEntityDateColumns +type ServiceZoneOptionalProps = DAL.SoftDeletableModelDateColumns const deletedAtIndexName = "IDX_service_zone_deleted_at" const deletedAtIndexStatement = createPsqlIndexStatementHelper({ diff --git a/packages/modules/fulfillment/src/models/shipping-option-rule.ts b/packages/modules/fulfillment/src/models/shipping-option-rule.ts index a710927a84..638b2c80e2 100644 --- a/packages/modules/fulfillment/src/models/shipping-option-rule.ts +++ b/packages/modules/fulfillment/src/models/shipping-option-rule.ts @@ -19,7 +19,7 @@ import { } from "@mikro-orm/core" import ShippingOption from "./shipping-option" -type ShippingOptionRuleOptionalProps = DAL.SoftDeletableEntityDateColumns +type ShippingOptionRuleOptionalProps = DAL.SoftDeletableModelDateColumns const DeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "shipping_option_rule", diff --git a/packages/modules/fulfillment/src/models/shipping-option-type.ts b/packages/modules/fulfillment/src/models/shipping-option-type.ts index 2ce6e93c6b..b0b45e604a 100644 --- a/packages/modules/fulfillment/src/models/shipping-option-type.ts +++ b/packages/modules/fulfillment/src/models/shipping-option-type.ts @@ -18,7 +18,7 @@ import { } from "@mikro-orm/core" import ShippingOption from "./shipping-option" -type ShippingOptionTypeOptionalProps = DAL.SoftDeletableEntityDateColumns +type ShippingOptionTypeOptionalProps = DAL.SoftDeletableModelDateColumns const DeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "shipping_option_type", diff --git a/packages/modules/fulfillment/src/models/shipping-option.ts b/packages/modules/fulfillment/src/models/shipping-option.ts index 9d063abe90..b847e08a86 100644 --- a/packages/modules/fulfillment/src/models/shipping-option.ts +++ b/packages/modules/fulfillment/src/models/shipping-option.ts @@ -30,7 +30,7 @@ import ShippingOptionRule from "./shipping-option-rule" import ShippingOptionType from "./shipping-option-type" import ShippingProfile from "./shipping-profile" -type ShippingOptionOptionalProps = DAL.SoftDeletableEntityDateColumns +type ShippingOptionOptionalProps = DAL.SoftDeletableModelDateColumns const DeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "shipping_option", diff --git a/packages/modules/fulfillment/src/models/shipping-profile.ts b/packages/modules/fulfillment/src/models/shipping-profile.ts index ec9d7a5020..b5f3997e57 100644 --- a/packages/modules/fulfillment/src/models/shipping-profile.ts +++ b/packages/modules/fulfillment/src/models/shipping-profile.ts @@ -20,7 +20,7 @@ import { } from "@mikro-orm/core" import ShippingOption from "./shipping-option" -type ShippingProfileOptionalProps = DAL.SoftDeletableEntityDateColumns +type ShippingProfileOptionalProps = DAL.SoftDeletableModelDateColumns const DeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "shipping_profile", diff --git a/packages/modules/inventory-next/src/models/inventory-item.ts b/packages/modules/inventory-next/src/models/inventory-item.ts index f7bdf40ff3..71bbccd433 100644 --- a/packages/modules/inventory-next/src/models/inventory-item.ts +++ b/packages/modules/inventory-next/src/models/inventory-item.ts @@ -34,7 +34,7 @@ const InventoryItemSkuIndex = createPsqlIndexStatementHelper({ unique: true, }) -type InventoryItemOptionalProps = DAL.SoftDeletableEntityDateColumns +type InventoryItemOptionalProps = DAL.SoftDeletableModelDateColumns @Entity() @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions) diff --git a/packages/modules/order/src/models/address.ts b/packages/modules/order/src/models/address.ts index 9b6e3d743d..f06d78b64c 100644 --- a/packages/modules/order/src/models/address.ts +++ b/packages/modules/order/src/models/address.ts @@ -12,7 +12,7 @@ import { Property, } from "@mikro-orm/core" -type OptionalAddressProps = DAL.EntityDateColumns +type OptionalAddressProps = DAL.ModelDateColumns const CustomerIdIndex = createPsqlIndexStatementHelper({ tableName: "order_address", diff --git a/packages/modules/order/src/models/adjustment-line.ts b/packages/modules/order/src/models/adjustment-line.ts index 5686856993..5085688e7c 100644 --- a/packages/modules/order/src/models/adjustment-line.ts +++ b/packages/modules/order/src/models/adjustment-line.ts @@ -2,7 +2,7 @@ import { BigNumberRawValue, DAL } from "@medusajs/types" import { BigNumber, MikroOrmBigNumberProperty } from "@medusajs/utils" import { OptionalProps, PrimaryKey, Property } from "@mikro-orm/core" -type OptionalAdjustmentLineProps = DAL.EntityDateColumns +type OptionalAdjustmentLineProps = DAL.ModelDateColumns /** * As per the Mikro ORM docs, superclasses should use the abstract class definition diff --git a/packages/modules/order/src/models/claim-item-image.ts b/packages/modules/order/src/models/claim-item-image.ts index 96e8be1f37..dbf299facd 100644 --- a/packages/modules/order/src/models/claim-item-image.ts +++ b/packages/modules/order/src/models/claim-item-image.ts @@ -15,7 +15,7 @@ import { } from "@mikro-orm/core" import ClaimItem from "./claim-item" -type OptionalClaimItemImageProps = DAL.EntityDateColumns +type OptionalClaimItemImageProps = DAL.ModelDateColumns const ClaimItemImageDeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "order_claim_item_image", diff --git a/packages/modules/order/src/models/claim-item.ts b/packages/modules/order/src/models/claim-item.ts index 0987ad7f2e..6968e56d06 100644 --- a/packages/modules/order/src/models/claim-item.ts +++ b/packages/modules/order/src/models/claim-item.ts @@ -23,7 +23,7 @@ import Claim from "./claim" import ClaimItemImage from "./claim-item-image" import LineItem from "./line-item" -type OptionalLineItemProps = DAL.EntityDateColumns +type OptionalLineItemProps = DAL.ModelDateColumns const ClaimIdIndex = createPsqlIndexStatementHelper({ tableName: "order_claim_item", diff --git a/packages/modules/order/src/models/claim.ts b/packages/modules/order/src/models/claim.ts index 5a4dfc2d96..1008e9b1f7 100644 --- a/packages/modules/order/src/models/claim.ts +++ b/packages/modules/order/src/models/claim.ts @@ -27,7 +27,7 @@ import OrderShippingMethod from "./order-shipping-method" import Return from "./return" import Transaction from "./transaction" -type OptionalOrderClaimProps = DAL.EntityDateColumns +type OptionalOrderClaimProps = DAL.ModelDateColumns const DisplayIdIndex = createPsqlIndexStatementHelper({ tableName: "order_claim", diff --git a/packages/modules/order/src/models/exchange-item.ts b/packages/modules/order/src/models/exchange-item.ts index 683c0febdb..444ec6acae 100644 --- a/packages/modules/order/src/models/exchange-item.ts +++ b/packages/modules/order/src/models/exchange-item.ts @@ -16,7 +16,7 @@ import { import Exchange from "./exchange" import LineItem from "./line-item" -type OptionalLineItemProps = DAL.EntityDateColumns +type OptionalLineItemProps = DAL.ModelDateColumns const ExchangeIdIndex = createPsqlIndexStatementHelper({ tableName: "order_exchange_item", diff --git a/packages/modules/order/src/models/exchange.ts b/packages/modules/order/src/models/exchange.ts index 3011ed6ac6..b5b8150f56 100644 --- a/packages/modules/order/src/models/exchange.ts +++ b/packages/modules/order/src/models/exchange.ts @@ -24,7 +24,7 @@ import Order from "./order" import OrderShippingMethod from "./order-shipping-method" import Return from "./return" -type OptionalOrderExchangeProps = DAL.EntityDateColumns +type OptionalOrderExchangeProps = DAL.ModelDateColumns const DisplayIdIndex = createPsqlIndexStatementHelper({ tableName: "order_exchange", diff --git a/packages/modules/order/src/models/line-item.ts b/packages/modules/order/src/models/line-item.ts index 029d869983..76d0349347 100644 --- a/packages/modules/order/src/models/line-item.ts +++ b/packages/modules/order/src/models/line-item.ts @@ -20,7 +20,7 @@ import { import LineItemAdjustment from "./line-item-adjustment" import LineItemTaxLine from "./line-item-tax-line" -type OptionalLineItemProps = DAL.EntityDateColumns +type OptionalLineItemProps = DAL.ModelDateColumns const ProductIdIndex = createPsqlIndexStatementHelper({ tableName: "order_line_item", diff --git a/packages/modules/order/src/models/order-change-action.ts b/packages/modules/order/src/models/order-change-action.ts index 59d4f46a37..584fa15ab0 100644 --- a/packages/modules/order/src/models/order-change-action.ts +++ b/packages/modules/order/src/models/order-change-action.ts @@ -21,7 +21,7 @@ import Order from "./order" import OrderChange from "./order-change" import Return from "./return" -type OptionalLineItemProps = DAL.EntityDateColumns +type OptionalLineItemProps = DAL.ModelDateColumns const OrderChangeIdIndex = createPsqlIndexStatementHelper({ tableName: "order_change_action", diff --git a/packages/modules/order/src/models/order-change.ts b/packages/modules/order/src/models/order-change.ts index 799a2ea2ac..f5422cfac3 100644 --- a/packages/modules/order/src/models/order-change.ts +++ b/packages/modules/order/src/models/order-change.ts @@ -24,7 +24,7 @@ import Order from "./order" import OrderChangeAction from "./order-change-action" import Return from "./return" -type OptionalLineItemProps = DAL.EntityDateColumns +type OptionalLineItemProps = DAL.ModelDateColumns const OrderIdIndex = createPsqlIndexStatementHelper({ tableName: "order_change", diff --git a/packages/modules/order/src/models/order-item.ts b/packages/modules/order/src/models/order-item.ts index 116022d7e2..68c429c2f3 100644 --- a/packages/modules/order/src/models/order-item.ts +++ b/packages/modules/order/src/models/order-item.ts @@ -18,7 +18,7 @@ import { import LineItem from "./line-item" import Order from "./order" -type OptionalLineItemProps = DAL.EntityDateColumns +type OptionalLineItemProps = DAL.ModelDateColumns const OrderIdIndex = createPsqlIndexStatementHelper({ tableName: "order_item", diff --git a/packages/modules/order/src/models/order-shipping-method.ts b/packages/modules/order/src/models/order-shipping-method.ts index 2f0104c40d..dedb2585d4 100644 --- a/packages/modules/order/src/models/order-shipping-method.ts +++ b/packages/modules/order/src/models/order-shipping-method.ts @@ -19,7 +19,7 @@ import Order from "./order" import Return from "./return" import ShippingMethod from "./shipping-method" -type OptionalShippingMethodProps = DAL.EntityDateColumns +type OptionalShippingMethodProps = DAL.ModelDateColumns const OrderIdIndex = createPsqlIndexStatementHelper({ tableName: "order_shipping", diff --git a/packages/modules/order/src/models/order.ts b/packages/modules/order/src/models/order.ts index 157ff73f77..4e262f80dd 100644 --- a/packages/modules/order/src/models/order.ts +++ b/packages/modules/order/src/models/order.ts @@ -27,7 +27,7 @@ import Transaction from "./transaction" type OptionalOrderProps = | "shipping_address" | "billing_address" - | DAL.EntityDateColumns + | DAL.ModelDateColumns const DisplayIdIndex = createPsqlIndexStatementHelper({ tableName: "order", diff --git a/packages/modules/order/src/models/return-item.ts b/packages/modules/order/src/models/return-item.ts index f6b53c9d4d..010a90e54d 100644 --- a/packages/modules/order/src/models/return-item.ts +++ b/packages/modules/order/src/models/return-item.ts @@ -17,7 +17,7 @@ import LineItem from "./line-item" import Return from "./return" import ReturnReason from "./return-reason" -type OptionalLineItemProps = DAL.EntityDateColumns +type OptionalLineItemProps = DAL.ModelDateColumns const ReturnIdIndex = createPsqlIndexStatementHelper({ tableName: "return_item", diff --git a/packages/modules/order/src/models/return-reason.ts b/packages/modules/order/src/models/return-reason.ts index 48db365bad..c5ce654126 100644 --- a/packages/modules/order/src/models/return-reason.ts +++ b/packages/modules/order/src/models/return-reason.ts @@ -34,7 +34,7 @@ const ParentIndex = createPsqlIndexStatementHelper({ where: "deleted_at IS NOT NULL", }) -type OptionalOrderProps = "parent_return_reason" | DAL.EntityDateColumns +type OptionalOrderProps = "parent_return_reason" | DAL.ModelDateColumns @Entity({ tableName: "return_reason" }) export default class ReturnReason { diff --git a/packages/modules/order/src/models/return.ts b/packages/modules/order/src/models/return.ts index dd050278fa..887c891cdd 100644 --- a/packages/modules/order/src/models/return.ts +++ b/packages/modules/order/src/models/return.ts @@ -27,7 +27,7 @@ import Exchange from "./exchange" import Order from "./order" import OrderShippingMethod from "./order-shipping-method" -type OptionalReturnProps = DAL.EntityDateColumns +type OptionalReturnProps = DAL.ModelDateColumns const DisplayIdIndex = createPsqlIndexStatementHelper({ tableName: "return", diff --git a/packages/modules/order/src/models/transaction.ts b/packages/modules/order/src/models/transaction.ts index 5acf777e7a..b30fe99e63 100644 --- a/packages/modules/order/src/models/transaction.ts +++ b/packages/modules/order/src/models/transaction.ts @@ -20,7 +20,7 @@ import Exchange from "./exchange" import Order from "./order" import Return from "./return" -type OptionalLineItemProps = DAL.EntityDateColumns +type OptionalLineItemProps = DAL.ModelDateColumns const ReferenceIdIndex = createPsqlIndexStatementHelper({ tableName: "order_transaction", diff --git a/packages/modules/payment/src/models/payment-collection.ts b/packages/modules/payment/src/models/payment-collection.ts index 92e5d053e3..fefa36eb74 100644 --- a/packages/modules/payment/src/models/payment-collection.ts +++ b/packages/modules/payment/src/models/payment-collection.ts @@ -25,7 +25,7 @@ import Payment from "./payment" import PaymentProvider from "./payment-provider" import PaymentSession from "./payment-session" -type OptionalPaymentCollectionProps = "status" | DAL.EntityDateColumns +type OptionalPaymentCollectionProps = "status" | DAL.ModelDateColumns @Entity({ tableName: "payment_collection" }) @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions) diff --git a/packages/modules/payment/src/models/payment.ts b/packages/modules/payment/src/models/payment.ts index aa476be541..afc8cd35e7 100644 --- a/packages/modules/payment/src/models/payment.ts +++ b/packages/modules/payment/src/models/payment.ts @@ -26,7 +26,7 @@ import PaymentCollection from "./payment-collection" import PaymentSession from "./payment-session" import Refund from "./refund" -type OptionalPaymentProps = DAL.EntityDateColumns +type OptionalPaymentProps = DAL.ModelDateColumns @Entity({ tableName: "payment" }) @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions) diff --git a/packages/modules/pricing/src/models/price-list-rule.ts b/packages/modules/pricing/src/models/price-list-rule.ts index 5aa144922c..7e37888266 100644 --- a/packages/modules/pricing/src/models/price-list-rule.ts +++ b/packages/modules/pricing/src/models/price-list-rule.ts @@ -17,7 +17,7 @@ import { } from "@mikro-orm/core" import PriceList from "./price-list" -type OptionalFields = DAL.SoftDeletableEntityDateColumns +type OptionalFields = DAL.SoftDeletableModelDateColumns const tableName = "price_list_rule" const PriceListRuleDeletedAtIndex = createPsqlIndexStatementHelper({ diff --git a/packages/modules/pricing/src/models/price-list.ts b/packages/modules/pricing/src/models/price-list.ts index b2f5606605..87449dc3ce 100644 --- a/packages/modules/pricing/src/models/price-list.ts +++ b/packages/modules/pricing/src/models/price-list.ts @@ -27,7 +27,7 @@ import PriceListRule from "./price-list-rule" type OptionalFields = | "starts_at" | "ends_at" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns const tableName = "price_list" const PriceListDeletedAtIndex = createPsqlIndexStatementHelper({ diff --git a/packages/modules/pricing/src/models/price-rule.ts b/packages/modules/pricing/src/models/price-rule.ts index ffd63a1545..64e7936719 100644 --- a/packages/modules/pricing/src/models/price-rule.ts +++ b/packages/modules/pricing/src/models/price-rule.ts @@ -17,7 +17,7 @@ import { } from "@mikro-orm/core" import Price from "./price" -type OptionalFields = DAL.SoftDeletableEntityDateColumns +type OptionalFields = DAL.SoftDeletableModelDateColumns const tableName = "price_rule" const PriceRuleDeletedAtIndex = createPsqlIndexStatementHelper({ diff --git a/packages/modules/pricing/src/models/price.ts b/packages/modules/pricing/src/models/price.ts index 1d1abb3479..1223ba5e85 100644 --- a/packages/modules/pricing/src/models/price.ts +++ b/packages/modules/pricing/src/models/price.ts @@ -24,7 +24,7 @@ import PriceList from "./price-list" import PriceRule from "./price-rule" import PriceSet from "./price-set" -type OptionalFields = DAL.SoftDeletableEntityDateColumns +type OptionalFields = DAL.SoftDeletableModelDateColumns const tableName = "price" const PriceDeletedAtIndex = createPsqlIndexStatementHelper({ diff --git a/packages/modules/promotion/src/models/campaign-budget.ts b/packages/modules/promotion/src/models/campaign-budget.ts index 033bfd02d6..bdc82a9ce7 100644 --- a/packages/modules/promotion/src/models/campaign-budget.ts +++ b/packages/modules/promotion/src/models/campaign-budget.ts @@ -29,7 +29,7 @@ type OptionalFields = | "description" | "limit" | "used" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns @Entity({ tableName: "promotion_campaign_budget" }) @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions) diff --git a/packages/modules/promotion/src/models/campaign.ts b/packages/modules/promotion/src/models/campaign.ts index b8d4f0c3e2..37b8e44965 100644 --- a/packages/modules/promotion/src/models/campaign.ts +++ b/packages/modules/promotion/src/models/campaign.ts @@ -26,7 +26,7 @@ type OptionalFields = | "description" | "starts_at" | "ends_at" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns const tableName = "promotion_campaign" const CampaignUniqueCampaignIdentifier = createPsqlIndexStatementHelper({ diff --git a/packages/modules/promotion/src/models/promotion-rule.ts b/packages/modules/promotion/src/models/promotion-rule.ts index 6217cc3cc7..ae3db494fc 100644 --- a/packages/modules/promotion/src/models/promotion-rule.ts +++ b/packages/modules/promotion/src/models/promotion-rule.ts @@ -20,7 +20,7 @@ import ApplicationMethod from "./application-method" import Promotion from "./promotion" import PromotionRuleValue from "./promotion-rule-value" -type OptionalFields = "description" | DAL.SoftDeletableEntityDateColumns +type OptionalFields = "description" | DAL.SoftDeletableModelDateColumns type OptionalRelations = "values" | "promotions" @Entity({ tableName: "promotion_rule" }) diff --git a/packages/modules/promotion/src/models/promotion.ts b/packages/modules/promotion/src/models/promotion.ts index 159278d914..e82dcc4468 100644 --- a/packages/modules/promotion/src/models/promotion.ts +++ b/packages/modules/promotion/src/models/promotion.ts @@ -26,7 +26,7 @@ import ApplicationMethod from "./application-method" import Campaign from "./campaign" import PromotionRule from "./promotion-rule" -type OptionalFields = "is_automatic" | DAL.SoftDeletableEntityDateColumns +type OptionalFields = "is_automatic" | DAL.SoftDeletableModelDateColumns type OptionalRelations = "application_method" | "campaign" @Entity({ tableName: "promotion" }) diff --git a/packages/modules/sales-channel/src/models/sales-channel.ts b/packages/modules/sales-channel/src/models/sales-channel.ts index 9480aa075c..b821f13e5a 100644 --- a/packages/modules/sales-channel/src/models/sales-channel.ts +++ b/packages/modules/sales-channel/src/models/sales-channel.ts @@ -12,7 +12,7 @@ import { Property, } from "@mikro-orm/core" -type SalesChannelOptionalProps = "is_disabled" | DAL.EntityDateColumns +type SalesChannelOptionalProps = "is_disabled" | DAL.ModelDateColumns @Entity() @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions) diff --git a/packages/modules/store/src/models/store.ts b/packages/modules/store/src/models/store.ts index ba6e1aa996..569720f64a 100644 --- a/packages/modules/store/src/models/store.ts +++ b/packages/modules/store/src/models/store.ts @@ -21,7 +21,7 @@ import { } from "@mikro-orm/core" import StoreCurrency from "./currency" -type StoreOptionalProps = DAL.SoftDeletableEntityDateColumns +type StoreOptionalProps = DAL.SoftDeletableModelDateColumns const StoreDeletedAtIndex = createPsqlIndexStatementHelper({ tableName: "store", diff --git a/packages/modules/tax/src/models/tax-rate-rule.ts b/packages/modules/tax/src/models/tax-rate-rule.ts index b56b7617e2..4614d38b9e 100644 --- a/packages/modules/tax/src/models/tax-rate-rule.ts +++ b/packages/modules/tax/src/models/tax-rate-rule.ts @@ -19,7 +19,7 @@ import TaxRate from "./tax-rate" const TABLE_NAME = "tax_rate_rule" -type OptionalRuleProps = DAL.SoftDeletableEntityDateColumns +type OptionalRuleProps = DAL.SoftDeletableModelDateColumns const taxRateIdIndexName = "IDX_tax_rate_rule_tax_rate_id" const taxRateIdIndexStatement = createPsqlIndexStatementHelper({ diff --git a/packages/modules/tax/src/models/tax-rate.ts b/packages/modules/tax/src/models/tax-rate.ts index 9418223b58..bfbffb1b94 100644 --- a/packages/modules/tax/src/models/tax-rate.ts +++ b/packages/modules/tax/src/models/tax-rate.ts @@ -22,7 +22,7 @@ import { import TaxRateRule from "./tax-rate-rule" import TaxRegion from "./tax-region" -type OptionalTaxRateProps = DAL.SoftDeletableEntityDateColumns +type OptionalTaxRateProps = DAL.SoftDeletableModelDateColumns const TABLE_NAME = "tax_rate" diff --git a/packages/modules/tax/src/models/tax-region.ts b/packages/modules/tax/src/models/tax-region.ts index 54847e88d7..82580a07e5 100644 --- a/packages/modules/tax/src/models/tax-region.ts +++ b/packages/modules/tax/src/models/tax-region.ts @@ -23,7 +23,7 @@ import { import TaxProvider from "./tax-provider" import TaxRate from "./tax-rate" -type OptionalTaxRegionProps = DAL.SoftDeletableEntityDateColumns +type OptionalTaxRegionProps = DAL.SoftDeletableModelDateColumns const TABLE_NAME = "tax_region" diff --git a/packages/modules/user/src/models/invite.ts b/packages/modules/user/src/models/invite.ts index 503cb2ebe1..f29710073d 100644 --- a/packages/modules/user/src/models/invite.ts +++ b/packages/modules/user/src/models/invite.ts @@ -45,7 +45,7 @@ const inviteDeletedAtIndexStatement = createPsqlIndexStatementHelper({ type OptionalFields = | "metadata" | "accepted" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns @Entity({ tableName: "invite" }) @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions) export default class Invite { diff --git a/packages/modules/user/src/models/user.ts b/packages/modules/user/src/models/user.ts index 0c454725e8..ea66b68df1 100644 --- a/packages/modules/user/src/models/user.ts +++ b/packages/modules/user/src/models/user.ts @@ -39,7 +39,7 @@ type OptionalFields = | "last_name" | "metadata" | "avatar_url" - | DAL.SoftDeletableEntityDateColumns + | DAL.SoftDeletableModelDateColumns @Entity() @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)