Skip to content

Commit 05b3aa4

Browse files
Update Wave 2 & 3 docs
1 parent 034378d commit 05b3aa4

File tree

2 files changed

+30
-41
lines changed

2 files changed

+30
-41
lines changed

ada-project-docs/wave_02.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ Our task list API allows users to create tasks and get a list of all tasks. Our
88

99
The following are required routes for wave 2. Feel free to implement the routes in any order within this wave.
1010

11-
### Tips
12-
13-
- Pay attention to the exact shape of the expected JSON. Double-check nested data structures and the names of the keys for any misspellings.
14-
- Use the tests in `tests/test_wave_02.py` to guide your implementation.
11+
Use the tests in `tests/test_wave_02.py` to guide your implementation.
1512
- You may feel that there are missing tests and missing edge cases considered in this wave. This is intentional.
1613
- You have fulfilled wave 2 requirements if all of the wave 2 tests pass.
1714
- You are free to add additional features, as long as the wave 2 tests still pass. However, we recommend that you consider the future waves, first.
1815
- Some tests use a fixture named `three_tasks` that is defined in `tests/conftest.py`. This fixture saves three different tasks with three different titles to the test database.
1916

17+
### Tips
18+
19+
- Pay attention to the exact shape of the expected JSON. Double-check nested data structures and the names of the keys for any misspellings.
20+
2021
### Sorting Tasks: By Title, Ascending
2122

2223
As a client, I want to be able to make a `GET` request to `/tasks?sort=asc` when there is more than one saved task, and get an array of tasks sorted by **title**. The titles should be in _ascending_ order, where a task with the title "A" is sorted before a task with the title "B."

ada-project-docs/wave_03.md

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,28 @@
44

55
Our task list API allows users to meaningfully use the task resource. Users want to be able to mark a task as "complete" or "incomplete."
66

7-
We want to design our API so that it stores a task's `completed_at` date as a datetime value in our database. In this scenario, our API does _not_ give users the `completed_at` date... it only gives the information if `is_complete` is `true` or `false`.
7+
We want to design our API so that it stores a task's `completed_at` date as a datetime value in our database. In this scenario, our API does _not_ give users the `completed_at` date it only gives the information if `is_complete` is `true` or `false`.
88

9-
A task's `is_complete` is `true` when there is a datetime for the task's `completed_at` value. A task's `is_complete` is `false` when there is a `null`/`None` value for the tasks's `completed_at` value.
9+
A task's `is_complete` is:
10+
- `true` when there is a datetime for the task's `completed_at` value.
11+
- `false` when there is a `null`/`None` value for the tasks's `completed_at` value.
1012

1113
## Requirements
1214

1315
The following are required routes for wave 3. Feel free to implement the routes in any order within this wave.
1416

15-
### Tips
16-
17-
- Use the tests in `tests/test_wave_3.py` to guide your implementation.
17+
Use the tests in `tests/test_wave_3.py` to guide your implementation.
1818
- You may feel that there are missing tests and missing edge cases considered in this wave. This is intentional.
1919
- You have fulfilled wave 3 requirements if all of the wave 3 tests pass.
2020
- You are free to add additional features, as long as the wave 3 tests still pass. However, we recommend that you consider the future waves, first.
2121
- A test uses a fixture named `completed_task` that is defined in `tests/conftest.py`. This fixture saves a task with a datetime value in `completed_at` to the test database.
22+
23+
### Tips
24+
2225
- JSON's value of `true` is similar to Python's value of `True`, and `false` is similar to Python's `False`.
2326
- SQL's value of `null` is similar to Python's value of `None`.
2427
- Python has a [datetime library](https://docs.python.org/3/library/datetime.html#module-datetime) which we recommend using to represent dates in model attributes.
28+
- Notice that these routes require that we look up a model by its ID, and then update that model. We should be able to reuse the same route helper methods that we have been using in other Task routes to help build these routes.
2529

2630
### Mark Complete on an Incomplete Task
2731

@@ -44,12 +48,10 @@ After I have made the `PATCH` request, I can submit a `GET` request to `/tasks/1
4448

4549
```json
4650
{
47-
"task": {
48-
"id": 1,
49-
"title": "Go on my daily walk 🏞",
50-
"description": "Notice something new every day",
51-
"is_complete": true
52-
}
51+
"id": 1,
52+
"title": "Go on my daily walk 🏞",
53+
"description": "Notice something new every day",
54+
"is_complete": true
5355
}
5456
```
5557

@@ -74,12 +76,10 @@ After I have made the `PATCH` request, I can submit a `GET` request to `/tasks/1
7476

7577
```json
7678
{
77-
"task": {
78-
"id": 1,
79-
"title": "Go on my daily walk 🏞",
80-
"description": "Notice something new every day",
81-
"is_complete": false
82-
}
79+
"id": 1,
80+
"title": "Go on my daily walk 🏞",
81+
"description": "Notice something new every day",
82+
"is_complete": false
8383
}
8484
```
8585

@@ -104,19 +104,13 @@ After I have made the `PATCH` request, I can submit a `GET` request to `/tasks/1
104104

105105
```json
106106
{
107-
"task": {
108-
"id": 1,
109-
"title": "Go on my daily walk 🏞",
110-
"description": "Notice something new every day",
111-
"is_complete": true
112-
}
107+
"id": 1,
108+
"title": "Go on my daily walk 🏞",
109+
"description": "Notice something new every day",
110+
"is_complete": true
113111
}
114112
```
115113

116-
Notice the same dictionary structure for the Task data as in our wave 1 routes. We should be able to use any response model helper that we are using in other Task routes to help build this response.
117-
118-
Also notice that fundamentally, this route requires that we look up a model by its ID, and then update that model. We should be able to reuse the same route helper methods that we have been using in other Task routes to help build this route.
119-
120114
### Mark Incomplete on an Incomplete Task
121115

122116
Given a task that has:
@@ -138,19 +132,13 @@ After I have made the `PATCH` request, I can submit a `GET` request to `/tasks/1
138132

139133
```json
140134
{
141-
"task": {
142-
"id": 1,
143-
"title": "Go on my daily walk 🏞",
144-
"description": "Notice something new every day",
145-
"is_complete": false
146-
}
135+
"id": 1,
136+
"title": "Go on my daily walk 🏞",
137+
"description": "Notice something new every day",
138+
"is_complete": false
147139
}
148140
```
149141

150-
Notice the same dictionary structure for the Task data as in our wave 1 routes. We should be able to use any response model helper that we are using in other Task routes to help build this response.
151-
152-
Also notice that fundamentally, this route requires that we look up a model by its ID, and then update that model. We should be able to reuse the same route helper methods that we have been using in other Task routes to help build this route.
153-
154142
## Mark Complete and Mark Incomplete for Missing Tasks
155143

156144
Given that there are no tasks with the ID `1`,

0 commit comments

Comments
 (0)