A website representing the challenge has been deployed to https://entity2-challenge.fiwares.com
Deployed with dokku on a VPS (we can discuss about it later)
Missions JSON is acessible here, order by listing_id and date (DESC): https://entity2-challenge.fiwares.com/missions.json
Install ruby 3.2.2 and gems
rvm install 3.2.2 # if you like rvm
bundle install
With docker, run postgresql in a container:
docker-compose up -d
Prepare the database for local development
rails db:prepare
FYI seeds.rb file contains the input hash which had to be processed for the challenge:
{
"listings": [
{ "id": 1, "num_rooms": 2 },
{ "id": 2, "num_rooms": 1 },
{ "id": 3, "num_rooms": 3 }
],
"bookings": [
{ "id": 1, "listing_id": 1, "start_date": "2016-10-10", "end_date": "2016-10-15" },
{ "id": 2, "listing_id": 1, "start_date": "2016-10-16", "end_date": "2016-10-20" },
{ "id": 3, "listing_id": 2, "start_date": "2016-10-15", "end_date": "2016-10-20" }
],
"reservations": [
{ "id": 1, "listing_id": 1, "start_date": "2016-10-11", "end_date": "2016-10-13" },
{ "id": 2, "listing_id": 1, "start_date": "2016-10-13", "end_date": "2016-10-15" },
{ "id": 3, "listing_id": 1, "start_date": "2016-10-16", "end_date": "2016-10-20" },
{ "id": 4, "listing_id": 2, "start_date": "2016-10-15", "end_date": "2016-10-18" }
]
}
./bin/dev
rails test:all
Running 68 tests in parallel using 8 processes
Run options: --seed 28305
# Running:
....................................................................
Finished in 1.227350s, 55.4039 runs/s, 123.8441 assertions/s.
68 runs, 152 assertions, 0 failures, 0 errors, 0 skips
