# Estuardo Sierra
## Calls API
A new product requirement states that all Talkdesk calls should be registered in a centralized system. A call has always two participants, a **customer** and an **agent**, and it can be either **inbound** (started by the customer) or outbound (started by the agent). The system must fulfill the following use cases:
* Ability to **register a new** call
* Ability to mark a call as **finished**
* Ability to **retrieve** the data associated with a given call
* Ability to list calls matching a given criteria. It should be possible to filter by:
* Start and end dates
* Status (in progress / finished)
* Contact number
Clients should be able to interact with this system through a REST API. Each call pertains to a specific **tenant** (and a tenant can only access calls belonging to it), it must have an **unique identifier** and a new record must include the following information:
* Start date
* Source number
* Destination number
* Direction (inbound/outbound)
When a call is marked as finished, the record must also include the corresponding end date.
## Solution design
*:video_game: Go Estuardo Sierra :muscle:*
* Ability to **register a new** call
[POST]/calls/reg
request payload:
{
callid:
TenenantId:
SourceNumber:
DestinatioNumber:
Direction:
}
response body: {
200(callid)
}
http status: 201 (CREATED)
* Ability to mark a call as **finished**
[Put]/v1/calls/status/{callid}
response body{
http code[200]
}
* Ability to **retrieve** the data associated with a given call
[GET]/calls/{callid}
response body{
callid:
TenenantId:
SourceNumber:
DestinatioNumber:
Direction:
}
* Ability to list calls matching a given criteria.
[GET]calls/list/startdate=?,enddate=?,x=?,y=?
response body{
callid:
TenenantId:
SourceNumber:
DestinatioNumber:
Direction:
}