package Ġcom . re kt apps . ass ault timer . notifications . scheduler . impl Ċ Ċ import Ġcom . re kt apps . ass ault timer . model . entity . Ass ault Ċ import Ġcom . re kt apps . ass ault timer . model . enums . Ass ault Type Ċ import Ġcom . re kt apps . ass ault timer . model . enums . Region Ċ import Ġcom . re kt apps . ass ault timer . notifications . Notification Mode Ċ import Ġcom . re kt apps . ass ault timer . notifications . scheduler . Ass ault Notification Scheduler Ċ import Ġcom . re kt apps . ass ault timer . notifications . scheduler . Next Incoming Ass ault Notification Scheduler Ċ import Ġcom . re kt apps . ass ault timer . service . Incoming Ass ault Service Ċ import Ġcom . re kt apps . ass ault timer . storage . settings . Notifications Config Ċ import Ġio . reactivex . Comp letable Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠNext Incoming Ass ault Notification Scheduler Impl Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġincoming Ass ault Service : ĠIncoming Ass ault Service , ĊĠĠĠ Ġprivate Ġval Ġass ault Notification Scheduler : ĠAss ault Notification Scheduler , ĊĠĠĠ Ġprivate Ġval Ġnotifications Config : ĠNotifications Config Ċ ) Ġ: ĠNext Incoming Ass ault Notification Scheduler Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġschedule ( region : ĠRegion , Ġass ault Type : ĠAss ault Type ): ĠComp letable Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwhen ( notifications Config . notification Mode ){ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠNotification Mode . AUTO Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġincoming Ass ault Service . getFirst Incoming Ass ault ( region , Ġass ault Type ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Comp letable Ġ{ Ġschedule Ass ault ( it ) Ġ} Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ ĠNotification Mode . MAN UAL Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġincoming Ass ault Service . getFirst Incoming Manual Notification Ass ault ( region , Ġass ault Type ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Comp letable Ġ{ Ġschedule Ass ault ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġschedule Ass ault ( ass ault : ĠAss ault ) Ġ= ĠComp letable . from Action Ġ{ Ġass ault Notification Scheduler . schedule ( ass ault ) Ġ} Ċ }