Skip to content

Commit f5fb19e

Browse files
authored
Merge pull request #50 from PortoCode/update-docs
Update Documentation
2 parents 151d98e + f3c407a commit f5fb19e

3 files changed

Lines changed: 160 additions & 46 deletions

File tree

README.md

Lines changed: 160 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![CI-iOS](https://github.com/PortoCode/essential-feed/actions/workflows/CI-iOS.yml/badge.svg)](https://github.com/PortoCode/essential-feed/actions/workflows/CI-iOS.yml)
44
[![CI-macOS](https://github.com/PortoCode/essential-feed/actions/workflows/CI-macOS.yml/badge.svg)](https://github.com/PortoCode/essential-feed/actions/workflows/CI-macOS.yml)
55

6-
## BDD Specs
6+
## Image Feed Feature Specs
77

88
### Story: Customer requests to see their image feed
99

@@ -19,9 +19,9 @@ So I can always enjoy the newest images of my friends
1919

2020
```
2121
Given the customer has connectivity
22-
When the customer requests to see their feed
23-
Then the app should display the latest feed from remote
24-
And replace the cache with the new feed
22+
When the customer requests to see their feed
23+
Then the app should display the latest feed from remote
24+
And replace the cache with the new feed
2525
```
2626

2727
### Narrative #2
@@ -36,21 +36,21 @@ So I can always enjoy images of my friends
3636

3737
```
3838
Given the customer doesn't have connectivity
39-
And there’s a cached version of the feed
40-
And the cache is less than seven days old
41-
When the customer requests to see the feed
42-
Then the app should display the latest feed saved
39+
And there’s a cached version of the feed
40+
And the cache is less than seven days old
41+
When the customer requests to see the feed
42+
Then the app should display the latest feed saved
4343
4444
Given the customer doesn't have connectivity
45-
And there’s a cached version of the feed
46-
And the cache is seven days old or more
47-
When the customer requests to see the feed
48-
Then the app should display an error message
45+
And there’s a cached version of the feed
46+
And the cache is seven days old or more
47+
When the customer requests to see the feed
48+
Then the app should display an error message
4949
5050
Given the customer doesn't have connectivity
51-
And the cache is empty
52-
When the customer requests to see the feed
53-
Then the app should display an error message
51+
And the cache is empty
52+
When the customer requests to see the feed
53+
Then the app should display an error message
5454
```
5555

5656
## Use Cases
@@ -83,8 +83,6 @@ Then the app should display an error message
8383
#### Primary course (happy path):
8484
1. Execute "Load Image Data" command with above data.
8585
2. System downloads data from the URL.
86-
87-
8886
3. System validates downloaded data.
8987
4. System delivers image data.
9088

@@ -176,13 +174,24 @@ Then the app should display an error message
176174

177175
---
178176

179-
## Flowchart
177+
### Cache Feed Image Data Use Case
180178

181-
![Feed Loading Feature](feed_flowchart.png)
179+
#### Data:
180+
- Image Data
181+
182+
#### Primary course (happy path):
183+
1. Execute "Save Image Data" command with above data.
184+
2. System caches image data.
185+
3. System delivers success message.
186+
187+
#### Saving error course (sad path):
188+
1. System delivers error.
182189

183-
## Architecture
190+
---
184191

185-
![Feed Loading Feature](feed_architecture.png)
192+
## Flowchart
193+
194+
![Feed Loading Feature](feed_flowchart.png)
186195

187196
## Model Specs
188197

@@ -193,36 +202,141 @@ Then the app should display an error message
193202
| `id` | `UUID` |
194203
| `description` | `String` (optional) |
195204
| `location` | `String` (optional) |
196-
| `url` | `URL` |
205+
| `url` | `URL` |
197206

198207
### Payload contract
199208

200209
```
201-
GET *url* (TBD)
210+
GET /feed
211+
202212
200 RESPONSE
213+
203214
{
204-
"items": [
205-
{
206-
"id": "a UUID",
207-
"description": "a description",
208-
"location": "a location",
209-
"image": "https://a-image.url",
210-
},
211-
{
212-
"id": "another UUID",
213-
"description": "another description",
214-
"image": "https://another-image.url"
215-
},
216-
{
217-
"id": "even another UUID",
218-
"location": "even another location",
219-
"image": "https://even-another-image.url"
220-
},
221-
{
222-
"id": "yet another UUID",
223-
"image": "https://yet-another-image.url"
224-
}
225-
...
226-
]
215+
"items": [
216+
{
217+
"id": "a UUID",
218+
"description": "a description",
219+
"location": "a location",
220+
"image": "https://a-image.url",
221+
},
222+
{
223+
"id": "another UUID",
224+
"description": "another description",
225+
"image": "https://another-image.url"
226+
},
227+
{
228+
"id": "even another UUID",
229+
"location": "even another location",
230+
"image": "https://even-another-image.url"
231+
},
232+
{
233+
"id": "yet another UUID",
234+
"image": "https://yet-another-image.url"
235+
}
236+
...
237+
]
227238
}
228239
```
240+
241+
---
242+
243+
## Image Comments Feature Specs
244+
245+
### Story: Customer requests to see image comments
246+
247+
### Narrative
248+
249+
```
250+
As an online customer
251+
I want the app to load image commments
252+
So I can see how people are engaging with images in my feed
253+
```
254+
255+
#### Scenarios (Acceptance criteria)
256+
257+
```
258+
Given the customer has connectivity
259+
When the customer requests to see comments on an image
260+
Then the app should display all comments for that image
261+
```
262+
263+
```
264+
Given the customer doesn't have connectivity
265+
When the customer requests to see comments on an image
266+
Then the app should display an error message
267+
```
268+
269+
## Use Cases
270+
271+
### Load Image Comments From Remote Use Case
272+
273+
#### Data:
274+
- ImageID
275+
276+
#### Primary course (happy path):
277+
1. Execute "Load Image Comments" command with above data.
278+
2. System loads data from remote service.
279+
3. System validates data.
280+
4. System creates comments from valid data.
281+
5. System delivers comments.
282+
283+
#### Invalid data – error course (sad path):
284+
1. System delivers invalid data error.
285+
286+
#### No connectivity – error course (sad path):
287+
1. System delivers connectivity error.
288+
289+
---
290+
291+
## Model Specs
292+
293+
### Image Comment
294+
295+
| Property | Type |
296+
|-------------------|-------------------------|
297+
| `id` | `UUID` |
298+
| `message` | `String` |
299+
| `created_at` | `Date` (ISO8601 String) |
300+
| `author` | `CommentAuthorObject` |
301+
302+
### Image Comment Author
303+
304+
| Property | Type |
305+
|-------------------|---------------------|
306+
| `username` | `String` |
307+
308+
### Payload contract
309+
310+
```
311+
GET /image/{image-id}/comments
312+
313+
2xx RESPONSE
314+
315+
{
316+
"items": [
317+
{
318+
"id": "a UUID",
319+
"message": "a message",
320+
"created_at": "2020-05-20T11:24:59+0000",
321+
"author": {
322+
"username": "a username"
323+
}
324+
},
325+
{
326+
"id": "another UUID",
327+
"message": "another message",
328+
"created_at": "2020-05-19T14:23:53+0000",
329+
"author": {
330+
"username": "another username"
331+
}
332+
},
333+
...
334+
]
335+
}
336+
```
337+
338+
---
339+
340+
## App Architecture
341+
342+
![](architecture.png)

architecture.png

47.5 KB
Loading

feed_architecture.png

-21.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)