Skip to content

Commit 9f1aeb3

Browse files
Extended the job-related interfaces
1 parent 0c4ea3e commit 9f1aeb3

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/Contracts/JobExecutionLog.php

+10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@
1414

1515
namespace Konekt\History\Contracts;
1616

17+
use DateTimeInterface;
18+
1719
interface JobExecutionLog
1820
{
1921
public function getExecution(): JobExecution;
22+
23+
public function getMessage(): string;
24+
25+
public function getHappenedAt(): DateTimeInterface;
26+
27+
public function getLevel(): string;
28+
29+
public function getContext(): array;
2030
}

src/Contracts/JobStatus.php

+3
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818

1919
interface JobStatus extends EnumInterface
2020
{
21+
public function isActive(): bool;
22+
23+
public function hasEnded(): bool;
2124
}

src/Models/JobExecutionLog.php

+21
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Konekt\History\Models;
66

7+
use DateTimeInterface;
78
use Illuminate\Database\Eloquent\Model;
89
use Illuminate\Database\Eloquent\Relations\BelongsTo;
910
use Illuminate\Support\Carbon;
@@ -43,4 +44,24 @@ public function getExecution(): JobExecution
4344
{
4445
return $this->jobExecution;
4546
}
47+
48+
public function getMessage(): string
49+
{
50+
return $this->message;
51+
}
52+
53+
public function getHappenedAt(): DateTimeInterface
54+
{
55+
return $this->happened_at;
56+
}
57+
58+
public function getLevel(): string
59+
{
60+
return $this->level;
61+
}
62+
63+
public function getContext(): array
64+
{
65+
return $this->context;
66+
}
4667
}

0 commit comments

Comments
 (0)