Skip to content

Commit

Permalink
Merge branch 'main' into portabilis-2023-07-07
Browse files Browse the repository at this point in the history
  • Loading branch information
edersoares committed Sep 7, 2023
2 parents 243d2f7 + edc9876 commit d3926fe
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

steps:
- name: Setup PHP
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.build
/database/backups
/database/data
/database/migrations/extras
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Enums/AbsenceDelayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public function name(): string

public static function getDescriptiveValues(): Collection
{
return collect(self::cases())->map(fn ($item) => $item->name());
return collect(self::cases())->mapWithKeys(fn (AbsenceDelayType $type) => [$type->value => $type->name()]);
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@
"sort-packages": true,
"optimize-autoloader": true,
"allow-plugins": {
"dex/composer-plug-and-play": true
"dex/composer-plug-and-play": true,
"pestphp/pest-plugin": true
}
},
"minimum-stability": "dev",
Expand Down
1 change: 1 addition & 0 deletions database/factories/LegacyCourseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function definition(): array
'hora_falta' => 0.75,
'ativo' => 1,
'modalidade_curso' => ModalidadeCurso::ENSINO_REGULAR,
'data_cadastro' => now(),
];
}

Expand Down
18 changes: 18 additions & 0 deletions database/factories/LegacyIndividualFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ public function current(): LegacyIndividual
]);
}

public function withName(string $name): static
{
return $this->afterCreating(function (LegacyIndividual $individual) use ($name) {
$individual->person->nome = $name;
});
}

public function withDocument(?string $rg = null, ?string $birthCertificate = null): static
{
return $this->afterCreating(function (LegacyIndividual $individual) use ($rg, $birthCertificate) {
LegacyDocumentFactory::new()->create([
'idpes' => $individual->getKey(),
'rg' => $rg,
'certidao_nascimento' => $birthCertificate,
]);
});
}

public function withAge(int $age): static
{
$year = now()->year - $age;
Expand Down
2 changes: 0 additions & 2 deletions ieducar/intranet/educar_falta_atraso_cad.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ public function Editar()
return false;
}

dd('eu');

$this->data_falta_atraso = Portabilis_Date_Utils::brToPgSQL($this->data_falta_atraso);
if ($this->tipo == 1) {
$obj = LegacyAbsenceDelay::find($this->cod_falta_atraso);
Expand Down

0 comments on commit d3926fe

Please sign in to comment.