Published on February 14, 2021
I've been working on OfficeLife for more than two years now, silently, patiently and very consistently. The number of features keeps growing, which makes me happy.
The goal of OfficeLife is to manage everything employees do in a company. From projects to time tracking to holidays. However, there is no point for anyone to use the software if we don’t offer a simple way to import employees to the system in the first place.
The strength of OfficeLife appears when all the employees use the system.
In OfficeLife, right now, you can add employees, one by one, by hand. But who would use the Add employee screen 500 times to import a list from a medium-size company?
When I started developing OfficeLife, I wanted to provide a simple way to populate an account. This would serve two purposes:
Very early in the development process, I wrote a Laravel command that populate an account with realistic data. I wrote about it here. This served me well and still does today. I run this command every day. So I postponed the ability to import actual, real data, because I didn't need it. And also because uploading files is always a pain, no matter the framework, and can lead to many errors.
However, the future users of my tool will want to import employees so they can start using it. I can’t postpone the feature any longer.
There are two main things we could do about importing users.
So I’m currently implementing the feature to upload a CSV of employees.
Like always in programming, there are many ways to write the feature.
Here is what I've decided to do (and I hope I won’t regret it in the future). It will be a three-step procedure:
In programming terms, here is what it translates to:
AddEmployeeToCompanyservice for each one of these lines.
This is a bit complex, but the process will make sure we won’t import crap data to the system.
Hi from Canada 🇨🇦