#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
54 changed files with 361 additions and 211 deletions
Showing only changes of commit 7f5e462e4d - Show all commits

View File

@@ -9,19 +9,19 @@ use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider;
use Toby\Domain\Slack\Channels\SlackApiChannel;
use Toby\Infrastructure\Slack\Channels\SlackApiChannel;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
Notification::resolved(function (ChannelManager $service): void {
$service->extend("slack", fn(Application $app) => $app->make(SlackApiChannel::class));
$service->extend("slack", fn(Application $app): SlackApiChannel => $app->make(SlackApiChannel::class));
});
}
public function boot(): void
{
Carbon::macro("toDisplayString", fn() => $this->translatedFormat("d.m.Y"));
Carbon::macro("toDisplayString", fn(): string => $this->translatedFormat("d.m.Y"));
}
}

View File

@@ -30,10 +30,10 @@ class AuthServiceProvider extends ServiceProvider
}
});
Gate::define("manageUsers", fn(User $user) => $user->role === Role::AdministrativeApprover);
Gate::define("manageHolidays", fn(User $user) => $user->role === Role::AdministrativeApprover);
Gate::define("manageVacationLimits", fn(User $user) => $user->role === Role::AdministrativeApprover);
Gate::define("generateTimesheet", fn(User $user) => $user->role === Role::AdministrativeApprover);
Gate::define("listMonthlyUsage", fn(User $user) => $user->role === Role::AdministrativeApprover);
Gate::define("manageUsers", fn(User $user): bool => $user->role === Role::AdministrativeApprover);
Gate::define("manageHolidays", fn(User $user): bool => $user->role === Role::AdministrativeApprover);
Gate::define("manageVacationLimits", fn(User $user): bool => $user->role === Role::AdministrativeApprover);
Gate::define("generateTimesheet", fn(User $user): bool => $user->role === Role::AdministrativeApprover);
Gate::define("listMonthlyUsage", fn(User $user): bool => $user->role === Role::AdministrativeApprover);
}
}

View File

@@ -28,6 +28,6 @@ class RouteServiceProvider extends ServiceProvider
protected function configureRateLimiting(): void
{
RateLimiter::for("api", fn(Request $request) => Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()));
RateLimiter::for("api", fn(Request $request): Limit => Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()));
}
}

View File

@@ -57,6 +57,6 @@ class CalendarGenerator
->approved()
->with("vacationRequest")
->get()
->groupBy(fn(Vacation $vacation) => $vacation->date->toDateString());
->groupBy(fn(Vacation $vacation): string => $vacation->date->toDateString());
}
}

View File

@@ -22,7 +22,9 @@ class DailySummaryRetriever
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
->with(["user", "vacationRequest"])
->whereDate("date", $date)
->approved()
->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
->whereTypes(
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)),
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
)
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
->get();
}
@@ -32,7 +34,9 @@ class DailySummaryRetriever
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
->with(["user", "vacationRequest"])
->whereDate("date", $date)
->approved()
->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
->whereTypes(
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)),
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
)
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
->get();
}
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:42 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```
krzysztofrewak commented 2022-04-26 10:07:53 +02:00 (Migrated from github.com)
Review
            ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
```suggestion ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type))) ```

View File

@@ -21,7 +21,7 @@ enum EmploymentForm: string
$cases = collect(EmploymentForm::cases());
return $cases->map(
fn(EmploymentForm $enum) => [
fn(EmploymentForm $enum): array => [
"label" => $enum->label(),
"value" => $enum->value,
],

View File

@@ -21,7 +21,7 @@ enum Role: string
$cases = collect(Role::cases());
return $cases->map(
fn(Role $enum) => [
fn(Role $enum): array => [
"label" => $enum->label(),
"value" => $enum->value,
],

View File

@@ -30,7 +30,7 @@ enum VacationType: string
$cases = VacationType::all();
return $cases->map(
fn(VacationType $enum) => [
fn(VacationType $enum): array => [
"label" => $enum->label(),
"value" => $enum->value,
],

View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Toby\Domain\Notifications;
class Channels
{
public const MAIL = "mail";
public const SLACK = "slack";
}

View File

@@ -19,10 +19,10 @@ class KeyHasBeenGivenNotification extends Notification
krzysztofrewak commented 2022-04-26 10:08:38 +02:00 (Migrated from github.com)
Review

Maybe these "slack" and other channels could be gathered somewhere and used as constants or enums?

Maybe these `"slack"` and other channels could be gathered somewhere and used as constants or enums?
krzysztofrewak commented 2022-04-26 10:08:38 +02:00 (Migrated from github.com)
Review

Maybe these "slack" and other channels could be gathered somewhere and used as constants or enums?

Maybe these `"slack"` and other channels could be gathered somewhere and used as constants or enums?
public function via(): array
{
return ["slack"];
krzysztofrewak commented 2022-04-26 10:08:38 +02:00 (Migrated from github.com)
Review

Maybe these "slack" and other channels could be gathered somewhere and used as constants or enums?

Maybe these `"slack"` and other channels could be gathered somewhere and used as constants or enums?
return [Channels::SLACK];
krzysztofrewak commented 2022-04-26 10:08:38 +02:00 (Migrated from github.com)
Review

Maybe these "slack" and other channels could be gathered somewhere and used as constants or enums?

Maybe these `"slack"` and other channels could be gathered somewhere and used as constants or enums?
}
public function toSlack($notifiable): string
krzysztofrewak commented 2022-04-26 10:08:38 +02:00 (Migrated from github.com)
Review

Maybe these "slack" and other channels could be gathered somewhere and used as constants or enums?

Maybe these `"slack"` and other channels could be gathered somewhere and used as constants or enums?
public function toSlack(Notifiable $notifiable): string
krzysztofrewak commented 2022-04-26 10:08:38 +02:00 (Migrated from github.com)
Review

Maybe these "slack" and other channels could be gathered somewhere and used as constants or enums?

Maybe these `"slack"` and other channels could be gathered somewhere and used as constants or enums?
{
return __(":sender gives key no :key to :recipient", [
"sender" => $this->getName($this->sender),
krzysztofrewak commented 2022-04-26 10:08:38 +02:00 (Migrated from github.com)
Review

Maybe these "slack" and other channels could be gathered somewhere and used as constants or enums?

Maybe these `"slack"` and other channels could be gathered somewhere and used as constants or enums?
krzysztofrewak commented 2022-04-26 10:08:38 +02:00 (Migrated from github.com)
Review

Maybe these "slack" and other channels could be gathered somewhere and used as constants or enums?

Maybe these `"slack"` and other channels could be gathered somewhere and used as constants or enums?

View File

@@ -19,10 +19,10 @@ class KeyHasBeenTakenNotification extends Notification
public function via(): array
{
return ["slack"];
return [Channels::SLACK];
}
public function toSlack($notifiable): string
public function toSlack(Notifiable $notifiable): string
{
return __(":recipient takes key no :key from :sender", [
"recipient" => $this->getName($this->recipient),

View File

@@ -0,0 +1,10 @@
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
<?php
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
declare(strict_types=1);
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
namespace Toby\Domain\Notifications;
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
interface Notifiable
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
{
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
public function notify($instance);
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:
}
krzysztofrewak commented 2022-04-27 09:14:59 +02:00 (Migrated from github.com)
Review

👀

:eyes:

View File

@@ -20,7 +20,7 @@ class VacationRequestCreatedNotification extends Notification
public function via(): array
{
return ["mail", "slack"];
return [Channels::MAIL, Channels::SLACK];
}
public function toSlack(): string

View File

@@ -22,7 +22,7 @@ class VacationRequestStatusChangedNotification extends Notification
public function via(): array
{
return ["mail", "slack"];
return [Channels::MAIL, Channels::SLACK];
}
public function toSlack(): string

View File

@@ -23,7 +23,7 @@ class VacationRequestWaitsForApprovalNotification extends Notification
public function via(): array
{
return ["mail", "slack"];
return [Channels::MAIL, Channels::SLACK];
}
public function toSlack(): string

View File

@@ -26,7 +26,7 @@ class PolishHolidaysRetriever
protected function prepareHolidays(array $holidays): Collection
{
return collect($holidays)->map(fn(Holiday $holiday) => [
return collect($holidays)->map(fn(Holiday $holiday): array => [
"name" => $holiday->getName([static::LANG_KEY]),
"date" => Carbon::createFromTimestamp($holiday->getTimestamp()),
])->values();

View File

@@ -1,25 +0,0 @@
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($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: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

@@ -1,55 +0,0 @@
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 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 Toby\Domain\DailySummaryRetriever;
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?
protected $description = "Codzienne 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?
$dailySummaryRetriever = app()->make(DailySummaryRetriever::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?
$absences = $dailySummaryRetriever->getAbsences($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?
->map(fn(Vacation $vacation): string => $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?
$remoteDays = $dailySummaryRetriever->getRemoteDays($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?
->map(fn(Vacation $vacation): string => $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 = $dailySummaryRetriever->getBirthdays($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?
->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: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 :sunny:")
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("#527aba")
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?
}
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

@@ -18,7 +18,7 @@ class TimesheetExport implements WithMultipleSheets
public function sheets(): array
{
return $this->users
->map(fn(User $user) => new TimesheetPerUserSheet($user, $this->month, $this->types))
->map(fn(User $user): TimesheetPerUserSheet => new TimesheetPerUserSheet($user, $this->month, $this->types))
->toArray();
}

View File

@@ -193,8 +193,8 @@ class TimesheetPerUserSheet implements WithTitle, WithHeadings, WithEvents, With
->get()
->groupBy(
[
fn(Vacation $vacation) => $vacation->date->toDateString(),
fn(Vacation $vacation) => $vacation->vacationRequest->type->value,
fn(Vacation $vacation): string => $vacation->date->toDateString(),
fn(Vacation $vacation): string => $vacation->vacationRequest->type->value,
],
);
}

View File

@@ -42,8 +42,8 @@ class UserVacationStatsRetriever
->states(VacationRequestStatesRetriever::successStates()),
)
->get()
->groupBy(fn(Vacation $vacation) => strtolower($vacation->date->englishMonth))
->map(fn(Collection $items) => $items->count());
->groupBy(fn(Vacation $vacation): string => strtolower($vacation->date->englishMonth))
->map(fn(Collection $items): int => $items->count());
}
public function getPendingVacationDays(User $user, YearPeriod $yearPeriod): int
@@ -107,13 +107,13 @@ class UserVacationStatsRetriever
{
$types = VacationType::all();
return $types->filter(fn(VacationType $type) => $this->configRetriever->hasLimit($type));
return $types->filter(fn(VacationType $type): bool => $this->configRetriever->hasLimit($type));
}
protected function getNotLimitableVacationTypes(): Collection
{
$types = VacationType::all();
return $types->filter(fn(VacationType $type) => !$this->configRetriever->hasLimit($type));
return $types->filter(fn(VacationType $type): bool => !$this->configRetriever->hasLimit($type));
}
}

View File

@@ -64,6 +64,6 @@ class DoesNotExceedLimitRule implements VacationRequestRule
{
$types = VacationType::all();
return $types->filter(fn(VacationType $type) => $this->configRetriever->hasLimit($type));
return $types->filter(fn(VacationType $type): bool => $this->configRetriever->hasLimit($type));
}
}

View File

@@ -19,7 +19,7 @@ class VacationTypeCanBeSelected implements VacationRequestRule
$employmentForm = $vacationRequest->user->profile->employment_form;
$availableTypes = VacationType::all()
->filter(fn(VacationType $type) => $this->configRetriever->isAvailableFor($type, $employmentForm));
->filter(fn(VacationType $type): bool => $this->configRetriever->isAvailableFor($type, $employmentForm));
return $availableTypes->contains($vacationRequest->type);
}

View File

@@ -35,7 +35,7 @@ class YearPeriodRetriever
$years = YearPeriod::all();
$navigation = $years->map(fn(YearPeriod $yearPeriod) => $this->toNavigation($yearPeriod));
$navigation = $years->map(fn(YearPeriod $yearPeriod): array => $this->toNavigation($yearPeriod));
return [
"current" => $this->toNavigation($current),

View File

@@ -9,12 +9,13 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Notifications\Notifiable;
use Toby\Domain\Notifications\Notifiable as NotifiableInterface;
/**
* @property int $id
* @property User $user
*/
class Key extends Model
class Key extends Model implements NotifiableInterface
{
use HasFactory;
use Notifiable;

View File

@@ -15,6 +15,7 @@ use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Collection;
use Toby\Domain\Enums\EmploymentForm;
use Toby\Domain\Enums\Role;
use Toby\Domain\Notifications\Notifiable as NotifiableInterface;
/**
* @property int $id
@@ -26,7 +27,7 @@ use Toby\Domain\Enums\Role;
* @property Collection $vacationRequests
* @property Collection $vacations
*/
class User extends Authenticatable
class User extends Authenticatable implements NotifiableInterface
{
use HasFactory;
use Notifiable;
@@ -99,7 +100,7 @@ class User extends Authenticatable
->where("email", "ILIKE", "%{$text}%")
->orWhereRelation(
"profile",
fn(Builder $query) => $query
fn(Builder $query): Builder => $query
->where("first_name", "ILIKE", "%{$text}%")
->orWhere("last_name", "ILIKE", "%{$text}%"),
);

View File

@@ -7,12 +7,13 @@ 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: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.
use Carbon\CarbonInterface;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
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;
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\DailySummaryRetriever;
use Toby\Eloquent\Models\Holiday;
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.
use Toby\Infrastructure\Slack\Elements\AbsencesAttachment;
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\Infrastructure\Slack\Elements\BirthdaysAttachment;
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\Infrastructure\Slack\Elements\RemotesAttachment;
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
{
@@ -27,40 +28,17 @@ 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: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.
return;
}
$absences = $dailySummaryRetriever->getAbsences($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.
->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.
$attachments = new 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.
new AbsencesAttachment($dailySummaryRetriever->getAbsences($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.
new RemotesAttachment($dailySummaryRetriever->getRemoteDays($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.
new BirthdaysAttachment($dailySummaryRetriever->getBirthdays($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.
]);
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 = $dailySummaryRetriever->getRemoteDays($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.
->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 = $dailySummaryRetriever->getBirthdays($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.
->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("#527aba")
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.
Http::withToken($this->getSlackClientToken())
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($this->getUrl(), [
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" => $this->getSlackChannel(),
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()}",
"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.
"attachments" => $attachments,
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.
]);
}
@@ -78,4 +56,24 @@ 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: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.
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.
protected function getUrl(): string
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 "{$this->getSlackBaseUrl()}/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.
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 getSlackBaseUrl(): string
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 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.
}
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 getSlackClientToken(): string
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 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.
}
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 getSlackChannel(): string
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 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.
}
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: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.

View File

@@ -16,6 +16,6 @@ class CalculateVacationDaysController extends Controller
{
$days = $calculator->calculateDays($request->from(), $request->to());
return new JsonResponse($days->map(fn(Carbon $day) => $day->toDateString())->all());
return new JsonResponse($days->map(fn(Carbon $day): string => $day->toDateString())->all());
}
}

View File

@@ -21,8 +21,8 @@ class GetAvailableVacationTypesController extends Controller
$user = User::query()->find($request->get("user"));
$types = VacationType::all()
->filter(fn(VacationType $type) => $configRetriever->isAvailableFor($type, $user->profile->employment_form))
->map(fn(VacationType $type) => [
->filter(fn(VacationType $type): bool => $configRetriever->isAvailableFor($type, $user->profile->employment_form))
->map(fn(VacationType $type): array => [
"label" => $type->label(),
"value" => $type->value,
])

View File

@@ -35,8 +35,10 @@ class TimesheetController extends Controller
$types = VacationType::all()
->filter(
fn(VacationType $type) => $configRetriever->isAvailableFor($type, EmploymentForm::EmploymentContract)
&& $configRetriever->isVacation($type),
fn(VacationType $type): bool => $configRetriever->isAvailableFor(
$type,
EmploymentForm::EmploymentContract,
) && $configRetriever->isVacation($type),
);
$filename = "{$carbonMonth->translatedFormat("F Y")}.xlsx";

View File

@@ -30,7 +30,7 @@ class VacationLimitController extends Controller
->sortBy(fn(VacationLimit $limit): string => "{$limit->user->profile->last_name} {$limit->user->profile->first_name}")
->values();
$limitsResource = $limits->map(fn(VacationLimit $limit) => [
$limitsResource = $limits->map(fn(VacationLimit $limit): array => [
"id" => $limit->id,
"user" => new UserResource($limit->user),
"hasVacation" => $limit->hasVacation(),

View File

@@ -32,7 +32,7 @@ class HandleInertiaRequests extends Middleware
{
$user = $request->user();
return fn() => [
return fn(): array => [
"user" => $user ? new UserResource($user) : null,
"can" => [
"manageVacationLimits" => $user ? $user->can("manageVacationLimits") : false,
@@ -45,7 +45,7 @@ class HandleInertiaRequests extends Middleware
protected function getFlashData(Request $request): Closure
{
return fn() => [
return fn(): array => [
"success" => $request->session()->get("success"),
"error" => $request->session()->get("error"),
"info" => $request->session()->get("info"),

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Slack\Channels;
use Illuminate\Http\Client\Response;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Http;
use Toby\Domain\Notifications\Notifiable;
class SlackApiChannel
{
public function send(Notifiable $notifiable, Notification $notification): Response
{
$baseUrl = $this->getBaseUrl();
$url = "{$baseUrl}/chat.postMessage";
$channel = $notifiable->routeNotificationFor("slack", $notification);
return Http::withToken($this->getClientToken())
->post($url, [
"channel" => $channel,
"text" => $notification->toSlack($notifiable),
]);
}
protected function getClientToken(): string
{
return config("services.slack.client_token");
}
protected function getBaseUrl(): string
{
return config("services.slack.url");
}
}

View File

@@ -2,7 +2,7 @@
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
declare(strict_types=1);
namespace Toby\Domain\Slack;
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
namespace Toby\Infrastructure\Slack;
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
use Exception;
use Illuminate\Http\Request as IlluminateRequest;
@@ -11,6 +11,7 @@ use Illuminate\Support\Collection;
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
use Illuminate\Validation\ValidationException;
use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\Controller as SlackController;
use Spatie\SlashCommand\Exceptions\InvalidRequest;
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
use Spatie\SlashCommand\Exceptions\RequestCouldNotBeHandled;
use Spatie\SlashCommand\Exceptions\SlackSlashCommandException;
use Spatie\SlashCommand\Response;
@@ -18,11 +19,11 @@ use Spatie\SlashCommand\Response;
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
class Controller extends SlackController
{
/**
* @throws RequestCouldNotBeHandled
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
* @throws InvalidRequest|RequestCouldNotBeHandled
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
*/
public function getResponse(IlluminateRequest $request): IlluminateResponse
{
$this->guardAgainstInvalidRequest($request);
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
$this->verifyWithSigning($request);
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
$handler = $this->determineHandler();
@@ -43,13 +44,13 @@ class Controller extends SlackController
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
{
$errors = (new Collection($exception->errors()))
->map(
fn(array $message) => Attachment::create()
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
fn(array $message): Attachment => Attachment::create()
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
->setColor("danger")
->setText($message[0]),
);
return Response::create($this->request)
->withText(":x: Komenda `/{$this->request->command} {$this->request->text}` jest niepoprawna:")
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawna:")
EwelinaLasowy commented 2022-04-26 14:21:14 +02:00 (Migrated from github.com)
Review
            ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:")
```suggestion ->withText(":x: Polecenie `/{$this->request->command} {$this->request->text}` jest niepoprawne:") ```
->withAttachments($errors->all());
}
}

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Slack\Elements;
use Illuminate\Support\Collection;
use Toby\Eloquent\Models\Vacation;
class AbsencesAttachment extends ListAttachment
{
public function __construct(Collection $absences)
{
parent::__construct();
$this
->setTitle("Nieobecności :palm_tree:")
->setColor("#eab308")
->setItems($absences->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name))
->setEmptyText("Wszyscy dzisiaj pracują :muscle:");
}
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Slack\Elements;
use Illuminate\Contracts\Support\Arrayable;
use Spatie\SlashCommand\Attachment as BaseAttachment;
class Attachment extends BaseAttachment implements Arrayable
{
}

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Slack\Elements;
use Illuminate\Support\Collection;
use Toby\Eloquent\Models\User;
class BirthdaysAttachment extends ListAttachment
{
public function __construct(Collection $birthdays)
{
parent::__construct();
$this
->setTitle("Urodziny :birthday:")
->setColor("#3c5f97")
->setItems($birthdays->map(fn(User $user): string => $user->profile->full_name))
->setEmptyText("Dzisiaj nikt nie ma urodzin :cry:");
}
}

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Slack\Elements;
use Illuminate\Support\Collection;
use Toby\Eloquent\Models\Key;
class KeysAttachment extends ListAttachment
{
public function __construct(Collection $keys)
{
parent::__construct();
$this
->setColor("#3c5f97")
->setItems($keys->map(fn(Key $key): string => "Klucz nr {$key->id} - <@{$key->user->profile->slack_id}>"))
->setEmptyText("Nie ma żadnych kluczy w tobym");
}
}

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Slack\Elements;
use Illuminate\Support\Collection;
class ListAttachment extends Attachment
{
protected Collection $items;
protected string $emptyText = "";
public function setItems(Collection $items): static
{
$this->items = $items;
return $this;
}
public function setEmptyText(string $emptyText): static
{
$this->emptyText = $emptyText;
return $this;
}
public function toArray(): array
{
$fields = parent::toArray();
return array_merge($fields, [
"text" => $this->items->isNotEmpty() ? $this->items->implode("\n") : $this->emptyText,
]);
}
}

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Slack\Elements;
use Illuminate\Support\Collection;
use Toby\Eloquent\Models\Vacation;
class RemotesAttachment extends ListAttachment
{
public function __construct(Collection $remoteDays)
{
parent::__construct();
$this
->setTitle("Praca zdalna :house_with_garden:")
->setColor("#527aba")
->setItems($remoteDays->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name))
->setEmptyText("Wszyscy dzisiaj są w biurze :boom:");
}
}

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Exceptions;
namespace Toby\Infrastructure\Slack\Exceptions;
use Spatie\SlashCommand\Exceptions\SlackSlashCommandException;

View File

@@ -2,13 +2,13 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
namespace Toby\Infrastructure\Slack\Handlers;
use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\Handlers\BaseHandler;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Toby\Domain\Slack\Traits\ListsHandlers;
use Toby\Infrastructure\Slack\Elements\Attachment;
use Toby\Infrastructure\Slack\Traits\ListsHandlers;
class CatchAll extends BaseHandler
{
@@ -24,7 +24,7 @@ class CatchAll extends BaseHandler
$handlers = $this->findAvailableHandlers();
$attachmentFields = $this->mapHandlersToAttachments($handlers);
return $this->respondToSlack(":x: Nie rozpoznaję tej komendy. Lista wszystkich komend:")
return $this->respondToSlack(":x: Nie rozpoznaję polecenia. Lista wszystkich poleceń:")
->withAttachment(
Attachment::create()
->setColor("danger")

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Slack\Handlers;
use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Toby\Domain\DailySummaryRetriever;
use Toby\Infrastructure\Slack\Elements\AbsencesAttachment;
use Toby\Infrastructure\Slack\Elements\BirthdaysAttachment;
use Toby\Infrastructure\Slack\Elements\RemotesAttachment;
class DailySummary extends SignatureHandler
{
protected $signature = "toby dzisiaj";
protected $description = "Codzienne podsumowanie";
public function handle(Request $request): Response
{
$dailySummaryRetriever = app()->make(DailySummaryRetriever::class);
$now = Carbon::today();
$attachments = new Collection([
new AbsencesAttachment($dailySummaryRetriever->getAbsences($now)),
new RemotesAttachment($dailySummaryRetriever->getRemoteDays($now)),
new BirthdaysAttachment($dailySummaryRetriever->getBirthdays($now)),
]);
return $this->respondToSlack("Podsumowanie dla dnia {$now->toDisplayString()}")
->withAttachments($attachments->all());
}
}

View File

@@ -2,16 +2,16 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
namespace Toby\Infrastructure\Slack\Handlers;
use Illuminate\Validation\ValidationException;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Toby\Domain\Notifications\KeyHasBeenGivenNotification;
use Toby\Domain\Slack\Exceptions\UserNotFoundException;
use Toby\Domain\Slack\Rules\SlackUserExistsRule;
use Toby\Domain\Slack\Traits\FindsUserBySlackId;
use Toby\Eloquent\Models\Key;
use Toby\Infrastructure\Slack\Exceptions\UserNotFoundException;
use Toby\Infrastructure\Slack\Rules\SlackUserExistsRule;
use Toby\Infrastructure\Slack\Traits\FindsUserBySlackId;
class GiveKeysTo extends SignatureHandler
{

View File

@@ -2,19 +2,19 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
namespace Toby\Infrastructure\Slack\Handlers;
use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Toby\Domain\Slack\Traits\ListsHandlers;
use Toby\Infrastructure\Slack\Elements\Attachment;
use Toby\Infrastructure\Slack\Traits\ListsHandlers;
class Help extends SignatureHandler
{
use ListsHandlers;
protected $signature = "toby pomoc";
protected $description = "Wyświetl wszystkie dostępne komendy";
protected $description = "Wyświetl wszystkie dostępne polecenia";
public function handle(Request $request): Response
{
@@ -22,7 +22,7 @@ class Help extends SignatureHandler
$attachmentFields = $this->mapHandlersToAttachments($handlers);
return $this->respondToSlack("Dostępne komendy:")
return $this->respondToSlack("Dostępne polecenia:")
->withAttachment(
Attachment::create()
->setColor("good")

View File

@@ -2,16 +2,16 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
namespace Toby\Infrastructure\Slack\Handlers;
use Illuminate\Support\Carbon;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Toby\Domain\Actions\VacationRequest\CreateAction;
use Toby\Domain\Enums\VacationType;
use Toby\Domain\Slack\Traits\FindsUserBySlackId;
use Toby\Eloquent\Models\User;
use Toby\Eloquent\Models\YearPeriod;
use Toby\Infrastructure\Slack\Traits\FindsUserBySlackId;
class HomeOffice extends SignatureHandler
{

View File

@@ -2,12 +2,12 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
namespace Toby\Infrastructure\Slack\Handlers;
use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Toby\Eloquent\Models\Key;
use Toby\Infrastructure\Slack\Elements\KeysAttachment;
class KeyList extends SignatureHandler
{
@@ -18,14 +18,9 @@ class KeyList extends SignatureHandler
{
$keys = Key::query()
->orderBy("id")
->get()
->map(fn(Key $key) => "Klucz nr {$key->id} - <@{$key->user->profile->slack_id}>");
->get();
return $this->respondToSlack("Lista kluczy :key:")
->withAttachment(
Attachment::create()
->setColor("#3c5f97")
->setText($keys->isNotEmpty() ? $keys->implode("\n") : "Nie ma żadnych kluczy w tobym"),
);
->withAttachment(new KeysAttachment($keys));
}
}

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
namespace Toby\Infrastructure\Slack\Handlers;
use Illuminate\Support\Facades\Validator;
use Spatie\SlashCommand\Handlers\SignatureHandler as BaseSignatureHandler;

View File

@@ -2,16 +2,16 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Handlers;
namespace Toby\Infrastructure\Slack\Handlers;
use Illuminate\Validation\ValidationException;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Toby\Domain\Notifications\KeyHasBeenTakenNotification;
use Toby\Domain\Slack\Exceptions\UserNotFoundException;
use Toby\Domain\Slack\Rules\SlackUserExistsRule;
use Toby\Domain\Slack\Traits\FindsUserBySlackId;
use Toby\Eloquent\Models\Key;
use Toby\Infrastructure\Slack\Exceptions\UserNotFoundException;
use Toby\Infrastructure\Slack\Rules\SlackUserExistsRule;
use Toby\Infrastructure\Slack\Traits\FindsUserBySlackId;
class TakeKeysFrom extends SignatureHandler
{

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Rules;
namespace Toby\Infrastructure\Slack\Rules;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Str;

View File

@@ -2,11 +2,11 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Traits;
namespace Toby\Infrastructure\Slack\Traits;
use Illuminate\Support\Str;
use Toby\Domain\Slack\Exceptions\UserNotFoundException;
use Toby\Eloquent\Models\User;
use Toby\Infrastructure\Slack\Exceptions\UserNotFoundException;
trait FindsUserBySlackId
{

View File

@@ -2,11 +2,12 @@
declare(strict_types=1);
namespace Toby\Domain\Slack\Traits;
namespace Toby\Infrastructure\Slack\Traits;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Spatie\SlashCommand\AttachmentField;
use Spatie\SlashCommand\Handlers\BaseHandler;
use Spatie\SlashCommand\Handlers\SignatureHandler;
use Spatie\SlashCommand\Handlers\SignatureParts;
use Spatie\SlashCommand\HandlesSlashCommand;
@@ -16,8 +17,8 @@ trait ListsHandlers
protected function findAvailableHandlers(): Collection
{
return collect(config("laravel-slack-slash-command.handlers"))
->map(fn(string $handlerClassName) => new $handlerClassName($this->request))
->filter(fn(HandlesSlashCommand $handler) => $handler instanceof SignatureHandler)
->map(fn(string $handlerClassName): BaseHandler => new $handlerClassName($this->request))
->filter(fn(HandlesSlashCommand $handler): bool => $handler instanceof SignatureHandler)
->filter(function (SignatureHandler $handler) {
$signatureParts = new SignatureParts($handler->getSignature());
@@ -29,13 +30,13 @@ trait ListsHandlers
{
return $handlers
->sort(
fn(SignatureHandler $handlerA, SignatureHandler $handlerB) => strcmp(
fn(SignatureHandler $handlerA, SignatureHandler $handlerB): int => strcmp(
$handlerA->getFullCommand(),
$handlerB->getFullCommand(),
),
)
->map(
fn(SignatureHandler $handler) => AttachmentField::create(
fn(SignatureHandler $handler): AttachmentField => AttachmentField::create(
$handler->getDescription(),
"`/{$handler->getSignature()}`",
),

View File

@@ -2,17 +2,16 @@
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\TakeKeysFrom;
use Toby\Infrastructure\Slack\Handlers\CatchAll;
use Toby\Infrastructure\Slack\Handlers\DailySummary;
use Toby\Infrastructure\Slack\Handlers\GiveKeysTo;
use Toby\Infrastructure\Slack\Handlers\Help;
use Toby\Infrastructure\Slack\Handlers\HomeOffice;
use Toby\Infrastructure\Slack\Handlers\KeyList;
use Toby\Infrastructure\Slack\Handlers\TakeKeysFrom;
return [
"signing_secret" => env("SLACK_SIGNING_SECRET"),
"verify_with_signing" => true,
"handlers" => [
TakeKeysFrom::class,
GiveKeysTo::class,

View File

@@ -3,11 +3,11 @@
declare(strict_types=1);
use Illuminate\Support\Facades\Route;
use Toby\Domain\Slack\Controller as SlackController;
use Toby\Infrastructure\Http\Controllers\Api\CalculateUserUnavailableDaysController;
use Toby\Infrastructure\Http\Controllers\Api\CalculateUserVacationStatsController;
use Toby\Infrastructure\Http\Controllers\Api\CalculateVacationDaysController;
use Toby\Infrastructure\Http\Controllers\Api\GetAvailableVacationTypesController;
use Toby\Infrastructure\Slack\Controller as SlackController;
Route::post("slack", [SlackController::class, "getResponse"]);