chore(medusa-core-utils): Migrate to TS (#2670)
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
import { EntityManager } from "typeorm"
|
||||
import { MedusaError, computerizeAmount } from "medusa-core-utils"
|
||||
import { computerizeAmount, MedusaError } from "medusa-core-utils"
|
||||
|
||||
import { AbstractBatchJobStrategy, IFileService } from "../../../interfaces"
|
||||
import CsvParser from "../../../services/csv-parser"
|
||||
import {
|
||||
BatchJobService,
|
||||
ProductVariantService,
|
||||
PriceListService,
|
||||
ProductVariantService,
|
||||
RegionService,
|
||||
} from "../../../services"
|
||||
import { CreateBatchJobInput } from "../../../types/batch-job"
|
||||
import {
|
||||
InjectedProps,
|
||||
OperationType,
|
||||
PriceListImportOperation,
|
||||
PriceListImportOperationPrice,
|
||||
ParsedPriceListImportPrice,
|
||||
PriceListImportBatchJob,
|
||||
PriceListImportCsvSchema,
|
||||
PriceListImportOperation,
|
||||
PriceListImportOperationPrice,
|
||||
TBuiltPriceListImportLine,
|
||||
TParsedPriceListImportRowData,
|
||||
} from "./types"
|
||||
@@ -204,7 +204,10 @@ class PriceListImportStrategy extends AbstractBatchJobStrategy {
|
||||
record.currency_code = price.currency_code
|
||||
}
|
||||
|
||||
record.amount = computerizeAmount(record.amount, record.currency_code)
|
||||
record.amount = computerizeAmount(
|
||||
record.amount as number,
|
||||
record.currency_code
|
||||
)
|
||||
|
||||
operationalPrices.push(record as PriceListImportOperationPrice)
|
||||
}
|
||||
|
||||
@@ -218,7 +218,10 @@ class ProductImportStrategy extends AbstractBatchJobStrategy {
|
||||
record.currency_code = price.currency_code
|
||||
}
|
||||
|
||||
record.amount = computerizeAmount(record.amount, record.currency_code)
|
||||
record.amount = computerizeAmount(
|
||||
Number(record.amount),
|
||||
record.currency_code as string
|
||||
)
|
||||
prices.push(record)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user