Skip to content

Commit

Permalink
Merge pull request #493 from canyongbs/fix/advapp-269-correct-sla-res…
Browse files Browse the repository at this point in the history
…ponse-trigger-dependency

[ADVAPP-269]: Correct SLA response trigger dependency
  • Loading branch information
Orrison authored Feb 1, 2024
2 parents 89a29c9 + 49125be commit e7dc587
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app-modules/service-management/src/Models/ServiceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ public function latestOutboundServiceRequestUpdate(): HasOne
});
}

public function getLatestResponseSeconds(): ?int
public function getLatestResponseSeconds(): int
{
if (! $this->latestInboundServiceRequestUpdate) {
return null;
return $this->created_at->diffInSeconds(now());
}

if (
Expand Down Expand Up @@ -331,7 +331,7 @@ public function getResponseSlaComplianceStatus(): ?SlaComplianceStatus

$latestResponseSeconds = $this->getLatestResponseSeconds();

return ($latestResponseSeconds <= $slaResponseSeconds)
return $latestResponseSeconds <= $slaResponseSeconds
? SlaComplianceStatus::Compliant
: SlaComplianceStatus::NonCompliant;
}
Expand Down

0 comments on commit e7dc587

Please sign in to comment.