StorePick HFSS Integration¶
Overview¶
1. Storepick HFSS Adapter Lambda - Lambda poll events from Range SQS and Product SQS. Once messages arrived in SQS then this lambda will get trigger. Read SQS messages, and call product V1 elastic search POST API /product/v1/items/@search to get details in bulk where we can pass list of item ids in request body to get productComplianceInfo.hfssInScope, productComplianceInfo.hfssLessHealthy,productComplianceInfo.foodDrink to calculate restricted value and productComplianceInfo.hfssCategory to send to Ocean and status to check whether product is active or not. Process only range/CREATE, product/CREATE, product/UPDATE and hfss/UPDATE eventEntity/eventType records else ignore others. This lambda will send all received evens to HFSS OSP PUT API /v1/products/hfss. Insert or Update record in BigQuery Table on the bases of BQ_SINK_ENABLED field mentioned in storepick-hfss-products.json config file. For any exception send received SQS message to DLQ.
2. Storepick HFSS Refresh Task - ECS Task trigger by support team manually. This task will trigger by support team manually. Call range V1 GET API /v1/products/hfss?pageToken=1648788 to retrieve all hfss product data. HFSS Product V1 GET API will give response in list Prepare structure of list of messages from HFSS Product V1 GET API response to publish in batch to SNS. (mode = day0) List of messages will publish in SNS where eventId = lastPageToken and eventEntity = hfss message attributes in batch of 10. Publish Batch SNS method will return response with Successful and Failed records.