Models - aamarill/Take-Home-Pay GitHub Wiki

Summary

This page describes every model in detail.

User Model

The User model is a Devise model. And, each user has many statements.

Methods

This model does not have any methods.

Statement Model

Each Statement has the data and methods needed to calculate the take-home pay. Each Statement belongs to a single user.

Methods

regular_pay

This method calculates the total pre-tax pay (minus overtime pay).

overtime_pay

This method calculates the total pre-tax pay from overtime hours.

gross_pay

This method calculates the total pre-tax pay.

non_taxable_wages

This method determines what part of the total pre-tax pay is not taxable.

tax_deferred_wages

This method is very similar to the non_taxable_wages method in that it won't be considered for taxing. However, it is labeled differently because of any additional features that may be added in the future that require the distinction between "deferred" (e.g. traditional retirement account) and simply "non-taxable" (e.q. health care premiums).

taxable_wages

This method calculates the total pre-tax income/wages that will be used when calculating the taxes owed.

medicare_deduction

This method calculates the deduction for Medicare. To learn more checkout this official IRS page.

fers_deduction

This method calculates the FERS deduction. FERS is a pension system for Federal Employees, you can learn more about this system here .

state_tax

This method calculates the state tax owed.

oasdi_deduction

This method calculates the old age, surviviors and disability (OASDI) deduction/tax. Go here to learn more about OASDI.

federal_tax

This method calculates the federal tax owed.

tsp_contribution

This method calculates the TSP contribution. The TSP is the retirement account that is offered to federal employees instead of a 401k plan.

roth_tsp_contribution

This method calculates the roth TSP contribution.

summed_deductions

This method adds up all of the deductions calculated.

take_home_pay

This method calculates the final take-home pay amount.

check_for_nil_values

This method takes a hash and converts any nil attributes in it to 0.0 and returns the new hash with the modified values.