<?php  namespace App\Models;  use Closure; use App\Enums\EmailType; use App\Enums\SurveyType; use App\Enums\QuestionType; use App\Traits\HasWebhooks; use Illuminate\Support\Str; use Illuminate\Http\Request; use App\Contracts\Reportable; use App\Enums\ClientSurveyType; use App\Traits\HasLimitedScope; use App\Traits\HasTranslations; use App\Traits\HasUserActivity; use App\Enums\ClientSurveyStatus; use App\Enums\CategoryReportGroup; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\URL; use App\Contracts\InteractsWithDomain; use App\Enums\InternalBaApplicantType; use App\Observers\ClientSurveyObserver; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\HasOne; use App\Services\ClientSurveys\ClientSurveyService; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\BelongsTo; use App\Contracts\HasWebhooks as HasWebhooksContracts; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\HasManyThrough; use App\Contracts\HasLimitedScope as HasLimitedScopeContract; use App\Contracts\HasUserActivity as HasUserActivityContract;  /**  * @property Collection $locations  * @property Collection $departments  */ class ClientSurvey extends Model implements HasLimitedScopeContract, HasUserActivityContract, HasWebhooksContracts, InteractsWithDomain, Reportable { 	use HasLimitedScope, HasWebhooks, HasTranslations, HasUserActivity;  	public array $translatable = [ 		'locations_description', 		'departments_description', 	];  	protected $casts = [ 		'start_date' => 'datetime', 		'end_date' => 'datetime', 		'invitation_date' => 'datetime', 		'reminder_date' => 'datetime', 		'multiple_access_codes' => 'boolean', 		'include_demographic_questions' => 'boolean', 		'paid' => 'boolean', 		'relevant' => 'boolean', 		'draft' => 'boolean', 		'display_report' => 'boolean', 		'comparable' => 'boolean', 		'filter' => 'boolean', 		'switch_basic_and_additional_question_order' => 'boolean', 		'survey_type' => SurveyType::class, 		'status' => ClientSurveyStatus::class, 		'type' => ClientSurveyType::class, 		'send_codes_via_email' => 'boolean', 		'location_answer_required' => 'boolean', 		'department_answer_required' => 'boolean', 		'locations_description' => 'array', 		'departments_description' => 'array', 		'demographic_answers_required' => 'boolean', 		'demographic_first' => 'boolean', 		'departments_first' => 'boolean', 		'locations_first' => 'boolean', 		'has_downloaded_codes' => 'boolean', 		'is_survey_already_approved' => 'boolean', 	];  	protected $with = ['client', 'survey'];  	protected $attributes = [ 		'paid' => false, 		'relevant' => true, 		'display_report' => true, 		'comparable' => true, 		'filter' => true, 		'include_demographic_questions' => true, 		'send_codes_via_email' => true, 		'demographic_answers_required' => false, 		'demographic_first' => false, 		'departments_first' => false, 		'locations_first' => false, 	];  	protected static function initObservers(): string 	{ 		return ClientSurveyObserver::class; 	}  	public function canAccessDomain(Domain $domain): bool{}  	public function hasBeenApproved(): bool{}  	public function hasFinished(): bool{}  	public function shouldSendCodesViaEmail(): bool{}  	public function didStatusChange(ClientSurveyStatus $status): bool{}  	public function didSurveyChange(string $survey_id): bool{}  	public function isIzzSurvey(): bool{}  	public function isPulsSurvey(): bool{}  	public function isPpiSurvey(): bool{}  	public function isBaSurvey(): bool{}  	public function isInFillablePeriod(): bool{}  	public function isSurveyPending(): bool{}  	public function isSurveyApproved(): bool{}  	public function getCodesForPdfGeneration(): array{}  	public function isBasePpiSurvey(): bool{}  	public function canGeneratePulsReport(): bool{}  	public function getUserActivityTitle(): string{}  	public function getUserActivityUrl(): string{}  	public function getActiveDomain(): Domain{}  	public function hasMailableApplicants(): bool{}  	public function client(): BelongsTo{}  	public function survey(): BelongsTo{}  	public function parent(): BelongsTo{}  	public function child(): HasOne{}  	public function answers(): HasMany{}  	public function clientSurveyDemographicQuestions(): HasMany{}  	public function clientSurveyPulsQuestions(): HasMany{}  	public function clientSurveyPpiQuestions(): HasMany{}  	public function mainQuestions(): HasManyThrough{}  	public function extraQuestions(): HasMany{}  	public function demographicQuestions(): BelongsToMany{}  	public function pulsQuestions(): BelongsToMany{}  	public function ppiBrandAwarenessQuestions(): BelongsToMany{}  	public function professionExtraQuestions(): HasMany{}  	public function brandAwarenessExtraQuestions(): HasMany{}  	public function professions(): BelongsToMany{}  	public function clientSurveyProfessionPivot(): HasMany{}  	public function domain(): BelongsTo{}  	public function questionCount(): int{}  	public function mandatoryQuestionCount(): int{}  	public function applicants(): HasMany{}  	public function departments(): HasMany{}  	public function locations(): HasMany{}  	public function emailActivities(): HasMany{}  	public function getApplicantsEmailArray(): array{}  	public function getNumberOfOnlineApplicantsWithoutEmail(): int{}  	public function getFullUrlForWebLogin(): ?string{}  	public function getSurveyDownloadCodesUrl(): ?string{}  	public function getBaInternalStartUrl(): string{}  	public function getPpiCompletionPercentage(int $applicant_count): string|int{}  	public function shouldSendCodeReminderMail(): bool{}  	public function getStyledOverallGradeString(): string{}  	public function generateApplicants(?array $emails = [], ?int $offline_applicants_count = 0, ?array $email_languages = []): void{}  	public function updateApplicants(?array $emails = [], ?int $offline_applicants_count = 0, ?array $email_languages = []): void{}  	public function scopeUserScope(Builder $query): Builder{}  	public function scopeForYear(Builder $query, ?int $year = null): Builder{}  	public function scopeSearch(Builder $query, ?string $search = null): Builder{}  	public function scopeIzzSurveys(Builder $query): Builder{}  	public function scopePulser(Builder $query): Builder{}  	public function scopePuls(Builder $query): Builder{}  	public function scopePpiSurveys(Builder $query): Builder{}  	public function scopeBaSurveys(Builder $query): Builder{}  	public function scopeBaInternalSurveys(Builder $query): Builder{}  	public function scopeBaPublicAndInternalSurveys(Builder $query): Builder{}  	public function scopePpiQuestionCombination(Builder $query, ?string $profession_id = null): Builder{}  	public function loadQuestionCombination(ClientSurvey $client_survey): ClientSurvey{}  	// Check if current applicant counts exists in limit set by number_of_employees or if no applicants are present and number_of_employees is > 0 	// Used for brand awareness surveys 	public function scopeInApplicantLimits(Builder $query): Builder{}  	public function scopeWithHasDuplicateApplicants(Builder $query): Builder{}  	public function scopeWithHasConflictingAnswers(Builder $query): Builder{}  	public function scopeFilterIzzSurveysByType(Builder $query, bool $show_puls = false): Builder{}  	public function scopeNotCanceled(Builder $query): Builder{}  	public function scopeByDomain(Builder $query, Domain $domain): Builder{}  	public function scopeCurrentlyActiveDuration(Builder $query): Builder{}  	public function emailTemplates(): HasMany{}  	public function handleApplicantAndClientEmailTemplates(Closure $closure): void{}  	public function handlePulsApplicantAndClientEmailTemplates(Closure $closure): void{}  	public function availableLanguages(): array{}  	public function scopeRelevant(Builder $query): Builder{}  	public function scopeComparable(Builder $query): Builder{}  	public function scopeBase(Builder $query): Builder{}  	public function scopeBrandAwareness(Builder $query): Builder{}  	public function scopePaid(Builder $query): Builder{}  	public function scopeFinished(Builder $query): Builder{}  	public function scopeStarted(Builder $query): Builder{}  	public function scopeViableClientSurveys(object $query): Builder{}  	public function scopeWithValidApplicants(Builder $query): Builder{}  	public function getApplicants(): Collection{}  	public function getNumberOfEmployees(): int{}  	public function getTotalNumberOfEmployeesInCompany(): int{}  	public function getCategories(): Collection{}  	public function getExtraQuestionsForPdf(array $applicants): Collection{}  	public function clientHasIndustry(): bool{}  	public function hasDepartments(): bool{}  	public function hasLocations(): bool{}  	public function hasNotes(): bool{}  	public function generateDownloadFileName(string $locale): string{}  	public function generateDownloadFileNameBenchmark(string $locale): string{}  	public function generateDownloadFileNameForComparativeReport(string $locale, string $name): string{}  	public function generateDownloadFileNameForGeneralExcelReport(string $locale): string{}  	public function generateDownloadFileNameForStatisticBenchmarkExcelReport(string $locale): string{}  	public function generateDownloadFileNameForPpiAnswerExcelReport(string $locale): string{}  	public function generateDownloadFileNameForBaAnswerExcelReport(string $locale): string{}  	public function generateDownloadFileNameForBaInternalAnswerExcelReport(string $locale): string{}  	public function generateDownloadFileNameForPulsReport(string $locale): string{}  	public function getDemographicQuestions(array $items): Collection{}  	public function getIds(): array{}  	public function getStartDate(): string{}  	public function getEndDate(): string{}  	public function getAvatar(): ?string{}  	public function getYear(): int{}  	public function loadAdditionalDataWithFilters(Request $request): Reportable{}  	public function getViewFile(): string{}  	public function getEngagementCategoryIds(): array{}  	public function getPromotorApplicantsCount(?InternalBaApplicantType $applicantType = null): int{}  	public function getPassiveApplicantsCount(?InternalBaApplicantType $applicantType = null): int{}  	public function getCriticApplicantsCount(?InternalBaApplicantType $applicantType = null): int{}  	public function showReportableComments(): bool{}  	public function isGeneratingReportPossible(): bool{}  	public function getClientName(): string{} }