Skip to content

Commit ab26a38

Browse files
committed
chore: updated approvals readme
1 parent 7162170 commit ab26a38

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

unicorn_approvals/src/README.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
1-
# ContractStatusChanged
1+
# Developing Unicorn Approvals
22

3-
*Automatically generated by the [Amazon Event Schemas](https://aws.amazon.com/)*
3+
![Properties Approval Architecture](https://static.us-east-1.prod.workshops.aws/public/f273b5fc-17cd-406b-9e63-1d331b00589d/static/images/architecture-approvals.png)
44

5-
## Requirements
5+
## Architecture overview
66

7-
1. Python 36+
8-
2. six 1.12.0
9-
3. regex 2019.11.1
7+
**Unicorn Approvals** uses an AWS Step Functions state machine to approve property listings for Unicorn Web. The workflow checks for contract information, description sentiment and safe images, and verifies the contract is approved before approving the listing. It publishes the result via the `PublicationEvaluationCompleted` event.
108

11-
## Install Dependencies
12-
### pip users
9+
A Unicorn Properties agent initiates the workflow by requesting to approve a listing, generating a `PublicationApprovalRequested` event with property information. To decouple from the Contracts Service, the Approval service maintains a local copy of contract status by consuming the ContractStatusChanged event.
1310

14-
Create and update it in current project's **requirements.txt**:
11+
The workflow checks the contract state. If the contract is in the WaitForContractApproval state, it updates the contract status for the property with its task token, triggering a DynamoDB stream event. The Property approvals sync function handles these events and passes the task token back to the state machine based on the contract state.
1512

16-
```
17-
six == 1.12.0
18-
regex == 2019.11.1
19-
```
13+
If the workflow completes successfully, it emits a PublicationEvaluationCompleted event with an **approved** or **declined** evaluation result, which Unicorn Web listens to update its publication flag.
2014

21-
Run Command:
22-
23-
```sh
24-
pip3 install -r requirements.txt
25-
```
15+
**Note:** Upon deleting the CloudFormation stack for this service, check if the `ApprovalStateMachine` StepFunction doesn't have any executions in `RUNNING` state. If there are, cancel those execution prior to deleting the CloudFormation stack.

0 commit comments

Comments
 (0)