Professional Documents
Culture Documents
WebService Logicsdfds
WebService Logicsdfds
WebService Logicsdfds
Users
1. UserID: AutoNumber
2. UserEmail : String(200)
3. UserName : String(200)
Article
4. ArticleID: AutoNumber
5. Day: Number
6. Caption: String (200)
7. Description: String (200)
8. Active: Bit/Boolean (Y/N)
9. ImageName : String (100)
Article Sections
1. SectionID : Number
2. ArticleID: Number
3. SectionNumber : Number
4. Section Description: Description (2000)
Actions
1. SectionID: Number
2. ActionID: Number
3. ActionDesctiption : String (2000)
4. Active (Y/N)
Growth
1. GrowthID : Autonumber
2. UserID : String (200)
3. Date : DateTime
4. Height: Decimal
5. Weight: Decimal
6. Head: Decimal
Sample Data
Articles
ArticleID
1
Day
1
Article Sections
SectionID
ArticleID
Caption
5 Best Destinations of the
world
10 Best-Selling Products Of All
Time
35 fantastic free Android
games
SectionNu
mber
1
Description
Last updated on November 5
in Travel
By Silicon India
Active
1
1
ImageName
Toptraveldestinations.jp
g
TopProducts.jpeg
Andriod Games
Caption
Description
Active
ImageName
Cape Town,
South Africa
Capetown1.jpg
Sydney
Australia
Sydney.jpg
Machu
Picchu, Peru
PlayStation
Lipitor
BADLAND
NULL
Paystation.jpg
Lipitor.jpg
NULL
Actions
ActionID
1
2
3
AIRBORNE
SectionI
D
1
1
1
Description
Action1
Action2
Action3
Airborne.jpg
Activ
e
1
1
1
WebService 1 : GetArticleoftheDay
This is an Article of the day Web Service. So once the User logs in the article of the day is presented. Logic
would be different if User logs in more than one time a day into the application or logs in after a few days
gap. There would be at least one article for each day and it could grow to many articles for one day. The
maximum number is not restricted but typically would be to a maximum of 10. The articles are identified
based on Application ID. There are multiple scenarios that need to be configured: 1. User logs in once everyday into the application: First available article (least article ID) is downloaded.
2. User logs in multiple times during the day: On each login the next available article (next higher article
ID for same day) of the day is downloaded until maximum articles are downloaded. Once maximum
number is reached, null is returned.
3. If the User logs in after multiple days, the counter begins from the last article downloaded by User and
is incremented every time he logs in until the counter reaches current.
Inputs :
{{Day}} (This is the day article needs to be downloaded for)
{{PreviousArticleID}} (This is the last article displayed to User)
Output
Article ID, Article Caption, Article Description , ImageName
Algorithm to retrieve ArticleID
1. Find Article.day for PreviousArticleID
2. If Article.day = {{Day}} then find next higher value for Article.day
a. If next higher value not found return NULL
b. If next higher value found return the values for that Article ID
3. If Article.day < {{Day}} then find next higher value for Article.day
a. If next higher value not found then increment Article.day by 1 and return first ArticleID Values.
b. If next higher value is found then return Article values
WebService 2 : GetArticleDetails
Input : {{ArticleID}}
Output:
<Article>
<ArticleInformation>Article ID, Article Caption, Article Description , ImageName
<SectionInformation>SectionNumber, Caption, Description, ImageName
<Actions>ActionID, Description</Actions>
</SectionInformation>
{{Height}}
{{Weight}}
{{Head}}
Get array of values for the parameter UserId
Scope of work
1. Create an architecture on Node.js on Express
2. Create the Web Services
3. Create data structure on Mongo DB
4. Recommend hosting solution. I think http://heroku.com is good but open to suggestion.
5. Host the webservices and DB
6. Unit Test the webservices with some sample data