# Fullstack Rails Developer Take Home Challenge ## Overview As a platform for rewarding and recognizing employees, one of Zestful’s unique features is our [peer to peer rewards program](https://zestful.com/program/peer-to-peer). This is where one employee can recognize another employee by gifting them funds that they can use on the products and services they care about most. Your challenge is to create a simplified version of this feature. ## Instructions Below are four user stories, each with their own set of acceptance criteria. Your challenge is to complete each user story, and fulfill each set of acceptance criteria. You can spend as little or as much time on this as you see fit. That said, **we do not expect, nor ask, you to spend more than five hours on the entire challenge.** We know that you have other responsibilities, priorities, and obligations. And blocking off five hours is not a small undertaking. As such, you have 10 days in which to complete the challenge. As far as resources are concerned, this will be on the honor system. You can comb the internet for any research and solutioning (as we all do!). Asking questions to anyone, be it friends, family, colleagues or strangers, is off limits. The user stories below outline the specifications and requirements. Though they are specific, the stories are also purposefully vague. The intent is to give you the freedom to interpret and implement them in whatever way, and to whatever degree, that your heart desires! ## User stories ### 1 - Create a private GitHub repository We have created a Rails application that you will work from. You will need to download it, and create a private GitHub repository for it under your GitHub profile. Here is a link to download and unzip the Rails application: Now you will create a **private** repository for this application in GitHub. For reference, here is how to [make a repository private](https://help.github.com/en/github/administering-a-repository/setting-repository-visibility#making-a-repository-private). #### Acceptance criteria - [ ] Rails application is version `5.2.x` - [ ] Ruby version `2.5.0` - [ ] Repository is private ### 2 - Ability to create and view users In order for a peer to give another peer a reward, they will first need to have funds available that they can gift out. Funding is an administrative level ability. As such, we will need to implement the notion of user roles: an `employee` role, and an `admin` role. #### Acceptance criteria - [ ] `Users`s can have a role of either `employee` or `admin` - [ ] Only admins can create new `User`s - [ ] Only admins can edit a user's role - [ ] An `index` view of `User`s that includes their role ### 3 - Ability to fund a user’s balance In order for a peer to give another peer a reward, they will first need to have funds available that they can gift out. Funding is an administrative level ability. #### Acceptance criteria - [ ] Ability for an `admin` to fund a user's balance with any dollar amount - [ ] Only `admins` can add funds to a user's balance - [ ] Adds their current balance to the `User`s `index` view ### 4 - Ability for a user to give a peer to peer reward Any Zestful user can give or receive a peer to peer reward, be it an employee or an admin. We will need a UI, and supporting backend, to make this possible. Since we are dealing with money, we want to ensure that an employee has adequate funding available before issuing a reward. As such, we will need to put validations in place to mitigate against any negative balances. #### Acceptance criteria - [ ] A form that enables a `User` to issue a peer to peer reward to another `User` - [ ] The form should have a place to: pick another user, specify a dollar amount, and enter a personal message - [ ] The form must use client side validation to ensure that a personal message was entered (the server cannot be hit during this process) - [ ] The form must use server side validation to ensure that the `User` has enough funds available to gift the reward amount - [ ] An `index` view of all rewards given including: from, to, amount, date, and message ## Submittal instructions When you are done, here is how you will submit your **private** repository to us: 1. Add these three people as **collaborators** to your repo. Here are the [instructions on how to do so](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository): - Harry Levine, username: `hpjaj` - Malte Muenke, username: `maltemco` - Eric Wood, username: `eric-wood` 2. Email a link of your repository to: `harry@zestful.com` If you have any questions, you can send them to: `harry@zestful.com` ### Good luck!