---
# System prepended metadata

title: Marketplace Feed Service

---

# Marketplace Feed Service

## Todo

- Update openapi.yml
    - Add HydratedFeedResponse type
        - Dan's naïve example for a shop list tile response:
            - Body is a HydratedTile[]
            - HydratedTile looks like:
                ```json
                {
                    content_type: string,
                    title: string,
                    subtitle?: string,
                    imageUrl?: string,
                    search_results?: Array<HydratedShop>,
                }
                ```
- Create contentful tile types
    - URL to get a feed details from contentful
https://cdn.contentful.com/spaces/ipjij3pt8hn7/environments/master/entries?access_token=10da9baa2eb31da2d50f09002546adbfb6ebf3fc8951aca4976b467bbd9b6b55&content_type=marketplaceFeed&fields.key=david-test-feed
- Create feed endpoint in accordance to openapi spec
    - request feeds to contentful CDN
    - use contentful response to make async requests to search service *via* core api
        - transform `feed.tiles.query`s into requests to core api
    - Combine shop data + feed data to construct payload
        - 
- Core API discovery endpoint
    - What does the request + response look like?
        - Req
            - lat
            - lng
            - sorts
            - filters
        - Resp
            - Hydrated shops
                - ex
                    ```json
                        meta: { ...we don't need this },
                        data: []
                    ```
- Gocd PR pipeline

## Tile
A tile is a sub-unit of a feed.
* Search Query (order of the shop/sort)
* How many shops
* Title
* Subtitle / description
* Image

### Tile Types
A tile can take on certain formats.

* Shops 4-up / shops hero / shops 2-up
* Promo - coupon, promo - code
* Items
* Text - quote, text - block, text - image
* "App driven" tiles like reorder, order tracking, rating capture


# Data Flow Diagram
![Data flow diagram picture](https://i.imgur.com/AyWkGwq.jpg)
