- Clone the project and Change directory to
booking-management
. Install all gems:
$ cd booking-management
$ bundle install
- Start the web server:
$ rails s
-
Commit 1: First commit.
Init the rails project mission management, with api only option
-
Commit 2: Create Listings
Create listing model migration
-
Commit 3: Create bookings
Create booking model migration and add the reference relation with listing
-
Commit 4: Create reservations
Create reservation model migration and add the reference relation with listing
-
Commit 5: Create missions
Create mission model migration and add the reference relation with listing. As mission has different types, I created also subclass like
FirstCheckin.rb
which is a subclass of mission with a typeFirstCheckin
. This will make the missions with different types separate more clearly. -
Commit 6: Service to generates missions.
According given booking or reservation, we create correspondant missions.
-
Commit 7: CRUD on listing / bookings / reservations.
API for listing, booking and reservations
-
Commit 8: Mission API
We can list all mission of a booking, a reservation or a listing. If there is no parent, it'll list all of missions.
So there is a
resource :missions
for every model namespace. -
Commit 9: generate missions after creating booking and reservation.
Add
after_save
method to booking and reservation model to generate missions after every creation. -
Commit 10: fill the database from the backend_test.rb
Use
rails db:migrate rails db:seed
orrails db:reset
to create the database, load the schema, and initialize it with the seed data.