Consumer Ratings
Context
This function is required for Use Case 2. It is triggered by the DressMeUp app when a user creates a collection item, handling the call to the Consumer Rating Prediction Service, by providing the necessary information and then writing back the results to the Dress Me Up Data Store.
Invocation
The function is triggered by a Cloud Storage notification when a collection item entry has been written to the data store.
Input
The input is a JSON payload with the following field.
Field | Description |
---|---|
Array | An array of garment IDs |
Actions
- The service creates an array of
garment ids
based on a user’s active collection. - The service sends the array to the Prediction Service and gets back a list of
garment ids
for a specific user. - The returned data is saved into the Dress Me Up Data Store.
Output
- Success / Error code.
- An object that features a
user id
and an array ofgarment ids
. - Results are written to
garment_suggestions
Data Store collection. - Example return object:
{
"user_id": "435",
"garment_ids": [
"43223432",
"53246342342",
"43635745234"
]
}