Commandline ruby applicaiton used to determine the milestone anniversary dates for a give data set
Two arguments are required:
- file name or path to file. Required
- run date. Optional, will default to current date
example:
./anniversary.rb employee_data.csv 2017-10-10
or
./anniversary.rb employee_data.csv
Expected Input is a CSV with the following fields:
employee_id, first_name, last_name, hire_date, supervisor_id
NOTE: hire_date must be in format YYYY-MM-DD
otherwise an error will be raised and processing will not continue
Date must be formated according to ISO-8601 as YYYY-MM-DD
otherwise current date will be used.
Application will output a JSON object listing supervisor ID and a list of upcoming milestones. Example output block from a different data file, assuming a run date of Oct 1, 2015:
{
"supervisor_id": "0028356",
"upcoming_milestones": [
{
"employee_id": "0018325",
"anniversary_date": "2015-10-03"
},
{
"employee_id": "0038576",
"anniversary_date": "2015-10-05"
},
{
"employee_id": "0038679",
"anniversary_date": "2015-10-05"
},
{
"employee_id": "0029385",
"anniversary_date": "2015-10-17"
},
{
"employee_id": "0066839",
"anniversary_date": "2015-10-22"
}
]
}