string('app.currency'); if ($currencyCode === '') { $currencyCode = 'EUR'; } /** @var non-empty-string $currencyCode */ $this->appDefaultCurrency = new Currency($currencyCode); } public function getWeeklyTotalForEmployee(Matricule $matricule, CarbonInterface $start, CarbonInterface $end): Money { $weekTotal = Order::query() ->where('employee_matricule', $matricule->value) ->whereIn('status', [OrderStatus::VALIDATED, OrderStatus::PENDING]) ->whereBetween('pickup_day', [$start, $end]) ->sum('total'); return new Money((int) $weekTotal, $this->appDefaultCurrency); } }