Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completed issue#421 #428

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Welcome to FinTech API, our powerful API is designed to simplify your life by of

## ✨ Features

- **Modular structure**: Not the API has a clean structure which benifits in improved code organizationqn and enhanced reusability of components
- **Modular structure**: Not the API has a clean structure which benefits in improved code organization and enhanced reusability of components

- **Request validation**: It improves security, prevents errors and vulnerabilities to the API

Expand Down
31 changes: 30 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@
from tasks.profit_percentage import profit_percentage_task
from tasks.loss_percentage import loss_percentage_task
from tasks.defensive_interval_ratio import defensive_interval_ratio_task

from validators.request_validators import SimpleInterestRateRequest, calculatePension, compoundInterest, futureSip, paybackPeriod, capmRequest, DebtServiceCoverageRatio, futureValueOfAnnuity, ProfitPercentage, LossPercentage, DefensiveIntervalRatio

from tasks.RateofReturn import calculate_rate_of_return
from tasks.cash_conversion_cycle import cash_conversion_cycle_task
from tasks.financialAssestRatio import financial_assest_ratio
Expand All @@ -140,6 +143,7 @@
from tasks.PriceElasticity import calculate_price_elasticity
from tasks.average_payment_period import average_payment_period_task


# Creating the app
app = FastAPI(
title="FinTech API",
Expand Down Expand Up @@ -1675,7 +1679,32 @@ def calculate_expected_return_of_portfolio(no_of_investments: int,
"/calculate_salary",
tags=["calculate_salary"],
description="Calculate Net annual salary of an employee",
)

)
def calculate_salary(base:int,
jb:int,
stock:int,
pb:int,
bonus:int,
ptax:int,
deduction:int):
try:
calculate_salary = functions.calculate_salary(base,jb,stock,pb,bonus,ptax,deduction)
return {

"Tag":"Net Salary Calculator",
"Base Salary per month":base,
"joining bonus/retention bonus":jb,
"RSU/stock bonus":stock,
"performance bonus":pb,
"any additional bonus":bonus,
"tax percentage":ptax,
"any additional deduction":deduction,
"ctc calculated": f"{ctc}",
}
except:
return HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR)

def calculate_salary(base: int,
jb: int,
stock: int,
Expand Down