894391aaa3
Trzeba jeszcze zrobić tak, aby pytania dla kolejnych hostów pojawiały się po kolei - tzn dopiero jak dla poprzedniego hosta hostNeedsQuestions jest false, to pokazujemy następnego. Potem trzeba popracować nad samym generowaniem treści na podstawie wszystkich tych odpowiedzi
33 lines
877 B
TypeScript
33 lines
877 B
TypeScript
import { EmailTemplate3Config } from './email-template-3';
|
|
|
|
export function hostNeedsQuestions({
|
|
presence,
|
|
legal_basis_type,
|
|
consent_problems,
|
|
legitimate_interest_activity_description,
|
|
legitimate_interest_activity_specified,
|
|
}: EmailTemplate3Config['hosts_settings'][string]) {
|
|
if (presence == 'not_mentioned') {
|
|
return false;
|
|
}
|
|
if (legal_basis_type == 'not_mentioned') {
|
|
return false;
|
|
}
|
|
if (legal_basis_type == 'consent' && consent_problems !== 'null') {
|
|
return false;
|
|
}
|
|
if (
|
|
legitimate_interest_activity_specified !== 'null' &&
|
|
legitimate_interest_activity_specified !== 'vague'
|
|
) {
|
|
return false;
|
|
}
|
|
if (
|
|
legal_basis_type == 'legitimate_interest' &&
|
|
legitimate_interest_activity_description != ''
|
|
) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|