Online Returns return handler Task

Overview

This repository contains a task. This Task will get trigger by Cloudwatch Rule after every 1 hour. Online Returns return handler task will fetch SCANNED status records from Scanned Product Table from the RDS. The Scanned product will be transferred from virtual store to physical store by calling stock transfer V2 API. After successful transfer status will get change from SCANNED to TRANSFERRED and PENDING to RETURNED in Scanned product table and Return Product Table respectively. For any failure status will get change from SCANNED to FAILED and PENDING to RETURN_FAILED in Scanned product table and Return Product Table respectively.

Catchweight Logic- We fetch catchweight products from scanned table by lookup with min in online product table and check catchweight flag with it’s UOM and price. The price of Catchweight Product is calculated from scanned product Barcode using Embedded price logic from https://morrisons.atlassian.net/wiki/spaces/TR/pages/1201275021/Price+embedded+barcodes Document. Satisfactory Conditions of extracting price from barcode gives catchweight price through which catchweight quantity of product is calculated, scanned table is updated with catchweight price and catchweight quantity.

Accounts Needed

AWS accounts will be required for DEV/SIT/PROD.

References

  1. Unit tests & code coverage at about 90%+.

  2. Configuration for multiple environments, DEV/SIT/PRD.

Document

Ref

Architecture Document

Solution Architecture.

Jira Story

Technical Elaboration - SPDP-5529.

Bitbucket Repository

online returns return handler.

Testing Approach

We will be using a BDD approach where the behaviour will be tested first the code will be developed to match the tested behaviour.

Deployment strategy

The deployment is handled by a jenkins multibranch pipeline, https://jenkins.p.morconnect.com/sonarqube/dashboard?id=storepick-online-returns-return-handler-dev. The commit in the develop branch will automatically deploy the application to the aws environments. The release is done by standard process of tagging the release branch, and by building and deploying from the tags. The tag format is sit-v*-<commit> for nonprod and prd-v*-<commit> for the production release. These tags are manually built on jenkins after the change request has been approved. The release branch is merged to the stable master branch after the successful production deployment.

Backout

To back out we will build off the last release in the master branch and redeploy an old tag version, this shall take around 5 minutes. This will minimise the data loss in case a problem is discovered.

Diagrams

Online Returns Architecture Gives the overview for Online Return Flow.

_images/online_returns.png