app.repository.export_audit_log_repository module

class app.repository.export_audit_log_repository.ExportAuditLogRepository(session_factory, model=<class 'app.model.export_audit_log.ExportAuditLog'>)[source]

Bases: BaseRepository

Repository for ExportAuditLog rows.

Parameters:

session_factory (Callable[[...], AbstractAsyncContextManager[AsyncSession]])

async mark_finished(audit_id, *, row_count, status)[source]

Update an existing audit row with the final row count and status. Run after the stream finishes (or fails) so that interrupted downloads keep their initial “started” marker.

Parameters:
  • audit_id (str)

  • row_count (int)

  • status (str)

Return type:

None

async list_recent(*, limit=50, oauth_user_id=None)[source]

Return audit rows most recent first.

When oauth_user_id is provided the list is scoped to that user; otherwise (admin view) all rows are returned. Capped at 200 to keep the response small enough for the history table.

Parameters:
  • limit (int)

  • oauth_user_id (str | None)

Return type:

List[ExportAuditLog]