Phase 4: API Endpoint
- Add RandomNumberOutcomeResponse schema to schemas.py - Add GET /api/audit/random-jobs endpoint to routes/audit.py - Returns list of outcomes (newest first, no pagination) - Requires VIEW_AUDIT permission - Add tests: admin can access, regular user forbidden, unauthenticated 401
This commit is contained in:
parent
7beb213cf5
commit
b3ed81e8fd
3 changed files with 71 additions and 1 deletions
|
|
@ -257,6 +257,24 @@ class AppointmentResponse(BaseModel):
|
|||
PaginatedAppointments = PaginatedResponse[AppointmentResponse]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Random Number Job Schemas
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class RandomNumberOutcomeResponse(BaseModel):
|
||||
"""Response model for a random number job outcome."""
|
||||
|
||||
id: int
|
||||
job_id: int
|
||||
triggered_by_user_id: int
|
||||
triggered_by_email: str
|
||||
value: int
|
||||
duration_ms: int
|
||||
status: str
|
||||
created_at: datetime
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Meta/Constants Schemas
|
||||
# =============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue