Project developed during the Elixir track on the Rocketseat platform.
Before you begin, make sure you have met the following requirements:
- You need the latest version of
Elixir
on your machine.
If you need installation instructions, click here.
To install Flightex, follow these steps:
1º Clone the repository.
> git clone https://github.com/joabehenrique/flight-booking.git
2º Navigate to the project folder.
> cd rocketseat-exlivery/exlivery
3º Use the command below to download the dependencies.
> mix deps.get
4º Use the command below to run the project.
> iex -S mix
To use Flightex, follow these steps:
Creating a user and your application.
> FlightBooking.start_agents
> {:ok, user} = %{name: "name", email: "name@email.com", cpf: "12345678900"}
> FlightBooking.create_or_update_user(user)
Searching created user
> FlightBooking.get_user "d42b7ff7-f907-4a1c-8c3a-484e5324e828"
{:ok,
%FlightBooking.Users.User{
cpf: "12345678900",
email: "name@email.com",
name: "name"
}}
Searching all users
> FlightBooking.get_all_users
Creating a booking
> {:ok, booking} = %{
user_id: "d42b7ff7-f907-4a1c-8c3a-484e5324e828",
date: NaiveDateTime.utc_now(),
origin: "SP",
destination: "RJ"
}
> FlightBooking.create_or_update_booking(booking)
Searching the reserve created
> FlightBooking.get_booking("a8a6d868-b78f-4bd1-9da1-7454728a1955")
{:ok,
%FlightBooking.Bookings.Booking{
date: ~N[2021-08-10 11:48:31.757414],
destination: "RJ",
origin: "SP",
user_id: "d42b7ff7-f907-4a1c-8c3a-484e5324e828",
user_name: "name"
}}
To contribute to Exlivery, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <nome_branch>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Send to the original branch:
git push origin Flightex / <local>
- Create the pull request.
Alternatively, see the GitHub documentation at how to create a pull request..
We thank the following people who contributed to this project:
Joabe Henrique [Author] |
Do you want to be part of this project? Click here and read how to contribute.
This project is under license. See the license file for more details.