<?php

namespace Planaday\Config\Booking\Form\Student;

use Planaday\Config\BasicEnumMappedSetting;
use Planaday\Config\BasicSettingsLog;
use Planaday\Config\EnumMappedSettings;
use Planaday\Config\FormGroupable;
use Planaday\Config\SettingsLoader;
use Planaday\Config\SettingsWithForm;
use Planaday\Config\SettingsWithUsageLog;
use Planaday\Platform\PlatformAbstraction\LocalizationController;
use Planaday\Utility\DependencyInjection\Attributes\Scoped;
use Planaday\Utility\FormBuilder\Conditions\InputValueCondition;
use Planaday\Utility\FormBuilder\InputFields\BoolInput;
use Planaday\Utility\FormBuilder\InputFields\StringInput;
use Planaday\Utility\FormBuilder\Structures\BasicGroup;
use Planaday\Utility\FormBuilder\Structures\CollapsibleGroup;
use Planaday\Utility\FormBuilder\Structures\QuestionCluster;
use Planaday\Utility\FormBuilder\Validators\RegexValidator;
use Planaday\Utility\FormBuilder\Validators\Required;
use Planaday\Utility\RegexUtility;

#[Scoped]
class StudentSettings implements EnumMappedSettings, SettingsWithForm, SettingsWithUsageLog {
	use FormGroupable;
	use BasicEnumMappedSetting;
	use BasicSettingsLog;

	protected bool $askGender = true;
	protected bool $genderRequired = false;
	protected bool $askInitials = true;
	protected bool $initialsRequired = false;
	protected bool $askPhoneNumber = false;
	protected bool $phoneNumberRequired = false;
	protected bool $askPlaceOfBirth = false;
	protected bool $placeOfBirthRequired = false;
	protected bool $askDateOfBirth = false;
	protected bool $dateOfBirthRequired = false;
	protected bool $askMaidenName = false;
	protected bool $askEmployeeNumber = false;
	protected bool $askCostCenterCode = false;
	protected bool $costCenterCodeRequired = false;
	protected bool $askCompanyPosition = false;
	protected bool $companyPositionRequired = false;
	protected bool $askInternalReference = false;
	protected bool $askNickName = false;
	protected bool $askIfContact = false;
	protected bool $askAddress = false;
	protected bool $askRemark = false;
	protected bool $askCode95 = false;
	protected bool $askSoob = false;
	protected ?string $termsAndConditionsUrl = null;
	protected bool $termsAndConditionsRequired = false;
	protected string $costCenterCodeText = "Kostenplaats";
	protected string $code95Text = "Cursus bevat code95, deze deelnemer ook meteen hiervoor aanmelden?";
	protected string $soobText = "Cursus bevat SOOB, deze deelnemer ook meteen hiervoor aanmelden?";

	public function __construct(
		protected LocalizationController $translator,
		protected SettingsLoader $settingsDatabase
	) {
		$this->settingsDatabase->reloadData($this, StudentOptionsEnum::class );
	}

	protected function createFormGroup(): BasicGroup {
		$t = function ( string $string ) {
			return $this->translator->translate( $string );
		};

		return ( new BasicGroup() )
			->setIndex( StudentOptionsEnum::class )
			->addContents(
				( new QuestionCluster() )
					->setName( $t( "Persoonsgegevens vragen en verplichten" ) )
					->setDescription( $t( "Welke persoonsgegevens worden gevraagt in het boekingsformulier? En " .
					                      "zijn deze verplicht (wanneer mogelijk)?" ) )
					->addContents(
						(new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_ADDRESS->value )
							->setName( $t( "Adres (verplicht als gevraagt)" ) )
							->setDescription( $t( "Moet het adres van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askAddress )
							->addSetCallback( function ( $value ) {
								$this->askAddress = $value ?? $this->askAddress;
							}),
						(new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_MAIDEN_NAME->value )
							->setName( $t( "Meisjesnaam" ) )
							->setDescription( $t( "Moet de meisjesnaam van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askMaidenName )
							->addSetCallback( function ( $value ) {
								$this->askMaidenName = $value ?? $this->askMaidenName;
							}),
						(new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_NICK_NAME->value )
							->setName( $t( "Roepnaam" ) )
							->setDescription( $t( "Moet de roepnaam van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askNickName )
							->addSetCallback( function ( $value ) {
								$this->askNickName = $value ?? $this->askNickName;
							}),
						$askGender = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_GENDER->value )
							->setName( $t( "Geslacht" ) )
							->setDescription( $t( "Moet het geslacht van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askGender )
							->addSetCallback( function ( $value ) {
								$this->askGender = $value ?? $this->askGender;
							}),
						(new BasicGroup())
							->addConditions(
								(new InputValueCondition($askGender))->equals()->value(true)
							)->addContents(
								(new BoolInput())
									->setIndex( StudentOptionsEnum::GENDER_REQUIRED->value )
									->setName( $t( "Verplicht" ) )
									->setDescription( $t( "Moet het geslacht verplicht zijn?" ) )
									->setDefaultValue( $this->genderRequired )
									->addSetCallback( function ( $value ) {
										$this->genderRequired = $value ?? $this->genderRequired;
									})
							)->addClasses("pad-subgroup"),
						$askInitials = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_INITIALS->value )
							->setName( $t( "Initialen" ) )
							->setDescription( $t( "Moeten de initialen van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askInitials )
							->addSetCallback( function ( $value ) {
								$this->askInitials = $value ?? $this->askInitials;
							}),
						(new BasicGroup())
							->addConditions(
								(new InputValueCondition($askInitials))->equals()->value(true)
							)->addContents(
								(new BoolInput())
									->setIndex( StudentOptionsEnum::INITIALS_REQUIRED->value )
									->setName( $t( "Verplicht" ) )
									->setDescription( $t( "Moeten de initialen verplicht zijn?" ) )
									->setDefaultValue( $this->initialsRequired )
									->addSetCallback( function ( $value ) {
										$this->initialsRequired = $value ?? $this->initialsRequired;
									})
							)->addClasses("pad-subgroup"),
						$askPhoneNumber = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_PHONE_NUMBER->value )
							->setName( $t( "Telefoonnummer" ) )
							->setDescription( $t( "Moet het telefoonnummer van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askPhoneNumber )
							->addSetCallback( function ( $value ) {
								$this->askPhoneNumber = $value ?? $this->askPhoneNumber;
							}),
						(new BasicGroup())
							->addConditions(
								(new InputValueCondition($askPhoneNumber))->equals()->value(true)
							)->addContents(
								(new BoolInput())
									->setIndex( StudentOptionsEnum::PHONE_NUMBER_REQUIRED->value )
									->setName( $t( "Verplicht" ) )
									->setDescription( $t( "Moet dit telefoonnummer verplicht zijn?" ) )
									->setDefaultValue( $this->phoneNumberRequired )
									->addSetCallback( function ( $value ) {
										$this->phoneNumberRequired = $value ?? $this->phoneNumberRequired;
									})
							)->addClasses("pad-subgroup"),
						$askDateOfBirth = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_DATE_OF_BIRTH->value )
							->setName( $t( "Geboortedatum" ) )
							->setDescription( $t( "Moet de geboortedatum van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askDateOfBirth )
							->addSetCallback( function ( $value ) {
								$this->askDateOfBirth = $value ?? $this->askDateOfBirth;
							}),
						(new BasicGroup())
							->addConditions(
								(new InputValueCondition($askDateOfBirth))->equals()->value(true)
							)->addContents(
								(new BoolInput())
									->setIndex( StudentOptionsEnum::DATE_OF_BIRTH_REQUIRED->value )
									->setName( $t( "Verplicht" ) )
									->setDescription( $t( "Moet de geboortedatum verplicht zijn?" ) )
									->setDefaultValue( $this->dateOfBirthRequired )
									->addSetCallback( function ( $value ) {
										$this->dateOfBirthRequired = $value ?? $this->dateOfBirthRequired;
									})
							)->addClasses("pad-subgroup"),
						$askPlaceOfBirth = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_PLACE_OF_BIRTH->value )
							->setName( $t( "Geboorteplaats" ) )
							->setDescription( $t( "Moet de geboorteplaats van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askPlaceOfBirth )
							->addSetCallback( function ( $value ) {
								$this->askPlaceOfBirth = $value ?? $this->askPlaceOfBirth;
							}),
						(new BasicGroup())
							->addConditions(
								(new InputValueCondition($askPlaceOfBirth))->equals()->value(true)
							)->addContents(
								(new BoolInput())
									->setIndex( StudentOptionsEnum::PLACE_OF_BIRTH_REQUIRED->value )
									->setName( $t( "Verplicht" ) )
									->setDescription( $t( "Moet de geboorteplaats verplicht zijn?" ) )
									->setDefaultValue( $this->placeOfBirthRequired )
									->addSetCallback( function ( $value ) {
										$this->placeOfBirthRequired = $value ?? $this->placeOfBirthRequired;
									})
							)->addClasses("pad-subgroup"),
						$askCompanyPosition = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_COMPANY_POSITION->value )
							->setName( $t( "Functie" ) )
							->setDescription( $t( "Moet de bedrijfsfunctie van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askCompanyPosition )
							->addSetCallback( function ( $value ) {
								$this->askCompanyPosition = $value ?? $this->askCompanyPosition;
							}),
						(new BasicGroup())
							->addConditions(
								(new InputValueCondition($askCompanyPosition))->equals()->value(true)
							)->addContents(
								(new BoolInput())
									->setIndex( StudentOptionsEnum::COMPANY_POSITION_REQUIRED->value )
									->setName( $t( "Verplicht" ) )
									->setDescription( $t( "Moet de bedrijfsfunctie verplicht zijn?" ) )
									->setDefaultValue( $this->companyPositionRequired )
									->addSetCallback( function ( $value ) {
										$this->companyPositionRequired = $value ?? $this->companyPositionRequired;
									})
							)->addClasses("pad-subgroup"),
						(new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_IF_CONTACT->value )
							->setName( $t( "Contact" ) )
							->setDescription( $t( "Moet er gevraagd worden of de cursist een contactpersoon is?" ) )
							->setDefaultValue( $this->askIfContact )
							->addSetCallback( function ( $value ) {
								$this->askIfContact = $value ?? $this->askIfContact;
							}),
						(new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_EMPLOYEE_NUMBER->value )
							->setName( $t( "personeelsnummer" ) )
							->setDescription( $t( "Moet het personeelsnummer van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askEmployeeNumber )
							->addSetCallback( function ( $value ) {
								$this->askEmployeeNumber = $value ?? $this->askEmployeeNumber;
							}),
						$askCostCenterCode = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_COST_CENTER_CODE->value )
							->setName( $t( "Kostenplaats" ) )
							->setDescription( $t( "Moet de kostenplaats van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askCostCenterCode )
							->addSetCallback( function ( $value ) {
								$this->askCostCenterCode = $value ?? $this->askCostCenterCode;
							}),
						(new BasicGroup())
							->addConditions(
								(new InputValueCondition($askCostCenterCode))->equals()->value(true)
							)->addContents(
								(new BoolInput())
									->setIndex( StudentOptionsEnum::COST_CENTER_CODE_REQUIRED->value )
									->setName( $t( "Verplicht" ) )
									->setDescription( $t( "Moet de kostenplaats verplicht zijn?" ) )
									->setDefaultValue( $this->costCenterCodeRequired )
									->addSetCallback( function ( $value ) {
										$this->costCenterCodeRequired = $value ?? $this->costCenterCodeRequired;
									})
							)->addClasses("pad-subgroup"),
						(new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_INTERNAL_REFERENCE->value )
							->setName( $t( "Interne referentie" ) )
							->setDescription( $t( "Moet de interne referentie van de cursist gevraagd worden?" ) )
							->setDefaultValue( $this->askInternalReference )
							->addSetCallback( function ( $value ) {
								$this->askInternalReference = $value ?? $this->askInternalReference;
							}),
					),
				(new BoolInput())
					->setIndex( StudentOptionsEnum::ASK_REMARK->value )
					->setName( $t( "Opmerkingen vragen?" ) )
					->setDescription( $t( "Moet er een opmerking gevraagd worden?" ) )
					->setDefaultValue( $this->askRemark )
					->addSetCallback( function ( $value ) {
						$this->askRemark = $value ?? $this->askRemark;
					}),
				( new CollapsibleGroup() )
					->setHeader( $t( "Cursus opties" ) )
					->setDescription( $t( "Welke opties worden gegeven in het boekingsformulier bij cursist " .
					                      "wanneer deze beschikbaar zijn?" ) )
					->addContents(
						$askCode95 = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_CODE_95->value )
							->setName( $t( "Code 95" ) )
							->setDescription( $t( "Moet de optie voor code 95 gegeven worden? Dit wordt alleen " .
							                      "gedaan wanneer dit beschikbaar is." ) )
							->setDefaultValue( $this->askCode95 )
							->addSetCallback( function ( $value ) {
								$this->askCode95 = $value ?? $this->askCode95;
							}),
						( new BasicGroup() )
							->addConditions(
								(new InputValueCondition($askCode95))->equals()->value(true)
							)
							->addContents(
								( new StringInput() )
									->setIndex( StudentOptionsEnum::CODE_95_TEXT->value )
									->setName( $t( "Code 95 tekst" ) )
									->setDescription( $t("Tekst die wordt gebruikt voor de code 95 optie"))
									->setDefaultValue( $this->code95Text )
									->setPlaceholder( $t( "Cursus bevat code95, deze deelnemer ook meteen hiervoor aanmelden?" ) )
									->addSetCallback( function ( $value ) {
										$this->code95Text = $value ?? $this->code95Text;
									})
									->addValidator(
										new Required( $t( "Deze tekst is verplicht als de optie wordt gevraagd" ) )
									)
							)->addClasses("pad-subgroup"),
						$askSoob = (new BoolInput())
							->setIndex( StudentOptionsEnum::ASK_SOOB->value )
							->setName( $t( "SOOB" ) )
							->setDescription( $t( "Moet de optie voor Soob gegeven worden? Dit wordt alleen " .
							                      "gedaan wanneer dit beschikbaar is." ) )
							->setDefaultValue( $this->askSoob )
							->addSetCallback( function ( $value ) {
								$this->askSoob = $value ?? $this->askSoob;
							}),
						( new BasicGroup() )
							->addConditions(
								(new InputValueCondition($askSoob))->equals()->value(true)
							)->addContents(
								( new StringInput() )
									->setIndex( StudentOptionsEnum::SOOB_TEXT->value )
									->setName( $t( "SOOB tekst" ) )
									->setDescription( $t("Tekst die wordt gebruikt voor de SOOB optie") )
									->setDefaultValue( $this->soobText )
									->setPlaceholder( $t( "Cursus bevat SOOB, deze deelnemer ook meteen hiervoor aanmelden?" ) )
									->addSetCallback( function ( $value ) {
										$this->soobText = $value ?? $this->soobText;
									})
									->addValidator(
										new Required( $t( "Deze tekst is verplicht als de optie wordt gevraagd" ) )
									)
							)->addClasses("pad-subgroup"),
					),
				$requireTermsAndConditions = ( new BoolInput() )
					->setIndex( StudentOptionsEnum::TERMS_AND_CONDITIONS_REQUIRED->value )
					->setName( $t( "Algemene voorwaarden?" ) )
					->setDescription( $t( "Moet de gebruiker de algemene voorwaarden accepteren?" ) )
					->setDefaultValue( $this->termsAndConditionsRequired )
					->addSetCallback( function ( $value ) {
						$this->termsAndConditionsRequired = $value ?? $this->termsAndConditionsRequired;
					}),
				( new BasicGroup() )
					->addConditions(
						( new InputValueCondition($requireTermsAndConditions))->equals()->value(true)
					)->addContents(
						( new StringInput() )
							->setIndex( StudentOptionsEnum::TERMS_AND_CONDITIONS_URL->value )
							->setName( $t( "Algemene voorwaarden URL" ) )
							->setDescription( $t( "Het volledige URL naar de algemene voorwaarden" ) )
							->setDefaultValue( $this->termsAndConditionsUrl )
							->setPlaceholder( $t( "https://www.example.com/algemene-voorwaarden" ) )
							->addSetCallback( function ( $value ) {
								$this->termsAndConditionsUrl = $value ?? $this->termsAndConditionsUrl;
							})
							->addValidator(
								new Required( $t( "Deze URL is verplicht als de optie wordt gevraagd" ) ),
								new RegexValidator("url", RegexUtility::SIMPLE_URL_REGEX, $t( "Deze URL is niet geldig" ) )
							)
					),
				( new BasicGroup() )
					->addConditions(
						( new InputValueCondition($askCostCenterCode))->equals()->value(true)
					)->addContents(
						( new StringInput() )
							->setIndex( StudentOptionsEnum::COST_CENTER_CODE_TEXT->value )
							->setName( $t( "Kostenplaats tekst" ) )
							->setDescription( $t("De text die wordt gebruikt voor 'kostenplaats'"))
							->setDefaultValue( $this->costCenterCodeText )
							->setPlaceholder( $t( "Kostenplaats" ) )
							->addSetCallback( function ( $value ) {
								$this->costCenterCodeText = $value ?? $this->costCenterCodeText;
							})
							->addValidator(
								new Required( $t( "Deze tekst is verplicht als om de kostenplaats wordt gevraagd" ) )
							)
					)
			);
	}

	/**
	 * @return array{values:mixed[], subGroups:array[], subGroupAliases:string[]}
	 */
	public function getEnumMapping(): array {
		return [
			"values"          => [
				StudentOptionsEnum::ASK_GENDER->value => &$this->askGender,
				StudentOptionsEnum::GENDER_REQUIRED->value => &$this->genderRequired,
				StudentOptionsEnum::ASK_INITIALS->value => &$this->askInitials,
				StudentOptionsEnum::INITIALS_REQUIRED->value => &$this->initialsRequired,
				StudentOptionsEnum::ASK_PHONE_NUMBER->value => &$this->askPhoneNumber,
				StudentOptionsEnum::PHONE_NUMBER_REQUIRED->value => &$this->phoneNumberRequired,
				StudentOptionsEnum::ASK_PLACE_OF_BIRTH->value => &$this->askPlaceOfBirth,
				StudentOptionsEnum::PLACE_OF_BIRTH_REQUIRED->value => &$this->placeOfBirthRequired,
				StudentOptionsEnum::ASK_DATE_OF_BIRTH->value => &$this->askDateOfBirth,
				StudentOptionsEnum::DATE_OF_BIRTH_REQUIRED->value => &$this->dateOfBirthRequired,
				StudentOptionsEnum::ASK_MAIDEN_NAME->value => &$this->askMaidenName,
				StudentOptionsEnum::ASK_EMPLOYEE_NUMBER->value => &$this->askEmployeeNumber,
				StudentOptionsEnum::ASK_COST_CENTER_CODE->value => &$this->askCostCenterCode,
				StudentOptionsEnum::COST_CENTER_CODE_REQUIRED->value => &$this->costCenterCodeRequired,
				StudentOptionsEnum::ASK_COMPANY_POSITION->value => &$this->askCompanyPosition,
				StudentOptionsEnum::COMPANY_POSITION_REQUIRED->value => &$this->companyPositionRequired,
				StudentOptionsEnum::ASK_INTERNAL_REFERENCE->value => &$this->askInternalReference,
				StudentOptionsEnum::ASK_NICK_NAME->value => &$this->askNickName,
				StudentOptionsEnum::ASK_IF_CONTACT->value => &$this->askIfContact,
				StudentOptionsEnum::ASK_ADDRESS->value => &$this->askAddress,
				StudentOptionsEnum::ASK_REMARK->value => &$this->askRemark,
				StudentOptionsEnum::ASK_CODE_95->value => &$this->askCode95,
				StudentOptionsEnum::ASK_SOOB->value => &$this->askSoob,
				StudentOptionsEnum::TERMS_AND_CONDITIONS_URL->value => &$this->termsAndConditionsUrl,
				StudentOptionsEnum::TERMS_AND_CONDITIONS_REQUIRED->value => &$this->termsAndConditionsRequired,
				StudentOptionsEnum::COST_CENTER_CODE_TEXT->value => &$this->costCenterCodeText,
				StudentOptionsEnum::CODE_95_TEXT->value => &$this->code95Text,
				StudentOptionsEnum::SOOB_TEXT->value => &$this->soobText,
			],
			"subGroups"       => [],
			"subGroupAliases" => []
		];
	}

	public function isAskGender(): bool {
		$this->logUse(StudentOptionsEnum::ASK_GENDER);
		return $this->askGender;
	}

	public function isGenderRequired(): bool {
		$this->logUse(StudentOptionsEnum::GENDER_REQUIRED);
		return $this->genderRequired;
	}

	public function isAskInitials(): bool {
		$this->logUse(StudentOptionsEnum::ASK_INITIALS);
		return $this->askInitials;
	}

	public function isInitialsRequired(): bool {
		$this->logUse(StudentOptionsEnum::INITIALS_REQUIRED);
		return $this->initialsRequired;
	}

	public function isAskPhoneNumber(): bool {
		$this->logUse(StudentOptionsEnum::ASK_PHONE_NUMBER);
		return $this->askPhoneNumber;
	}

	public function isAskPlaceOfBirth(): bool {
		$this->logUse(StudentOptionsEnum::ASK_PLACE_OF_BIRTH);
		return $this->askPlaceOfBirth;
	}

	public function isAskDateOfBirth(): bool {
		$this->logUse(StudentOptionsEnum::ASK_DATE_OF_BIRTH);
		return $this->askDateOfBirth;
	}

	public function isAskMaidenName(): bool {
		$this->logUse(StudentOptionsEnum::ASK_MAIDEN_NAME);
		return $this->askMaidenName;
	}

	public function isAskEmployeeNumber(): bool {
		$this->logUse(StudentOptionsEnum::ASK_EMPLOYEE_NUMBER);
		return $this->askEmployeeNumber;
	}

	public function isAskCostCenterCode(): bool {
		$this->logUse(StudentOptionsEnum::ASK_COST_CENTER_CODE);
		return $this->askCostCenterCode;
	}

	public function isAskCompanyPosition(): bool {
		$this->logUse(StudentOptionsEnum::ASK_COMPANY_POSITION);
		return $this->askCompanyPosition;
	}

	public function isAskInternalReference(): bool {
		$this->logUse(StudentOptionsEnum::ASK_INTERNAL_REFERENCE);
		return $this->askInternalReference;
	}

	public function isAskNickName(): bool {
		$this->logUse(StudentOptionsEnum::ASK_NICK_NAME);
		return $this->askNickName;
	}

	public function isAskIfContact(): bool {
		$this->logUse(StudentOptionsEnum::ASK_IF_CONTACT);
		return $this->askIfContact;
	}

	public function isAskAddress(): bool {
		$this->logUse(StudentOptionsEnum::ASK_ADDRESS);
		return $this->askAddress;
	}

	public function isAskRemark(): bool {
		$this->logUse(StudentOptionsEnum::ASK_REMARK);
		return $this->askRemark;
	}

	public function isAskCode95(): bool {
		$this->logUse(StudentOptionsEnum::ASK_CODE_95);
		return $this->askCode95;
	}

	public function isAskSoob(): bool {
		$this->logUse(StudentOptionsEnum::ASK_SOOB);
		return $this->askSoob;
	}

	public function isCostCenterCodeRequired(): bool {
		$this->logUse(StudentOptionsEnum::COST_CENTER_CODE_REQUIRED);
		return $this->costCenterCodeRequired;
	}

	public function isDateOfBirthRequired(): bool {
		$this->logUse(StudentOptionsEnum::DATE_OF_BIRTH_REQUIRED);
		return $this->dateOfBirthRequired;
	}

	public function isPlaceOfBirthRequired(): bool {
		$this->logUse(StudentOptionsEnum::PLACE_OF_BIRTH_REQUIRED);
		return $this->placeOfBirthRequired;
	}

	public function isPhoneNumberRequired(): bool {
		$this->logUse(StudentOptionsEnum::PHONE_NUMBER_REQUIRED);
		return $this->phoneNumberRequired;
	}

	public function isCompanyPositionRequired(): bool {
		$this->logUse(StudentOptionsEnum::COMPANY_POSITION_REQUIRED);
		return $this->companyPositionRequired;
	}

	public function isTermsAndConditionsRequired(): bool {
		$this->logUse(StudentOptionsEnum::TERMS_AND_CONDITIONS_REQUIRED);
		return $this->termsAndConditionsRequired;
	}

	public function getTermsAndConditionsUrl(): ?string {
		$this->logUse(StudentOptionsEnum::TERMS_AND_CONDITIONS_URL);
		if ( empty( $this->termsAndConditionsUrl ) ) {
			return null;
		}

		$success = preg_match( RegexUtility::SIMPLE_URL_REGEX, $this->termsAndConditionsUrl, $matches );

		if ( !$success ) {
			return null;
		}

		return "https://" . $matches[1];
	}

	public function getCostCenterCodeText(): string {
		$this->logUse(StudentOptionsEnum::COST_CENTER_CODE_TEXT);
		return $this->costCenterCodeText;
	}

	public function getCode95Text(): string {
		$this->logUse(StudentOptionsEnum::CODE_95_TEXT);
		return $this->code95Text;
	}

	public function getSoobText(): string {
		$this->logUse(StudentOptionsEnum::SOOB_TEXT);
		return $this->soobText;
	}
}