You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* (feat): no partial withdraws
* Apply suggestions from code review
Co-authored-by: Julia Possamai <jpossamai@coderockr.com>
Co-authored-by: Julia Possamai <jpossamai@coderockr.com>
Copy file name to clipboardExpand all lines: README.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,26 +9,28 @@ In this challenge you should build an API for an application that stores and man
9
9
1.__Creation__ of an investment with an owner, a creation date and an amount.
10
10
1. The creation date of an investment can be today or a date in the past.
11
11
2. An investment should not be or become negative.
12
-
2.__View__ of an investment with its withdrawals and current balance.
13
-
1. Current balance should be the sum of the invested amount, the [gains] and withdrawals.
14
-
3. Partial or total __withdrawal__ of the investment amount.
15
-
1. Should not be able to withdraw more than the available balance.
16
-
2. Withdrawals in the past can be created, but can't happen before the investment creation or previously created withdrawals.
17
-
3. Should show the amount paid on [taxes].
12
+
2.__View__ of an investment with its initial amount and expected balance.
13
+
1. Expected balance should be the sum of the invested amount and the [gains][].
14
+
3.__Withdrawal__ of a investment.
15
+
1. The withdraw will always be the sum of the initial amount and its gains,
16
+
partial withdrawn is not supported.
17
+
2. Withdrawals can happen in the past or today, but can't happen before the investment creation or the future.
18
+
3.[Taxes][taxes] need to be applied to the withdrawals before showing the
19
+
final value.
18
20
4.__List__ of a person's investments
19
21
1. This list should have pagination.
20
22
21
23
__NOTE:__ the implementation of an interface will not be evaluated.
22
24
23
25
### Gain Calculation
24
26
25
-
The investment will pay 0.52% every month in the same day of the investment creation, if a withdrawal is made then in that month nothing will be paid.
27
+
The investment will pay 0.52% every month in the same day of the investment creation.
26
28
27
-
Given that the gain is paid every month, it should be treated as as [compound gain], which means that gain that is not withdrawn will become part of the investment balance for the next payment.
29
+
Given that the gain is paid every month, it should be treated as [compound gain][], which means that every new period (month) the amount gained will become part of the investment balance for the next payment.
28
30
29
31
### Taxation
30
32
31
-
When money is withdrawn, tax is triggered. Taxes apply only to the profit/gain portion of the money withdrawn. For example, if the initial investment was 1000.00, the current balance is 1200.00, and you withdraw 150.00, then the taxes will be applied to 16.67% = (200/1200) of the amount withdrawn. Meaning that you should apply tax on 25.00 (150 x 16,67%).
33
+
When money is withdrawn, tax is triggered. Taxes apply only to the profit/gain portion of the money withdrawn. For example, if the initial investment was 1000.00, the current balance is 1200.00, then the taxes will be applied to 16.67% = (200/1200) of the balance. Meaning that you should apply tax on 33.34 (200 x 16,67%).
32
34
33
35
The tax percentage changes according to the age of the investment:
34
36
* If it is less than one year old, the percentage will be 22.5%
@@ -49,8 +51,8 @@ The project source code and dependencies should be made available in GitHub. Her
49
51
- Special build instructions, if any
50
52
- List of third-party libraries used and short description of why/how they were used
51
53
- A link to the API documentation.
52
-
4. Once the work is complete, create a pull request from "development" into "master" and send us the link.
53
-
5. Avoid using huge commits hiding your progress. Feel free to work on a branch and use rebase to adjust your commits before submitting the final version.
54
+
4. Once the work is complete, create a pull request from "development" into "main" and send us the link.
55
+
5. Avoid using huge commits hiding your progress. Feel free to work on a branch and use `git rebase` to adjust your commits before submitting the final version.
54
56
55
57
## Coding Standards
56
58
When working on the project be as clean and consistent as possible.
@@ -80,6 +82,7 @@ Use the following checklist to ensure high quality of the project.
80
82
81
83
This coding challenge was inspired on [kinvoapp/kinvo-back-end-test](https://github.com/kinvoapp/kinvo-back-end-test/blob/2f17d713de739e309d17a1a74a82c3fd0e66d128/README.md)
0 commit comments