- Add employee_data_processor.py: functional but ugly code with god function, globals, hardcoded values, mixed concerns - Add employees.csv: sample data with 10 records (4 invalid for testing) - Generates report.json and report.html output files - Perfect candidate for refactoring demo
81 lines
No EOL
1.8 KiB
JSON
81 lines
No EOL
1.8 KiB
JSON
{
|
|
"summary": {
|
|
"total_employees": 6,
|
|
"skipped_records": 4,
|
|
"total_annual_payroll": 3984000,
|
|
"employees_by_department": {
|
|
"Engineering": 2,
|
|
"Human Resources": 2,
|
|
"Sales": 1,
|
|
"Marketing": 1
|
|
}
|
|
},
|
|
"employees": [
|
|
{
|
|
"name": "Alice Smith",
|
|
"email": "alice@example.com",
|
|
"department": "Engineering",
|
|
"annual_salary": 900000,
|
|
"hire_date": "2023-01-15",
|
|
"years_experience": 3.0
|
|
},
|
|
{
|
|
"name": "Diana Prince",
|
|
"email": "diana@example.com",
|
|
"department": "Engineering",
|
|
"annual_salary": 984000,
|
|
"hire_date": "2022-05-20",
|
|
"years_experience": 3.66
|
|
},
|
|
{
|
|
"name": "Eve Wilson",
|
|
"email": "eve@example.com",
|
|
"department": "Human Resources",
|
|
"annual_salary": 696000,
|
|
"hire_date": "2023-04-10",
|
|
"years_experience": 2.77
|
|
},
|
|
{
|
|
"name": "Grace Lee",
|
|
"email": "grace@example.com",
|
|
"department": "Sales",
|
|
"annual_salary": 0,
|
|
"hire_date": "2023-06-01",
|
|
"years_experience": 2.63
|
|
},
|
|
{
|
|
"name": "Ivy Chen",
|
|
"email": "ivy@example.com",
|
|
"department": "Marketing",
|
|
"annual_salary": 744000,
|
|
"hire_date": "2023-07-15",
|
|
"years_experience": 2.51
|
|
},
|
|
{
|
|
"name": "Jack Brown",
|
|
"email": "jack@example.com",
|
|
"department": "Human Resources",
|
|
"annual_salary": 660000,
|
|
"hire_date": "2023-08-01",
|
|
"years_experience": 2.46
|
|
}
|
|
],
|
|
"skipped": [
|
|
{
|
|
"name": "Bob Jones",
|
|
"reason": "Negative salary"
|
|
},
|
|
{
|
|
"name": "Charlie",
|
|
"reason": "Invalid email"
|
|
},
|
|
{
|
|
"name": "Frank Miller",
|
|
"reason": "Invalid department"
|
|
},
|
|
{
|
|
"name": "Henry Davis",
|
|
"reason": "Invalid hire_date"
|
|
}
|
|
]
|
|
} |