- Docker
- Go 1.21.0
- go-migrate
- Clone the repository
git clone https://github.com/chawin-a/robinhood-interview.git
- Run docker compose
docker compose up -d
- Run migrations
migrate -path migrations -database "postgres://postgres:password@localhost:5432/db?sslmode=disable" up
- Init mock data
go run scripts/mock/main.go
POST
/user/:id
name type data type description id required uuid N/A
{
"user": {
"Id": "033d6d81-23ce-484b-97f7-d06b7ae0aba6",
"Username": "user5",
"Name": "user5",
"Email": "[email protected]",
"CreatedAt": "2023-08-15T03:02:11.326823Z"
}
}
POST
/interview
name type data type description limit required int N/A latest_timestamp timestamptz N/A
{
"interviews": [
{
"Id": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"UserId": "86839593-8d05-4798-8d86-e93f411edc08",
"Description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ligula purus, pulvinar vel nisi in, feugiat gravida lorem. Phasellus elit nunc, posuere ac ante sit amet, bibendum iaculis mi.",
"Status": "To Do",
"IsArchived": false,
"CreatedAt": "2023-08-15T03:08:02.970709Z",
"UpdatedAt": "2023-08-15T03:08:02.970709Z"
},
{
"Id": "ebbeca29-dfc9-49a0-b392-c1668be9520e",
"UserId": "7474c95f-5a85-433a-bc39-6bfe66c4ddf4",
"Description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ligula purus, pulvinar vel nisi in, feugiat gravida lorem. Phasellus elit nunc, posuere ac ante sit amet, bibendum iaculis mi.",
"Status": "To Do",
"IsArchived": false,
"CreatedAt": "2023-08-15T03:08:02.982283Z",
"UpdatedAt": "2023-08-15T03:08:02.982283Z"
}
],
"latest_timestamp": "2023-08-15T03:08:02.982283Z"
}
POST
/interview/:id
name type data type description id required uuid N/A
{
"interview": {
"Id": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"UserId": "86839593-8d05-4798-8d86-e93f411edc08",
"Description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ligula purus, pulvinar vel nisi in, feugiat gravida lorem. Phasellus elit nunc, posuere ac ante sit amet, bibendum iaculis mi.",
"Status": "To Do",
"IsArchived": false,
"CreatedAt": "2023-08-15T03:08:02.970709Z",
"UpdatedAt": "2023-08-15T03:08:02.970709Z"
}
}
POST
/interview/:id/archive
name type data type description id required uuid N/A
{
"interview": {
"Id": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"UserId": "86839593-8d05-4798-8d86-e93f411edc08",
"Description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ligula purus, pulvinar vel nisi in, feugiat gravida lorem. Phasellus elit nunc, posuere ac ante sit amet, bibendum iaculis mi.",
"Status": "To Do",
"IsArchived": true,
"CreatedAt": "2023-08-15T03:08:02.970709Z",
"UpdatedAt": "2023-08-15T03:17:08.492502Z"
}
}
POST
/interview/:id/update_status
name type data type description id required uuid N/A
name type data type description status required ENUM("To Do", "In Progress", "Done") N/A
{
"interview": {
"Id": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"UserId": "86839593-8d05-4798-8d86-e93f411edc08",
"Description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ligula purus, pulvinar vel nisi in, feugiat gravida lorem. Phasellus elit nunc, posuere ac ante sit amet, bibendum iaculis mi.",
"Status": "In Progress",
"IsArchived": true,
"CreatedAt": "2023-08-15T03:08:02.970709Z",
"UpdatedAt": "2023-08-15T03:18:15.789981Z"
}
}
POST
/interview/:id/comment
name type data type description id required uuid N/A
{
"comments": [
{
"Id": "92035213-14fa-4182-9d5c-2ae05c87dafa",
"UserId": "7474c95f-5a85-433a-bc39-6bfe66c4ddf4",
"InterviewId": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"Comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"CreatedAt": "2023-08-15T03:08:02.981083Z"
},
{
"Id": "209530ab-59bb-4d8a-a682-77a250eb6e2b",
"UserId": "a228d32b-0fd0-47d8-8dbc-4d9fc9a9b9c2",
"InterviewId": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"Comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"CreatedAt": "2023-08-15T03:08:02.979885Z"
},
{
"Id": "0eb265ba-0197-4a0f-a12f-47cddc6e3e9b",
"UserId": "7474c95f-5a85-433a-bc39-6bfe66c4ddf4",
"InterviewId": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"Comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"CreatedAt": "2023-08-15T03:08:02.978672Z"
},
{
"Id": "74d0b58a-0bd2-40ed-b171-27b4f05ecf23",
"UserId": "1074ece6-2c8c-4fc4-9df6-35bcd2d11f38",
"InterviewId": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"Comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"CreatedAt": "2023-08-15T03:08:02.975957Z"
}
]
}
POST
/interview/:id/comment/create
name type data type description id required uuid N/A
name type data type description comment required string N/A
{
"comment": {
"Id": "fa380cb2-f49a-48d6-ba5f-4c3e0308f4de",
"UserId": "1074ece6-2c8c-4fc4-9df6-35bcd2d11f38",
"InterviewId": "2b0f6430-48c5-484c-a0b0-010d386bddbb",
"Comment": "hello",
"CreatedAt": "2023-08-15T03:22:27.255629Z"
}
}