Pass the highest risk level of user's exposure from last 14 days detected by Exposure Notification Framework to PWA.
Steps:
- PWA request reporting risk level
- JS Bridge UseCase: OnGetBridgeDataUseCase
- JS Bridge Data Type: OutgoingBridgeDataType.ANALYZE_RESULT
- Get all data about exposures from local database
- UseCase: GetAnalyzeResultUseCase
- Repository function: ExposureRepository.getAllResults()
- Repository implementation: ExposureRepositoryImpl.getAllResults()
- Filter exposure with the highest risk score from exposures
- UseCase: GetAnalyzeResultUseCase
- Calc risk level from risk score (max riskScore = 4096):
- riskScore < 1500 -> NO_RISK
- riskScore < 3000 -> MIDDLE_RISK
- else -> HIGH_RISK
- Enum function: RiskLevelData.fromRiskScore(riskScore: Int)
- Pass calculated risk level to PWA by returning json with result model back through OnGetBridgeDataUseCase
- JS Bridge UseCase: OnGetBridgeDataUseCase
- JS Bridge Data Type: OutgoingBridgeDataType.ANALYZE_RESULT
- Json composer: OutgoingBridgeDataResultComposer.composeAnalyzeResult(exposure: ExposureItem)