Skip to content

Commit be38b59

Browse files
jbrooksukclaude
andauthored
Require a status when creating an incident (#358)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ba368f0 commit be38b59

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/Data/Requests/Incident/CreateIncidentRequestData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(
2020
#[Max(255)]
2121
public readonly string $name,
2222
#[Enum(IncidentStatusEnum::class)]
23-
public readonly ?IncidentStatusEnum $status = null,
23+
public readonly IncidentStatusEnum $status,
2424
#[RequiredWithout('template')]
2525
public readonly ?string $message = null,
2626
#[RequiredWithout('message')]

tests/Unit/Actions/Incident/CreateIncidentTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
$data = CreateIncidentRequestData::from([
1818
'name' => 'My Incident',
1919
'message' => 'This is an incident message.',
20+
'status' => IncidentStatusEnum::investigating,
2021
]);
2122

2223
$incident = app(CreateIncident::class)->handle($data);
@@ -99,6 +100,7 @@
99100
$data = CreateIncidentRequestData::from([
100101
'name' => 'My Incident',
101102
'message' => 'This is an incident message.',
103+
'status' => IncidentStatusEnum::investigating,
102104
'components' => [
103105
['id' => $componentA->id, 'status' => ComponentStatusEnum::performance_issues->value],
104106
['id' => $componentB->id, 'status' => ComponentStatusEnum::partial_outage->value],

0 commit comments

Comments
 (0)