* fix css focuses * #90 - wip * #90 - fix to generate PDF * #90 - wip * #90 - wip * #90 - wip * #90 - wip * #90 - fix to calendar * #90 - wip * #90 - fix * #90 - fix lint * #90 - fix * Apply suggestions from code review Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com> Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com> * #90 - cr fixes * #90 - fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com> Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com>
This commit is contained in:
@@ -9,12 +9,14 @@ use Toby\Eloquent\Models\YearPeriod;
|
||||
|
||||
class CreateUserAction
|
||||
{
|
||||
public function execute(array $data): User
|
||||
public function execute(array $userData, array $profileData): User
|
||||
{
|
||||
$user = new User($data);
|
||||
$user = new User($userData);
|
||||
|
||||
$user->save();
|
||||
|
||||
$user->profile()->create($profileData);
|
||||
|
||||
$this->createVacationLimitsFor($user);
|
||||
|
||||
return $user;
|
||||
|
19
app/Domain/Actions/UpdateUserAction.php
Normal file
19
app/Domain/Actions/UpdateUserAction.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Domain\Actions;
|
||||
|
||||
use Toby\Eloquent\Models\User;
|
||||
|
||||
class UpdateUserAction
|
||||
{
|
||||
public function execute(User $user, array $userData, array $profileData): User
|
||||
{
|
||||
$user->update($userData);
|
||||
|
||||
$user->profile->update($profileData);
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
@@ -39,7 +39,7 @@ class VacationRequestCreatedNotification extends Notification
|
||||
|
||||
protected function buildMailMessage(string $url): MailMessage
|
||||
{
|
||||
$user = $this->vacationRequest->user->first_name;
|
||||
$user = $this->vacationRequest->user->profile->first_name;
|
||||
$type = $this->vacationRequest->type->label();
|
||||
$from = $this->vacationRequest->from->toDisplayString();
|
||||
$to = $this->vacationRequest->to->toDisplayString();
|
||||
@@ -92,7 +92,7 @@ class VacationRequestCreatedNotification extends Notification
|
||||
return __("The vacation request :title has been created correctly by user :creator on your behalf in the :appName.", [
|
||||
"title" => $this->vacationRequest->name,
|
||||
"appName" => $appName,
|
||||
"creator" => $this->vacationRequest->creator->fullName,
|
||||
"creator" => $this->vacationRequest->creator->profile->full_name,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -42,14 +42,14 @@ class VacationRequestStatusChangedNotification extends Notification
|
||||
|
||||
protected function buildMailMessage(string $url): MailMessage
|
||||
{
|
||||
$user = $this->user->first_name;
|
||||
$user = $this->user->profile->first_name;
|
||||
$title = $this->vacationRequest->name;
|
||||
$type = $this->vacationRequest->type->label();
|
||||
$status = $this->vacationRequest->state->label();
|
||||
$from = $this->vacationRequest->from->toDisplayString();
|
||||
$to = $this->vacationRequest->to->toDisplayString();
|
||||
$days = $this->vacationRequest->vacations()->count();
|
||||
$requester = $this->vacationRequest->user->fullName;
|
||||
$requester = $this->vacationRequest->user->profile->full_name;
|
||||
|
||||
return (new MailMessage())
|
||||
->greeting(__("Hi :user!", [
|
||||
@@ -59,7 +59,7 @@ class VacationRequestStatusChangedNotification extends Notification
|
||||
"title" => $title,
|
||||
"status" => $status,
|
||||
]))
|
||||
->line(__("The vacation request :title for user :requester has been :status.", [
|
||||
->line(__("The vacation request :title from user :requester has been :status.", [
|
||||
"title" => $title,
|
||||
"requester" => $requester,
|
||||
"status" => $status,
|
||||
|
@@ -43,7 +43,7 @@ class VacationRequestWaitsForApprovalNotification extends Notification
|
||||
|
||||
protected function buildMailMessage(string $url): MailMessage
|
||||
{
|
||||
$user = $this->user->first_name;
|
||||
$user = $this->user->profile->first_name;
|
||||
$type = $this->vacationRequest->type->label();
|
||||
$from = $this->vacationRequest->from->toDisplayString();
|
||||
$to = $this->vacationRequest->to->toDisplayString();
|
||||
@@ -84,7 +84,7 @@ class VacationRequestWaitsForApprovalNotification extends Notification
|
||||
protected function buildDescription(): string
|
||||
{
|
||||
$title = $this->vacationRequest->name;
|
||||
$requester = $this->vacationRequest->user->fullName;
|
||||
$requester = $this->vacationRequest->user->profile->full_name;
|
||||
|
||||
if ($this->vacationRequest->state->equals(WaitingForTechnical::class)) {
|
||||
return __("The vacation request :title from user :requester is waiting for your technical approval.", [
|
||||
|
@@ -46,7 +46,7 @@ class TimesheetPerUserSheet implements WithTitle, WithHeadings, WithEvents, With
|
||||
|
||||
public function title(): string
|
||||
{
|
||||
return $this->user->fullName;
|
||||
return $this->user->profile->full_name;
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
|
Reference in New Issue
Block a user