Skip to content

This is a rails 6 app to track workers' overtime hours on a weekly basis. SMS reminders are sent out to workers. Admin receives a summary to approve or send back. Approvals are kept for audit.

Notifications You must be signed in to change notification settings

laurieroy/rails-overtime

Repository files navigation

Overtime App

demo

This is an enterprise app built using RSpec and Capybara, TDD/BDD methods. There is a background job that sends out SMS messages via Twilio and emails via google.

Requirements:

A company needs to document whether salaried employees worked overtime each week:

Managers receive an email link to a list of pending OT requests. These will be viewed on a desktop. Employees will mostly receive notifications via phone, so sending a reminder by text is optimal.

Update: The company liked the MVP well enough to add more features: all employees will track all hours, so a text will be sent daily.

This company only has about 1000 employees, but some with the same first and last name. The last four of the SSN will be used to differentiate these employees. Since this is a code-along, I am following with the company requirements as presented.

Models:

  • Post: date, rationale
  • User: using devise with admin

Features:

Admin approves workflow | sends SMS with link for employee to input OT | Admin dashboard | Email summary to managers for approval | Needs to document if employee did not log OT |

New to me:

  • TDD/BDD in rails
  • Use Warden to mimic signing in for feature test
  • Skip registration in Devise
  • Use the administrate gem for an admin dashboard
  • Use Single-Table Inheritance pattern (STI) for admin, employee as types of user
    • Add self-referential assoc: manager has many employees(hands)
  • Use the pundit gem for permissions
  • Send text using Twilio API
  • == outputs raw
  • Honeybadger (reviewed, todo: implement)
  • New Relic

Refactor TODOS:

  • Refactor user association integration test in post_spec

  • Rector posts/_form for admin user with status

  • Fix bootstrap tables in chrome (cols)

  • Edit icon

  • Block styling

  • Upgrade email from sendgrid to google

  • Add name to navbar

  • Add cal button to show month for user to see when check dates

Testing: Rspec, Capybara, FactoryBot 6

He uses Gritter/Growl notifications, which was recently retired. I'm using JS for now. He also used SendGrid for Heroku messages. I will attempt google.

Uses: Ruby 2.6.3, Rails: 6.1.2, PostgresSql: 13.1, BS: 4.6, Font Awesome

Devise for auth | Pundit 2.1 for permissions

Upgrades: name_of_person instead of custom model method, Figure out breaking changes in growl notification, Factory Bot, enums in adminstrate,

This app was built in Feb and May 2021 as a code along by Jordan Hudgens. Although I've done systems testing before, I'm not sure of how much unit testing to include, and hoped this course would help answer that. The code along is Rails 4, but I built it using Rails 6. Hopefully not too many breaking changes as I go along.

Update some of the front-end to React: Aug 21

-->

About

This is a rails 6 app to track workers' overtime hours on a weekly basis. SMS reminders are sent out to workers. Admin receives a summary to approve or send back. Approvals are kept for audit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published