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