MuleSoft Accelerator for Consumer Goods icon

MuleSoft Accelerator for Consumer Goods

(0 reviews)

Use case 7 - Pricing Data Integration for TPM

Analyze the impact of promotions on margins, revenue, and overall business performance facilitates informed decision-making and strategic planning for consumer packaged goods (CPG) companies. This solution provides prebuilt assets for integrating list price and cost of goods sold (COGS) data to ensure accurate calculation of promotion profitability and effective resource allocation, maximizing return on investment.

Overview

See also

Description

Integrating list price and cost of goods sold (COGS) data is crucial for CPG companies in trade promotion management as it enables accurate calculation of promotional ROI by comparing revenue generated from promotions with the associated costs. This integration ensures that companies can optimize their promotional strategies effectively, balancing profitability with sales volume.

Glossary

TermDefinition
CGConsumer Goods
OSObject Store
HyperforceSalesforce Hyperforce extends CRM services to major public cloud platforms for improved scalability, global reach, and flexibility

Goals

  • Support the extraction, transformation and loading of List Price and Cost Of Goods Sold (COGS) from S3 to Hyperforce.
  • Orchestrate the Hyperforce System APIs to create transactions, messages and ingest price data in Hyperforce.
  • Archive the successfully processed files in S3.

Use case considerations

  • Hyperforce System API will enhance the backend Hyperforce APIs to provide a secure layer and orchestrate the multiple backend API requests to comply with the below limitations of the Volume Management APIs.
    • The payload size must not exceed 30MB
    • Transaction size should fall within the range of 1 to 2147483646
  • Hyperforce System API supports the following:
    • Create transactions
    • Send account and products prices for a registered transaction
    • Get status information for a given transaction
  • The Price Data Synchronization Process API gets triggered as soon as the files are available in Amazon S3.
  • The Price Data Synchronization Process API reads the file name to determine if its a list price (LIST) or Cost of Goods sold (COGS).
  • The Price Data Synchronization Process APIsplits the file into 30 MB chunks using the For-each scope and sends the create transaction requests to Hyperforce System API.
  • The Price Data Synchronization Process API sends a request to the Hyperforce System API to create a transaction.
  • The Price Data Synchronization Process API then sends the account and products prices for the registered transaction until it reaches the limit of the transaction or until all the split messages are sent over to the Hyperforce System API.
  • If the limit of a transaction is reached before all the files are processed, the Price Data Synchronization Process API appends a counter to the transaction name and creates a new transaction.
  • The files are moved to archive folder after they are successfully uploaded to Hyperforce via the Hyperforce System API.

Technical considerations

  • Prior to setting up the integration, ensure that the integration user has access to the Consumer Goods Cloud Integration Service API
  • S3 is used as the source in the implementation but it can be replaced by any other File based source.

End-to-end scenarios

  • Pricing data for List and COGS is synchronised between S3 and Hyperforce.

Solution definition

The primary set of use cases covered in the current solution details the integration approach for synchronizing pricing information for Trade Promotion Management, involving List and COGS price integration, to transfer data from File based source(S3) to Hyperforce.

Goal

Integrate pricing data from S3 to Hyperforce.

Main success scenario

  1. An event is triggered to the Prices Synchronization API as soon as the files are placed in S3. This can also be setup as a scheduled job at a configured frequency to read the files from S3.
  2. The Prices Synchronization API checks for the two sets of files
    • List
    • COGS
  3. The Prices Synchronization API transforms the file as per the Hyperforce JSON format
  4. If the JSON payload size is more than 30MB, then the Prices Synchronization API splits the json payload using the for-each scope into multiple messages of 30 MB size each.
  5. For the first file, the Prices Synchronization API invokes the Hyperforce System API to create a transaction with the configured number of messages.
  6. For the registered transaction in Step 5, the Prices Synchronization API invokes the Hyperforce System API to send messages to the transaction created in Step 5 until all the messages are sent over to Hyperforce.
  7. If the actual number of messages from the JSON file exceeds the registered number of messages in a transaction, the Prices Synchronization API increments the suffix of the transactionName by 1 and updates the object store in mule with the new transaction name.8.The Prices Synchronization API moves the successful files to the archive folder and the failed files if any to the error folder in S3.

Assumptions and constraints

The following will be used to guide or constrain the solution design at a high level:

  • The payload size should not be more than 30MB
  • Transaction size: min: 1 and max: 2147483646.
  • Decimal value value accepted is 2147483673 and rounded off to the 7 place.

High-level architecture

rcg-tpm-pricing-integration-hla

Activity diagram

rcg-tpm-pricing-integration-activity-diagram

Processing logic

  1. An event is triggered from S3 as soon as the files are put into the S3 bucket.
  2. The Prices Synchronization API checks for files with suffix LIST and COGS in S3 folders.
  3. The Prices Synchronization API transforms the file format to JSON format.
  4. If the JSON payload size is more than 30MB, then the Prices Synchronization API splits the json payload using the for-each scope into multiple messages of 30 MB size each.
  5. For the first file, the Prices Synchronization API invokes the Hyperforce System API to create a transaction with the configured number of messages.
  6. For the registered transaction in Step 5, the Prices Synchronization API invokes the Hyperforce System API to send pricing data( LIST and COGS)
  7. The Price Data Synchronization Process API invokes the Hyperforce System API to send messages to the transaction created in Step 5 until all the messages are sent over to Hyperforce.
  8. If the actual number of messages from the JSON file exceeds the registered number of messages in a transaction, the Price Data Synchronization Process API increments the suffix of the transactionName by 1 and updates the object store in mule with the new transaction name.
  9. The Price Data Synchronization Process API moves the successful files to the archive folder and the failed files if any to the error folder in S3.

Before you begin

bulb.png The Getting Started with MuleSoft Accelerators guide provides general information on getting started with the accelerator components. This includes instructions on setting up your local workstation for configuring and deploying the applications.

Downloadable assets

Accelerator System APIs

Accelerator Process APIs

Common services (can be used across any use case)


Reviews

TypeCustom
OrganizationMuleSoft
Published by
MuleSoft Solutions
Published onFeb 12, 2024
Asset overview

Asset versions for 5.3.x

Asset versions
VersionActions
5.3.0

Categories

Accelerator
Consumer GoodsNo values left to add
Industry Vertical
RetailConsumer GoodsNo values left to add

Tags