@startuml
participant EIP
participant DEEP.IO
participant PDE
participant SAMSON
participant BI
participant "SAMSON Memo"
participant "EIP Accounting MS"
participant "Notification Gateway"

EIP -> DEEP.IO: Device financed in EIP Pending shipment
DEEP.IO -> PDE: Device financed in EIP Pending shipment
activate PDE
	PDE -> SAMSON: Fetch billing details
	SAMSON -> PDE
	PDE -> PDE: Evaluate promotion eligibility
	alt not all rules are passed
		PDE -[#magenta]> DEEP.IO: Promotion identified as Candidate [[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedascandidate.json/ event]]
		deactivate PDE
		DEEP.IO -[#magenta]-> BI: Promotion identified as Candidate [[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedascandidate.json/ event]]
		DEEP.IO -[#magenta]-> "SAMSON Memo": Promotion identified as Candidate [[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedascandidate.json/ event]]
		DEEP.IO -[#magenta]-> "EIP Accounting MS": Promotion identified as Candidate [[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedascandidate.json/ event]]
		DEEP.IO -[#magenta]-> "Notification Gateway": Promotion identified as Candidate [[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedascandidate.json/ event]]
		alt account level changes
			SAMSON -> DEEP.IO : Account update
			DEEP.IO -> PDE: Account update
			activate PDE
			PDE -> SAMSON: Fetch billing details
			SAMSON -> PDE
			PDE -> PDE : Reevaluate promotion
			alt all rules passed
				PDE -> PDE : Mark promotion as expected
				PDE -[#magenta]> DEEP.IO: Promotion identified as Expected[[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedasexpected.json/ event]]
				deactivate PDE
			end
			DEEP.IO -[#magenta]-> BI: Promotion identified as Expected[[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedasexpected.json/ event]]
		end
	end
	alt all rules passed
		activate PDE
		PDE -> PDE : Mark promotion as expected
		PDE -[#magenta]> DEEP.IO: Promotion identified as Expected[[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedasexpected.json/ event]]
		deactivate PDE
		DEEP.IO -[#magenta]-> BI: Promotion identified as Expected[[http://flows.corporate.t-mobile.com/all-swaggers/swagger/ce.dsg.deep.io/loanpromoassignedasexpected.json/ event]]
	end
@enduml