|
1 |
| -# The Brief: |
| 1 | +#Moneybox Technical Task |
2 | 2 |
|
3 |
| -Create a mini version of the Moneybox app that will allow existing users to login, check their account and add money to their moneybox. |
| 3 | +##The Brief… |
| 4 | +Create a screen that allows a user to login to their moneybox account and display their total plan value. |
4 | 5 |
|
5 |
| -## Part A - Fix current bugs |
| 6 | +Duration: 2 hours |
6 | 7 |
|
7 |
| -In this repository you will find LoginActivity that allows users to enter their username, password and optionally their name. We have implemented a basic screen for you that validates username, password and name against simple regular expressions but makes no calls to the API. |
| 8 | +##What we are looking for… |
| 9 | +A fully working Android application |
| 10 | +Clean coding style |
| 11 | +Demonstration of architecture choices |
| 12 | +UI considerations including validation |
| 13 | +Unit Tests |
8 | 14 |
|
9 |
| -Unfortunately this screen has 3 bugs raised by our testers that they want you to fix and are listed below. If you are struggling to fix any of these bugs, please give it your best attempt and then move onto the next bug or task. |
| 15 | +##The Project… |
| 16 | +The project includes the networking code and models to complete the task, you will just need to integrate them and implement the logic. |
10 | 17 |
|
11 |
| -### Bug 1 - Layout does not look as expected |
| 18 | +The `Networking` class contains the `OkHttp` and `Retrofit` instances with the required headers for an unauthenticated request. |
| 19 | +The `models` package contains the request and response models with all the fields required for the rest of the task. |
12 | 20 |
|
13 |
| -Please re-arrange the views in the LoginActivity to match the expected layout. |
| 21 | +##Part 1 - Login Screen… |
| 22 | +We would like to allow the user to enter their email address and password and login to our app. Please design your screen according to the wireframes below: |
14 | 23 |
|
15 |
| - |
16 |
| - |
17 |
| -### Bug 2 - Validation is incorrect |
18 |
| -If the input entered by the user is correct then they should see a toast saying “Input is valid!”. However if it is not correct we should show an error on the field that is incorrect. Below is the following validation logic: |
19 |
| - |
20 |
| -- Email is not optional and should match EMAIL_REGEX |
21 |
| -- Password is not optional and should match PASSWORD_REGEX |
22 |
| -- Name is optional, but if it contains any value it should match NAME_REGEX |
23 |
| - |
24 |
| -There is some validation logic in LoginActivity, but it is currently incorrect. Please implement this feature to match this logic. |
25 |
| - |
26 |
| -### Bug 3 - Animation is looping incorrectly |
27 |
| - |
28 |
| -Above the login button is an animation of an owl and a pig. We would like this animation to play every time the user starts the activity and then loop indefinitely. The logic for this animation should be as follows: |
29 |
| - |
30 |
| -- The animation should start from frame **0** to **109** when the user first starts the activity. See below for animation. |
31 |
| - |
32 |
| -- When the first stage of the animation has finished it should then loop from frame **131** to **158** continuously. See below for animation.<br/> |
33 |
| - |
34 |
| - |
35 |
| -To create animation in our app we use a helpful library called Lottie. This has been added to the project for you, but currently it just plays the animation once and then stops. Please implement the logic as described above. |
36 |
| - |
37 |
| -There is lots of helpful documentation on Lottie [here](http://airbnb.io/lottie/#/android). Please take a look at this page for information on how to loop the animation, play from a min and max frame and detect when an animation ends. |
38 |
| - |
39 |
| -## Part B - Add 2 new screens |
40 |
| - |
41 |
| -We now want to give some useful functionality to our users. To allow them to log into the app, view and edit their account using our sandbox API. |
42 |
| - |
43 |
| -### Screen 2 - User accounts screen |
44 |
| -This screen should be shown after the user has successfully logged in and should show have the following functionality: |
45 |
| -- Display "Hello {name} **only** if they provided it on previous screen" |
46 |
| -- Show the **'TotalPlanValue'** of a user. |
47 |
| -- Show the accounts the user holds, e.g. ISA, GIA, LISA, Pension. |
48 |
| -- Show all of those account's **'PlanValue'**. |
49 |
| -- Shhow all of those account's **'Moneybox'** total. |
50 |
| - |
51 |
| -### Screen 3 - Individual account screen |
52 |
| -If a user selects one of those accounts, they should then be taken to this screen. This screen should have the following functionality: |
53 |
| -- Show the **'Name'** of the account. |
54 |
| -- Show the account's **'PlanValue'**. |
55 |
| -- Show the accounts **'Moneybox'** total. |
56 |
| -- Allow a user to add to a fixed value (e.g. £10) to their moneybox total. |
57 |
| - |
58 |
| -A prototype wireframe of all 3 screens is provided as a guideline. You are free to change any elements of the screen and provide additional information if you wish. |
59 |
| - |
60 |
| - |
61 |
| - |
62 |
| -## What we are looking for: |
63 |
| - - An android application written in either Java or Kotlin. |
64 |
| - - Demonstration of coding style and design patterns. |
65 |
| - - Knowledge of common android libraries and any others that you find useful. |
66 |
| - - Storage of data between screens. |
67 |
| - - Consistency of data between screens. |
68 |
| - - Error handling. |
69 |
| - - Any form of unit or integration testing you see fit. |
70 |
| - - The application must run on Android 5.0 and above. |
71 |
| - - The application must compile and run in Android Studio. |
72 |
| - |
73 |
| -Please feel free to refactor the LoginActivity and use any libraries/helper methods to make your life easier. |
74 |
| - |
75 |
| -## How to Submit your solution: |
76 |
| - - Zip up your solution, excluding any build artifacts to reduce the size, and email it back to our recruitment team. |
77 |
| - - Provide a readme in markdown which details how you solved the bugs in part A, and explains the structure of your solution in Part B and any libraries that you may have used. |
78 |
| - |
79 |
| -## API Usage |
80 |
| -This a brief summary of the api endpoints in the moneybox sandbox environment. There a lot of other additional properties from the json responses that are not relevant, but you must use these endpoints to retrieve the information needed for this application. |
81 |
| - |
82 |
| -#### Base URL & Test User |
83 |
| -The base URL for the moneybox sandbox environment is `https://api-test01.moneyboxapp.com/`. |
84 |
| -You can log into test your app using the following user: |
85 |
| - |
86 |
| -| Username | Password | |
87 |
| -| ------------- | ------------- | |
88 |
| -| androidtest@moneyboxapp.com | P455word12 | |
89 |
| - |
90 |
| -#### Headers |
91 |
| - |
92 |
| -In order to make requests https must be used and the following headers must be included in each request. |
93 |
| - |
94 |
| -| Key | Value | |
95 |
| -| ------------- | ------------- | |
96 |
| -| AppId | 3a97b932a9d449c981b595 | |
97 |
| -| Content-Type | application/json | |
98 |
| -| appVersion | 5.10.0 | |
99 |
| -| apiVersion | 3.0.0 | |
100 |
| - |
101 |
| -#### Authentication |
102 |
| -To login with this user to retrieve a bearer token you need to call `POST /users/login`. |
| 24 | +To login please use the endpoint and credentials below: |
103 | 25 | ```
|
104 |
| -POST /users/login |
105 |
| -{ |
106 |
| - "Email": "androidtest@moneyboxapp.com", |
107 |
| - "Password": "P455word12", |
108 |
| - "Idfa": "ANYTHING" |
109 |
| -} |
| 26 | +Endpoint: @POST("users/login") |
| 27 | +Email: jaeren+androidtest@moneyboxapp.com |
| 28 | +Password: P455word12 |
110 | 29 | ```
|
111 |
| -Sample json response |
112 |
| -``` |
113 |
| -"Session": { |
114 |
| - "BearerToken": "TsMWRkbrcu3NGrpf84gi2+pg0iOMVymyKklmkY0oI84=", |
115 |
| - "ExternalSessionId": "4ff0eab7-7d3f-40c5-b87b-68d4a4961983", -- not used |
116 |
| - "SessionExternalId": "4ff0eab7-7d3f-40c5-b87b-68d4a4961983", -- not used |
117 |
| - "ExpiryInSeconds": 0 -- not used |
118 |
| - } |
119 |
| -``` |
120 |
| -After obtaining a bearer token an Authorization header must be provided for all other endpoints along with the headers listed above (Note: The BearerToken has a sliding expiration of 5 mins). |
| 30 | +You can use `LoginRequest` to make your request and `LoginResponse to parse your response. |
121 | 31 |
|
122 |
| -| Key | Value | |
123 |
| -| ------------- | ------------- | |
124 |
| -| Authorization | Bearer TsMWRkbrcu3NGrpf84gi2+pg0iOMVymyKklmkY0oI84= | |
| 32 | +##Part 2 - Display Plan Value |
| 33 | +Once you have logged in, please create a simple screen that displays the user's `TotalPlanValue`. Please design your screen according to the wireframe below: |
| 34 | + |
| 35 | +To retrieve this data please use the endpoint with an additional authorization header, replacing BEARER_TOKEN_HERE with the bearer token you get in `SessionDataResponse`: |
125 | 36 |
|
126 |
| -#### Investor Products |
127 |
| -Provides product and account information for a user that will be needed for the two additional screens. |
128 |
| -``` |
129 |
| -GET /investorproducts |
130 |
| -``` |
131 |
| -### One off payments |
132 |
| -Adds a one off amount to the users moneybox. |
133 | 37 | ```
|
134 |
| -POST /oneoffpayments |
135 |
| -{ |
136 |
| - "Amount": 20, |
137 |
| - "InvestorProductId": 3230 ------> The InvestorProductId from /investorproducts endpoint |
138 |
| -} |
| 38 | +Endpoint: @GET("investorproducts") |
| 39 | +Header name: Authorization |
| 40 | +Header value: Bearer {BEARER_TOKEN_HERE} |
| 41 | +
|
139 | 42 | ```
|
140 |
| -Good luck! |
| 43 | +You can use the `AllProductsResponse` to parse this response and retrieve the plan value. |
| 44 | + |
| 45 | +##How to submit your test… |
| 46 | +Please push your project to Github and invite android@moneyboxapp.com to view your project. |
0 commit comments