libs/customer-order/driver/magento/src/transforms/responses/order.ts
File order.ts
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
daffAdd,
daffSubtract,
} from '@daffodil/core';
import { MagentoDiscount } from '@daffodil/driver/magento';
Function daffMagentoCustomerOrderTransformItem
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffMagentoCustomerOrderTransformItem(item: MagentoOrderItem, order: MagentoCustomerOrder, qty: number): DaffOrderItem {
const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);
const rowTotal = qty * item.product_sale_price.value;
const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);
Function daffMagentoCustomerOrderTransformTotals
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffMagentoCustomerOrderTransformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {
return [
{
label: 'Subtotal',
type: DaffOrderTotalTypeEnum.Subtotal,