@open-mercato/sync-akeneo 0.10.1-develop.8287.1.7313a0fe67 → 0.10.1-develop.8291.1.6ec3aee41c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/sync_akeneo/lib/catalog-importer.js +3 -2
- package/dist/modules/sync_akeneo/lib/catalog-importer.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/sync_akeneo/__tests__/catalog-importer.numeric-values.test.ts +292 -0
- package/src/modules/sync_akeneo/__tests__/catalog-importer.prices.test.ts +47 -0
- package/src/modules/sync_akeneo/lib/catalog-importer.ts +6 -5
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
import { isAkeneoResponseTooLargeError } from "./client.js";
|
|
42
42
|
import { inferAkeneoProductMapping } from "./inference.js";
|
|
43
43
|
import { normalizeMarkdownText } from "./markdown.js";
|
|
44
|
+
import { decimalToString, parseDecimal } from "@open-mercato/shared/lib/decimal";
|
|
44
45
|
const REJECTED_MEDIA_UPLOAD_CODES = /* @__PURE__ */ new Set([
|
|
45
46
|
"dangerous_executable",
|
|
46
47
|
"max_upload_size",
|
|
@@ -278,9 +279,9 @@ function parsePriceCollection(value) {
|
|
|
278
279
|
return value.map((entry) => {
|
|
279
280
|
const record = safeRecord(entry);
|
|
280
281
|
const currencyCode = typeof record?.currency === "string" ? record.currency.trim().toUpperCase() : "";
|
|
281
|
-
const amount =
|
|
282
|
+
const amount = parseDecimal(record?.amount);
|
|
282
283
|
if (!currencyCode || amount === null) return null;
|
|
283
|
-
return { currencyCode, amount };
|
|
284
|
+
return { currencyCode, amount: decimalToString(amount) };
|
|
284
285
|
}).filter((entry) => Boolean(entry));
|
|
285
286
|
}
|
|
286
287
|
function collectMediaReferences(value) {
|