package Ġorg . step ik . android . domain . course _ re venue . inter actor Ċ Ċ import Ġio . reactivex . Maybe Ċ import Ġio . reactivex . Single Ċ import Ġorg . step ik . android . domain . course _ re venue . model . Course Bene ficiary Ċ import Ġorg . step ik . android . domain . course _ re venue . model . Course Benefit Ċ import Ġorg . step ik . android . domain . course _ re venue . model . Course Benefit By Month ListItem Ċ import Ġorg . step ik . android . domain . course _ re venue . model . Course Benefit ListItem Ċ import Ġorg . step ik . android . domain . course _ re venue . model . Course Benefit Summary Ċ import Ġorg . step ik . android . domain . course _ re venue . repository . Course Benefit By Months Repository Ċ import Ġorg . step ik . android . domain . course _ re venue . repository . Course Bene fici aries Repository Ċ import Ġorg . step ik . android . domain . course _ re venue . repository . Course Benefit Sum maries Repository Ċ import Ġorg . step ik . android . domain . course _ re venue . repository . Course Bene fits Repository Ċ import Ġorg . step ik . android . domain . profile . repository . Profile Repository Ċ import Ġorg . step ik . android . domain . user . repository . UserRepository Ċ import Ġorg . step ik . android . model . user . User Ċ import Ġru . nob ird . android . core . model . Paged List Ċ import Ġru . nob ird . android . core . model . transform Ċ import Ġru . nob ird . android . domain . rx . maybe First Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠCourse Bene fits Interactor Ċ @ Inject Ċ constructor ( ĊĠĠĠ Ġprivate Ġval Ġcourse Benefit Sum maries Repository : ĠCourse Benefit Sum maries Repository , ĊĠĠĠ Ġprivate Ġval Ġcourse Bene fits Repository : ĠCourse Bene fits Repository , ĊĠĠĠ Ġprivate Ġval Ġcourse Bene fits By Months Repository : ĠCourse Benefit By Months Repository , ĊĠĠĠ Ġprivate Ġval Ġuser Repository : ĠUser Repository , ĊĠĠĠ Ġprivate Ġval Ġcourse Bene fici aries Repository : ĠCourse Bene fici aries Repository , ĊĠĠĠ Ġprivate Ġval Ġprofile Repository : ĠProfile Repository Ċ ) Ġ{ ĊĠĠĠ Ġfun Ġget Course Benefit Summary ( course Id : ĠLong ): ĠMaybe < Course Benefit Summary > Ġ= ĊĠĠĠĠĠĠĠ Ġcourse Benefit Sum maries Repository ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. getC ourse Benefit Sum maries ( course Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. maybe First () ĊĊĠĠĠ Ġfun Ġget Course Bene fits ( course Id : ĠLong , Ġpage : ĠInt Ġ= Ġ 1 ): ĠSingle < Paged List < Course Benefit ListItem . Data >> Ġ= ĊĠĠĠĠĠĠĠ Ġcourse Bene fits Repository ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. getC ourse Bene fits ( course Id , Ġpage ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Ġ{ Ġresolve Course Benefit List Items ( it ) Ġ} ĊĊĠĠĠ Ġfun Ġget Course Bene ficiary ( course Id : ĠLong ): ĠSingle < Course Bene ficiary > Ġ= ĊĠĠĠĠĠĠĠ Ġprofile Repository ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. get Profile () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatMap Ġ{ Ġprofile Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcourse Bene fici aries Repository ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. getC ourse Bene ficiary ( course Id , Ġprofile . id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Course Bene fits By Months ( course Id : ĠLong , Ġpage : ĠInt ): ĠSingle < Paged List < Course Benefit By Month ListItem . Data >> Ġ= ĊĠĠĠĠĠĠĠ Ġcourse Bene fits By Months Repository ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. getC ourse Benefit By Months ( course Id , Ġpage ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġcourse Bene fits By Months Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcourse Bene fits By Months . transform Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmap Ġ{ ĠCourse Benefit By Month ListItem . Data ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġresolve Course Benefit List Items ( course Bene fits : ĠP aged List < Course Benefit >): ĠSingle < Paged List < Course Benefit ListItem . Data >> Ġ= ĊĠĠĠĠĠĠĠ Ġuser Repository ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. get Users ( course Bene fits . map ( Course Benefit :: buyer )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġusers Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġuser Map Ġ= Ġusers . associate By ( User :: id ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcourse Bene fits . transform Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmap Ġ{ ĠCourse Benefit ListItem . Data ( it , Ġuser Map [ it . buyer ]) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ċ }