CSV to Database Application
Sebuah aplikasi (API) untuk menghandle import data dari CSV ke Database dengan spesifikasi:
- Tidak blocking dari sisi user (user masih bisa melakukan hal lain selama menunggu hasil)
- File bisa disimpan sebagai future reference
- Database Table name: Users
- Column: username, password, name
- CSV Column Names and the order uploaded must be the same as the Column names above!
Endpoint: POST /api/files
Response Body (Username (Primary Key) already exist)
{
"errors": "Username already registered!"
}
Response Body (Extension of the file uploaded is not .csv)
{
"errors": "Extension of the file uploaded must be .csv!"
}
Response Body (CSV Column Names and the order uploaded is not match with the requirements)
{
"errors": "CSV Format doesn't Match with The Requirements!"
}
Endpoint: POST /api/users
{
"username": "jimleecw",
"password": "rahasia",
"name": "Jimlee"
}
{
"errors": "Username already registered!"
}