Challenge Overview
For this challenge, we'd like to implement a v2 API in tc-api which will return the terms details of the given list and the terms agreement status for the given user.
The API endpoint will be like /terms, There will be two parameters.
termsOfUseIds - a list of termsOfUserId to check, the ids will be comma-separated.
userId - the user id to check the agreement status.
The response will be like
"terms": [
{
"agreeabilityType": "Electronically-agreeable",
"agreed": true,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 1",
"termsOfUseId": 40000001,
"url": "http://topcoder.com/tou40000001.txt"
},
{
"agreeabilityType": "Electronically-agreeable",
"agreed": true,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 2",
"termsOfUseId": 40000002,
"url": "http://topcoder.com/tou40000002.txt"
},
{
"agreeabilityType": "Electronically-agreeable",
"agreed": false,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 3",
"termsOfUseId": 40000003,
"url": "http://topcoder.com/tou40000003.txt"
},
{
"agreeabilityType": "Non-electronically-agreeable",
"agreed": false,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 4",
"termsOfUseId": 40000004,
"url": "http://topcoder.com/tou40000004.txt"
},
{
"agreeabilityType": "Non-electronically-agreeable",
"agreed": false,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 5",
"termsOfUseId": 40000005,
"url": "http://topcoder.com/tou40000005.txt"
}
]
General Requirements
1. Please implement the new API as above.
2. Create Test Data and properly test the API by using PostMan, no unit tests required.
3. apiary.apib file should be updated to describe the new API, fix the existing problem of apiary.apib file.
Reference
There are already terms related APIs for reference. You can reuse the similar logic.
You can find the related logic by https://github.com/appirio-tech/tc-api/blob/master/actions/terms.js
1. Get Terms Details For the given id - https://github.com/appirio-tech/tc-api/blob/master/actions/terms.js#L134-L148
2. Check User Term Agreement - https://github.com/appirio-tech/tc-api/blob/master/actions/terms.js#L151-L161
3. etc
Testing
Please follow https://github.com/appirio-tech/tc-api/wiki to setup the TC API locally.
For dependent informix, you can use docker, please check - https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/informix
Please check
2. Verification Steps to testing
3. Winner will be responsible to create a PR for merging
The API endpoint will be like /terms, There will be two parameters.
termsOfUseIds - a list of termsOfUserId to check, the ids will be comma-separated.
userId - the user id to check the agreement status.
The response will be like
"terms": [
{
"agreeabilityType": "Electronically-agreeable",
"agreed": true,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 1",
"termsOfUseId": 40000001,
"url": "http://topcoder.com/tou40000001.txt"
},
{
"agreeabilityType": "Electronically-agreeable",
"agreed": true,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 2",
"termsOfUseId": 40000002,
"url": "http://topcoder.com/tou40000002.txt"
},
{
"agreeabilityType": "Electronically-agreeable",
"agreed": false,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 3",
"termsOfUseId": 40000003,
"url": "http://topcoder.com/tou40000003.txt"
},
{
"agreeabilityType": "Non-electronically-agreeable",
"agreed": false,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 4",
"termsOfUseId": 40000004,
"url": "http://topcoder.com/tou40000004.txt"
},
{
"agreeabilityType": "Non-electronically-agreeable",
"agreed": false,
"text": "xxxxx",
"title": "NodeJS API Sample Term Of Use 5",
"termsOfUseId": 40000005,
"url": "http://topcoder.com/tou40000005.txt"
}
]
General Requirements
1. Please implement the new API as above.
2. Create Test Data and properly test the API by using PostMan, no unit tests required.
3. apiary.apib file should be updated to describe the new API, fix the existing problem of apiary.apib file.
Reference
There are already terms related APIs for reference. You can reuse the similar logic.
You can find the related logic by https://github.com/appirio-tech/tc-api/blob/master/actions/terms.js
1. Get Terms Details For the given id - https://github.com/appirio-tech/tc-api/blob/master/actions/terms.js#L134-L148
2. Check User Term Agreement - https://github.com/appirio-tech/tc-api/blob/master/actions/terms.js#L151-L161
3. etc
Testing
Please follow https://github.com/appirio-tech/tc-api/wiki to setup the TC API locally.
For dependent informix, you can use docker, please check - https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/informix
Please check
Final Submission Guidelines
1. Git Patch file for changes.2. Verification Steps to testing
3. Winner will be responsible to create a PR for merging