Skip to content
This repository was archived by the owner on Sep 21, 2024. It is now read-only.

reaper/challenge-entity2

Repository files navigation

CI Linters

entity2 challenge

Website

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

Screenshot 2023-04-07 at 09 35 14

Preparations

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" }
  ]
}

Run the server

./bin/dev

Run tests

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

About

Entity 2 challenge - 2023

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published