Challenge Overview
Welcome to Topcoder Mobile - Connected Car REST API Implementation Code Challenge
Topcoder Mobile - Connected Car application will be used to activate Topcoder Mobile data plan on new customer car.
For this challenge we need you generate a NodeJS server based on the attached Swagger file on challenge spec. As part of this challenge, we also need a database for the APIs using mongoDB
NodeJS Framework and Modules
Mongo Database Schema
REST API Endpoints
You will implement these API endpoints, here are a breakdown of the requirements :
1). Customer Lookup
- This is DB query for E-mail + Phone Number, return Firstname and LastName if found or error if not
- This is query DB for VIN and return SIM if found, error if not
- Data should match standards for ICCID and VIN or Failure when invalid data or no match
- Insert record into DB with Phone + SIM and generate a random 4 digit PIN number to save as PIN, If record already exists (Phone + SIM), overwrite PIN
- This endpoint will call an external API and forward the payload which is received.
- This should validate that the Phone + SIM + PIN matches a record, return success if match, throw error if not.
6). Provisioning
- This should just return success if the SIM is valid (ICCID)
Postman Client
- Create Postman collection and environments files listing all calls and sample data.
- Crate proper content for body request and response
- Provide description for endpoints.
- Get Started with Postman : http://www.getpostman.com/
Hosting
- It is preferred if you provide scripts and steps to deploy the application in Heroku
Documentation
- Provide a detailed README documentation for how to setup and configure the application.
Configurations
- You are expected to use environment variables to store sensitive information and environment-specific configurations.
- All source code that implement the challenge requirements.
- README in markup language
- Verification document contains steps to verify your solution.
- Sample input file.
Topcoder Mobile - Connected Car application will be used to activate Topcoder Mobile data plan on new customer car.
For this challenge we need you generate a NodeJS server based on the attached Swagger file on challenge spec. As part of this challenge, we also need a database for the APIs using mongoDB
NodeJS Framework and Modules
- You will use MongoDB and NodeJS stack in this challenge
- You are required to use open source node module such as async to deliver a high quality, well organized code.
- Third party code must not have GPL or AGPL license. MIT and Apache licenses are acceptable.
Mongo Database Schema
- Create Mongo Database schema based on Swagger file
- You are expected to add more sample data and submit the dump file for testing purpose.
- Create detailed documentation how to Setup MongoDB
REST API Endpoints
You will implement these API endpoints, here are a breakdown of the requirements :
1). Customer Lookup
- This is DB query for E-mail + Phone Number, return Firstname and LastName if found or error if not
- Route : POST /Customer/Lookup
- Request body parameters :
- E-mail (required)
- Phone Number (required)
- It returns output as json object :
- E-mail,
- Phone,
- FirstName,
- LastName,
- Street,
- City,
- State,
- Zip
- This is query DB for VIN and return SIM if found, error if not
- Data should match standards for ICCID and VIN or Failure when invalid data or no match
- Route: POST /SIM/Lookup
- Request body parameters :
- VIN (required)
- It returns output as json object :
- SIM
- Insert record into DB with Phone + SIM and generate a random 4 digit PIN number to save as PIN, If record already exists (Phone + SIM), overwrite PIN
- Route : POST /PIN/Create
- Request body parameters :
- Phone
- SIM
- It returns
- Success - if PIN is successfully generated and saved to the DB
- Failure
- This endpoint will call an external API and forward the payload which is received.
- Route : POST /PIN/Send
- Request body parameters :
- Phone
- SIM
- Query the PIN + SIM in DB - If combination of PIN + SIM not found, throw error
- Call an external endpoint with POST (needs to be configurable via env variable)
- {“msg”:”Here is your PIN: <PINOFRECORD>”,”phone”:”<PHONEOFRECORD>”}
- Header of x-api-key (needs to be configurable via env variable)
- Content-Type: application/json
- External Endpoint returns success as:
- {"StatusMessage":"success","StatusCode":0,"StatusException":"N/A"}
- Any other message should be treated as failure
- It returns
- Success - if external endpoint returns success
- Failure
- This should validate that the Phone + SIM + PIN matches a record, return success if match, throw error if not.
- Route : POST /PIN/Input
- Request body parameters :
- Phone
- SIM
- PIN
- Return success if found and match, throw error if not.
6). Provisioning
- This should just return success if the SIM is valid (ICCID)
- Route : POST /Provisioning
- Request body parameters :
- SIM
- return success if data is valid
Postman Client
- Create Postman collection and environments files listing all calls and sample data.
- Crate proper content for body request and response
- Provide description for endpoints.
- Get Started with Postman : http://www.getpostman.com/
Hosting
- It is preferred if you provide scripts and steps to deploy the application in Heroku
Documentation
- Provide a detailed README documentation for how to setup and configure the application.
Configurations
- You are expected to use environment variables to store sensitive information and environment-specific configurations.
Final Submission Guidelines
Challenge Deliverables- All source code that implement the challenge requirements.
- README in markup language
- Verification document contains steps to verify your solution.
- Sample input file.