As I worked for MLS I felt that some processes could improve. I had a particular interest in automating the most time-consuming and error-prone processes. Those revolved bookings and invoices. My idea was to gather all bookings and then to have easy access to their details, generating confirmations and invoices from them.
My first thought was where to lodge this booking platform. The most logical option to me was to keep using the Rails Admin gem, already mounted on the new MLS website.
Next came the data models... And that's when things got tough.
I thought I knew how to structure the information I wanted to include in the platform but I didn't. There are many ways of associating data between models. I struggled to make the different models work together, efficiently.
I practiced generating and destroying models. I went through tons of migrations and rollbacks. I added and removed columns and indexes. Databases are a painful subject! I changed my dev database to Postgres because I was developing in SQLite and results would differ on staging every time I committed a new change. I also created a seed file to set base content for some models. After all, the platform became more solid.
With the data model sorted, the platform needed some custom actions: to generate documents based on bookings. I used another gem called Prawn to generate pdfs. Writing the code for each pdf document was fun! When I thought that the worst part was gone... Then I noticed all the edge cases. There were too many rules to account for to generate these documents well. This part of code contains the most complex and abstract logic of the platform.
I wouldn't be able to get to the end of it without the help of a senior developer. Thank you, dear boyfriend!
With the hardest part of the project completed, I decided to add an extra cloning action to allow to replicate bookings with a click.
I wrote documentation for new users to learn to operate the platform. I also created shortcuts in the platform for easy access to the documentation.
After I deployed the code I used the gem rails_admin_import to import the necessary data for each model to start working in production.
When the team started using the platform they requested minor adjustments here and there but I was very happy to see that it all was working smoothly!