Skip to content

Commit 77b0c72

Browse files
committed
fix(interfaces): use collections.abc, Literal for status, ContributionEvent for event param
1 parent fcb2c04 commit 77b0c72

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/ghdcbot/core/interfaces.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from __future__ import annotations
22

3+
from collections.abc import Iterable, Sequence
34
from datetime import datetime
4-
from typing import Any, Iterable, Protocol, Sequence
5+
from typing import Literal, Protocol
56

67
from ghdcbot.config.models import IdentityMapping
78
from ghdcbot.core.models import (
@@ -129,7 +130,11 @@ def list_pending_issue_requests(self) -> list[dict]:
129130
def get_issue_request(self, request_id: str) -> dict | None:
130131
"""Return a single issue request by request_id, or None."""
131132

132-
def update_issue_request_status(self, request_id: str, status: str) -> None:
133+
def update_issue_request_status(
134+
self,
135+
request_id: str,
136+
status: Literal["pending", "approved", "rejected", "cancelled"],
137+
) -> None:
133138
"""Update an issue request status (pending, approved, rejected, cancelled)."""
134139

135140
# Audit log
@@ -148,7 +153,7 @@ def was_notification_sent(self, dedupe_key: str) -> bool:
148153
def mark_notification_sent(
149154
self,
150155
dedupe_key: str,
151-
event: Any,
156+
event: ContributionEvent,
152157
discord_user_id: str,
153158
channel_id: str | None,
154159
target_github_user: str | None = None,

0 commit comments

Comments
 (0)