fix(medusa): Lint and missing transaction usage (#1297)
This commit is contained in:
@@ -189,7 +189,7 @@ export class AdminPostDraftOrdersReq {
|
|||||||
|
|
||||||
@IsObject()
|
@IsObject()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
metadata?: Record<string, any> = {}
|
metadata?: Record<string, unknown> = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ShippingMethod {
|
class ShippingMethod {
|
||||||
@@ -198,7 +198,7 @@ class ShippingMethod {
|
|||||||
|
|
||||||
@IsObject()
|
@IsObject()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
data?: Record<string, any> = {}
|
data?: Record<string, unknown> = {}
|
||||||
|
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@@ -228,5 +228,5 @@ class Item {
|
|||||||
|
|
||||||
@IsObject()
|
@IsObject()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
metadata?: Record<string, any> = {}
|
metadata?: Record<string, unknown> = {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,5 +134,5 @@ export class AdminPostDraftOrdersDraftOrderLineItemsReq {
|
|||||||
|
|
||||||
@IsObject()
|
@IsObject()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
metadata?: Record<string, any> = {}
|
metadata?: Record<string, unknown> = {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,5 +128,5 @@ export class AdminPostDraftOrdersDraftOrderLineItemsItemReq {
|
|||||||
|
|
||||||
@IsObject()
|
@IsObject()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
metadata?: Record<string, any> = {}
|
metadata?: Record<string, unknown> = {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Router } from "express"
|
import { Router } from "express"
|
||||||
import { Notification } from "./../../../../"
|
import { Notification } from "./../../../../"
|
||||||
import { PaginatedResponse } from "./../../../../types/common"
|
|
||||||
import middlewares from "../../../middlewares"
|
import middlewares from "../../../middlewares"
|
||||||
|
|
||||||
const route = Router()
|
const route = Router()
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default async (req, res) => {
|
|||||||
include_resends,
|
include_resends,
|
||||||
} = await validator(AdminGetNotificationsParams, req.query)
|
} = await validator(AdminGetNotificationsParams, req.query)
|
||||||
|
|
||||||
const selector: any = {}
|
const selector: Record<string, unknown> = {}
|
||||||
|
|
||||||
let includeFields: string[] = []
|
let includeFields: string[] = []
|
||||||
if (fields) {
|
if (fields) {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export default async (req, res) => {
|
|||||||
"notificationService"
|
"notificationService"
|
||||||
)
|
)
|
||||||
|
|
||||||
const config: any = {}
|
const config: Record<string, unknown> = {}
|
||||||
|
|
||||||
if (validatedBody.to) {
|
if (validatedBody.to) {
|
||||||
config.to = validatedBody.to
|
config.to = validatedBody.to
|
||||||
|
|||||||
@@ -70,5 +70,5 @@ export class AdminPostOrdersOrderShippingMethodsReq {
|
|||||||
|
|
||||||
@IsObject()
|
@IsObject()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
data?: Record<string, any> = {}
|
data?: Record<string, unknown> = {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Type, Transform } from "class-transformer"
|
import { Type } from "class-transformer"
|
||||||
import {
|
import {
|
||||||
IsEmail,
|
IsEmail,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
SwapService,
|
SwapService,
|
||||||
} from "../../../../services"
|
} from "../../../../services"
|
||||||
import { validator } from "../../../../utils/validator"
|
import { validator } from "../../../../utils/validator"
|
||||||
|
import { EntityManager } from "typeorm"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @oas [post] /order/{id}/swaps
|
* @oas [post] /order/{id}/swaps
|
||||||
@@ -201,10 +202,12 @@ export default async (req, res) => {
|
|||||||
case "swap_created": {
|
case "swap_created": {
|
||||||
const { key, error } = await idempotencyKeyService.workStage(
|
const { key, error } = await idempotencyKeyService.workStage(
|
||||||
idempotencyKey.idempotency_key,
|
idempotencyKey.idempotency_key,
|
||||||
async (manager) => {
|
async (transactionManager: EntityManager) => {
|
||||||
const swaps = await swapService.list({
|
const swaps = await swapService
|
||||||
idempotency_key: idempotencyKey.idempotency_key,
|
.withTransaction(transactionManager)
|
||||||
})
|
.list({
|
||||||
|
idempotency_key: idempotencyKey.idempotency_key,
|
||||||
|
})
|
||||||
|
|
||||||
if (!swaps.length) {
|
if (!swaps.length) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
@@ -213,10 +216,12 @@ export default async (req, res) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const order = await orderService.retrieve(id, {
|
const order = await orderService
|
||||||
select: defaultAdminOrdersFields,
|
.withTransaction(transactionManager)
|
||||||
relations: defaultAdminOrdersRelations,
|
.retrieve(id, {
|
||||||
})
|
select: defaultAdminOrdersFields,
|
||||||
|
relations: defaultAdminOrdersRelations,
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
response_code: 200,
|
response_code: 200,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { defaultAdminOrdersRelations, defaultAdminOrdersFields } from "."
|
import { defaultAdminOrdersRelations, defaultAdminOrdersFields } from "."
|
||||||
import { validator } from "../../../../utils/validator"
|
import { validator } from "../../../../utils/validator"
|
||||||
import { IsNumber, IsOptional, IsString } from "class-validator"
|
import { IsNumber, IsOptional, IsString } from "class-validator"
|
||||||
import { identity, omit, pick, pickBy } from "lodash"
|
import { omit, pick, pickBy } from "lodash"
|
||||||
import { OrderService } from "../../../../services"
|
import { OrderService } from "../../../../services"
|
||||||
import { AdminListOrdersSelector } from "../../../../types/orders"
|
import { AdminListOrdersSelector } from "../../../../types/orders"
|
||||||
import { Type } from "class-transformer"
|
import { Type } from "class-transformer"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Transform, Type } from "class-transformer"
|
import { Type } from "class-transformer"
|
||||||
import {
|
import {
|
||||||
IsArray,
|
IsArray,
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
IsString,
|
IsString,
|
||||||
ValidateNested,
|
ValidateNested,
|
||||||
} from "class-validator"
|
} from "class-validator"
|
||||||
import { MedusaError } from "medusa-core-utils"
|
|
||||||
import { defaultAdminProductFields, defaultAdminProductRelations } from "."
|
import { defaultAdminProductFields, defaultAdminProductRelations } from "."
|
||||||
import { ProductService, ProductVariantService } from "../../../../services"
|
import { ProductService, ProductVariantService } from "../../../../services"
|
||||||
import { PriceSelectionParams } from "../../../../types/price-selection"
|
import { PriceSelectionParams } from "../../../../types/price-selection"
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export type AdminRegionsDeleteRes = DeleteResponse
|
|||||||
|
|
||||||
export class FulfillmentOption {
|
export class FulfillmentOption {
|
||||||
provider_id: string
|
provider_id: string
|
||||||
options: any[]
|
options: unknown[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AdminGetRegionsRegionFulfillmentOptionsRes {
|
export class AdminGetRegionsRegionFulfillmentOptionsRes {
|
||||||
|
|||||||
@@ -1,19 +1,10 @@
|
|||||||
import { getListConfig, pickByConfig } from "./utils/get-query-config"
|
import { getListConfig, pickByConfig } from "./utils/get-query-config"
|
||||||
import {
|
import { IsArray, IsNumber, IsOptional, IsString } from "class-validator"
|
||||||
IsArray,
|
|
||||||
ValidateNested,
|
|
||||||
IsNumber,
|
|
||||||
IsOptional,
|
|
||||||
IsString,
|
|
||||||
} from "class-validator"
|
|
||||||
import { Type } from "class-transformer"
|
import { Type } from "class-transformer"
|
||||||
import { omit, pickBy, pick, identity } from "lodash"
|
import { omit, pickBy, identity } from "lodash"
|
||||||
|
|
||||||
import { TaxRate } from "../../../.."
|
import { TaxRate } from "../../../.."
|
||||||
import {
|
import { NumericalComparisonOperator } from "../../../../types/common"
|
||||||
NumericalComparisonOperator,
|
|
||||||
FindConfig,
|
|
||||||
} from "../../../../types/common"
|
|
||||||
import { TaxRateService } from "../../../../services"
|
import { TaxRateService } from "../../../../services"
|
||||||
import { IsType } from "../../../../utils/validators/is-type"
|
import { IsType } from "../../../../utils/validators/is-type"
|
||||||
import { validator } from "../../../../utils/validator"
|
import { validator } from "../../../../utils/validator"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default (app) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type AdminUploadRes = {
|
export type AdminUploadRes = {
|
||||||
uploads: any[]
|
uploads: unknown[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AdminDeleteUploadRes = DeleteResponse
|
export type AdminDeleteUploadRes = DeleteResponse
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default async (req, res) => {
|
|||||||
// Add JWT to cookie
|
// Add JWT to cookie
|
||||||
req.session.jwt = jwt.sign(
|
req.session.jwt = jwt.sign(
|
||||||
{ customer_id: result.customer?.id },
|
{ customer_id: result.customer?.id },
|
||||||
(config as any).jwtSecret,
|
config.jwtSecret as string,
|
||||||
{
|
{
|
||||||
expiresIn: "30d",
|
expiresIn: "30d",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ export type StoreProductsRes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type StorePostSearchRes = {
|
export type StorePostSearchRes = {
|
||||||
hits: any[]
|
hits: unknown[]
|
||||||
[k: string]: any
|
[k: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StoreProductsListRes = PaginatedResponse & {
|
export type StoreProductsListRes = PaginatedResponse & {
|
||||||
|
|||||||
@@ -42,5 +42,5 @@ export class StorePostSearchReq {
|
|||||||
limit?: number
|
limit?: number
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
filter?: any
|
filter?: unknown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default async (req, res) => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// should be selector
|
// should be selector
|
||||||
const query: any = {}
|
const query: Record<string, unknown> = {}
|
||||||
|
|
||||||
if ("is_return" in req.query) {
|
if ("is_return" in req.query) {
|
||||||
query.is_return = validated.is_return === "true"
|
query.is_return = validated.is_return === "true"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import OrderService from "../../../../services/order"
|
|||||||
import ReturnService from "../../../../services/return"
|
import ReturnService from "../../../../services/return"
|
||||||
import SwapService from "../../../../services/swap"
|
import SwapService from "../../../../services/swap"
|
||||||
import { validator } from "../../../../utils/validator"
|
import { validator } from "../../../../utils/validator"
|
||||||
|
import { EntityManager } from "typeorm"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @oas [post] /swaps
|
* @oas [post] /swaps
|
||||||
@@ -182,10 +183,12 @@ export default async (req, res) => {
|
|||||||
case "swap_created": {
|
case "swap_created": {
|
||||||
const { key, error } = await idempotencyKeyService.workStage(
|
const { key, error } = await idempotencyKeyService.workStage(
|
||||||
idempotencyKey.idempotency_key,
|
idempotencyKey.idempotency_key,
|
||||||
async (manager) => {
|
async (transactionManager: EntityManager) => {
|
||||||
const swaps = await swapService.list({
|
const swaps = await swapService
|
||||||
idempotency_key: idempotencyKey.idempotency_key,
|
.withTransaction(transactionManager)
|
||||||
})
|
.list({
|
||||||
|
idempotency_key: idempotencyKey.idempotency_key,
|
||||||
|
})
|
||||||
|
|
||||||
if (!swaps.length) {
|
if (!swaps.length) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
@@ -194,10 +197,12 @@ export default async (req, res) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const swap = await swapService.retrieve(swaps[0].id, {
|
const swap = await swapService
|
||||||
select: defaultStoreSwapFields,
|
.withTransaction(transactionManager)
|
||||||
relations: defaultStoreSwapRelations,
|
.retrieve(swaps[0].id, {
|
||||||
})
|
select: defaultStoreSwapFields,
|
||||||
|
relations: defaultStoreSwapRelations,
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
response_code: 200,
|
response_code: 200,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { omit, pickBy } from "lodash"
|
import { omit, pickBy } from "lodash"
|
||||||
import { AdminGetCustomersParams } from "../../api/routes/admin/customers/list-customers"
|
import { AdminGetCustomersParams } from "../../api/routes/admin/customers"
|
||||||
import { AdminCustomersListRes } from "../../api"
|
import { AdminCustomersListRes } from "../../api"
|
||||||
import { CustomerService } from "../../services"
|
import { CustomerService } from "../../services"
|
||||||
import { FindConfig } from "../../types/common"
|
import { FindConfig } from "../../types/common"
|
||||||
@@ -9,8 +9,7 @@ import { Customer } from "../../models/customer"
|
|||||||
const listAndCount = async (
|
const listAndCount = async (
|
||||||
scope,
|
scope,
|
||||||
query,
|
query,
|
||||||
body,
|
body
|
||||||
context = {}
|
|
||||||
): Promise<AdminCustomersListRes> => {
|
): Promise<AdminCustomersListRes> => {
|
||||||
const validatedQueryParams = await validator(AdminGetCustomersParams, query)
|
const validatedQueryParams = await validator(AdminGetCustomersParams, query)
|
||||||
|
|
||||||
|
|||||||
@@ -1190,7 +1190,7 @@ class CartService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
async authorizePayment(
|
async authorizePayment(
|
||||||
cartId: string,
|
cartId: string,
|
||||||
context: Record<string, any> = {}
|
context: Record<string, unknown> = {}
|
||||||
): Promise<Cart> {
|
): Promise<Cart> {
|
||||||
return this.atomicPhase_(async (manager: EntityManager) => {
|
return this.atomicPhase_(async (manager: EntityManager) => {
|
||||||
const cartRepository = manager.getCustomRepository(this.cartRepository_)
|
const cartRepository = manager.getCustomRepository(this.cartRepository_)
|
||||||
@@ -1500,7 +1500,7 @@ class CartService extends BaseService {
|
|||||||
async addShippingMethod(
|
async addShippingMethod(
|
||||||
cartId: string,
|
cartId: string,
|
||||||
optionId: string,
|
optionId: string,
|
||||||
data: Record<string, any> = {}
|
data: Record<string, unknown> = {}
|
||||||
): Promise<Cart> {
|
): Promise<Cart> {
|
||||||
return this.atomicPhase_(async (manager: EntityManager) => {
|
return this.atomicPhase_(async (manager: EntityManager) => {
|
||||||
const cart = await this.retrieve(cartId, {
|
const cart = await this.retrieve(cartId, {
|
||||||
|
|||||||
@@ -654,7 +654,7 @@ class DiscountService extends BaseService {
|
|||||||
resolvedConditionType.type
|
resolvedConditionType.type
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
async (err: any) => {
|
async (err: { code: string }) => {
|
||||||
if (err.code === PostgresError.DUPLICATE_ERROR) {
|
if (err.code === PostgresError.DUPLICATE_ERROR) {
|
||||||
// A unique key constraint failed meaning the combination of
|
// A unique key constraint failed meaning the combination of
|
||||||
// discount rule id, type, and operator already exists in the db.
|
// discount rule id, type, and operator already exists in the db.
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ class InviteService extends BaseService {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async resend(id): Promise<any> {
|
async resend(id): Promise<void> {
|
||||||
const inviteRepo = this.manager_.getCustomRepository(InviteRepository)
|
const inviteRepo = this.manager_.getCustomRepository(InviteRepository)
|
||||||
|
|
||||||
const invite = await inviteRepo.findOne({ id })
|
const invite = await inviteRepo.findOne({ id })
|
||||||
|
|||||||
@@ -188,9 +188,8 @@ class OrderService extends BaseService {
|
|||||||
const orderRepo = this.manager_.getCustomRepository(this.orderRepository_)
|
const orderRepo = this.manager_.getCustomRepository(this.orderRepository_)
|
||||||
const query = this.buildQuery_(selector, config)
|
const query = this.buildQuery_(selector, config)
|
||||||
|
|
||||||
const { select, relations, totalsToSelect } = this.transformQueryForTotals_(
|
const { select, relations, totalsToSelect } =
|
||||||
config
|
this.transformQueryForTotals_(config)
|
||||||
)
|
|
||||||
|
|
||||||
if (select && select.length) {
|
if (select && select.length) {
|
||||||
query.select = select
|
query.select = select
|
||||||
@@ -249,9 +248,8 @@ class OrderService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const { select, relations, totalsToSelect } = this.transformQueryForTotals_(
|
const { select, relations, totalsToSelect } =
|
||||||
config
|
this.transformQueryForTotals_(config)
|
||||||
)
|
|
||||||
|
|
||||||
if (select && select.length) {
|
if (select && select.length) {
|
||||||
query.select = select
|
query.select = select
|
||||||
@@ -341,9 +339,8 @@ class OrderService extends BaseService {
|
|||||||
const orderRepo = this.manager_.getCustomRepository(this.orderRepository_)
|
const orderRepo = this.manager_.getCustomRepository(this.orderRepository_)
|
||||||
const validatedId = this.validateId_(orderId)
|
const validatedId = this.validateId_(orderId)
|
||||||
|
|
||||||
const { select, relations, totalsToSelect } = this.transformQueryForTotals_(
|
const { select, relations, totalsToSelect } =
|
||||||
config
|
this.transformQueryForTotals_(config)
|
||||||
)
|
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
where: { id: validatedId },
|
where: { id: validatedId },
|
||||||
@@ -379,9 +376,8 @@ class OrderService extends BaseService {
|
|||||||
async retrieveByCartId(cartId, config = {}) {
|
async retrieveByCartId(cartId, config = {}) {
|
||||||
const orderRepo = this.manager_.getCustomRepository(this.orderRepository_)
|
const orderRepo = this.manager_.getCustomRepository(this.orderRepository_)
|
||||||
|
|
||||||
const { select, relations, totalsToSelect } = this.transformQueryForTotals_(
|
const { select, relations, totalsToSelect } =
|
||||||
config
|
this.transformQueryForTotals_(config)
|
||||||
)
|
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
where: { cart_id: cartId },
|
where: { cart_id: cartId },
|
||||||
@@ -417,9 +413,8 @@ class OrderService extends BaseService {
|
|||||||
async retrieveByExternalId(externalId, config = {}) {
|
async retrieveByExternalId(externalId, config = {}) {
|
||||||
const orderRepo = this.manager_.getCustomRepository(this.orderRepository_)
|
const orderRepo = this.manager_.getCustomRepository(this.orderRepository_)
|
||||||
|
|
||||||
const { select, relations, totalsToSelect } = this.transformQueryForTotals_(
|
const { select, relations, totalsToSelect } =
|
||||||
config
|
this.transformQueryForTotals_(config)
|
||||||
)
|
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
where: { external_id: externalId },
|
where: { external_id: externalId },
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { JsonWebTokenError } from "jsonwebtoken"
|
|
||||||
import { MedusaError } from "medusa-core-utils"
|
import { MedusaError } from "medusa-core-utils"
|
||||||
import { BaseService } from "medusa-interfaces"
|
import { BaseService } from "medusa-interfaces"
|
||||||
import { Brackets, EntityManager, ILike, SelectQueryBuilder } from "typeorm"
|
import { Brackets, EntityManager, ILike, SelectQueryBuilder } from "typeorm"
|
||||||
|
|||||||
@@ -422,9 +422,8 @@ class ReturnService extends BaseService {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const calculationContext = this.totalsService_.getCalculationContext(
|
const calculationContext =
|
||||||
order
|
this.totalsService_.getCalculationContext(order)
|
||||||
)
|
|
||||||
|
|
||||||
const taxLines = await this.taxProviderService_
|
const taxLines = await this.taxProviderService_
|
||||||
.withTransaction(manager)
|
.withTransaction(manager)
|
||||||
@@ -496,9 +495,8 @@ class ReturnService extends BaseService {
|
|||||||
return returnOrder
|
return returnOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
const fulfillmentData = await this.fulfillmentProviderService_.createReturn(
|
const fulfillmentData =
|
||||||
returnData
|
await this.fulfillmentProviderService_.createReturn(returnData)
|
||||||
)
|
|
||||||
|
|
||||||
returnOrder.shipping_data = fulfillmentData
|
returnOrder.shipping_data = fulfillmentData
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import _ from "lodash"
|
import _ from "lodash"
|
||||||
import { MedusaError } from "medusa-core-utils"
|
import { MedusaError } from "medusa-core-utils"
|
||||||
import { BaseService } from "medusa-interfaces"
|
import { BaseService } from "medusa-interfaces"
|
||||||
import { ITaxCalculationStrategy } from "../interfaces/tax-calculation-strategy"
|
import { ITaxCalculationStrategy, TaxCalculationContext } from "../interfaces"
|
||||||
import { TaxCalculationContext } from "../interfaces/tax-service"
|
|
||||||
import { Cart } from "../models/cart"
|
import { Cart } from "../models/cart"
|
||||||
import { Discount } from "../models/discount"
|
import { Discount } from "../models/discount"
|
||||||
import { DiscountRuleType } from "../models/discount-rule"
|
import { DiscountRuleType } from "../models/discount-rule"
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
} from "../interfaces/price-selection-strategy"
|
} from "../interfaces/price-selection-strategy"
|
||||||
import { MoneyAmountRepository } from "../repositories/money-amount"
|
import { MoneyAmountRepository } from "../repositories/money-amount"
|
||||||
import { EntityManager } from "typeorm"
|
import { EntityManager } from "typeorm"
|
||||||
import { MedusaError } from "medusa-core-utils"
|
|
||||||
|
|
||||||
class PriceSelectionStrategy extends AbstractPriceSelectionStrategy {
|
class PriceSelectionStrategy extends AbstractPriceSelectionStrategy {
|
||||||
private moneyAmountRepository_: typeof MoneyAmountRepository
|
private moneyAmountRepository_: typeof MoneyAmountRepository
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsInt,
|
IsInt,
|
||||||
IsNumber,
|
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
Validate,
|
Validate,
|
||||||
|
|||||||
Reference in New Issue
Block a user