rentgen/components/report-window/deduce-problems.tsx

24 lines
871 B
TypeScript
Raw Normal View History

import { RequestCluster } from '../../request-cluster';
import { ParsedAnswers } from './parse-answers';
2022-02-10 18:13:59 +01:00
import NoInformationAtAllProblem from './problems/no-information-at-all';
import { Problem } from './problems/problem';
2022-07-07 22:10:03 +02:00
import { TransferOutsideEU } from './problems/transfer-outside-eu';
import { UnknownIdentity } from './problems/unknown-identity';
2022-07-07 21:16:48 +02:00
import { UnknownLegalBasis } from './problems/unknown-legal-basis';
2022-02-10 18:13:59 +01:00
import { UnlawfulCookieAccess } from './problems/unlawful-cookies';
export default function deduceProblems(
2022-04-24 22:11:33 +02:00
answers: ParsedAnswers,
clusters: Record<string, RequestCluster>
): Problem[] {
return [
NoInformationAtAllProblem,
UnlawfulCookieAccess,
UnknownLegalBasis,
UnknownIdentity,
TransferOutsideEU,
]
2022-07-07 21:16:48 +02:00
.map((c) => new c(answers, clusters))
.filter((p) => p.qualifies());
}