diff --git a/src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper.ts b/src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper.ts index 5e8a868..9842adf 100644 --- a/src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper.ts +++ b/src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper.ts @@ -178,6 +178,16 @@ export function mappingRevertTransaction(data, type) { const total_share_tenant = share_margin > 0 ? (Number(share_margin) / 100) * total_price : 0; + item.item.bundling_items = item.item.bundling_items?.map((bundling) => { + if (bundling.item_id) return bundling; + return { + ...bundling, + item_id: bundling.id, + item_name: bundling.name, + id: uuidv4(), + }; + }); + Object.assign(item, { item_id: item.item.id, item_name: item.item.name, @@ -192,15 +202,6 @@ export function mappingRevertTransaction(data, type) { (bundling) => bundling.name, ), breakdown_bundling: item.item.breakdown_bundling, - bundling_items: item.item.bundling_items?.map((bundling) => { - if (bundling.item_id) return bundling; - return { - ...bundling, - item_id: bundling.id, - item_name: bundling.name, - id: uuidv4(), - }; - }), item_tenant_id: item.item.tenant?.id ?? null, item_tenant_name: item.item.tenant?.id ?? null,