---
# System prepended metadata

title: Untitled

---

### Terradatum Implement
---
#### 1. User Scenario
![](https://i.imgur.com/CGZWIGg.png)

![](https://i.imgur.com/DyQ4Eiy.png)


#### 2. Backend Changes
* **Modal Updates**
    Create a new column called `terradatum` in table `organisationunits` to store the url of S3 bucket for CSV file.

    CSV example:      https://docs.google.com/spreadsheets/d/1L5iMpRoCfjEVdH6C2JASBhYuneoGJcr2uLcxGdfpGSo
    
* **Data Migration**
    Create a data migration to backfill in all the csv s3 file info for the related orgs


* **Controller Updates**
    Break exisitng videoes index and info controller to return data based on the context passing in. e.g. `terradatum` or `youtube` and so on. For `terradatum` context, it will fetch the csv file from s3 bucket and return all urls storing in the csv files.
    
    As for all the existing logic for `youtube` in videos controller, we need to move it into `youtube` service. We also implement all the logic for `terradatum` in the `terradatum` service as well
e.g.
```
{
  video_url: 'https://portal.marketupdatevideo.com/single_video.php?id=wa_91910-ChulaVista_residential',
  thumbnail_url: 'https://portal.marketupdatevideo.com/assets/uploads/100_player_invite_img.png'
}
```

Add pagination params for the result and support continuator

* **Cache**
May or may not to add returned CSV data to cache server depends on the performance.

#### 3. Frontend Changes
Add a new button to switch among different integrations at this stage.

FYI. waiting for the mockup to decide how to implement in details.


## tickets

### Phase 1
Integrate with Terradatum
    * as a user I want to include a Terradatum video in my email
    * as an internal user I want to update a Terradatum video url

* Simple UI (support tabs for each channel) 2 
    ![](https://i.imgur.com/bFHVyrb.png)
* Add the Terradatum field to the org (and the data) 1 (**Kingsley**)
* Update video index controller to support multiple video sources 1 (**Allen**)
* Create service for YouTube (API) 2 (**Allen**)
    - clean up existing YouTube implementation
* Create service for Terradatum (CSV) 3 (**Kingsley**)
    - implement some caching if required 2 (**by testing, not required**)
* Add internal UI for Terradatum 1
    - Add field to the org from (**Kingsley**)
* Document workflow for adding new clients 1 (**Allen**)
* Update the video play button service to handle any image 3 (**Allen**)
    - image in image out

15 days
7.5
2 weeks

### Phase 2
Integrate with Vimeo

* Add the Vimeo field to the user and org (internal and app) 1
* Investigate relevant gems to use 3
* Create service for interfacing with gem/API 2

3 days
1 week

### Phase 3
Allow videos to be paginated

* Update video controller to handle pagination using X-headers 9
* Add Continuator component to UI 1

10 / 2 => 5
1 week

### Phase 4
Make videos searchable (Block from UI)

* Update controller to handle searching 9
* Update UI to pass a search string or URL 1

10 / 2 => 5
1 week

### Phase 5

* New video library UI ?
