CASA
Migration of a housing management app to PHP and GDPR scripts to clean personal data.
Context
CASA is the app the group uses to manage its housing for employees. Some parts were in old PHP and others in Java with Angular. One feature could use three technologies so maintenance was hard. The app also stores sensitive data like bank details and family situations.
What I did
- I moved the consultation pages and the Excel exports from Java to PHP 8.1. The Java layer is no longer needed for these features.
- While reading the old Java code I found a wrong formula for the occupancy rate. Sold homes were counted. I fixed the rule with the people who use these figures.
- I added cascading filters: when you pick a region the list of districts updates without reloading the page.
- I added an alert icon on tenant files when an incident is recorded. I also fixed broken accents and missing photos after the move to Linux.
GDPR scripts
I wrote two SQL scripts. The first one anonymises applications that never got a home. The second one deletes the personal data of former tenants five years after they leave. The history of moves is kept because it is still used.
Everything runs in one transaction so nothing changes if there is an error. With EXPLAIN ANALYZE I saw that PostgreSQL was reading the whole table. A partial index on the leaving dates fixed it.