Initial commit
Dieser Commit ist enthalten in:
63
domain/repositories/fingerprint_repository.py
Normale Datei
63
domain/repositories/fingerprint_repository.py
Normale Datei
@ -0,0 +1,63 @@
|
||||
"""
|
||||
Fingerprint repository interface.
|
||||
"""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional, List
|
||||
from datetime import datetime
|
||||
|
||||
from domain.entities.browser_fingerprint import BrowserFingerprint
|
||||
|
||||
|
||||
class IFingerprintRepository(ABC):
|
||||
"""Interface for fingerprint persistence."""
|
||||
|
||||
@abstractmethod
|
||||
def save(self, fingerprint: BrowserFingerprint) -> str:
|
||||
"""Save a fingerprint and return its ID."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def find_by_id(self, fingerprint_id: str) -> Optional[BrowserFingerprint]:
|
||||
"""Find a fingerprint by ID."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def find_by_account_id(self, account_id: str) -> Optional[BrowserFingerprint]:
|
||||
"""Find a fingerprint associated with an account."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def find_all(self) -> List[BrowserFingerprint]:
|
||||
"""Find all fingerprints."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def update(self, fingerprint: BrowserFingerprint) -> bool:
|
||||
"""Update an existing fingerprint."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def delete(self, fingerprint_id: str) -> bool:
|
||||
"""Delete a fingerprint by ID."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def find_by_platform(self, platform: str) -> List[BrowserFingerprint]:
|
||||
"""Find all fingerprints for a specific platform."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def exists(self, fingerprint_id: str) -> bool:
|
||||
"""Check if a fingerprint exists."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def count(self) -> int:
|
||||
"""Count total fingerprints."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def find_recent(self, limit: int = 10) -> List[BrowserFingerprint]:
|
||||
"""Find most recently created fingerprints."""
|
||||
pass
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren