Being a microservice architecture, whenever a communication needed to be added, it was haphazardly written in any service. This used to cause a major issue whenever any notification needed to be updated, there was no clear ownership of messages being sent out in doctor-patient appointment lifecycle. This used to cause a lot of production escalations due to wrong messages being delivered sometimes.
To overcome these problems, I came up with the architecture for a Notification System utilizing Event Driven Architecture. Since Appointment Lifecycle had clear appointment status' and every communication was related to these status' ie either being sent before, on or after one of these status changes, I started sending these status changes as Kafka Events which on consumption in my new microservices, were processed using Strategy Design Pattern.
The new microservice currently dictates which SMS, Whatsapp, Email, Push Notification and Chat System Message goes out to Patient, Doctor, Hospital or RM of the Doctor managing a total of 220 different communications with full maintainability due to repository structuring and 0 bugs on production due to full code coverage through Unit Tests