-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 27-documents
- Loading branch information
Showing
83 changed files
with
4,120 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Concerns; | ||
|
||
use App\Models\Beneficiary; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
|
||
trait BelongsToBeneficiary | ||
{ | ||
public function initializeBelongsToBeneficiary(): void | ||
{ | ||
$this->fillable[] = 'beneficiary_id'; | ||
} | ||
|
||
public function beneficiary(): BelongsTo | ||
{ | ||
return $this->belongsTo(Beneficiary::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Concerns; | ||
|
||
use App\Models\Beneficiary; | ||
use App\Models\BeneficiaryPartner; | ||
|
||
trait HasEffectiveAddress | ||
{ | ||
protected static function bootHasEffectiveAddress(): void | ||
{ | ||
static::creating(fn (Beneficiary | BeneficiaryPartner $model) => self::copyLegalResidenceToEffectiveResidence($model)); | ||
|
||
static::updating(fn (Beneficiary | BeneficiaryPartner $model) => self::copyLegalResidenceToEffectiveResidence($model)); | ||
} | ||
|
||
protected static function copyLegalResidenceToEffectiveResidence(Beneficiary | BeneficiaryPartner $model): void | ||
{ | ||
if ($model->same_as_legal_residence) { | ||
$model->effective_residence_county_id = $model->legal_residence_county_id; | ||
$model->effective_residence_city_id = $model->legal_residence_city_id; | ||
$model->effective_residence_address = $model->legal_residence_address; | ||
if (isset($model->legal_residence_environment)) { | ||
$model->effective_residence_environment = $model->legal_residence_environment; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum AggravatingFactorsSchema: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case SEPARATION = 'separation'; | ||
case AGGRESSOR_PARENT_HAS_CONTACT_WITH_CHILDREN = 'aggressor_parent_has_contact_with_children'; | ||
case AGGRESSOR_PARENT_THREATEN_THE_VICTIM_IN_THE_VISITATION_PROGRAM = 'aggressor_parent_threaten_the_victim_in_the_visitation_program'; | ||
case CHILDREN_FROM_OTHER_MARRIAGE_ARE_INTEGRATED_INTO_FAMILY = 'children_from_other_marriage_are_integrated_into_family'; | ||
case DOMESTIC_VIOLENCE_DURING_PREGNANCY = 'domestic_violence_during_pregnancy'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'beneficiary.section.initial_evaluation.labels'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum Applicant: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case BENEFICIARY = 'beneficiary'; | ||
case OTHER = 'other'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.applicant'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum Frequency: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case DAILY = 'daily'; | ||
case WEEKLY = 'weekly'; | ||
case MONTHLY = 'monthly'; | ||
case LASS_THAN_MONTHLY = 'lass_than_monthly'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.frequency'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum Helps: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case TEMPORARY_SHELTER = 'temporary_shelter'; | ||
case EMERGENCY_BAG_STORAGE = 'emergency_bag_storage'; | ||
case FINANCIAL_SUPPORT = 'financial_support'; | ||
case EMOTIONAL_SUPPORT = 'emotional_support'; | ||
case ACCOMPANYING_ACTIONS = 'accompanying_actions'; | ||
case EMERGENCY_CALL = 'emergency_call'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.helps'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum Level: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case HIGH = 'high'; | ||
case MEDIUM = 'medium'; | ||
case LOW = 'low'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.level'; | ||
} | ||
|
||
public static function colors(): array | ||
{ | ||
return [ | ||
'success' => Level::LOW, | ||
'warning' => Level::MEDIUM, | ||
'danger' => Level::HIGH, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum RecommendationService: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case PSYCHOLOGICAL_ADVICE = 'psychological_advice'; | ||
case LEGAL_ADVICE = 'legal_advice'; | ||
case LEGAL_ASSISTANCE = 'legal_assistance'; | ||
case FAMILY_COUNSELING = 'family_counseling'; | ||
case PRENATAL_ADVICE = 'prenatal_advice'; | ||
case SOCIAL_ADVICE = 'social_advice'; | ||
case MEDICAL_SERVICES = 'medical_services'; | ||
case MEDICAL_PAYMENT = 'medical_payment'; | ||
case SECURING_RESIDENTIAL_SPACES = 'securing_residential_spaces'; | ||
case OCCUPATIONAL_PROGRAM_SERVICES = 'occupational_program_services'; | ||
case EDUCATIONAL_SERVICES_FOR_CHILDREN = 'educational_services_for_children'; | ||
case TEMPORARY_SHELTER_SERVICES = 'temporary_shelter_services'; | ||
case PROTECTION_ORDER = 'protection_order'; | ||
case CRISIS_ASSISTANCE = 'crisis_assistance'; | ||
case SAFETY_PLAN = 'safety_plan'; | ||
case OTHER_SERVICES = 'other_services'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'beneficiary.section.detailed_evaluation.labels'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum RiskFactorsSchema: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case AGGRESSOR_PRESENT_RISK_RELATED_TO_VICES = 'aggressor_present_risk_related_to_vices'; | ||
case AGGRESSOR_IS_POSSESSIVE_OR_JEALOUS = 'aggressor_is_possessive_or_jealous'; | ||
case AGGRESSOR_HAVE_MENTAL_PROBLEMS = 'aggressor_have_mental_problems'; | ||
case AGGRESSOR_PRESENT_MANIFESTATIONS_OF_ECONOMIC_STRESS = 'aggressor_present_manifestations_of_economic_stress'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'beneficiary.section.initial_evaluation.labels'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum Role: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case COORDINATOR = 'coordinator'; | ||
case MANGER = 'manger'; | ||
case CHEF_MANAGER = 'chef_manager'; | ||
case CHEF_SERVICE = 'chef_service'; | ||
case PSYCHOLOGICAL_ADVICE = 'psychological_advice'; | ||
case PSYCHOTHERAPIST = 'psychotherapist'; | ||
case CLINICAL_PSYCHOLOGIST = 'clinical_psychologist'; | ||
case PSYCHO_PEDAGOGUE = 'psycho_pedagogue'; | ||
case SOCIAL_WORKER = 'social_worker'; | ||
case LEGAL_ADVISOR = 'legal_advisor'; | ||
case FACILITATOR = 'facilitator'; | ||
case TRAINER = 'trainer'; | ||
case DOCTOR = 'doctor'; | ||
case MEDICAL_ASSISTANT = 'medical_assistant'; | ||
case OCCUPATIONAL_THERAPIST = 'occupational_therapist'; | ||
case OTHER = 'other'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.role'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum VictimPerceptionOfTheRiskSchema: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case VICTIM_AFRAID_FOR_HIMSELF = 'victim_afraid_for_himself'; | ||
case VICTIM_HAS_AN_ATTITUDE_OF_ACCEPTANCE = 'victim_has_an_attitude_of_acceptance'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'beneficiary.section.initial_evaluation.labels'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum ViolenceHistorySchema: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case PREVIOUS_ACTS_OF_VIOLENCE = 'previous_acts_of_violence'; | ||
case VIOLENCE_AGAINST_CHILDREN_OR_FAMILY_MEMBERS = 'violence_against_children_or_family_members'; | ||
case ABUSER_EXHIBITED_GENERALIZED_VIOLENT = 'abuser_exhibited_generalized_violent'; | ||
case PROTECTION_ORDER_IN_PAST = 'protection_order_in_past'; | ||
case ABUSER_VIOLATED_PROTECTION_ORDER = 'abuser_violated_protection_order'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'beneficiary.section.initial_evaluation.labels'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns\Enums\Arrayable; | ||
use App\Concerns\Enums\Comparable; | ||
use App\Concerns\Enums\HasLabel; | ||
|
||
enum ViolencesTypesSchema: string | ||
{ | ||
use Arrayable; | ||
use Comparable; | ||
use HasLabel; | ||
|
||
case FREQUENCY_OF_VIOLENCE_ACTS = 'frequency_of_violence_acts'; | ||
case USE_WEAPONS_IN_ACT_OF_VIOLENCE = 'use_weapons_in_act_of_violence'; | ||
case CONTROLLING_AND_ISOLATING = 'controlling_and_isolating'; | ||
case STALKED_OR_HARASSED = 'stalked_or_harassed'; | ||
case SEXUAL_VIOLENCE = 'sexual_violence'; | ||
case DEATH_THREATS = 'death_threats'; | ||
case STRANGULATION_ATTEMPT = 'strangulation_attempt'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'beneficiary.section.initial_evaluation.labels'; | ||
} | ||
} |
Oops, something went wrong.