1Khách chọn Zalo để nhận OTP. Service chọn ZaloSender theo lựa chọn đó, để quy tắc OTP không phải chứa nhánh if cho từng kênh.The customer chooses Zalo for OTP delivery. The service selects ZaloSender so OTP rules need no channel-specific branches.
2Service tạo OtpNotification với sender đã chọn. Một object ghép hai chiều thay đổi, thay vì cần class OtpZaloNotification.The service constructs OtpNotification with the selected sender. One object pairs the two axes without an OtpZaloNotification class.
3Service gọi deliver() để yêu cầu gửi OTP. Phía gọi chỉ đưa người nhận và mã, không phải tự dựng nội dung hay gọi SDK của Zalo.The service calls deliver() to request OTP delivery. It supplies the recipient and code without composing the text or calling the Zalo SDK.
4OtpNotification soạn câu chứa mã và thông báo thời hạn năm phút, nên đổi câu chữ chỉ sửa một nơi. Việc kiểm tra mã và thực thi thời hạn thuộc hệ thống xác thực, không nằm trong Bridge này.OtpNotification composes the code and five-minute expiry message, keeping wording changes in one place. Code verification and expiry enforcement belong to the authentication system, outside this Bridge.
5Thông báo gọi sender.send() qua hợp đồng MessageSender. Nó chỉ cần khả năng gửi tin, nên không phụ thuộc SDK hay cấu hình riêng của Zalo.The notification calls sender.send() through the MessageSender contract. It needs delivery capability without depending on Zalo's SDK or configuration.
6Lời gọi được chuyển tới ZaloSender, object đã ghép từ đầu. Ví dụ Go in dòng dưới để mô phỏng gửi; bản Java ủy quyền cho ZaloZnsClient, nơi cần ánh xạ sang mẫu ZNS hợp lệ.The call reaches ZaloSender, the object selected during wiring. The Go example prints the simulated delivery below; Java delegates to ZaloZnsClient, which must map it to an approved ZNS template.
7Một khách khác chọn SMS và đủ điều kiện nhận khuyến mãi. sendPromo() lấy senders.get("SMS") rồi tạo PromoNotification(SmsSender): cùng một Map sender, ghép với loại thông báo thứ hai mà không cần class PromoSmsNotification.Another customer prefers SMS and qualifies for a promotion. sendPromo() takes senders.get("SMS") and creates PromoNotification(SmsSender): the same sender Map, paired with a second notification kind, with no PromoSmsNotification class.
8Lúc 10 giờ sáng, PromoNotification qua kiểm tra giờ im lặng và gửi nội dung kèm dòng từ chối nhận tin. SmsSender chuyển cho gateway.sendBrandname(); bản Go SMSSender in dòng dưới.At 10 a.m., PromoNotification passes the quiet-hours check and sends the campaign plus the opt-out line. SmsSender hands it to gateway.sendBrandname(); the Go SMSSender prints the line below.
9Nếu gọi sendPromo() sau 21 giờ, PromoNotification return ngay và không chạm tới sender. Quy tắc này nằm ở phía abstraction nên áp dụng cho mọi kênh; còn OTP không có giờ im lặng.If sendPromo() runs after 9 p.m., PromoNotification returns immediately without touching the sender. The rule lives on the abstraction side, so it applies to every channel; OTP has no quiet hours.