refactor(api): Phase 22 P2 Protocol 簽名修正 + 缺失方法補齊
All checks were successful
E2E Health Check / e2e-health (push) Successful in 16s
All checks were successful
E2E Health Check / e2e-health (push) Successful in 16s
- IApprovalRepository.create() 簽名由 ApprovalRequestCreate 改為 dict (與實作一致) - 補齊 find_by_fingerprint() 和 increment_hit_count() Protocol 方法 2026-03-31 Claude Code (首席架構師 P2 修復) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,8 +34,19 @@ class IApprovalRepository(Protocol):
|
||||
實作: ApprovalDBRepository (PostgreSQL)
|
||||
"""
|
||||
|
||||
async def create(self, request: ApprovalRequestCreate) -> ApprovalRequest:
|
||||
"""建立新的 Approval"""
|
||||
async def create(self, data: dict) -> ApprovalRequest:
|
||||
"""
|
||||
建立新的 Approval
|
||||
|
||||
Phase 22 P2: 簽名修正為 dict (與實作一致)
|
||||
2026-03-31 Claude Code (首席架構師 P2 修復)
|
||||
|
||||
Args:
|
||||
data: ApprovalRecord 建立資料 dict
|
||||
|
||||
Returns:
|
||||
ApprovalRequest
|
||||
"""
|
||||
...
|
||||
|
||||
async def get_by_id(self, approval_id: UUID) -> ApprovalRequest | None:
|
||||
@@ -65,6 +76,30 @@ class IApprovalRepository(Protocol):
|
||||
"""新增簽核"""
|
||||
...
|
||||
|
||||
async def find_by_fingerprint(
|
||||
self,
|
||||
fingerprint: str,
|
||||
) -> ApprovalRequest | None:
|
||||
"""
|
||||
根據指紋查找 Approval (告警收斂用)
|
||||
|
||||
Phase 22 P2: 補齊缺失 Protocol 方法
|
||||
2026-03-31 Claude Code (首席架構師 P2 修復)
|
||||
"""
|
||||
...
|
||||
|
||||
async def increment_hit_count(
|
||||
self,
|
||||
approval_id: UUID,
|
||||
) -> ApprovalRequest | None:
|
||||
"""
|
||||
增加 hit_count (告警收斂用)
|
||||
|
||||
Phase 22 P2: 補齊缺失 Protocol 方法
|
||||
2026-03-31 Claude Code (首席架構師 P2 修復)
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class IIncidentRepository(Protocol):
|
||||
|
||||
Reference in New Issue
Block a user