This Ruby on Rails application manages employee data and calculates tax deductions based on their salaries for the current financial year.
- Ruby (version 3.1.0)
- Rails (version 7.1.2)
-
Clone the repository:
git clone https://github.com/your_username/employee_tax_app.git cd employee_tax_app
-
Install dependencies:
bundle install
-
Set up the database:
rails db:create rails db:migrate
-
Start the Rails server:
rails server
-
Access the application in your browser at
http://localhost:3000
.
- Create employees with their details including employee ID, name, email, salary, date of joining, and phone numbers.
- Use the API endpoint
/api/employees
to create employees (POST request with JSON data). - Access the tax deduction information for employees via
/api/tax/tax_deduction
(GET request).
- URL:
/api/employees
- Method:
POST
- Data Format: JSON
- Parameters:
{ "employee": { "employee_id": 101, "first_name": "Alice", "last_name": "Johnson", "email": "alice@example.com", "phone_numbers": ["1234567890", "9876543210"], "doj": "2023-05-10", "salary": 60000 } }
- URL:
/api/tax/tax_deduction
- Method:
GET