chore: Cleanup manager decorator usage (#9181)
This commit is contained in:
1 parent
adbeb9cc1d
commit
81d3ae01c7
20 files changed
+362
-359
No files matched your search
@@ -13,6 +13,8 @@ export function InjectManager(managerProperty?: string): MethodDecorator {
|
||||
)
|
||||
}
|
||||
|
||||
managerProperty ??= "baseRepository_"
|
||||
|
||||
const originalMethod = descriptor.value
|
||||
const argIndex = target.MedusaContextIndex_[propertyKey]
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ export class ApiKeyModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ApiKeyTypes.ApiKeyDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createApiKeys(
|
||||
data: ApiKeyTypes.CreateApiKeyDTO | ApiKeyTypes.CreateApiKeyDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -134,7 +134,7 @@ export class ApiKeyModuleService
|
||||
return Array.isArray(data) ? responseWithRawToken : responseWithRawToken[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createApiKeys_(
|
||||
data: ApiKeyTypes.CreateApiKeyDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -177,7 +177,7 @@ export class ApiKeyModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ApiKeyTypes.ApiKeyDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async upsertApiKeys(
|
||||
data: ApiKeyTypes.UpsertApiKeyDTO | ApiKeyTypes.UpsertApiKeyDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -246,7 +246,7 @@ export class ApiKeyModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ApiKeyTypes.ApiKeyDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateApiKeys(
|
||||
idOrSelector: string | FilterableApiKeyProps,
|
||||
data: ApiKeyTypes.UpdateApiKeyDTO,
|
||||
@@ -272,7 +272,7 @@ export class ApiKeyModuleService
|
||||
return isString(idOrSelector) ? serializedResponse[0] : serializedResponse
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateApiKeys_(
|
||||
normalizedInput: UpdateApiKeyInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -289,7 +289,7 @@ export class ApiKeyModuleService
|
||||
return updatedApiKeys
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-expect-error
|
||||
async retrieveApiKey(
|
||||
id: string,
|
||||
@@ -306,7 +306,7 @@ export class ApiKeyModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
//@ts-expect-error
|
||||
async listApiKeys(
|
||||
filters?: ApiKeyTypes.FilterableApiKeyProps,
|
||||
@@ -327,7 +327,7 @@ export class ApiKeyModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
//@ts-expect-error
|
||||
async listAndCountApiKeys(
|
||||
filters?: ApiKeyTypes.FilterableApiKeyProps,
|
||||
@@ -361,7 +361,7 @@ export class ApiKeyModuleService
|
||||
data: ApiKeyTypes.RevokeApiKeyDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<ApiKeyTypes.ApiKeyDTO[]>
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async revoke(
|
||||
idOrSelector: string | FilterableApiKeyProps,
|
||||
data: ApiKeyTypes.RevokeApiKeyDTO,
|
||||
@@ -383,7 +383,7 @@ export class ApiKeyModuleService
|
||||
return isString(idOrSelector) ? serializedResponse[0] : serializedResponse
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async revoke_(
|
||||
normalizedInput: RevokeApiKeyInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -411,7 +411,7 @@ export class ApiKeyModuleService
|
||||
return revokedApiKeys
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async authenticate(
|
||||
token: string,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -429,7 +429,7 @@ export class ApiKeyModuleService
|
||||
return serialized
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async authenticate_(
|
||||
token: string,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
@@ -70,7 +70,7 @@ export default class AuthModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<AuthTypes.AuthIdentityDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createAuthIdentities(
|
||||
data: AuthTypes.CreateAuthIdentityDTO[] | AuthTypes.CreateAuthIdentityDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -100,7 +100,7 @@ export default class AuthModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<AuthTypes.AuthIdentityDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateAuthIdentities(
|
||||
data: AuthTypes.UpdateAuthIdentityDTO | AuthTypes.UpdateAuthIdentityDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -145,7 +145,7 @@ export default class AuthModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<AuthTypes.ProviderIdentityDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createProviderIdentities(
|
||||
data:
|
||||
| AuthTypes.CreateProviderIdentityDTO[]
|
||||
@@ -173,7 +173,7 @@ export default class AuthModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<AuthTypes.ProviderIdentityDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateProviderIdentities(
|
||||
data:
|
||||
| AuthTypes.UpdateProviderIdentityDTO
|
||||
|
||||
@@ -9,16 +9,16 @@ import {
|
||||
ModulesSdkTypes,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
InjectManager,
|
||||
InjectTransactionManager,
|
||||
MedusaContext,
|
||||
MedusaError,
|
||||
ModulesSdkUtils,
|
||||
createRawPropertiesFromBigNumber,
|
||||
decorateCartTotals,
|
||||
deduplicate,
|
||||
InjectManager,
|
||||
InjectTransactionManager,
|
||||
isObject,
|
||||
isString,
|
||||
MedusaContext,
|
||||
MedusaError,
|
||||
ModulesSdkUtils,
|
||||
} from "@medusajs/utils"
|
||||
import {
|
||||
Address,
|
||||
@@ -246,7 +246,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.CartDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createCarts(
|
||||
data: CartTypes.CreateCartDTO[] | CartTypes.CreateCartDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -268,7 +268,7 @@ export default class CartModuleService
|
||||
| CartTypes.CartDTO[]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createCarts_(
|
||||
data: CartTypes.CreateCartDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -314,7 +314,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.CartDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateCarts(
|
||||
dataOrIdOrSelector:
|
||||
| CartTypes.UpdateCartDTO[]
|
||||
@@ -338,7 +338,7 @@ export default class CartModuleService
|
||||
return isString(dataOrIdOrSelector) ? serializedResult[0] : serializedResult
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateCarts_(
|
||||
dataOrIdOrSelector:
|
||||
| CartTypes.UpdateCartDTO[]
|
||||
@@ -388,7 +388,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.CartLineItemDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async addLineItems(
|
||||
cartIdOrData:
|
||||
| string
|
||||
@@ -417,7 +417,7 @@ export default class CartModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async addLineItems_(
|
||||
cartId: string,
|
||||
items: CartTypes.CreateLineItemDTO[],
|
||||
@@ -439,7 +439,7 @@ export default class CartModuleService
|
||||
return await this.addLineItemsBulk_(toUpdate, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async addLineItemsBulk_(
|
||||
data: CreateLineItemDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -462,7 +462,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.CartLineItemDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateLineItems(
|
||||
lineItemIdOrDataOrSelector:
|
||||
| string
|
||||
@@ -506,7 +506,7 @@ export default class CartModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateLineItem_(
|
||||
lineItemId: string,
|
||||
data: Partial<CartTypes.UpdateLineItemDTO>,
|
||||
@@ -520,7 +520,7 @@ export default class CartModuleService
|
||||
return item
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateLineItemsWithSelector_(
|
||||
updates: CartTypes.UpdateLineItemWithSelectorDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -550,7 +550,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.CartAddressDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createAddresses(
|
||||
data: CartTypes.CreateAddressDTO[] | CartTypes.CreateAddressDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -569,7 +569,7 @@ export default class CartModuleService
|
||||
| CartTypes.CartAddressDTO[]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createAddresses_(
|
||||
data: CartTypes.CreateAddressDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -587,7 +587,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.CartAddressDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateAddresses(
|
||||
data: CartTypes.UpdateAddressDTO[] | CartTypes.UpdateAddressDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -606,7 +606,7 @@ export default class CartModuleService
|
||||
| CartTypes.CartAddressDTO[]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateAddresses_(
|
||||
data: CartTypes.UpdateAddressDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -626,7 +626,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.CartShippingMethodDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async addShippingMethods(
|
||||
cartIdOrData:
|
||||
| string
|
||||
@@ -659,7 +659,7 @@ export default class CartModuleService
|
||||
>(methods, { populate: true })
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async addShippingMethods_(
|
||||
cartId: string,
|
||||
data: CartTypes.CreateShippingMethodForSingleCartDTO[],
|
||||
@@ -681,7 +681,7 @@ export default class CartModuleService
|
||||
return await this.addShippingMethodsBulk_(methods, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async addShippingMethodsBulk_(
|
||||
data: CartTypes.CreateShippingMethodDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -704,7 +704,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.LineItemAdjustmentDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async addLineItemAdjustments(
|
||||
cartIdOrData:
|
||||
| string
|
||||
@@ -752,7 +752,7 @@ export default class CartModuleService
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async setLineItemAdjustments(
|
||||
cartId: string,
|
||||
adjustments: (
|
||||
@@ -807,7 +807,7 @@ export default class CartModuleService
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async setShippingMethodAdjustments(
|
||||
cartId: string,
|
||||
adjustments: (
|
||||
@@ -876,7 +876,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.ShippingMethodAdjustmentDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async addShippingMethodAdjustments(
|
||||
cartIdOrData:
|
||||
| string
|
||||
@@ -950,7 +950,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.LineItemTaxLineDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async addLineItemTaxLines(
|
||||
cartIdOrData:
|
||||
| string
|
||||
@@ -994,7 +994,7 @@ export default class CartModuleService
|
||||
return serialized
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async setLineItemTaxLines(
|
||||
cartId: string,
|
||||
taxLines: (
|
||||
@@ -1064,7 +1064,7 @@ export default class CartModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CartTypes.ShippingMethodTaxLineDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async addShippingMethodTaxLines(
|
||||
cartIdOrData:
|
||||
| string
|
||||
@@ -1110,7 +1110,7 @@ export default class CartModuleService
|
||||
return serialized
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async setShippingMethodTaxLines(
|
||||
cartId: string,
|
||||
taxLines: (
|
||||
|
||||
@@ -91,7 +91,7 @@ export default class CustomerModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CustomerTypes.CustomerDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createCustomers(
|
||||
dataOrArray:
|
||||
| CustomerTypes.CreateCustomerDTO
|
||||
@@ -109,7 +109,7 @@ export default class CustomerModuleService
|
||||
return Array.isArray(dataOrArray) ? serialized : serialized[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createCustomers_(
|
||||
dataOrArray:
|
||||
| CustomerTypes.CreateCustomerDTO
|
||||
@@ -158,7 +158,7 @@ export default class CustomerModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CustomerTypes.CustomerDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateCustomers(
|
||||
idsOrSelector: string | string[] | CustomerTypes.FilterableCustomerProps,
|
||||
data: CustomerTypes.CustomerUpdatableFields,
|
||||
@@ -214,7 +214,7 @@ export default class CustomerModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CustomerTypes.CustomerGroupDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createCustomerGroups(
|
||||
dataOrArrayOfData:
|
||||
| CustomerTypes.CreateCustomerGroupDTO
|
||||
@@ -250,7 +250,7 @@ export default class CustomerModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CustomerTypes.CustomerGroupDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateCustomerGroups(
|
||||
groupIdOrSelector:
|
||||
| string
|
||||
@@ -309,7 +309,7 @@ export default class CustomerModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<{ id: string }[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async addCustomerToGroup(
|
||||
data: CustomerTypes.GroupCustomerPair | CustomerTypes.GroupCustomerPair[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -338,7 +338,7 @@ export default class CustomerModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CustomerTypes.CustomerAddressDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createCustomerAddresses(
|
||||
data:
|
||||
| CustomerTypes.CreateCustomerAddressDTO
|
||||
@@ -360,7 +360,7 @@ export default class CustomerModuleService
|
||||
return serialized[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async createCustomerAddresses_(
|
||||
data:
|
||||
| CustomerTypes.CreateCustomerAddressDTO
|
||||
@@ -390,7 +390,7 @@ export default class CustomerModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<CustomerTypes.CustomerAddressDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateCustomerAddresses(
|
||||
addressIdOrSelector:
|
||||
| string
|
||||
@@ -451,7 +451,7 @@ export default class CustomerModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<void>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async removeCustomerFromGroup(
|
||||
data: CustomerTypes.GroupCustomerPair | CustomerTypes.GroupCustomerPair[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
@@ -135,7 +135,7 @@ export default class FulfillmentModuleService
|
||||
return joinerConfig
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-ignore
|
||||
async listShippingOptions(
|
||||
filters: FulfillmentTypes.FilterableShippingOptionForContextProps = {},
|
||||
@@ -155,7 +155,7 @@ export default class FulfillmentModuleService
|
||||
return await super.listShippingOptions(filters, config, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async listShippingOptionsForContext(
|
||||
filters: FulfillmentTypes.FilterableShippingOptionForContextProps,
|
||||
config: FindConfig<ShippingOptionDTO> = {},
|
||||
@@ -194,7 +194,7 @@ export default class FulfillmentModuleService
|
||||
>(shippingOptions)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async retrieveFulfillment(
|
||||
id: string,
|
||||
config: FindConfig<FulfillmentTypes.FulfillmentDTO> = {},
|
||||
@@ -211,7 +211,7 @@ export default class FulfillmentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async listFulfillments(
|
||||
filters: FulfillmentTypes.FilterableFulfillmentProps = {},
|
||||
config: FindConfig<FulfillmentTypes.FulfillmentDTO> = {},
|
||||
@@ -228,7 +228,7 @@ export default class FulfillmentModuleService
|
||||
>(fulfillments)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async listAndCountFulfillments(
|
||||
filters?: FilterableFulfillmentSetProps,
|
||||
config?: FindConfig<FulfillmentDTO>,
|
||||
@@ -258,7 +258,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.FulfillmentSetDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createFulfillmentSets(
|
||||
data:
|
||||
@@ -282,7 +282,7 @@ export default class FulfillmentModuleService
|
||||
>(returnedFulfillmentSets)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createFulfillmentSets_(
|
||||
data:
|
||||
| FulfillmentTypes.CreateFulfillmentSetDTO
|
||||
@@ -328,7 +328,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ServiceZoneDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createServiceZones(
|
||||
data:
|
||||
@@ -348,7 +348,7 @@ export default class FulfillmentModuleService
|
||||
>(Array.isArray(data) ? createdServiceZones : createdServiceZones[0])
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createServiceZones_(
|
||||
data:
|
||||
| FulfillmentTypes.CreateServiceZoneDTO[]
|
||||
@@ -392,7 +392,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ShippingOptionDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createShippingOptions(
|
||||
data:
|
||||
@@ -412,7 +412,7 @@ export default class FulfillmentModuleService
|
||||
>(Array.isArray(data) ? createdShippingOptions : createdShippingOptions[0])
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createShippingOptions_(
|
||||
data:
|
||||
| FulfillmentTypes.CreateShippingOptionDTO[]
|
||||
@@ -453,7 +453,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ShippingProfileDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
@EmitEvents()
|
||||
async createShippingProfiles(
|
||||
data:
|
||||
@@ -481,7 +481,7 @@ export default class FulfillmentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createShippingProfiles_(
|
||||
data:
|
||||
| FulfillmentTypes.CreateShippingProfileDTO[]
|
||||
@@ -507,7 +507,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.GeoZoneDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createGeoZones(
|
||||
data:
|
||||
@@ -544,7 +544,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ShippingOptionRuleDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createShippingOptionRules(
|
||||
data:
|
||||
@@ -570,7 +570,7 @@ export default class FulfillmentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createShippingOptionRules_(
|
||||
data:
|
||||
| FulfillmentTypes.CreateShippingOptionRuleDTO[]
|
||||
@@ -598,7 +598,7 @@ export default class FulfillmentModuleService
|
||||
return createdSORules
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createFulfillment(
|
||||
data: FulfillmentTypes.CreateFulfillmentDTO,
|
||||
@@ -650,7 +650,7 @@ export default class FulfillmentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createReturnFulfillment(
|
||||
data: FulfillmentTypes.CreateFulfillmentDTO,
|
||||
@@ -702,7 +702,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.FulfillmentSetDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateFulfillmentSets(
|
||||
data: UpdateFulfillmentSetDTO[] | UpdateFulfillmentSetDTO,
|
||||
@@ -720,7 +720,7 @@ export default class FulfillmentModuleService
|
||||
>(updatedFulfillmentSets)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateFulfillmentSets_(
|
||||
data: UpdateFulfillmentSetDTO[] | UpdateFulfillmentSetDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -938,7 +938,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ServiceZoneDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateServiceZones(
|
||||
idOrSelector: string | FulfillmentTypes.FilterableServiceZoneProps,
|
||||
@@ -981,7 +981,7 @@ export default class FulfillmentModuleService
|
||||
>(toReturn)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateServiceZones_(
|
||||
data:
|
||||
| FulfillmentTypes.UpdateServiceZoneDTO[]
|
||||
@@ -1155,7 +1155,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ServiceZoneDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async upsertServiceZones(
|
||||
data:
|
||||
@@ -1177,7 +1177,7 @@ export default class FulfillmentModuleService
|
||||
return Array.isArray(data) ? allServiceZones : allServiceZones[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertServiceZones_(
|
||||
data:
|
||||
| FulfillmentTypes.UpsertServiceZoneDTO[]
|
||||
@@ -1238,7 +1238,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ShippingOptionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateShippingOptions(
|
||||
idOrSelector: string | FulfillmentTypes.FilterableShippingOptionProps,
|
||||
@@ -1274,7 +1274,7 @@ export default class FulfillmentModuleService
|
||||
return isString(idOrSelector) ? serialized[0] : serialized
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateShippingOptions_(
|
||||
data: UpdateShippingOptionsInput[] | UpdateShippingOptionsInput,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1476,7 +1476,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ShippingOptionDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async upsertShippingOptions(
|
||||
data:
|
||||
@@ -1498,7 +1498,7 @@ export default class FulfillmentModuleService
|
||||
return Array.isArray(data) ? allShippingOptions : allShippingOptions[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertShippingOptions_(
|
||||
data:
|
||||
| FulfillmentTypes.UpsertShippingOptionDTO[]
|
||||
@@ -1556,7 +1556,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ShippingProfileDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateShippingProfiles(
|
||||
idOrSelector: string | FulfillmentTypes.FilterableShippingProfileProps,
|
||||
data: FulfillmentTypes.UpdateShippingProfileDTO,
|
||||
@@ -1608,7 +1608,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ShippingProfileDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertShippingProfiles(
|
||||
data:
|
||||
| FulfillmentTypes.UpsertShippingProfileDTO[]
|
||||
@@ -1658,7 +1658,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.GeoZoneDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateGeoZones(
|
||||
data:
|
||||
@@ -1701,7 +1701,7 @@ export default class FulfillmentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentTypes.ShippingOptionRuleDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateShippingOptionRules(
|
||||
data:
|
||||
@@ -1723,7 +1723,7 @@ export default class FulfillmentModuleService
|
||||
>(updatedShippingOptionRules)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateShippingOptionRules_(
|
||||
data:
|
||||
| FulfillmentTypes.UpdateShippingOptionRuleDTO[]
|
||||
@@ -1751,7 +1751,7 @@ export default class FulfillmentModuleService
|
||||
: updatedShippingOptionRules[0]
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateFulfillment(
|
||||
id: string,
|
||||
@@ -1765,7 +1765,7 @@ export default class FulfillmentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateFulfillment_(
|
||||
id: string,
|
||||
data: FulfillmentTypes.UpdateFulfillmentDTO,
|
||||
@@ -1873,7 +1873,7 @@ export default class FulfillmentModuleService
|
||||
})
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async cancelFulfillment(
|
||||
id: string,
|
||||
@@ -1937,7 +1937,7 @@ export default class FulfillmentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async validateShippingOption(
|
||||
shippingOptionId: string,
|
||||
context: Record<string, unknown> = {},
|
||||
|
||||
@@ -224,7 +224,7 @@ export default class InventoryModuleService
|
||||
context?: Context
|
||||
): Promise<InventoryTypes.ReservationItemDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createReservationItems(
|
||||
input:
|
||||
@@ -259,7 +259,7 @@ export default class InventoryModuleService
|
||||
: serializedReservations[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createReservationItems_(
|
||||
input: InventoryTypes.CreateReservationItemInput[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -324,7 +324,7 @@ export default class InventoryModuleService
|
||||
context?: Context
|
||||
): Promise<InventoryTypes.InventoryItemDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createInventoryItems(
|
||||
input:
|
||||
@@ -359,7 +359,7 @@ export default class InventoryModuleService
|
||||
return Array.isArray(input) ? serializedItems : serializedItems[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createInventoryItems_(
|
||||
input: InventoryTypes.CreateInventoryItemInput[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -377,7 +377,7 @@ export default class InventoryModuleService
|
||||
context?: Context
|
||||
): Promise<InventoryTypes.InventoryLevelDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createInventoryLevels(
|
||||
input:
|
||||
@@ -413,7 +413,7 @@ export default class InventoryModuleService
|
||||
return Array.isArray(input) ? serialized : serialized[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createInventoryLevels_(
|
||||
input: InventoryTypes.CreateInventoryLevelInput[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -431,7 +431,7 @@ export default class InventoryModuleService
|
||||
context?: Context
|
||||
): Promise<InventoryTypes.InventoryItemDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateInventoryItems(
|
||||
input:
|
||||
@@ -467,7 +467,7 @@ export default class InventoryModuleService
|
||||
return Array.isArray(input) ? serializedItems : serializedItems[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateInventoryItems_(
|
||||
input: (Partial<InventoryTypes.CreateInventoryItemInput> & {
|
||||
id: string
|
||||
@@ -477,7 +477,7 @@ export default class InventoryModuleService
|
||||
return await this.inventoryItemService_.update(input, context)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
@EmitEvents()
|
||||
async deleteInventoryItemLevelByLocationId(
|
||||
locationId: string | string[],
|
||||
@@ -508,7 +508,7 @@ export default class InventoryModuleService
|
||||
* @param locationId - the id of the location associated with the level
|
||||
* @param context
|
||||
*/
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async deleteInventoryLevel(
|
||||
inventoryItemId: string,
|
||||
locationId: string,
|
||||
@@ -546,7 +546,7 @@ export default class InventoryModuleService
|
||||
context?: Context
|
||||
): Promise<InventoryTypes.InventoryLevelDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateInventoryLevels(
|
||||
updates:
|
||||
@@ -582,7 +582,7 @@ export default class InventoryModuleService
|
||||
return Array.isArray(updates) ? updatedLevels : updatedLevels[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateInventoryLevels_(
|
||||
updates: InventoryTypes.BulkUpdateInventoryLevelInput[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -633,7 +633,7 @@ export default class InventoryModuleService
|
||||
context?: Context
|
||||
): Promise<InventoryTypes.ReservationItemDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateReservationItems(
|
||||
input:
|
||||
@@ -666,7 +666,7 @@ export default class InventoryModuleService
|
||||
return Array.isArray(input) ? serialized : serialized[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateReservationItems_(
|
||||
input: (InventoryTypes.UpdateReservationItemInput & { id: string })[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -787,7 +787,7 @@ export default class InventoryModuleService
|
||||
return result
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
// @ts-expect-error
|
||||
async softDeleteReservationItems(
|
||||
ids: string | string[],
|
||||
@@ -811,7 +811,7 @@ export default class InventoryModuleService
|
||||
result
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
// @ts-expect-error
|
||||
async restoreReservationItems(
|
||||
ids: string | string[],
|
||||
@@ -829,7 +829,7 @@ export default class InventoryModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
@EmitEvents()
|
||||
async deleteReservationItemByLocationId(
|
||||
locationId: string | string[],
|
||||
@@ -866,7 +866,7 @@ export default class InventoryModuleService
|
||||
* @param context
|
||||
*/
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
@EmitEvents()
|
||||
async deleteReservationItemsByLineItem(
|
||||
lineItemId: string | string[],
|
||||
@@ -903,7 +903,7 @@ export default class InventoryModuleService
|
||||
* @param context
|
||||
*/
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
@EmitEvents()
|
||||
async restoreReservationItemsByLineItem(
|
||||
lineItemId: string | string[],
|
||||
@@ -959,7 +959,7 @@ export default class InventoryModuleService
|
||||
context: Context
|
||||
): Promise<InventoryTypes.InventoryLevelDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async adjustInventory(
|
||||
inventoryItemIdOrData: string | any,
|
||||
@@ -1010,7 +1010,7 @@ export default class InventoryModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async adjustInventory_(
|
||||
inventoryItemId: string,
|
||||
locationId: string,
|
||||
@@ -1037,7 +1037,7 @@ export default class InventoryModuleService
|
||||
return result[0]
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async retrieveInventoryLevelByItemAndLocation(
|
||||
inventoryItemId: string,
|
||||
locationId: string,
|
||||
@@ -1067,7 +1067,7 @@ export default class InventoryModuleService
|
||||
* @return The available quantity
|
||||
* @throws when the inventory item is not found
|
||||
*/
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async retrieveAvailableQuantity(
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
@@ -1103,7 +1103,7 @@ export default class InventoryModuleService
|
||||
* @return The stocked quantity
|
||||
* @throws when the inventory item is not found
|
||||
*/
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async retrieveStockedQuantity(
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
@@ -1140,7 +1140,7 @@ export default class InventoryModuleService
|
||||
* @return The reserved quantity
|
||||
* @throws when the inventory item is not found
|
||||
*/
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async retrieveReservedQuantity(
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
@@ -1177,7 +1177,7 @@ export default class InventoryModuleService
|
||||
* @param context
|
||||
* @return Whether there is sufficient inventory
|
||||
*/
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async confirmInventory(
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
|
||||
@@ -13,13 +13,13 @@ import {
|
||||
CommonEvents,
|
||||
InjectManager,
|
||||
InjectTransactionManager,
|
||||
isDefined,
|
||||
mapObjectTo,
|
||||
MapToConfig,
|
||||
MedusaContext,
|
||||
MedusaError,
|
||||
Modules,
|
||||
ModulesSdkUtils,
|
||||
isDefined,
|
||||
mapObjectTo,
|
||||
} from "@medusajs/utils"
|
||||
import { LinkService } from "@services"
|
||||
import { shouldForceTransaction } from "../utils"
|
||||
@@ -116,7 +116,7 @@ export default class LinkModuleService<TLink> implements ILinkModule {
|
||||
})
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async retrieve(
|
||||
primaryKeyData: string | string[],
|
||||
foreignKeyData: string,
|
||||
@@ -139,7 +139,7 @@ export default class LinkModuleService<TLink> implements ILinkModule {
|
||||
return entry[0]
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async list(
|
||||
filters: Record<string, unknown> = {},
|
||||
config: FindConfig<unknown> = {},
|
||||
@@ -154,7 +154,7 @@ export default class LinkModuleService<TLink> implements ILinkModule {
|
||||
return await this.baseRepository_.serialize<object[]>(rows)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async listAndCount(
|
||||
filters: Record<string, unknown> = {},
|
||||
config: FindConfig<unknown> = {},
|
||||
|
||||
@@ -66,7 +66,7 @@ export default class NotificationModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<NotificationTypes.NotificationDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createNotifications(
|
||||
data:
|
||||
@@ -95,7 +95,7 @@ export default class NotificationModuleService
|
||||
return Array.isArray(data) ? serialized : serialized[0]
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
protected async createNotifications_(
|
||||
data: NotificationTypes.CreateNotificationDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
DAL,
|
||||
FilterableOrderReturnReasonProps,
|
||||
FindConfig,
|
||||
IOrderModuleService,
|
||||
InternalModuleDeclaration,
|
||||
IOrderModuleService,
|
||||
ModuleJoinerConfig,
|
||||
ModulesSdkTypes,
|
||||
OrderDTO,
|
||||
@@ -19,21 +19,21 @@ import {
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
BigNumber,
|
||||
createRawPropertiesFromBigNumber,
|
||||
DecorateCartLikeInputDTO,
|
||||
decorateCartTotals,
|
||||
deduplicate,
|
||||
InjectManager,
|
||||
InjectTransactionManager,
|
||||
isDefined,
|
||||
isObject,
|
||||
isString,
|
||||
MathBN,
|
||||
MedusaContext,
|
||||
MedusaError,
|
||||
ModulesSdkUtils,
|
||||
OrderChangeStatus,
|
||||
OrderStatus,
|
||||
createRawPropertiesFromBigNumber,
|
||||
decorateCartTotals,
|
||||
deduplicate,
|
||||
isDefined,
|
||||
isObject,
|
||||
isString,
|
||||
promiseAll,
|
||||
transformPropertiesToBigNumber,
|
||||
} from "@medusajs/utils"
|
||||
@@ -76,8 +76,8 @@ import {
|
||||
import { UpdateReturnReasonDTO } from "src/types/return-reason"
|
||||
import { joinerConfig } from "../joiner-config"
|
||||
import {
|
||||
ApplyOrderChangeDTO,
|
||||
applyChangesToOrder,
|
||||
ApplyOrderChangeDTO,
|
||||
calculateOrderChange,
|
||||
formatOrder,
|
||||
} from "../utils"
|
||||
@@ -594,7 +594,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createOrders(
|
||||
data: OrderTypes.CreateOrderDTO[] | OrderTypes.CreateOrderDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -629,7 +629,7 @@ export default class OrderModuleService<
|
||||
| OrderTypes.OrderDTO[]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createOrders_(
|
||||
data: OrderTypes.CreateOrderDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -702,7 +702,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateOrders(
|
||||
dataOrIdOrSelector:
|
||||
| OrderTypes.UpdateOrderDTO[]
|
||||
@@ -726,7 +726,7 @@ export default class OrderModuleService<
|
||||
return isString(dataOrIdOrSelector) ? serializedResult[0] : serializedResult
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateOrders_(
|
||||
dataOrIdOrSelector:
|
||||
| OrderTypes.UpdateOrderDTO[]
|
||||
@@ -777,7 +777,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderLineItemDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createOrderLineItems(
|
||||
orderIdOrData:
|
||||
| string
|
||||
@@ -829,7 +829,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createOrderLineItems_(
|
||||
orderId: string,
|
||||
items: OrderTypes.CreateOrderLineItemDTO[],
|
||||
@@ -852,7 +852,7 @@ export default class OrderModuleService<
|
||||
return await this.createOrderLineItemsBulk_(toUpdate, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createOrderLineItemsBulk_(
|
||||
data: CreateOrderLineItemDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -900,7 +900,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderLineItemDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateOrderLineItems(
|
||||
lineItemIdOrDataOrSelector:
|
||||
| string
|
||||
@@ -949,7 +949,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateOrderLineItem_(
|
||||
lineItemId: string,
|
||||
data: Partial<OrderTypes.UpdateOrderLineItemDTO>,
|
||||
@@ -975,7 +975,7 @@ export default class OrderModuleService<
|
||||
return item
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateOrderLineItemsWithSelector_(
|
||||
updates: OrderTypes.UpdateOrderLineItemWithSelectorDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1022,7 +1022,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderItemDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateOrderItem(
|
||||
orderItemIdOrDataOrSelector:
|
||||
| string
|
||||
@@ -1068,7 +1068,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateOrderItem_(
|
||||
orderItemId: string,
|
||||
data: Partial<OrderTypes.UpdateOrderItemDTO>,
|
||||
@@ -1082,7 +1082,7 @@ export default class OrderModuleService<
|
||||
return detail
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateOrderItemWithSelector_(
|
||||
updates: OrderTypes.UpdateOrderItemWithSelectorDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1119,7 +1119,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderShippingMethodDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createOrderShippingMethods(
|
||||
orderIdOrData:
|
||||
| string
|
||||
@@ -1175,7 +1175,7 @@ export default class OrderModuleService<
|
||||
>(methods, { populate: true })
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createOrderShippingMethods_(
|
||||
orderId: string,
|
||||
data: CreateOrderShippingMethodDTO[],
|
||||
@@ -1201,7 +1201,7 @@ export default class OrderModuleService<
|
||||
return await this.createOrderShippingMethodsBulk_(methods, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createOrderShippingMethodsBulk_(
|
||||
data: {
|
||||
shipping_method: OrderTypes.CreateOrderShippingMethodDTO
|
||||
@@ -1218,7 +1218,7 @@ export default class OrderModuleService<
|
||||
return sm.map((s) => s.shipping_method)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-ignore
|
||||
async softDeleteOrderShippingMethods<TReturnableLinkableKeys extends string>(
|
||||
ids: string | object | string[] | object[],
|
||||
@@ -1244,7 +1244,7 @@ export default class OrderModuleService<
|
||||
return returned
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-ignore
|
||||
async restoreOrderShippingMethods<TReturnableLinkableKeys extends string>(
|
||||
ids: string | object | string[] | object[],
|
||||
@@ -1283,7 +1283,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderLineItemAdjustmentDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createOrderLineItemAdjustments(
|
||||
orderIdOrData:
|
||||
| string
|
||||
@@ -1333,7 +1333,7 @@ export default class OrderModuleService<
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async setOrderLineItemAdjustments(
|
||||
orderId: string,
|
||||
adjustments: (
|
||||
@@ -1384,7 +1384,7 @@ export default class OrderModuleService<
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async setOrderShippingMethodAdjustments(
|
||||
orderId: string,
|
||||
adjustments: (
|
||||
@@ -1453,7 +1453,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderShippingMethodAdjustmentDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createOrderShippingMethodAdjustments(
|
||||
orderIdOrData:
|
||||
| string
|
||||
@@ -1532,7 +1532,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderLineItemTaxLineDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createOrderLineItemTaxLines(
|
||||
orderIdOrData:
|
||||
| string
|
||||
@@ -1577,7 +1577,7 @@ export default class OrderModuleService<
|
||||
return serialized
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async setOrderLineItemTaxLines(
|
||||
orderId: string,
|
||||
taxLines: (
|
||||
@@ -1643,7 +1643,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderShippingMethodTaxLineDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createOrderShippingMethodTaxLines(
|
||||
orderIdOrData:
|
||||
| string
|
||||
@@ -1687,7 +1687,7 @@ export default class OrderModuleService<
|
||||
return serialized
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async setOrderShippingMethodTaxLines(
|
||||
orderId: string,
|
||||
taxLines: (
|
||||
@@ -1753,7 +1753,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.ReturnDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createReturns(
|
||||
data: OrderTypes.CreateOrderReturnDTO | OrderTypes.CreateOrderReturnDTO[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -1783,7 +1783,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderClaimDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createOrderClaims(
|
||||
data: OrderTypes.CreateOrderClaimDTO | OrderTypes.CreateOrderClaimDTO[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -1813,7 +1813,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderExchangeDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createOrderExchanges(
|
||||
data:
|
||||
| OrderTypes.CreateOrderExchangeDTO
|
||||
@@ -1834,7 +1834,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async createOrderRelatedEntity_(
|
||||
data: any,
|
||||
service: any,
|
||||
@@ -1880,7 +1880,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderChangeDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createOrderChange(
|
||||
data: CreateOrderChangeDTO | CreateOrderChangeDTO[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -1895,7 +1895,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createOrderChange_(
|
||||
data: CreateOrderChangeDTO | CreateOrderChangeDTO[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -1956,7 +1956,7 @@ export default class OrderModuleService<
|
||||
return await this.orderChangeService_.create(input, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async previewOrderChange(orderId: string, sharedContext?: Context) {
|
||||
const order = await this.retrieveOrder(
|
||||
orderId,
|
||||
@@ -2101,7 +2101,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<void>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async cancelOrderChange(
|
||||
orderChangeIdOrData:
|
||||
| string
|
||||
@@ -2141,7 +2141,7 @@ export default class OrderModuleService<
|
||||
data: OrderTypes.ConfirmOrderChangeDTO[],
|
||||
sharedContext?: Context
|
||||
)
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async confirmOrderChange(
|
||||
orderChangeIdOrData:
|
||||
| string
|
||||
@@ -2191,7 +2191,7 @@ export default class OrderModuleService<
|
||||
data: OrderTypes.DeclineOrderChangeDTO[],
|
||||
sharedContext?: Context
|
||||
)
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async declineOrderChange(
|
||||
orderChangeIdOrData:
|
||||
| string
|
||||
@@ -2221,7 +2221,7 @@ export default class OrderModuleService<
|
||||
await this.orderChangeService_.update(updates as any, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async applyPendingOrderActions(
|
||||
orderId: string | string[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -2273,7 +2273,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async revertLastVersion(
|
||||
orderId: string,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -2296,7 +2296,7 @@ export default class OrderModuleService<
|
||||
return await this.revertLastChange_(order, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async revertLastChange_(
|
||||
order: OrderDTO,
|
||||
sharedContext?: Context
|
||||
@@ -2517,7 +2517,7 @@ export default class OrderModuleService<
|
||||
data: OrderTypes.CreateOrderChangeActionDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderChangeActionDTO[]>
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async addOrderAction(
|
||||
data:
|
||||
| OrderTypes.CreateOrderChangeActionDTO
|
||||
@@ -2562,7 +2562,7 @@ export default class OrderModuleService<
|
||||
return Array.isArray(data) ? actions : actions[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async applyOrderChanges_(
|
||||
changeActions: ApplyOrderChangeDTO[],
|
||||
sharedContext?: Context
|
||||
@@ -2662,7 +2662,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderTransactionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async addOrderTransactions(
|
||||
transactionData:
|
||||
| OrderTypes.CreateOrderTransactionDTO
|
||||
@@ -2710,7 +2710,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-ignore
|
||||
async deleteOrderTransactions(
|
||||
transactionIds: string | object | string[] | object[],
|
||||
@@ -2740,7 +2740,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-ignore
|
||||
async softDeleteOrderTransactions<TReturnableLinkableKeys extends string>(
|
||||
transactionIds: string | object | string[] | object[],
|
||||
@@ -2773,7 +2773,7 @@ export default class OrderModuleService<
|
||||
return returned
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-ignore
|
||||
async restoreOrderTransactions<TReturnableLinkableKeys extends string>(
|
||||
transactionIds: string | object | string[] | object[],
|
||||
@@ -2807,7 +2807,7 @@ export default class OrderModuleService<
|
||||
return returned
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async updateOrderPaidRefundableAmount_(
|
||||
transactionData: {
|
||||
order_id: string
|
||||
@@ -2874,7 +2874,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async archive(
|
||||
orderId: string | string[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -2932,7 +2932,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async completeOrder(
|
||||
orderId: string | string[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -2984,7 +2984,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderTypes.OrderDTO[]>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async cancel(
|
||||
orderId: string | string[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3020,7 +3020,7 @@ export default class OrderModuleService<
|
||||
|
||||
// ------------------- Bundled Order Actions
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createReturn(
|
||||
data: OrderTypes.CreateOrderReturnDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3044,7 +3044,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async receiveReturn(
|
||||
data: OrderTypes.ReceiveOrderReturnDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3061,7 +3061,7 @@ export default class OrderModuleService<
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async receiveReturn_(
|
||||
data: OrderTypes.ReceiveOrderReturnDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3069,7 +3069,7 @@ export default class OrderModuleService<
|
||||
return await BundledActions.receiveReturn.bind(this)(data, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async cancelReturn(
|
||||
data: OrderTypes.CancelOrderReturnDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3086,7 +3086,7 @@ export default class OrderModuleService<
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async cancelReturn_(
|
||||
data: OrderTypes.CancelOrderReturnDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3094,7 +3094,7 @@ export default class OrderModuleService<
|
||||
return await BundledActions.cancelReturn.bind(this)(data, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createClaim(
|
||||
data: OrderTypes.CreateOrderClaimDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3128,7 +3128,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createClaim_(
|
||||
data: OrderTypes.CreateOrderClaimDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3136,7 +3136,7 @@ export default class OrderModuleService<
|
||||
return await BundledActions.createClaim.bind(this)(data, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async cancelClaim(
|
||||
data: OrderTypes.CancelOrderClaimDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3148,7 +3148,7 @@ export default class OrderModuleService<
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async cancelClaim_(
|
||||
data: OrderTypes.CancelOrderClaimDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3156,7 +3156,7 @@ export default class OrderModuleService<
|
||||
return await BundledActions.cancelClaim.bind(this)(data, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createExchange(
|
||||
data: OrderTypes.CreateOrderExchangeDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3200,7 +3200,7 @@ export default class OrderModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<OrderReturnReasonDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateReturnReasons(
|
||||
idOrSelector: string | FilterableOrderReturnReasonProps,
|
||||
data: UpdateOrderReturnReasonDTO,
|
||||
@@ -3238,7 +3238,7 @@ export default class OrderModuleService<
|
||||
: updatedReturnReasons
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createExchange_(
|
||||
data: OrderTypes.CreateOrderExchangeDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3246,7 +3246,7 @@ export default class OrderModuleService<
|
||||
return await BundledActions.createExchange.bind(this)(data, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async cancelExchange(
|
||||
data: OrderTypes.CancelOrderExchangeDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3258,7 +3258,7 @@ export default class OrderModuleService<
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async cancelExchange_(
|
||||
data: OrderTypes.CancelOrderExchangeDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3266,7 +3266,7 @@ export default class OrderModuleService<
|
||||
return await BundledActions.cancelExchange.bind(this)(data, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async registerFulfillment(
|
||||
data: OrderTypes.RegisterOrderFulfillmentDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3277,7 +3277,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async cancelFulfillment(
|
||||
data: OrderTypes.CancelOrderFulfillmentDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3288,7 +3288,7 @@ export default class OrderModuleService<
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async registerShipment(
|
||||
data: OrderTypes.RegisterOrderShipmentDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -3296,7 +3296,7 @@ export default class OrderModuleService<
|
||||
return await BundledActions.registerShipment.bind(this)(data, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async registerDelivery(
|
||||
data: OrderTypes.RegisterOrderDeliveryDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
|
||||
@@ -131,7 +131,7 @@ export default class PaymentModuleService
|
||||
data: CreatePaymentCollectionDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PaymentCollectionDTO[]>
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createPaymentCollections(
|
||||
data: CreatePaymentCollectionDTO | CreatePaymentCollectionDTO[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -151,7 +151,7 @@ export default class PaymentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createPaymentCollections_(
|
||||
data: CreatePaymentCollectionDTO[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -171,7 +171,7 @@ export default class PaymentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PaymentCollectionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updatePaymentCollections(
|
||||
idOrSelector: string | FilterablePaymentCollectionProps,
|
||||
data: PaymentCollectionUpdatableFields,
|
||||
@@ -212,7 +212,7 @@ export default class PaymentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updatePaymentCollections_(
|
||||
data: UpdatePaymentCollectionDTO[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -229,7 +229,7 @@ export default class PaymentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PaymentCollectionDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async upsertPaymentCollections(
|
||||
data: UpsertPaymentCollectionDTO | UpsertPaymentCollectionDTO[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -267,7 +267,7 @@ export default class PaymentModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PaymentCollectionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async completePaymentCollections(
|
||||
paymentCollectionId: string | string[],
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -292,7 +292,7 @@ export default class PaymentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createPaymentSession(
|
||||
paymentCollectionId: string,
|
||||
input: CreatePaymentSessionDTO,
|
||||
@@ -345,7 +345,7 @@ export default class PaymentModuleService
|
||||
})
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createPaymentSession_(
|
||||
paymentCollectionId: string,
|
||||
data: CreatePaymentSessionDTO,
|
||||
@@ -366,7 +366,7 @@ export default class PaymentModuleService
|
||||
return paymentSession
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updatePaymentSession(
|
||||
data: UpdatePaymentSessionDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -390,7 +390,7 @@ export default class PaymentModuleService
|
||||
return await this.baseRepository_.serialize(updated[0], { populate: true })
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async deletePaymentSession(
|
||||
id: string,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -409,7 +409,7 @@ export default class PaymentModuleService
|
||||
await this.paymentSessionService_.delete(id, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async authorizePaymentSession(
|
||||
id: string,
|
||||
context: Record<string, unknown>,
|
||||
@@ -488,7 +488,7 @@ export default class PaymentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async authorizePaymentSession_(
|
||||
session: PaymentSession,
|
||||
data: Record<string, unknown>,
|
||||
@@ -534,7 +534,7 @@ export default class PaymentModuleService
|
||||
return payment
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-expect-error
|
||||
async retrievePaymentSession(
|
||||
id: string,
|
||||
@@ -550,7 +550,7 @@ export default class PaymentModuleService
|
||||
return await this.baseRepository_.serialize(session)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-expect-error
|
||||
async listPaymentSessions(
|
||||
filters?: FilterablePaymentSessionProps,
|
||||
@@ -566,7 +566,7 @@ export default class PaymentModuleService
|
||||
return await this.baseRepository_.serialize<PaymentSessionDTO[]>(sessions)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updatePayment(
|
||||
data: UpdatePaymentDTO,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -579,7 +579,7 @@ export default class PaymentModuleService
|
||||
})
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async capturePayment(
|
||||
data: CreateCaptureDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -612,7 +612,7 @@ export default class PaymentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async capturePayment_(
|
||||
data: CreateCaptureDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -689,7 +689,7 @@ export default class PaymentModuleService
|
||||
|
||||
return [payment, isFullyCaptured]
|
||||
}
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
private async capturePaymentFromProvider_(
|
||||
payment: Payment,
|
||||
isFullyCaptured: boolean,
|
||||
@@ -712,7 +712,7 @@ export default class PaymentModuleService
|
||||
return payment
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async refundPayment(
|
||||
data: CreateRefundDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -753,7 +753,7 @@ export default class PaymentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async refundPayment_(
|
||||
payment: Payment,
|
||||
data: CreateRefundDTO,
|
||||
@@ -794,7 +794,7 @@ export default class PaymentModuleService
|
||||
return refund
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
private async refundPaymentFromProvider_(
|
||||
payment: Payment,
|
||||
refund: Refund,
|
||||
@@ -816,7 +816,7 @@ export default class PaymentModuleService
|
||||
return payment
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async cancelPayment(
|
||||
paymentId: string,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -848,7 +848,7 @@ export default class PaymentModuleService
|
||||
return await this.retrievePayment(payment.id, {}, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async processEvent(
|
||||
eventData: ProviderWebhookPayload,
|
||||
@MedusaContext() sharedContext?: Context
|
||||
@@ -890,7 +890,7 @@ export default class PaymentModuleService
|
||||
}
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async listPaymentProviders(
|
||||
filters: FilterablePaymentProviderProps = {},
|
||||
config: FindConfig<PaymentProviderDTO> = {},
|
||||
@@ -910,7 +910,7 @@ export default class PaymentModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async listAndCountPaymentProviders(
|
||||
filters: FilterablePaymentProviderProps = {},
|
||||
config: FindConfig<PaymentProviderDTO> = {},
|
||||
@@ -930,7 +930,7 @@ export default class PaymentModuleService
|
||||
]
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
private async maybeUpdatePaymentCollection_(
|
||||
paymentCollectionId: string,
|
||||
sharedContext?: Context
|
||||
|
||||
@@ -147,7 +147,7 @@ export default class PricingModuleService
|
||||
return pricingContext
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-expect-error
|
||||
async retrievePriceSet(
|
||||
id: string,
|
||||
@@ -163,7 +163,7 @@ export default class PricingModuleService
|
||||
return await this.baseRepository_.serialize<PriceSetDTO>(priceSet)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-expect-error
|
||||
async listPriceSets(
|
||||
filters: PricingTypes.FilterablePriceSetProps = {},
|
||||
@@ -204,7 +204,7 @@ export default class PricingModuleService
|
||||
return priceSets
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-expect-error
|
||||
async listAndCountPriceSets(
|
||||
filters: PricingTypes.FilterablePriceSetProps = {},
|
||||
@@ -245,7 +245,7 @@ export default class PricingModuleService
|
||||
return [priceSets, count]
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async calculatePrices(
|
||||
pricingFilters: PricingFilters,
|
||||
pricingContext: PricingContext = { context: {} },
|
||||
@@ -395,7 +395,7 @@ export default class PricingModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PriceSetDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createPriceSets(
|
||||
data: PricingTypes.CreatePriceSetDTO | PricingTypes.CreatePriceSetDTO[],
|
||||
@@ -432,7 +432,7 @@ export default class PricingModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PriceSetDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async upsertPriceSets(
|
||||
data: UpsertPriceSetDTO | UpsertPriceSetDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -472,7 +472,7 @@ export default class PricingModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PriceSetDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updatePriceSets(
|
||||
idOrSelector: string | PricingTypes.FilterablePriceSetProps,
|
||||
data: PricingTypes.UpdatePriceSetDTO,
|
||||
@@ -507,7 +507,7 @@ export default class PricingModuleService
|
||||
return isString(idOrSelector) ? priceSets[0] : priceSets
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updatePriceSets_(
|
||||
data: ServiceTypes.UpdatePriceSetInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -619,7 +619,7 @@ export default class PricingModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PricingTypes.PriceSetDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async addPrices(
|
||||
data: AddPricesDTO | AddPricesDTO[],
|
||||
@@ -642,7 +642,7 @@ export default class PricingModuleService
|
||||
return Array.isArray(data) ? orderedPriceSets : orderedPriceSets[0]
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
// @ts-ignore
|
||||
async createPriceLists(
|
||||
@@ -656,7 +656,7 @@ export default class PricingModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
// @ts-ignore
|
||||
async updatePriceLists(
|
||||
data: PricingTypes.UpdatePriceListDTO[],
|
||||
@@ -669,7 +669,7 @@ export default class PricingModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updatePriceListPrices(
|
||||
data: PricingTypes.UpdatePriceListPricesDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -679,7 +679,7 @@ export default class PricingModuleService
|
||||
return await this.baseRepository_.serialize<PricingTypes.PriceDTO[]>(prices)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async removePrices(
|
||||
ids: string[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -687,7 +687,7 @@ export default class PricingModuleService
|
||||
await this.removePrices_(ids, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async addPriceListPrices(
|
||||
data: PricingTypes.AddPriceListPricesDTO[],
|
||||
@@ -698,7 +698,7 @@ export default class PricingModuleService
|
||||
return await this.baseRepository_.serialize<PricingTypes.PriceDTO[]>(prices)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async setPriceListRules(
|
||||
data: PricingTypes.SetPriceListRulesDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -710,7 +710,7 @@ export default class PricingModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async removePriceListRules(
|
||||
data: PricingTypes.RemovePriceListRulesDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -732,7 +732,7 @@ export default class PricingModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PricePreferenceDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createPricePreferences(
|
||||
data:
|
||||
@@ -761,7 +761,7 @@ export default class PricingModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PricePreferenceDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async upsertPricePreferences(
|
||||
data: UpsertPricePreferenceDTO | UpsertPricePreferenceDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -805,7 +805,7 @@ export default class PricingModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PricePreferenceDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updatePricePreferences(
|
||||
idOrSelector: string | PricingTypes.FilterablePricePreferenceProps,
|
||||
data: PricingTypes.UpdatePricePreferenceDTO,
|
||||
@@ -845,7 +845,7 @@ export default class PricingModuleService
|
||||
return isString(idOrSelector) ? pricePreferences[0] : pricePreferences
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createPricePreferences_(
|
||||
data: PricingTypes.CreatePricePreferenceDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -861,7 +861,7 @@ export default class PricingModuleService
|
||||
return preferences
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updatePricePreferences_(
|
||||
data: PricingTypes.UpdatePricePreferenceDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -874,7 +874,7 @@ export default class PricingModuleService
|
||||
return preferences
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createPriceSets_(
|
||||
data: PricingTypes.CreatePriceSetDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -941,7 +941,7 @@ export default class PricingModuleService
|
||||
return createdPriceSets
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async addPrices_(
|
||||
input: AddPricesDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1018,7 +1018,7 @@ export default class PricingModuleService
|
||||
return entities
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createPriceLists_(
|
||||
data: PricingTypes.CreatePriceListDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1132,7 +1132,7 @@ export default class PricingModuleService
|
||||
return priceLists
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updatePriceLists_(
|
||||
data: PricingTypes.UpdatePriceListDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1196,7 +1196,7 @@ export default class PricingModuleService
|
||||
return entities
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updatePriceListPrices_(
|
||||
data: PricingTypes.UpdatePriceListPricesDTO[],
|
||||
sharedContext: Context = {}
|
||||
@@ -1244,7 +1244,7 @@ export default class PricingModuleService
|
||||
return entities
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async removePrices_(
|
||||
ids: string[],
|
||||
sharedContext: Context = {}
|
||||
@@ -1252,7 +1252,7 @@ export default class PricingModuleService
|
||||
await this.priceService_.delete(ids, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async addPriceListPrices_(
|
||||
data: PricingTypes.AddPriceListPricesDTO[],
|
||||
sharedContext: Context = {}
|
||||
@@ -1326,7 +1326,7 @@ export default class PricingModuleService
|
||||
return entities
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async setPriceListRules_(
|
||||
data: PricingTypes.SetPriceListRulesDTO[],
|
||||
sharedContext: Context = {}
|
||||
@@ -1388,7 +1388,7 @@ export default class PricingModuleService
|
||||
return entities
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async removePriceListRules_(
|
||||
data: PricingTypes.RemovePriceListRulesDTO[],
|
||||
sharedContext: Context = {}
|
||||
|
||||
@@ -8,10 +8,10 @@ import {
|
||||
ProductTypes,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
Image as ProductImage,
|
||||
Product,
|
||||
ProductCategory,
|
||||
ProductCollection,
|
||||
Image as ProductImage,
|
||||
ProductOption,
|
||||
ProductOptionValue,
|
||||
ProductTag,
|
||||
@@ -166,7 +166,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductVariantDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createProductVariants(
|
||||
data:
|
||||
@@ -187,7 +187,7 @@ export default class ProductModuleService
|
||||
return Array.isArray(data) ? createdVariants : createdVariants[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createVariants_(
|
||||
data: ProductTypes.CreateProductVariantDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -235,7 +235,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductVariantDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
@EmitEvents()
|
||||
async upsertProductVariants(
|
||||
data:
|
||||
@@ -283,7 +283,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductVariantDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateProductVariants(
|
||||
idOrSelector: string | ProductTypes.FilterableProductVariantProps,
|
||||
@@ -317,7 +317,7 @@ export default class ProductModuleService
|
||||
return isString(idOrSelector) ? updatedVariants[0] : updatedVariants
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateVariants_(
|
||||
data: UpdateProductVariantInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -396,7 +396,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductTagDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createProductTags(
|
||||
data: ProductTypes.CreateProductTagDTO[] | ProductTypes.CreateProductTagDTO,
|
||||
@@ -427,7 +427,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductTagDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
@EmitEvents()
|
||||
async upsertProductTags(
|
||||
data: ProductTypes.UpsertProductTagDTO[] | ProductTypes.UpsertProductTagDTO,
|
||||
@@ -477,7 +477,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductTagDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateProductTags(
|
||||
idOrSelector: string | ProductTypes.FilterableProductTagProps,
|
||||
@@ -529,7 +529,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductTypeDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createProductTypes(
|
||||
data:
|
||||
| ProductTypes.CreateProductTypeDTO[]
|
||||
@@ -556,7 +556,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductTypeDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertProductTypes(
|
||||
data:
|
||||
| ProductTypes.UpsertProductTypeDTO[]
|
||||
@@ -599,7 +599,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductTypeDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateProductTypes(
|
||||
idOrSelector: string | ProductTypes.FilterableProductTypeProps,
|
||||
data: ProductTypes.UpdateProductTypeDTO,
|
||||
@@ -645,7 +645,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductOptionDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createProductOptions(
|
||||
data:
|
||||
| ProductTypes.CreateProductOptionDTO[]
|
||||
@@ -663,7 +663,7 @@ export default class ProductModuleService
|
||||
return Array.isArray(data) ? createdOptions : createdOptions[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createOptions_(
|
||||
data: ProductTypes.CreateProductOptionDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -699,7 +699,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductOptionDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertProductOptions(
|
||||
data:
|
||||
| ProductTypes.UpsertProductOptionDTO[]
|
||||
@@ -744,7 +744,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductOptionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateProductOptions(
|
||||
idOrSelector: string | ProductTypes.FilterableProductOptionProps,
|
||||
data: ProductTypes.UpdateProductOptionDTO,
|
||||
@@ -776,7 +776,7 @@ export default class ProductModuleService
|
||||
return isString(idOrSelector) ? updatedOptions[0] : updatedOptions
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateOptions_(
|
||||
data: UpdateProductOptionInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -859,7 +859,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductCollectionDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createProductCollections(
|
||||
data:
|
||||
| ProductTypes.CreateProductCollectionDTO[]
|
||||
@@ -889,7 +889,7 @@ export default class ProductModuleService
|
||||
return Array.isArray(data) ? createdCollections : createdCollections[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createCollections_(
|
||||
data: ProductTypes.CreateProductCollectionDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -918,7 +918,7 @@ export default class ProductModuleService
|
||||
data: ProductTypes.UpsertProductCollectionDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductCollectionDTO>
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertProductCollections(
|
||||
data:
|
||||
| ProductTypes.UpsertProductCollectionDTO[]
|
||||
@@ -990,7 +990,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductCollectionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateProductCollections(
|
||||
idOrSelector: string | ProductTypes.FilterableProductCollectionProps,
|
||||
data: ProductTypes.UpdateProductCollectionDTO,
|
||||
@@ -1041,7 +1041,7 @@ export default class ProductModuleService
|
||||
return isString(idOrSelector) ? updatedCollections[0] : updatedCollections
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateCollections_(
|
||||
data: UpdateCollectionInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1118,7 +1118,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductCategoryDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createProductCategories(
|
||||
data:
|
||||
@@ -1156,7 +1156,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductCategoryDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
@EmitEvents()
|
||||
async upsertProductCategories(
|
||||
data:
|
||||
@@ -1224,7 +1224,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductCategoryDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateProductCategories(
|
||||
idOrSelector: string | ProductTypes.FilterableProductTypeProps,
|
||||
@@ -1282,7 +1282,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createProducts(
|
||||
data: ProductTypes.CreateProductDTO[] | ProductTypes.CreateProductDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1316,7 +1316,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertProducts(
|
||||
data: ProductTypes.UpsertProductDTO[] | ProductTypes.UpsertProductDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1383,7 +1383,7 @@ export default class ProductModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<ProductTypes.ProductDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateProducts(
|
||||
idOrSelector: string | ProductTypes.FilterableProductProps,
|
||||
data: ProductTypes.UpdateProductDTO,
|
||||
@@ -1427,7 +1427,7 @@ export default class ProductModuleService
|
||||
return isString(idOrSelector) ? updatedProducts[0] : updatedProducts
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createProducts_(
|
||||
data: ProductTypes.CreateProductDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1493,7 +1493,7 @@ export default class ProductModuleService
|
||||
return productData
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateProducts_(
|
||||
data: UpdateProductInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
@@ -121,11 +121,12 @@ export default class PromotionModuleService
|
||||
return joinerConfig
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async registerUsage(
|
||||
computedActions: PromotionTypes.UsageComputedActions[],
|
||||
@MedusaContext()
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@MedusaContext()
|
||||
sharedContext: Context = {}
|
||||
): Promise<void> {
|
||||
const promotionCodes = computedActions
|
||||
.map((computedAction) => computedAction.code)
|
||||
@@ -229,7 +230,7 @@ export default class PromotionModuleService
|
||||
}
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async revertUsage(
|
||||
computedActions: PromotionTypes.UsageComputedActions[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -320,7 +321,7 @@ export default class PromotionModuleService
|
||||
}
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async computeActions(
|
||||
promotionCodes: string[],
|
||||
applicationContext: PromotionTypes.ComputeActionContext,
|
||||
@@ -534,7 +535,7 @@ export default class PromotionModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionTypes.PromotionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createPromotions(
|
||||
data:
|
||||
| PromotionTypes.CreatePromotionDTO
|
||||
@@ -566,7 +567,7 @@ export default class PromotionModuleService
|
||||
return Array.isArray(data) ? promotions : promotions[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createPromotions_(
|
||||
data: PromotionTypes.CreatePromotionDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -802,7 +803,7 @@ export default class PromotionModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionTypes.PromotionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updatePromotions(
|
||||
data:
|
||||
| PromotionTypes.UpdatePromotionDTO
|
||||
@@ -832,7 +833,7 @@ export default class PromotionModuleService
|
||||
return Array.isArray(data) ? promotions : promotions[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updatePromotions_(
|
||||
data: PromotionTypes.UpdatePromotionDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -930,7 +931,7 @@ export default class PromotionModuleService
|
||||
return updatedPromotions
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-ignore
|
||||
async updatePromotionRules(
|
||||
data: PromotionTypes.UpdatePromotionRuleDTO[],
|
||||
@@ -948,7 +949,7 @@ export default class PromotionModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updatePromotionRules_(
|
||||
data: PromotionTypes.UpdatePromotionRuleDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1011,7 +1012,7 @@ export default class PromotionModuleService
|
||||
return updatedRules
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async addPromotionRules(
|
||||
promotionId: string,
|
||||
rulesData: PromotionTypes.CreatePromotionRuleDTO[],
|
||||
@@ -1033,7 +1034,7 @@ export default class PromotionModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async addPromotionTargetRules(
|
||||
promotionId: string,
|
||||
rulesData: PromotionTypes.CreatePromotionRuleDTO[],
|
||||
@@ -1066,7 +1067,7 @@ export default class PromotionModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async addPromotionBuyRules(
|
||||
promotionId: string,
|
||||
rulesData: PromotionTypes.CreatePromotionRuleDTO[],
|
||||
@@ -1101,7 +1102,7 @@ export default class PromotionModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createPromotionRulesAndValues_(
|
||||
rulesData: PromotionTypes.CreatePromotionRuleDTO[],
|
||||
relationName: "promotions" | "method_target_rules" | "method_buy_rules",
|
||||
@@ -1157,7 +1158,7 @@ export default class PromotionModuleService
|
||||
return createdPromotionRules
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async removePromotionRules(
|
||||
promotionId: string,
|
||||
ruleIds: string[],
|
||||
@@ -1166,7 +1167,7 @@ export default class PromotionModuleService
|
||||
await this.removePromotionRules_(promotionId, ruleIds, sharedContext)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async removePromotionRules_(
|
||||
promotionId: string,
|
||||
ruleIds: string[],
|
||||
@@ -1184,7 +1185,7 @@ export default class PromotionModuleService
|
||||
await this.promotionRuleService_.delete(idsToRemove, sharedContext)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async removePromotionTargetRules(
|
||||
promotionId: string,
|
||||
ruleIds: string[],
|
||||
@@ -1198,7 +1199,7 @@ export default class PromotionModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async removePromotionBuyRules(
|
||||
promotionId: string,
|
||||
ruleIds: string[],
|
||||
@@ -1212,7 +1213,7 @@ export default class PromotionModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async removeApplicationMethodRules_(
|
||||
promotionId: string,
|
||||
ruleIds: string[],
|
||||
@@ -1257,7 +1258,7 @@ export default class PromotionModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionTypes.CampaignDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createCampaigns(
|
||||
data: PromotionTypes.CreateCampaignDTO | PromotionTypes.CreateCampaignDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1277,7 +1278,7 @@ export default class PromotionModuleService
|
||||
return Array.isArray(data) ? campaigns : campaigns[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createCampaigns_(
|
||||
data: PromotionTypes.CreateCampaignDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1367,7 +1368,7 @@ export default class PromotionModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionTypes.CampaignDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateCampaigns(
|
||||
data: PromotionTypes.UpdateCampaignDTO | PromotionTypes.UpdateCampaignDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1387,7 +1388,7 @@ export default class PromotionModuleService
|
||||
return Array.isArray(data) ? campaigns : campaigns[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateCampaigns_(
|
||||
data: PromotionTypes.UpdateCampaignDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1459,7 +1460,7 @@ export default class PromotionModuleService
|
||||
return updatedCampaigns
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async addPromotionsToCampaign(
|
||||
data: PromotionTypes.AddPromotionsToCampaignDTO,
|
||||
sharedContext?: Context
|
||||
@@ -1473,7 +1474,7 @@ export default class PromotionModuleService
|
||||
// - introduce currency_code to promotion
|
||||
// - allow promotions to be queried by currency code
|
||||
// - when the above is present, validate adding promotion to campaign based on currency code
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async addPromotionsToCampaign_(
|
||||
data: PromotionTypes.AddPromotionsToCampaignDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -1526,7 +1527,7 @@ export default class PromotionModuleService
|
||||
return promotionsToAdd.map((promo) => promo.id)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async removePromotionsFromCampaign(
|
||||
data: PromotionTypes.AddPromotionsToCampaignDTO,
|
||||
sharedContext?: Context
|
||||
@@ -1536,7 +1537,7 @@ export default class PromotionModuleService
|
||||
return { ids }
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async removePromotionsFromCampaign_(
|
||||
data: PromotionTypes.AddPromotionsToCampaignDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
@@ -76,7 +76,7 @@ export default class RegionModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<RegionDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createRegions(
|
||||
data: CreateRegionDTO | CreateRegionDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -90,7 +90,7 @@ export default class RegionModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createRegions_(
|
||||
data: CreateRegionDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -129,7 +129,7 @@ export default class RegionModuleService
|
||||
return result
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
// @ts-ignore
|
||||
async softDeleteRegions(
|
||||
ids: string | object | string[] | object[],
|
||||
@@ -158,7 +158,7 @@ export default class RegionModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<RegionDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertRegions(
|
||||
data: UpsertRegionDTO | UpsertRegionDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -198,7 +198,7 @@ export default class RegionModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<RegionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateRegions(
|
||||
idOrSelector: string | FilterableRegionProps,
|
||||
data: UpdateRegionDTO,
|
||||
@@ -232,7 +232,7 @@ export default class RegionModuleService
|
||||
return isString(idOrSelector) ? regions[0] : regions
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateRegions_(
|
||||
data: UpdateRegionInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
@@ -62,7 +62,7 @@ export default class SalesChannelModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createSalesChannels(
|
||||
data: CreateSalesChannelDTO | CreateSalesChannelDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -79,7 +79,7 @@ export default class SalesChannelModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createSalesChannels_(
|
||||
data: CreateSalesChannelDTO[],
|
||||
@MedusaContext() sharedContext: Context
|
||||
@@ -99,7 +99,7 @@ export default class SalesChannelModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateSalesChannels(
|
||||
idOrSelector: string | FilterableSalesChannelProps,
|
||||
data: UpdateSalesChannelDTO | UpdateSalesChannelDTO[],
|
||||
@@ -134,7 +134,7 @@ export default class SalesChannelModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateSalesChannels_(
|
||||
data: UpdateSalesChannelDTO[],
|
||||
sharedContext: Context
|
||||
@@ -150,7 +150,7 @@ export default class SalesChannelModuleService
|
||||
data: UpsertSalesChannelDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO>
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertSalesChannels(
|
||||
data: UpsertSalesChannelDTO | UpsertSalesChannelDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
DAL,
|
||||
FilterableStockLocationProps,
|
||||
IEventBusService,
|
||||
IStockLocationService,
|
||||
InternalModuleDeclaration,
|
||||
IStockLocationService,
|
||||
ModuleJoinerConfig,
|
||||
ModulesSdkTypes,
|
||||
StockLocationAddressInput,
|
||||
@@ -16,10 +16,10 @@ import {
|
||||
import {
|
||||
InjectManager,
|
||||
InjectTransactionManager,
|
||||
isString,
|
||||
MedusaContext,
|
||||
MedusaService,
|
||||
Modules,
|
||||
isString,
|
||||
promiseAll,
|
||||
} from "@medusajs/utils"
|
||||
import { joinerConfig } from "../joiner-config"
|
||||
@@ -79,7 +79,7 @@ export default class StockLocationModuleService
|
||||
context: Context
|
||||
): Promise<StockLocationTypes.StockLocationDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createStockLocations(
|
||||
data: CreateStockLocationInput | CreateStockLocationInput[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -98,7 +98,7 @@ export default class StockLocationModuleService
|
||||
return Array.isArray(data) ? serialized : serialized[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createStockLocations_(
|
||||
data: CreateStockLocationInput[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -115,7 +115,7 @@ export default class StockLocationModuleService
|
||||
context?: Context
|
||||
): Promise<StockLocationTypes.StockLocationDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async upsertStockLocations(
|
||||
data: UpsertStockLocationInput | UpsertStockLocationInput[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -132,7 +132,7 @@ export default class StockLocationModuleService
|
||||
>(Array.isArray(data) ? result : result[0])
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertStockLocations_(
|
||||
input: UpsertStockLocationInput[],
|
||||
@MedusaContext() context: Context = {}
|
||||
@@ -174,7 +174,7 @@ export default class StockLocationModuleService
|
||||
* @param context
|
||||
* @returns The updated stock location.
|
||||
*/
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateStockLocations(
|
||||
idOrSelector: string | FilterableStockLocationProps,
|
||||
data: UpdateStockLocationInput | UpdateStockLocationInput[],
|
||||
@@ -200,7 +200,7 @@ export default class StockLocationModuleService
|
||||
return Array.isArray(data) ? serialized : serialized[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async updateStockLocations_(
|
||||
data:
|
||||
| UpdateStockLocationInput[]
|
||||
@@ -221,7 +221,7 @@ export default class StockLocationModuleService
|
||||
context?: Context
|
||||
): Promise<StockLocationTypes.StockLocationAddressDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateStockLocationAddresses(
|
||||
data:
|
||||
| (StockLocationAddressInput & { id: string })
|
||||
@@ -240,7 +240,7 @@ export default class StockLocationModuleService
|
||||
return Array.isArray(data) ? serialized : serialized[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async updateStockLocationAddresses_(
|
||||
input: (StockLocationAddressInput & { id: string })[],
|
||||
@MedusaContext() context: Context
|
||||
|
||||
@@ -55,7 +55,7 @@ export default class StoreModuleService
|
||||
data: StoreTypes.CreateStoreDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<StoreTypes.StoreDTO>
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createStores(
|
||||
data: StoreTypes.CreateStoreDTO | StoreTypes.CreateStoreDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -69,7 +69,7 @@ export default class StoreModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async create_(
|
||||
data: StoreTypes.CreateStoreDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -94,7 +94,7 @@ export default class StoreModuleService
|
||||
data: StoreTypes.UpsertStoreDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<StoreTypes.StoreDTO>
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertStores(
|
||||
data: StoreTypes.UpsertStoreDTO | StoreTypes.UpsertStoreDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -133,7 +133,7 @@ export default class StoreModuleService
|
||||
data: StoreTypes.UpdateStoreDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<StoreTypes.StoreDTO[]>
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateStores(
|
||||
idOrSelector: string | StoreTypes.FilterableStoreProps,
|
||||
data: StoreTypes.UpdateStoreDTO,
|
||||
@@ -164,7 +164,7 @@ export default class StoreModuleService
|
||||
return isString(idOrSelector) ? stores[0] : stores
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async update_(
|
||||
data: UpdateStoreInput[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
@@ -84,7 +84,7 @@ export default class TaxModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<TaxTypes.TaxRateDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createTaxRates(
|
||||
data: TaxTypes.CreateTaxRateDTO[] | TaxTypes.CreateTaxRateDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -94,7 +94,7 @@ export default class TaxModuleService
|
||||
return Array.isArray(data) ? rates : rates[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async createTaxRates_(
|
||||
data: TaxTypes.CreateTaxRateDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -157,7 +157,7 @@ export default class TaxModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<TaxTypes.TaxRateDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async updateTaxRates(
|
||||
selector: string | string[] | TaxTypes.FilterableTaxRateProps,
|
||||
data: TaxTypes.UpdateTaxRateDTO,
|
||||
@@ -170,7 +170,7 @@ export default class TaxModuleService
|
||||
return isString(selector) ? serialized[0] : serialized
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
protected async updateTaxRates_(
|
||||
idOrSelector: string | string[] | TaxTypes.FilterableTaxRateProps,
|
||||
data: TaxTypes.UpdateTaxRateDTO,
|
||||
@@ -269,7 +269,7 @@ export default class TaxModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<TaxTypes.TaxRateDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async upsertTaxRates(
|
||||
data: TaxTypes.UpsertTaxRateDTO | TaxTypes.UpsertTaxRateDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -292,7 +292,7 @@ export default class TaxModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<TaxRegionDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createTaxRegions(
|
||||
data: TaxTypes.CreateTaxRegionDTO | TaxTypes.CreateTaxRegionDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -348,7 +348,7 @@ export default class TaxModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<TaxTypes.TaxRateRuleDTO[]>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async createTaxRateRules(
|
||||
data: TaxTypes.CreateTaxRateRuleDTO | TaxTypes.CreateTaxRateRuleDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -358,7 +358,7 @@ export default class TaxModuleService
|
||||
return Array.isArray(data) ? result : result[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async createTaxRateRules_(
|
||||
data: TaxTypes.CreateTaxRateRuleDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -372,7 +372,7 @@ export default class TaxModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
async getTaxLines(
|
||||
items: (TaxTypes.TaxableItemDTO | TaxTypes.TaxableShippingDTO)[],
|
||||
calculationContext: TaxTypes.TaxCalculationContext,
|
||||
@@ -712,7 +712,7 @@ export default class TaxModuleService
|
||||
return code.toLowerCase()
|
||||
}
|
||||
|
||||
// @InjectTransactionManager("baseRepository_")
|
||||
// @InjectTransactionManager()
|
||||
// async createProvidersOnLoad(@MedusaContext() sharedContext: Context = {}) {
|
||||
// const providersToLoad = this.container_["tax_providers"] as ITaxProvider[]
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
UserTypes,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
arrayDifference,
|
||||
CommonEvents,
|
||||
EmitEvents,
|
||||
InjectManager,
|
||||
@@ -14,7 +15,6 @@ import {
|
||||
MedusaError,
|
||||
MedusaService,
|
||||
UserEvents,
|
||||
arrayDifference,
|
||||
} from "@medusajs/utils"
|
||||
import jwt, { JwtPayload } from "jsonwebtoken"
|
||||
import crypto from "node:crypto"
|
||||
@@ -71,7 +71,7 @@ export default class UserModuleService
|
||||
}
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async validateInviteToken(
|
||||
token: string,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -97,7 +97,7 @@ export default class UserModuleService
|
||||
})
|
||||
}
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async refreshInviteTokens(
|
||||
inviteIds: string[],
|
||||
@@ -124,7 +124,7 @@ export default class UserModuleService
|
||||
)
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
async refreshInviteTokens_(
|
||||
inviteIds: string[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -172,7 +172,7 @@ export default class UserModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<UserTypes.UserDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createUsers(
|
||||
data: UserTypes.CreateUserDTO[] | UserTypes.CreateUserDTO,
|
||||
@@ -212,7 +212,7 @@ export default class UserModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<UserTypes.UserDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateUsers(
|
||||
data: UserTypes.UpdateUserDTO | UserTypes.UpdateUserDTO[],
|
||||
@@ -252,7 +252,7 @@ export default class UserModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<UserTypes.InviteDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async createInvites(
|
||||
data: UserTypes.CreateInviteDTO[] | UserTypes.CreateInviteDTO,
|
||||
@@ -293,7 +293,7 @@ export default class UserModuleService
|
||||
return Array.isArray(data) ? serializedInvites : serializedInvites[0]
|
||||
}
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
@InjectTransactionManager()
|
||||
private async createInvites_(
|
||||
data: UserTypes.CreateInviteDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -331,7 +331,7 @@ export default class UserModuleService
|
||||
sharedContext?: Context
|
||||
): Promise<UserTypes.InviteDTO>
|
||||
|
||||
@InjectManager("baseRepository_")
|
||||
@InjectManager()
|
||||
@EmitEvents()
|
||||
async updateInvites(
|
||||
data: UserTypes.UpdateInviteDTO | UserTypes.UpdateInviteDTO[],
|
||||
|
||||
Reference in new issue
Block a user