In this lesson, we will transform the initial job description from the client to an actual to-do list: I call this a "plan of action". The goal is to make predictions, what actions rely on what other actions, and minimize the unpleasant surprises along the way.
I usually advise reading the job description three times, with different goals in mind:
Along the way, another result of this should be the list of questions for the client. If you don't ask them right away, you may suffer from "unpleasant surprises" or misunderstandings in the future, leading to many painful code changes.
With those goals in mind, here's the full job description from the client.
You can also read it in a separate Google Docs format here if you prefer.
Create a Laravel APIs application for a travel agency.
Japan: road to Wonder
or Norway: the land of the ICE
;Japan: road to Wonder
may have a tour from 10 to 27 May at €1899, another one from 10 to 15 September at €669 etc. At the end, you will book a tour, not a travel.At the end, the project should have:
public
travels;slug
(e.g. all the tours of the travel foo-bar
). Users can filter (search) the results by priceFrom
, priceTo
, dateFrom
(from that startingDate
) and dateTo
(until that startingDate
). User can sort the list by price
asc and desc. They will always be sorted, after every additional user-provided filter, by startingDate
asc.Users
Roles
Travels
numberOfDays - 1
)Tours
99900
, but, when returned to Frontends, they will be formatted (99900 / 100
);admin
user will also have the editor
role;Recently I posted a tweet about a typical process of building a Laravel project:
In our case, it's not a web project, we have only API, so our list is even shorter:
So this is precisely what our initial plan of action will look like, which will roughly correlate to the list of lessons.
/travels
travels/slug/tours
role:xxxxx
I deliberately emphasized that it's the initial plan, as there will always be unpredictable things you will encounter while building the project. But it's still beneficial to have some plan than start coding without any plan.
When we have a "rough" action plan, I suggest another re-reading of the initial description. This time, your goal is to find "small details" which you would assign (in your mind or written form) to one of the points in the plan.
This aims to minimize the surprises and ask the client how exactly some features would work. Also, you need to "read between the lines" and identify things the client didn't specify, but you would still need to implement them.
Here's the list of potential "special attention" things I've identified:
You may start thinking about the solutions immediately or leave them until you build the functions.
As I mentioned, one of the goals for this re-reading process was to form the questions for the client, but in this case, the description is very clear and understandable: I don't have any questions here.
The client emphasized: "Feature tests are a big big plus."
So we need to implement them. The question is when? There are different approaches:
So, we will write automated tests at the end of this lesson or the finished feature. It's much easier to do because we still remember how that particular feature works, it's still fresh, and we can simulate and reproduces the situations easier.
With TDD, we don't know 100% how features should work. And with tests at the end, we have the opposite effect: we likely have forgotten the details about some features created much earlier.
Enough of preparation. It looks like we have a vision, time to implement it.