@shushed/helpers 0.0.202-bug-erp-770-20251202001825 → 0.0.202-bug-erp-770-20251202004216
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/index.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -111415,7 +111415,9 @@ function transformMasterOrder(payload) {
|
|
|
111415
111415
|
const paymentCreatedByRaw = primary.created_by || invoice0?.created_by || sale0?.created_by || "";
|
|
111416
111416
|
const paymentCreatedByUpper = String(paymentCreatedByRaw).toUpperCase();
|
|
111417
111417
|
const isEmail = typeof paymentCreatedByRaw === "string" && paymentCreatedByRaw.includes("@");
|
|
111418
|
-
const
|
|
111418
|
+
const validEnumValues = ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
111419
|
+
const isValidEnum = validEnumValues.includes(paymentCreatedByUpper);
|
|
111420
|
+
const created_by = isEmail ? paymentCreatedByRaw : isValidEnum ? paymentCreatedByUpper : "MOTO";
|
|
111419
111421
|
const journey_label = null;
|
|
111420
111422
|
const card_number = sortedEntries.find((e) => e.source === "card_payment" && e.card_number)?.card_number || primary.card_number || null;
|
|
111421
111423
|
const cardPaymentForBrand = sortedEntries.find((e) => e.source === "card_payment" && e.service_type);
|