olist/work-at-olist

Name: work-at-olist

Owner: Olist

Description: Apply for a job at Olist's Development Team

Created: 2016-04-06 04:07:28.0

Updated: 2018-01-18 00:46:32.0

Pushed: 2018-01-16 13:11:27.0

Homepage: null

Size: 18

Language: null

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Work at Olist

Olist is a company that offers an integration platform for sellers and marketplaces allowing them to sell their products across multiple channels.

The Olist development team consists of developers who loves what they do. Our agile development processes and our search for the best development practices provide a great environment for professionals who like to create quality software in good company.

We are always looking for good programmers who love to improve their work. We give preference to small teams with qualified professionals over large teams with average professionals.

This repository contains a problem used to evaluate the candidate skills. It's important to notice that satisfactorily solving the problem is just a part of what will be evaluated. We also consider other programming disciplines like documentation, testing, commit timeline, design and coding best practices.

Hints:

How to participate
  1. Make a fork of this repository on Github. If you can't create a public fork of this project, make a private repository (bitbucket offers free private repos) and add read permission for the users @osantana and @dvainsencher on project;
  2. Follow the instructions of README.md (this file);
  3. Deploy your project on a host service (we recommend Heroku);
  4. Apply for the position at our career page with:
  5. Link to the fork on Github (or bitbucket.org);
  6. Link to the project in a the deployed host service.
Specification

You should implement a Python application that receives call detail records and calculates monthly bills for a given telephone number.

This Python application must provide a HTTP REST API to attend the requirements.

1. Receive telephone call detail records

There are many telecommunications platform technologies that can potentially be clients of this system. Each one has its own communication flow. It's not safe to believe that when an already sent record can be resent or retrieved later. This context requires system flexibility in receiving information to avoid record loss.

There are two call detailed record types: Call Start Record and Call End Record. To get all information of a telephone call you should use the records pair.

Call Start Record information:

The Call End Record has the same information excepting origin and destination fields.

The phone number format is AAXXXXXXXXX, where AA is the area code and XXXXXXXXX is the phone number. The phone number is composed of 8 or 9 digits.

Examples
  1. Call Start Record

d":  // Record unique identificator;
ype":  // Indicate if it's a call "start" or "end" record;
imestamp":  // The timestamp of when the event occured;
all_id":  // Unique for each call record pair;
ource":  // The subscriber phone number that originated the call;
estination":  // The phone number receiving the call.

  1. Call End Record

id":  // Record unique identificator;
type":  // Indicate if it's a call "start" or "end" record;
timestamp":  // The timestamp of when the event occured;
call_id":  // Unique for each call record pair.

2. Get telephone bill

To get a telephone bill we need two information: the subscriber telephone number (required); the reference period (month/year) (optional). If the reference period is not informed the system will consider the last closed period. In other words it will get the previous month. It's only possible to get a telephone bill after the reference period has ended.

The telephone bill itself is composed by subscriber and period attributes and a list of all call records of the period. A call record belongs to the period in which the call has ended (eg. A call that started on January 31st and finished in February 1st belongs to February period).

Each telephone bill call record has the fields:

3. Pricing rules

The call price depends on fixed charges, call duration and the time of the day that the call was made. There are two tariff times:

  1. Standard time call - between 6h00 and 22h00 (excluding):

  2. Standing charge: R$ 0,36 (fixed charges that are used to pay for the cost of the connection);

  3. Call charge/minute: R$ 0,09 (there is no fractioned charge. The charge applies to each completed 60 seconds cycle).

  4. Reduced tariff time call - between 22h00 and 6h00 (excluding):

  5. Standing charge: R$ 0,36

  6. Call charge/minute: R$ 0,00 (hooray!)

It's important to notice that the price rules can change from time to time, but an already calculated call price can not change.

Examples
  1. For a call started at 21:57:13 and finished at 22:10:56 we have:

  2. Standing charge: R$ 0,36

  3. Call charge:

    • minutes between 21:57:13 and 22:00 = 2 (
    • price: 2 * R$ 0,09 = R$ 0,18
  4. Total: R$ 0,18 + R$ 0,36 = R$ 0,54

Project Requirements:
Recommendations

Have fun!


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.