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AQ,OAMjCe,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAazB,QAAOtC,EAAAA,EAAA,GACpB8D,OAAOC,aAAazB,SAAW,IAC/BD,EAAQC,SAGXwB,OAAOC,aAAaxB,YAAWvC,EAAAA,EAAA,GAC5B8D,OAAOC,aAAaxB,aAAe,IACnCF,EAAQE,iCC9FnByB,EAAOC,QAAUhC,2BCAjB+B,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/get-attributes-for-selected-variant.ts?32ae","webpack://Msdyn365.Commerce.Online/./src/actions/DataServiceEntities.g.ts?6c17","webpack://Msdyn365.Commerce.Online/./src/actions/DataActionExtension.g.ts?ff78","webpack://Msdyn365.Commerce.Online/./src/actions/get-nutritional-table-cap.action.ts?8d08","webpack://Msdyn365.Commerce.Online/./src/actions/get-sales-order-confirmation-with-hydrations.ts?2593","webpack://Msdyn365.Commerce.Online/./src/themes/loacker/loacker.tsx?edb7","webpack://Msdyn365.Commerce.Online/./lib/loacker/module-registration.js?05ee","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getSelectedProductIdFromActionInput, getSelectedVariant, SelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getAttributeDefinitionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\n\r\n/**\r\n * Chains getting the SelectedVariant with GetActivePrice.\r\n */\r\nexport class AttributesForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public catalogId: number;\r\n\r\n public selectedProduct: SimpleProduct | undefined;\r\n\r\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.selectedProduct = selectedProduct;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => 'AttributesForSelectedVariant';\r\n\r\n public getCacheObjectType = () => 'ProductAttributeValue';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createAttributesForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): AttributesForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n\r\n if (productId) {\r\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n }\r\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Calls the Retail API a get a list of dimension values for a given product.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getAttributesForSelectedVariantAction(\r\n input: AttributesForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return Promise.resolve()\r\n .then(() => {\r\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\r\n\r\n if (!activeProduct) {\r\n const selectedVariantInput = new SelectedVariantInput(input.productId, input.channelId);\r\n\r\n return getSelectedVariant(selectedVariantInput, ctx);\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then((productResult: SimpleProduct | null) => {\r\n const activeProduct: SimpleProduct | undefined = productResult;\r\n\r\n if (activeProduct) {\r\n return getAttributeValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n activeProduct.RecordId,\r\n input.channelId,\r\n input.catalogId\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .then((attributeValues: AttributeValue[] | null) => {\r\n const resultArray = attributeValues;\r\n return getAttributeDefinitionsAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n { AttributeGroupIdentifier: 5637144583 }\r\n ).then(result => {\r\n resultArray.map(item => {\r\n const corr = result.find(element => element.RecordId === item.RecordId);\r\n item.KeyName = corr && corr.Name;\r\n });\r\n return resultArray;\r\n });\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.message);\r\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\r\n action: >getAttributesForSelectedVariantAction,\r\n input: createAttributesForSelectedVariantInput\r\n});\r\n","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * NutritionalValue_CAP entity interface.\r\n */\r\nexport interface INutritionalValue_CAP {\r\n DataAreaId?: string;\r\n TableNumber: number;\r\n SortNumber: number;\r\n Text: number;\r\n TableField?: string;\r\n Indentation: number;\r\n CharDimension: number;\r\n Bold: number;\r\n Italics: number;\r\n Id: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * NutritionalValue_CAP entity class.\r\n */\r\nexport class NutritionalValue_CAPExtensionClass implements INutritionalValue_CAP {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DataAreaId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TableNumber: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public SortNumber: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Text: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TableField: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Indentation: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CharDimension: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Bold: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Italics: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DataAreaId = odataObject.DataAreaId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TableNumber = odataObject.TableNumber;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.SortNumber = odataObject.SortNumber;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Text = odataObject.Text;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TableField = odataObject.TableField;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Indentation = odataObject.Indentation;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CharDimension = odataObject.CharDimension;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Bold = odataObject.Bold;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Italics = odataObject.Italics;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id ? parseInt(odataObject.Id, 10) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (var i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n var className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport {\r\n AsyncResult,\r\n callActionOrExecute,\r\n DataServiceQuery,\r\n IContext,\r\n IDataServiceRequest,\r\n IQueryResultSettings\r\n} from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './DataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction nutritionalValue_CAPQuery(id?: number): DataServiceQuery {\r\n const key = id ? { Id: id } : null;\r\n return new DataServiceQuery(\r\n 'NutritionalValue_CAP',\r\n 'NutritionalValue_CAP',\r\n DataServiceEntities.NutritionalValue_CAPExtensionClass,\r\n key\r\n );\r\n}\r\n\r\nexport function createGetRetailParametersExt_CAPInput(queryResultSettings: IQueryResultSettings): IDataServiceRequest {\r\n const query = nutritionalValue_CAPQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetRetailParametersExt_CAP',\r\n true,\r\n DataServiceEntities.NutritionalValue_CAPExtensionClass,\r\n 'true',\r\n { bypassCache: 'none', returnEntity: 'DataServiceEntities.INutritionalValue_CAP' },\r\n {}\r\n );\r\n}\r\n\r\nexport function getRetailParametersExt_CAPAsync(context: IContext): AsyncResult {\r\n const request = createGetRetailParametersExt_CAPInput(context.queryResultSettings || {});\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getRetailParametersExt_CAPAsync } from './DataActionExtension.g';\r\nimport { INutritionalValue_CAP } from './DataServiceEntities.g';\r\n/**\r\n * GetServiceTableCap Input Action\r\n */\r\nexport class GetNutritionalTableCapInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TODO`;\r\n public getCacheObjectType = () => 'TODO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetNutritionalTableCapData {\r\n nutritionalTable: INutritionalValue_CAP[];\r\n}\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetNutritionalTableCapInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetNutritionalTableCapInput, ctx: Msdyn365.IActionContext): Promise {\r\n const response = await getRetailParametersExt_CAPAsync({ callerContext: ctx });\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetServiceTableCap',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICommerceApiSettings,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport { ProductDeliveryOptions, SalesOrder, SimpleProduct, TransactionType } from '@msdyn365-commerce/retail-proxy';\r\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n getSalesOrderDetailsBySalesIdAsync,\r\n getSalesOrderDetailsByTransactionIdAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/SalesOrdersDataActions.g';\r\nimport {\r\n ArrayExtensions,\r\n buildCacheKey,\r\n getSimpleProducts,\r\n ObjectExtensions,\r\n ProductInput,\r\n QueryResultSettingsProxy\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Sales order response interface.\r\n */\r\ninterface ISalesOrderWithHydrations {\r\n salesOrder: SalesOrder;\r\n products: SimpleProduct[];\r\n productDeliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\n/**\r\n * OrderTypes Types of orders.\r\n */\r\nexport enum orderTypes {\r\n salesOrder = 'salesOrder',\r\n transaction = 'transaction'\r\n}\r\n\r\n/**\r\n * Calls the Retail API and returns the sales order.\r\n * @param orderType - OrderType.\r\n * @param orderId - Unique OrderId for each order.\r\n * @returns Sales Order.\r\n */\r\nconst getSalesOrder = (orderType: string = '', orderId: string = '') => async (\r\n context: IActionContext\r\n): Promise => {\r\n // Local (1) searches the retail server database, and remote (2) searches\r\n // on the headquarters side. All (3) and none (0) are not supported.\r\n const localSearch = 1;\r\n return orderType === orderTypes.salesOrder\r\n ? getSalesOrderDetailsBySalesIdAsync({ callerContext: context }, orderId)\r\n : getSalesOrderDetailsByTransactionIdAsync({ callerContext: context }, orderId, localSearch);\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the products.\r\n * @param productIds - The product ids of the product to retrieve.\r\n * @param channelId - The channel id for the products.\r\n * @returns Simple product data.\r\n */\r\nconst getProducts = (productIds: (string | number)[] = [], channelId?: number) => async (\r\n context: IActionContext\r\n): Promise => {\r\n const productInputs = productIds.map(\r\n productId => new ProductInput(productId, context.requestContext.apiSettings, channelId, undefined, context.requestContext)\r\n );\r\n return getSimpleProducts(productInputs, context);\r\n};\r\n\r\n/**\r\n * Action input.\r\n */\r\nexport class GetSalesOrderConfirmationWithHydrationsInput implements IActionInput {\r\n public orderType: string;\r\n\r\n public orderId: string;\r\n\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n constructor(orderType: string, orderId: string, apiSettings: ICommerceApiSettings) {\r\n this.orderType = orderType;\r\n this.orderId = orderId;\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n /**\r\n * Get cache key.\r\n * @returns String.\r\n */\r\n public getCacheKey = () => buildCacheKey('SalesOrderConfirmationWithHydrations', this.apiSettings);\r\n\r\n /**\r\n * Get cache object.\r\n * @returns String.\r\n */\r\n public getCacheObjectType = () => `SalesOrderConfirmationWithHydrations-${this.orderType}-${this.orderId}`;\r\n\r\n /**\r\n * Get cache data type.\r\n * @returns String.\r\n */\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the retail api call.\r\n * @param inputData - Actioncontext data.\r\n * @returns Sales Order Input.\r\n */\r\nconst createSalesOrderConfrimationWithHydrationsInput = (inputData: ICreateActionContext) => {\r\n const { salesId = '', transactionId = '' } = inputData.requestContext.query || {};\r\n if (salesId) {\r\n return new GetSalesOrderConfirmationWithHydrationsInput(orderTypes.salesOrder, salesId, inputData.requestContext.apiSettings);\r\n } else if (transactionId) {\r\n return new GetSalesOrderConfirmationWithHydrationsInput(\r\n orderTypes.transaction,\r\n transactionId,\r\n inputData.requestContext.apiSettings\r\n );\r\n }\r\n throw new Error('createSalesOrderConfrimationWithHydrationsInput - No salesId or transactionId provided.');\r\n};\r\n\r\n/**\r\n * Get sales order with hydrations action.\r\n * @param input - Input for data action.\r\n * @param context - Action context.\r\n * @returns Sales order response.\r\n */\r\nexport async function getSalesOrderConfirmationWithHydrationsAction(\r\n input: GetSalesOrderConfirmationWithHydrationsInput,\r\n context: IActionContext\r\n): Promise {\r\n if (!context) {\r\n throw new Error('getSalesOrderConfirmationWithHydrationsAction - Action context cannot be null/undefined');\r\n }\r\n\r\n const { orderType, orderId } = input;\r\n\r\n if (!orderType || !orderId) {\r\n context.trace('[getSalesOrderConfirmationWithHydrationsAction] No orderType or orderId provided.');\r\n return {};\r\n }\r\n\r\n const salesOrder = await getSalesOrder(orderType, orderId)(context);\r\n\r\n if (!salesOrder) {\r\n context.trace('[getSalesOrderWithHydrationsAction] No salesOrder found.');\r\n return {};\r\n }\r\n\r\n // If it is salesInvoice, return salesOrder and empty products\r\n if (salesOrder.TransactionTypeValue === TransactionType.SalesInvoice) {\r\n return {\r\n salesOrder,\r\n products: []\r\n };\r\n }\r\n\r\n if (!ArrayExtensions.hasElements(salesOrder.SalesLines)) {\r\n context.trace('[getSalesOrderWithHydrationsAction] No salesLine found.');\r\n return {};\r\n }\r\n let count = 0;\r\n const salesLinesCustom = salesOrder.SalesLines.map(salesLine => {\r\n const bundleQuantities = salesOrder.Comment?.split('|');\r\n\r\n if (salesLine.SalesStatusValue === 7) {\r\n const bundleSubProducts = salesOrder.SalesLines?.filter(\r\n salesLineS =>\r\n salesLineS &&\r\n salesLine &&\r\n salesLineS.LineNumber &&\r\n salesLine.LineNumber &&\r\n salesLineS.LineNumber > salesLine.LineNumber &&\r\n salesLineS.LineNumber < salesLine.LineNumber + 1\r\n );\r\n const bundleNetAmount =\r\n bundleSubProducts &&\r\n bundleSubProducts.map(bundleProduct => bundleProduct.NetAmount).reduce((total = 0, current = 0) => total + current, 0);\r\n const bundleGrossAmount =\r\n bundleSubProducts &&\r\n bundleSubProducts.map(bundleProduct => bundleProduct.GrossAmount).reduce((total = 0, current = 0) => total + current, 0);\r\n\r\n const bundleTotalAmount =\r\n bundleSubProducts &&\r\n bundleSubProducts.map(bundleProduct => bundleProduct.TotalAmount).reduce((total = 0, current = 0) => total + current, 0);\r\n const bundlePrice =\r\n bundleSubProducts &&\r\n bundleSubProducts.map(bundleProduct => bundleProduct.Price).reduce((total = 0, current = 0) => total + current, 0);\r\n const bundleNetAmountWithAllInclusiveTax =\r\n bundleSubProducts &&\r\n bundleSubProducts\r\n .map(bundleProduct => bundleProduct.NetAmountWithAllInclusiveTax)\r\n .reduce((total = 0, current = 0) => total + current, 0);\r\n\r\n if (bundleSubProducts && bundleSubProducts.length > 0) {\r\n return {\r\n ...salesLine,\r\n SalesStatusValue: bundleSubProducts[0].SalesStatusValue,\r\n IsBundle: true,\r\n NetAmount: bundleNetAmount,\r\n GrossAmount: bundleGrossAmount,\r\n TotalAmount: bundleTotalAmount,\r\n Price: bundlePrice,\r\n NetAmountWithAllInclusiveTax: bundleNetAmountWithAllInclusiveTax,\r\n Quantity: bundleQuantities && bundleQuantities[count++]\r\n };\r\n }\r\n }\r\n return salesLine;\r\n });\r\n\r\n const salesOrderC = {\r\n ...salesOrder,\r\n SalesLines: salesLinesCustom\r\n };\r\n\r\n const filteredsalesLines = salesOrderC.SalesLines.filter(salesLine => Number.isInteger(salesLine.LineNumber));\r\n\r\n const salesOrderP = {\r\n ...salesOrderC,\r\n SalesLines: filteredsalesLines\r\n };\r\n /*\r\n const productIds = salesOrder.SalesLines.filter(salesLine => Number.isInteger(salesLine.LineNumber)).map(\r\n salesLine => salesLine?.ProductId ?? ''\r\n );*/\r\n const productIds = salesOrderP.SalesLines.map(salesLine => salesLine.ProductId ?? '');\r\n if (!ArrayExtensions.hasElements(productIds)) {\r\n context.trace('[getSalesOrderWithHydrationsAction] No products in saleLines found.');\r\n return {};\r\n }\r\n\r\n const products = await getProducts(productIds, salesOrderC.ChannelId)(context);\r\n\r\n if (!ArrayExtensions.hasElements(products)) {\r\n context.trace('[getSalesOrderWithHydrationsAction] No simple products found.');\r\n return {};\r\n }\r\n\r\n const validProducts = products.filter(product => !ObjectExtensions.isNullOrUndefined(product.RecordId));\r\n const filterPickup = 4;\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: context, queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context) },\r\n validProducts.map(product => product.RecordId),\r\n {},\r\n filterPickup\r\n )\r\n .then(result => {\r\n return result;\r\n })\r\n .catch((error: Error) => {\r\n context.trace(error.message);\r\n context.telemetry.exception(error);\r\n context.telemetry.debug('[getDeliveryOptionsForCartLineItems]Error executing action');\r\n throw new Error('[getDeliveryOptionsForCartLineItems]Error executing action');\r\n });\r\n\r\n return {\r\n salesOrder: salesOrderP,\r\n products,\r\n deliveryOptions\r\n };\r\n}\r\n\r\n/**\r\n * Get sales order with hydrations action.\r\n * @param id - Unique Id for data action.\r\n * @param context - Action context.\r\n * @param input - Input for data action.\r\n * @returns Sales order response.\r\n */\r\nexport const getSalesOrderConfirmationWithHydrationsActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/order-management/get-sales-order-confirmation-with-hydrations',\r\n action: >getSalesOrderConfirmationWithHydrationsAction,\r\n input: createSalesOrderConfrimationWithHydrationsInput\r\n});\r\n\r\nexport default getSalesOrderConfirmationWithHydrationsActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\n/**\r\n * CoreComponent component\r\n * @extends {React.PureComponent}\r\n */\r\n\r\nclass Loacker extends React.PureComponent {\r\n constructor(props: {}) {\r\n super(props);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return