diff --git a/Readme.md b/Readme.md index 2a11c976..215a05d0 100644 --- a/Readme.md +++ b/Readme.md @@ -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 diff --git a/main.py b/main.py index e387738b..a0c2d859 100644 --- a/main.py +++ b/main.py @@ -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 @@ -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", @@ -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,