#116 - integration with slack #129

Merged
Baakoma merged 19 commits from #116-integration-with-slack into main 2022-04-27 09:57:13 +02:00
33 changed files with 599 additions and 78 deletions
Showing only changes of commit fad4290cc3 - Show all commits

View File

@@ -4,11 +4,22 @@ declare(strict_types=1);
namespace Toby\Architecture\Providers;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider;
use Toby\Domain\Slack\Channels\SlackApiChannel;
class AppServiceProvider extends ServiceProvider
{
public function register()
{
Notification::resolved(function (ChannelManager $service) {
$service->extend("slack", fn(Application $app) => $app->make(SlackApiChannel::class));
});
}
public function boot(): void
{
Carbon::macro("toDisplayString", fn() => $this->translatedFormat("d.m.Y"));

View File

@@ -53,7 +53,6 @@ class CreateAction
$vacationRequest->save();
$days = $this->vacationDaysCalculator->calculateDays(
$vacationRequest->yearPeriod,
$vacationRequest->from,
$vacationRequest->to,
);

View File

@@ -20,7 +20,17 @@ class VacationRequestCreatedNotification extends Notification
public function via(): array
{
return ["mail"];
return ["mail", "slack"];
}
public function toSlack(): string
{
$url = route("vacation.requests.show", ["vacationRequest" => $this->vacationRequest->id]);
return implode("\n", [
$this->buildDescription(),
"<${url}|Zobacz szczegóły>",
]);
}
/**
@@ -80,18 +90,16 @@ class VacationRequestCreatedNotification extends Notification
protected function buildDescription(): string
{
$name = $this->vacationRequest->name;
$appName = config("app.name");
if ($this->vacationRequest->creator()->is($this->vacationRequest->user)) {
return __("The vacation request :title has been created correctly in the :appName.", [
return __("The vacation request :title for user :user has been created successfully.", [
"user" => $this->vacationRequest->user->profile->full_name,
"title" => $name,
"appName" => $appName,
]);
}
return __("The vacation request :title has been created correctly by user :creator on your behalf in the :appName.", [
return __("The vacation request :title has been created successfully by user :creator on your behalf.", [
"title" => $this->vacationRequest->name,
"appName" => $appName,
"creator" => $this->vacationRequest->creator->profile->full_name,
]);
}

View File

@@ -22,7 +22,17 @@ class VacationRequestStatusChangedNotification extends Notification
public function via(): array
{
return ["mail"];
return ["mail", "slack"];
}
public function toSlack(): string
{
$url = route("vacation.requests.show", ["vacationRequest" => $this->vacationRequest->id]);
return implode("\n", [
$this->buildDescription(),
"<${url}|Zobacz szczegóły>",
]);
}
/**
@@ -43,27 +53,17 @@ class VacationRequestStatusChangedNotification extends Notification
protected function buildMailMessage(string $url): MailMessage
{
$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->profile->full_name;
return (new MailMessage())
->greeting(__("Hi :user!", [
"user" => $user,
]))
->subject(__("Vacation request :title has been :status", [
"title" => $title,
"status" => $status,
]))
->line(__("The vacation request :title from user :requester has been :status.", [
"title" => $title,
"requester" => $requester,
"status" => $status,
]))
->subject($this->buildSubject())
->line($this->buildDescription())
->line(__("Vacation type: :type", [
"type" => $type,
]))
@@ -74,4 +74,21 @@ class VacationRequestStatusChangedNotification extends Notification
]))
->action(__("Click here for details"), $url);
}
protected function buildSubject(): string
{
return __("Vacation request :title has been :status", [
"title" => $this->vacationRequest->name,
"status" => $this->vacationRequest->state->label(),
]);
}
protected function buildDescription(): string
{
return __("The vacation request :title from user :requester has been :status.", [
"title" => $this->vacationRequest->name,
"requester" => $this->vacationRequest->user->profile->full_name,
"status" => $this->vacationRequest->state->label(),
]);
}
}

View File

@@ -23,7 +23,17 @@ class VacationRequestWaitsForApprovalNotification extends Notification
public function via(): array
{
return ["mail"];
return ["mail", "slack"];
}
public function toSlack(): string
{
$url = route("vacation.requests.show", ["vacationRequest" => $this->vacationRequest->id]);
return implode("\n", [
$this->buildDescription(),
"<${url}|Zobacz szczegóły>",
]);
}
/**

View File

@@ -0,0 +1,25 @@
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
<?php
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
declare(strict_types=1);
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
namespace Toby\Domain\Slack\Channels;
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
use Illuminate\Http\Client\Response;
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
use Illuminate\Notifications\Notification;
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
use Illuminate\Support\Facades\Http;
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
class SlackApiChannel
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
{
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
public function send($notifiable, Notification $notification): Response
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
{
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
$baseUrl = config("services.slack.url");
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
$url = "{$baseUrl}/chat.postMessage";
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
$channel = $notifiable->routeNotificationFor('slack', $notification);
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
return Http::withToken(config("services.slack.client_token"))
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
->post($url, [
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
"channel" => $channel,
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
"text" => $notification->toSlack(),
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
]);
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
}
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?
}
krzysztofrewak commented 2022-04-26 10:09:19 +02:00 (Migrated from github.com)
Review

Can you type $notifiable?

Can you type `$notifiable`?
krzysztofrewak commented 2022-04-26 10:09:51 +02:00 (Migrated from github.com)
Review

Hm, I don't if I wouldn't put his to Infrastucture directory.

Hm, I don't if I wouldn't put his to Infrastucture directory.
krzysztofrewak commented 2022-04-26 10:11:01 +02:00 (Migrated from github.com)
Review

Could you extract this config to separate method? It would make further testing easier, I think.

Could you extract this config to separate method? It would make further testing easier, I think.
Baakoma commented 2022-04-26 11:00:45 +02:00 (Migrated from github.com)
Review

In general, it can be anything that uses trait Notifiable

In general, it can be anything that uses trait `Notifiable`
krzysztofrewak commented 2022-04-26 11:17:21 +02:00 (Migrated from github.com)
Review

Oh no, maybe you could add some interface fot that?

Oh no, maybe you could add some interface fot that?

View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
use Illuminate\Support\Collection;
use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\AttachmentField;
use Spatie\SlashCommand\Handlers\CatchAll as BaseCatchAllHandler;
use Spatie\SlashCommand\Handlers\SignatureHandler;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
class CatchAll extends BaseCatchAllHandler
{
public function handle(Request $request): Response
{
$response = $this->respondToSlack("Nie rozpoznaję tej komendy: `/{$request->command} {$request->text}`");
[$command] = explode(' ', $this->request->text ?? "");
$alternativeHandlers = $this->findAlternativeHandlers($command);
if ($alternativeHandlers->count()) {
$response->withAttachment($this->getCommandListAttachment($alternativeHandlers));
}
if ($this->containsHelpHandler($alternativeHandlers)) {
$response->withAttachment(Attachment::create()
->setText("Aby wyświetlić wszystkie komendy, napisz: `/toby pomoc`")
);
}
return $response;
}
protected function getCommandListAttachment(Collection $handlers): Attachment
{
$attachmentFields = $handlers
->map(function (SignatureHandler $handler) {
return AttachmentField::create($handler->getFullCommand(), $handler->getDescription());
})
->all();
return Attachment::create()
->setColor('warning')
->setTitle('Czy miałeś na myśli:')
->setFields($attachmentFields);
}
}

View File

@@ -0,0 +1,74 @@
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
<?php
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
declare(strict_types=1);
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
namespace Toby\Domain\Slack\Handlers;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Illuminate\Support\Carbon;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Illuminate\Support\Collection;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Spatie\SlashCommand\Attachment;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Spatie\SlashCommand\Request;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Spatie\SlashCommand\Response;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Spatie\SlashCommand\Handlers\SignatureHandler;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Toby\Domain\Enums\VacationType;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Toby\Domain\VacationTypeConfigRetriever;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Toby\Eloquent\Models\User;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
use Toby\Eloquent\Models\Vacation;
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
class DailySummary extends SignatureHandler
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
{
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
protected $signature = "toby dzisiaj";
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
protected $description = "Podsumowanie";
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
public function handle(Request $request): Response
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
{
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
$configRetriever = app(VacationTypeConfigRetriever::class);
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
$now = Carbon::today();
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
/** @var Collection $absences */
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
$absences = Vacation::query()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->with(["user", "vacationRequest"])
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->whereDate("date", $now)
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->approved()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->whereTypes(VacationType::all()->filter(fn(VacationType $type) => $configRetriever->isVacation($type)))
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->get()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->map(fn(Vacation $vacation) => $vacation->user->profile->full_name);
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
/** @var Collection $remoteDays */
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
$remoteDays = Vacation::query()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->with(["user", "vacationRequest"])
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->whereDate("date", $now)
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->approved()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->whereTypes(VacationType::all()->filter(fn(VacationType $type) => !$configRetriever->isVacation($type)))
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->get()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->map(fn(Vacation $vacation) => $vacation->user->profile->full_name);
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
$birthdays = User::query()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->whereRelation("profile", "birthday", $now)
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->get()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->map(fn(User $user) => $user->profile->full_name);
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
$absencesAttachment = Attachment::create()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setTitle("Nieobecności :palm_tree:")
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setColor('#eab308')
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setText($absences->isNotEmpty() ? $absences->implode("\n") : "Wszyscy dzisiaj pracują :muscle:");
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
$remoteAttachment = Attachment::create()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setTitle("Praca zdalna :house_with_garden:")
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setColor('#d946ef')
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setText($remoteDays->isNotEmpty() ? $remoteDays->implode("\n") : "Wszyscy dzisiaj są w biurze :boom:");
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
$birthdayAttachment = Attachment::create()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setTitle("Urodziny :birthday:")
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setColor('#3C5F97')
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->setText($birthdays->isNotEmpty() ? $birthdays->implode("\n") : "Dzisiaj nikt nie ma urodzin :cry:");
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
return $this->respondToSlack("Podsumowanie dla dnia {$now->toDisplayString()}")
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->withAttachment($absencesAttachment)
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->withAttachment($remoteAttachment)
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->withAttachment($birthdayAttachment)
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
->displayResponseToEveryoneOnChannel();
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
}
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?
}
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $absences = $dailySummaryRetriever->getAbsences($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
            ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);

        $birthdays = $dailySummaryRetriever->getBirthdays($now)
            ->map(fn(User $user): string => $user->profile->full_name);
```suggestion $absences = $dailySummaryRetriever->getAbsences($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $remoteDays = $dailySummaryRetriever->getRemoteDays($now) ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) ->map(fn(User $user): string => $user->profile->full_name); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

What if we would have five more activities? Maybe this could be encapsulated somehow?

What if we would have five more activities? Maybe this could be encapsulated somehow?

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Toby\Domain\Slack;
namespace Toby\Domain\Slack\Handlers;
use Illuminate\Support\Str;
use Spatie\SlashCommand\Request;
@@ -13,13 +13,13 @@ use Toby\Eloquent\Models\User;
class GiveKeysTo extends SignatureHandler
{
protected $signature = "toby klucze:dla {to}";
protected $signature = "toby klucze:dla {użytkownik}";
protected $description = "Daj klucze użytkownikowi {to}";
protected $description = "Daj klucze wskazanemu użytkownikowi";
public function handle(Request $request): Response
{
$to = $this->getArgument('to');
$to = $this->getArgument('użytkownik');
$id = Str::between($to, "@", "|");

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
use Illuminate\Support\Collection;
use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\AttachmentField;
use Spatie\SlashCommand\Handlers\Help as BaseHelpHandler;
use Spatie\SlashCommand\Handlers\SignatureHandler;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
class Help extends BaseHelpHandler
{
protected $signature = "toby pomoc";
protected $description = "Wyświetl wszystkie dostępne komendy tobiego";
public function handle(Request $request): Response
{
$handlers = $this->findAvailableHandlers();
return $this->displayListOfAllCommands($handlers);
}
protected function displayListOfAllCommands(Collection $handlers): Response
{
$attachmentFields = $handlers
->sort(function (SignatureHandler $handlerA, SignatureHandler $handlerB) {
return strcmp($handlerA->getFullCommand(), $handlerB->getFullCommand());
})
->map(function (SignatureHandler $handler) {
return AttachmentField::create("/{$handler->getSignature()}", $handler->getDescription());
})
->all();
return $this->respondToSlack('Dostępne komendy')
->withAttachment(
Attachment::create()
->setColor('good')
->setFields($attachmentFields)
);
}
}

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Toby\Domain\Slack;
namespace Toby\Domain\Slack\Handlers;
use Illuminate\Support\Carbon;
use Spatie\SlashCommand\Request;
@@ -15,12 +15,12 @@ use Toby\Eloquent\Models\YearPeriod;
class HomeOffice extends SignatureHandler
{
protected $signature = "toby zdalnie {date=dzisiaj}";
protected $description = "Praca zdalna {kiedy}";
protected $signature = "toby zdalnie {kiedy?}";
protected $description = "Pracuj zdalnie wybranego dnia (domyślnie dzisiaj)";
public function handle(Request $request): Response
{
$date = $this->getDateFromArgument($this->getArgument('date'));
$date = $this->getDateFromArgument($this->getArgument('kiedy') ?? "dzisiaj");
$user = $this->findUserBySlackId($request->userId);
$yearPeriod = YearPeriod::findByYear($date->year);
@@ -34,7 +34,8 @@ class HomeOffice extends SignatureHandler
"flow_skipped" => false,
], $user);
return $this->respondToSlack("Praca zdalna dnia {$date->toDisplayString()} została utworzona pomyślnie");
return $this->respondToSlack("Praca zdalna dnia {$date->toDisplayString()} została utworzona pomyślnie.")
->displayResponseToEveryoneOnChannel();
}
protected function getDateFromArgument(string $argument): Carbon

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Spatie\SlashCommand\Handlers\SignatureHandler;
use Toby\Eloquent\Models\Key;
class KeyList extends SignatureHandler
{
protected $signature = "toby klucze";
protected $description = "Lista wszystkich kluczy";
public function handle(Request $request): Response
{
$keys = Key::query()
->orderBy("id")
->get()
->map(fn(Key $key) => "Klucz nr {$key->id} - <@{$key->user->profile->slack_id}>");
return $this->respondToSlack("Lista kluczy")
->withAttachment(
Attachment::create()
->setColor('#3C5F97')
->setText($keys->implode("\n"))
);
}
}

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Spatie\SlashCommand\Handlers\SignatureHandler;
class SaySomething extends SignatureHandler
{
protected $signature = "toby powiedz {zdanie}";
protected $description = "Powiedz zdanie";
public function handle(Request $request): Response
{
$sentence = $this->getArgument("zdanie");
return $this->respondToSlack($sentence)
->displayResponseToEveryoneOnChannel();
}
}

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Toby\Domain\Slack;
namespace Toby\Domain\Slack\Handlers;
use Illuminate\Support\Str;
use Spatie\SlashCommand\Request;
@@ -13,13 +13,13 @@ use Toby\Eloquent\Models\User;
class TakeKeysFrom extends SignatureHandler
{
protected $signature = "toby klucze:od {from}";
protected $signature = "toby klucze:od {użytkownik}";
protected $description = "Zabierz klucze użytkownikowi {from}";
protected $description = "Zabierz klucze wskazanemu użytkownikowi";
public function handle(Request $request): Response
{
$from = $this->getArgument('from');
$from = $this->getArgument("użytkownik");
$id = Str::between($from, "@", "|");

View File

@@ -1,30 +0,0 @@
<?php
declare(strict_types=1);
namespace Toby\Domain\Slack;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Spatie\SlashCommand\Handlers\SignatureHandler;
use Toby\Eloquent\Models\Key;
class KeyList extends SignatureHandler
{
protected $signature = "toby klucze";
protected $description = "Lista wszystkich kluczy";
public function handle(Request $request): Response
{
$temp = [];
foreach (Key::orderBy("id")->get() as $key) {
$temp[] = "Klucz nr {$key->id} - <@{$key->user->profile->slack_id}>";
}
return $this->respondToSlack(implode("\n", $temp))
->displayResponseToEveryoneOnChannel();
}
}

View File

@@ -11,9 +11,10 @@ use Toby\Eloquent\Models\YearPeriod;
class VacationDaysCalculator
{
public function calculateDays(YearPeriod $yearPeriod, CarbonInterface $from, CarbonInterface $to): Collection
public function calculateDays(CarbonInterface $from, CarbonInterface $to): Collection
{
$period = CarbonPeriod::create($from, $to);
$yearPeriod = YearPeriod::findByYear($from->year);
$holidays = $yearPeriod->holidays()->pluck("date");
$validDays = new Collection();

View File

@@ -29,7 +29,7 @@ class DoesNotExceedLimitRule implements VacationRequestRule
$limit = $this->getUserVacationLimit($vacationRequest->user, $vacationRequest->yearPeriod);
$vacationDays = $this->getVacationDaysWithLimit($vacationRequest->user, $vacationRequest->yearPeriod);
$estimatedDays = $this->vacationDaysCalculator->calculateDays($vacationRequest->yearPeriod, $vacationRequest->from, $vacationRequest->to)->count();
$estimatedDays = $this->vacationDaysCalculator->calculateDays($vacationRequest->from, $vacationRequest->to)->count();
return $limit >= ($vacationDays + $estimatedDays);
}

View File

@@ -16,7 +16,7 @@ class MinimumOneVacationDayRule implements VacationRequestRule
public function check(VacationRequest $vacationRequest): bool
{
return $this->vacationDaysCalculator
->calculateDays($vacationRequest->yearPeriod, $vacationRequest->from, $vacationRequest->to)
->calculateDays($vacationRequest->from, $vacationRequest->to)
->isNotEmpty();
}

View File

@@ -19,6 +19,7 @@ use Toby\Eloquent\Helpers\ColorGenerator;
* @property string $position
* @property EmploymentForm $employment_form
* @property Carbon $employment_date
* @property Carbon $birthday
*/
class Profile extends Model
{
@@ -32,6 +33,7 @@ class Profile extends Model
protected $casts = [
"employment_form" => EmploymentForm::class,
"employment_date" => "date",
"birthday" => "date",
];
public function user(): BelongsTo

View File

@@ -125,6 +125,11 @@ class User extends Authenticatable
);
}
public function routeNotificationForSlack()
{
return $this->profile->slack_id;
}
protected static function newFactory(): UserFactory
{
return UserFactory::new();

View File

@@ -0,0 +1,97 @@
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
<?php
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
declare(strict_types=1);
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
namespace Toby\Infrastructure\Console\Commands;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Carbon\CarbonInterface;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Illuminate\Console\Command;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Illuminate\Support\Carbon;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Illuminate\Support\Collection;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Illuminate\Support\Facades\Http;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Spatie\SlashCommand\Attachment;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Toby\Domain\Enums\VacationType;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Toby\Domain\VacationTypeConfigRetriever;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Toby\Eloquent\Models\Holiday;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Toby\Eloquent\Models\User;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
use Toby\Eloquent\Models\Vacation;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
class SendDailySummaryToSlack extends Command
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
{
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
protected $signature = "toby:slack:daily-summary {--f|force}";
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
protected $description = "Sent daily summary to slack";
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
public function handle(VacationTypeConfigRetriever $configRetriever): void
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
{
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$now = Carbon::today();
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
if (!$this->option("force") && !$this->shouldHandle($now)) {
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
return;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
}
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
/** @var Collection $absences */
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$absences = Vacation::query()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->with(["user", "vacationRequest"])
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->whereDate("date", $now)
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->approved()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->whereTypes(VacationType::all()->filter(fn(VacationType $type) => $configRetriever->isVacation($type)))
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->get()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->map(fn(Vacation $vacation) => $vacation->user->profile->full_name);
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
/** @var Collection $remoteDays */
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$remoteDays = Vacation::query()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->with(["user", "vacationRequest"])
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->whereDate("date", $now)
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->approved()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->whereTypes(VacationType::all()->filter(fn(VacationType $type) => !$configRetriever->isVacation($type)))
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->get()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->map(fn(Vacation $vacation) => $vacation->user->profile->full_name);
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$birthdays = User::query()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->whereRelation("profile", "birthday", $now)
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->get()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->map(fn(User $user) => $user->profile->full_name);
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$absencesAttachment = Attachment::create()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setTitle("Nieobecności :palm_tree:")
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setColor('#eab308')
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setText($absences->isNotEmpty() ? $absences->implode("\n") : "Wszyscy dzisiaj pracują :muscle:");
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$remoteAttachment = Attachment::create()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setTitle("Praca zdalna :house_with_garden:")
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setColor('#d946ef')
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setText($remoteDays->isNotEmpty() ? $remoteDays->implode("\n") : "Wszyscy dzisiaj są w biurze :boom:");
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$birthdayAttachment = Attachment::create()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setTitle("Urodziny :birthday:")
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setColor('#3C5F97')
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->setText($birthdays->isNotEmpty() ? $birthdays->implode("\n") : "Dzisiaj nikt nie ma urodzin :cry:");
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$baseUrl = config("services.slack.url");
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$url = "{$baseUrl}/chat.postMessage";
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
Http::withToken(config("services.slack.client_token"))
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
->post($url, [
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
"channel" => config("services.slack.default_channel"),
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
"text" => "Podsumowanie dla dnia {$now->toDisplayString()}",
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
'attachments' => collect([$absencesAttachment, $remoteAttachment, $birthdayAttachment])->map(
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
fn(Attachment $attachment) => $attachment->toArray()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
)->toArray(),
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
]);
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
}
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
protected function shouldHandle(CarbonInterface $day): bool
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
{
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
$holidays = Holiday::query()->whereDate("date", $day)->pluck("date");
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
if ($day->isWeekend()) {
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
return false;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
}
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
if ($holidays->contains($day)) {
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
return false;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
}
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
return true;
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
}
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
}
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

These attachments are almost the same as somewhere above. There should be some abstraction for that.

These attachments are almost the same as somewhere above. There should be some abstraction for that.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.

View File

@@ -14,7 +14,7 @@ class CalculateVacationDaysController extends Controller
{
public function __invoke(CalculateVacationDaysRequest $request, VacationDaysCalculator $calculator): JsonResponse
{
$days = $calculator->calculateDays($request->yearPeriod(), $request->from(), $request->to());
$days = $calculator->calculateDays($request->from(), $request->to());
return new JsonResponse($days->map(fn(Carbon $day) => $day->toDateString())->all());
}

View File

@@ -22,6 +22,7 @@ class UserRequest extends FormRequest
"position" => ["required"],
"employmentForm" => ["required", new Enum(EmploymentForm::class)],
"employmentDate" => ["required", "date_format:Y-m-d"],
"birthday" => ["nullable", "date_format:Y-m-d"],
];
}
@@ -41,6 +42,7 @@ class UserRequest extends FormRequest
"position" => $this->get("position"),
"employment_form" => $this->get("employmentForm"),
"employment_date" => $this->get("employmentDate"),
"birthday" => $this->get("birthday"),
];
}
}

View File

@@ -21,6 +21,7 @@ class UserFormDataResource extends JsonResource
"position" => $this->profile->position,
"employmentForm" => $this->profile->employment_form,
"employmentDate" => $this->profile->employment_date->toDateString(),
"birthday" => $this->profile->birthday->toDateString(),
];
}
}

View File

@@ -38,7 +38,6 @@ return [
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Barryvdh\DomPDF\ServiceProvider::class,
Spatie\SlashCommand\SlashCommandServiceProvider::class,
Toby\Architecture\Providers\AppServiceProvider::class,
Toby\Architecture\Providers\AuthServiceProvider::class,
Toby\Architecture\Providers\EventServiceProvider::class,

View File

@@ -1,9 +1,15 @@
<?php
use Toby\Domain\Slack\GiveKeysTo;
use Toby\Domain\Slack\HomeOffice;
use Toby\Domain\Slack\KeyList;
use Toby\Domain\Slack\TakeKeysFrom;
declare(strict_types=1);
use Toby\Domain\Slack\Handlers\CatchAll;
use Toby\Domain\Slack\Handlers\DailySummary;
use Toby\Domain\Slack\Handlers\GiveKeysTo;
use Toby\Domain\Slack\Handlers\Help;
use Toby\Domain\Slack\Handlers\HomeOffice;
use Toby\Domain\Slack\Handlers\KeyList;
use Toby\Domain\Slack\Handlers\SaySomething;
use Toby\Domain\Slack\Handlers\TakeKeysFrom;
return [
'url' => 'api/slack',
@@ -14,7 +20,9 @@ return [
GiveKeysTo::class,
KeyList::class,
HomeOffice::class,
Spatie\SlashCommand\Handlers\Help::class,
Spatie\SlashCommand\Handlers\CatchAll::class,
DailySummary::class,
SaySomething::class,
Help::class,
CatchAll::class
],
];

View File

@@ -8,4 +8,9 @@ return [
"client_secret" => env("GOOGLE_CLIENT_SECRET"),
"redirect" => env("GOOGLE_REDIRECT"),
],
"slack" => [
"url" => "https://slack.com/api",
"client_token" => env("SLACK_CLIENT_TOKEN"),
"default_channel" => env("SLACK_DEFAULT_CHANNEL"),
],
];

View File

@@ -23,6 +23,7 @@ class ProfileFactory extends Factory
"employment_form" => $this->faker->randomElement(EmploymentForm::cases()),
"position" => $this->faker->jobTitle(),
"employment_date" => Carbon::createFromInterface($this->faker->dateTimeBetween("2020-10-27"))->toDateString(),
"birthday" => Carbon::createFromInterface($this->faker->dateTimeBetween("1970-01-01", "1998-01-01"))->toDateString(),
];
}
}

View File

@@ -11,13 +11,15 @@ return new class() extends Migration {
{
Schema::table("profiles", function (Blueprint $table): void {
$table->string("slack_id")->nullable();
$table->date("birthday")->nullable();
});
}
public function down(): void
{
Schema::table("profiles", function (Blueprint $table): void {
$table->string("slack_id");
$table->dropColumn("slack_id");
$table->dropColumn("birthday");
});
}
};

View File

@@ -234,6 +234,29 @@
</p>
</div>
</div>
<div class="items-center py-4 sm:grid sm:grid-cols-3">
<label
for="birthday"
class="block text-sm font-medium text-gray-700 sm:mt-px"
>
Data urodzenia
</label>
<div class="mt-1 sm:col-span-2 sm:mt-0">
<FlatPickr
id="birthday"
v-model="form.birthday"
placeholder="Wybierz datę"
class="block w-full max-w-lg rounded-md shadow-sm sm:text-sm"
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors.birthday, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.birthday }"
/>
<p
v-if="form.errors.birthday"
class="mt-2 text-sm text-red-600"
>
{{ form.errors.birthday }}
</p>
</div>
</div>
<div class="flex justify-end py-3">
<div class="space-x-3">
<InertiaLink
@@ -274,6 +297,7 @@ const form = useForm({
role: props.roles[0],
position: null,
employmentDate: null,
birthday: null,
})
function createUser() {

View File

@@ -241,6 +241,29 @@
</p>
</div>
</div>
<div class="items-center py-4 sm:grid sm:grid-cols-3">
<label
for="birthday"
class="block text-sm font-medium text-gray-700 sm:mt-px"
>
Data urodzenia
</label>
<div class="mt-1 sm:col-span-2 sm:mt-0">
<FlatPickr
id="birthday"
v-model="form.birthday"
placeholder="Wybierz datę"
class="block w-full max-w-lg rounded-md shadow-sm sm:text-sm"
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors.birthday, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.birthday }"
/>
<p
v-if="form.errors.birthday"
class="mt-2 text-sm text-red-600"
>
{{ form.errors.birthday }}
</p>
</div>
</div>
<div class="flex justify-end py-3">
<div class="space-x-3">
<InertiaLink
@@ -282,6 +305,7 @@ const form = useForm({
position: props.user.position,
employmentForm: props.employmentForms.find(form => form.value === props.user.employmentForm),
employmentDate: props.user.employmentDate,
birthday: props.user.birthday,
})
function editUser() {

View File

@@ -56,7 +56,7 @@
"All rights reserved.": "Wszelkie prawa zastrzeżone",
"Show vacation request": "Pokaż wniosek",
"Vacation request :title has been created" : "Wniosek :title został utworzony",
"The vacation request :title has been created correctly in the :appName.": "W systemie :appName został poprawnie utworzony wniosek urlopowy :title.",
"The vacation request :title from user :requester has been created sucessfully.": "Wniosek :title użytkownika :requester został utworzony pomyślnie.",
"Vacation type: :type": "Rodzaj wniosku: :type",
"From :from to :to (number of days: :days)": "Od :from do :to (liczba dni: :days)",
"Click here for details": "Kliknij, aby zobaczyć szczegóły",
@@ -67,7 +67,7 @@
"Vacation request :title has been :status": "Wniosek :title został :status",
"The vacation request :title from user :requester has been :status.": "Wniosek urlopowy :title użytkownika :requester został :status.",
"Vacation request :title has been created on your behalf": "Wniosek urlopowy :title został utworzony w Twoim imieniu",
"The vacation request :title has been created correctly by user :creator on your behalf in the :appName.": "W systemie :appName został poprawnie utworzony wniosek urlopowy :title w Twoim imieniu przez użytkownika :creator.",
"The vacation request :title has been created successfully by user :creator on your behalf.": "Wniosek urlopowy :title został pomyślnie utworzony w Twoim imieniu przez użytkownika :creator.",
"Key no :number has been created.": "Klucz nr :number został utworzony.",
"Key no :number has been deleted.": "Klucz nr :number został usunięty.",
"Key no :number has been taken from :user.": "Klucz nr :number został zabrany użytkownikowi :user.",

View File

@@ -0,0 +1,82 @@
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
<?php
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
declare(strict_types=1);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
namespace Tests\Unit;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use Illuminate\Foundation\Testing\RefreshDatabase;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use Illuminate\Support\Carbon;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use Illuminate\Support\Facades\Http;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use Tests\TestCase;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use Tests\Traits\InteractsWithYearPeriods;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use Toby\Eloquent\Models\Holiday;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use Toby\Infrastructure\Console\Commands\SendDailySummaryToSlack;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
class SendDailySummaryToSlackTest extends TestCase
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
{
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use RefreshDatabase;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
use InteractsWithYearPeriods;
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
protected function setUp(): void
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
{
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
parent::setUp();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
Http::fake();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->createCurrentYearPeriod();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
}
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
public function testCommandSendsMessageToSlackIfWeekday(): void
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
{
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$weekDay = Carbon::create(2022, 4, 22);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->assertTrue($weekDay->isWeekday());
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->travelTo($weekDay);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->artisan(SendDailySummaryToSlack::class)
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
->execute();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
Http::assertSentCount(1);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
}
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
public function testCommandDoesntSendIfIsWeekend(): void
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
{
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$weekend = Carbon::create(2022, 4, 23);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->assertTrue($weekend->isWeekend());
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->travelTo($weekend);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->artisan(SendDailySummaryToSlack::class)
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
->execute();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
Http::assertNothingSent();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
}
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
public function testCommandDoesntSendIfIsHoliday(): void
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
{
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$holiday = Holiday::factory(["date" => Carbon::create(2022, 4, 22)])->create();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->assertDatabaseHas("holidays", [
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
"date" => $holiday->date->toDateString(),
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
]);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->travelTo(Carbon::create(2022, 4, 22));
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->artisan(SendDailySummaryToSlack::class)
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
->execute();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
Http::assertNothingSent();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
}
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
public function testCommandForceSendsMessageEvenIsWeekendOrHoliday(): void
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
{
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$weekend = Carbon::create(2022, 4, 23);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->assertTrue($weekend->isWeekend());
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->travelTo($weekend);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
$this->artisan(SendDailySummaryToSlack::class, ["--force" => true])
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
->execute();
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
Http::assertSentCount(1);
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
}
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```
}
EwelinaLasowy commented 2022-04-26 14:22:36 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfWeekend(): void
```suggestion public function testCommandDoesntSendMessageIfWeekend(): void ```
EwelinaLasowy commented 2022-04-26 14:23:25 +02:00 (Migrated from github.com)
Review
    public function testCommandDoesntSendMessageIfHoliday(): void
```suggestion public function testCommandDoesntSendMessageIfHoliday(): void ```