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