GithubHelp home page GithubHelp logo

reboarding's Introduction

Reboarding to the office

Accenture competition second round

Running in docker

Build the image:
docker image build -t reboarding .

Run the docker image:
docker run -p 8080:8080 -d reboarding [ARGS]

To start the application basic configuration shall be provided. This includes the dates where the required distance between reservable seats decreases. These dates provided in the following format: 'YYYY-MM-DD'. Image file of the office layout are stored in the resources. Seat coordinates mapped in advance by hand and stored in seat-coordinates.json.

List of arguments:
--date.stepTo1
--date.stepTo2
--date.stepTo3
--date.stepTo5
--date.endOfPeriod --numberInWaitnigListBeforeNotification

Distribute seats

To pack the most people to the office with the given distance criteria, the problem can be represented as a graph. The nodes are connected when they are further apart from each other than the given distance. The graphs maximal clique is when the most seats can be reserved, and they all compile to the rules. This is find by an implementation of the Bron-Kerbosch algorithm. With this approach the application finds the optimal seating distribution in about 2 minutes.

Testing locally

For local testing dummy data is provided in the application.properties file, so it can be started without any arguments or configuration.

API testing

API testing is done by Postman Script. For these scripts to run correctly, the current date needs to have a corresponding capacity. For this reason the application can be started with apitest argument for local testing.

docker run -p 8080:8080 -d reboarding apitest
newman run postman/postman_collection.json -g postman/postman_globals.json   

CI/CD

Unit tests and build run by Github Action, after every commit or pull request to master.

Endpoints

HTTP Method URL Description
POST /api/reboarding/register?userId={userId}&day={day} Register a user to a given date
POST /api/reboarding/entry/{userId} Check in a user for today
POST /api/reboarding/exit/{userId} Check out a user for today
GET /api/reboarding/status?userId={userId}&day={day} Get the status of the user for a given day
GET /api/reboarding/layout?day={day} Get the status of all seats for a given day (image)
GET /api/reboarding/layout?userId={userId}&day={day} Get the location of the reserved seat on a given day (image)

reboarding's People

Contributors

eles-peter avatar kasznar avatar dankobalazs avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.