//! Devices: E-15 list, E-16 revoke, E-17 push token (FR-3, SPEC §8.4). //! //! Registered and annotated by M2a; M3 owns this file and implements the handlers (until then 501 //! `not_implemented`). use crate::api::{IdPath, not_implemented}; use crate::auth::AuthDevice; use crate::error::AppError; use crate::openapi::responses::{BadRequest, Conflict, Forbidden, NotFound}; use crate::wire::{DeviceList, PushTokenRequest, UuidSchema}; #[utoipa::path( get, path = "/devices", operation_id = "listDevices", summary = "E-15 List devices (admin all, member own)", responses( (status = 200, description = "Ordered by `created_at`, revoked devices included (with `revoked_at`).", body = DeviceList, content_type = "application/json; charset=utf-8"), ) )] pub async fn list_devices(_device: AuthDevice) -> AppError { not_implemented() } #[utoipa::path( delete, path = "/devices/{device_id}", operation_id = "revokeDevice", summary = "E-16 Revoke a device", description = "Revoking an already revoked device is 204. Admin any device except the current one; member own devices except the current one (SPEC §8.4).", params( ("device_id" = UuidSchema, Path, description = "Not a UUID is 404 `not_found`."), ), responses( (status = 204, description = "Revoked."), (status = 403, response = Forbidden), (status = 404, response = NotFound), (status = 409, response = Conflict), ) )] pub async fn revoke_device(_device: AuthDevice, IdPath(_device_id): IdPath) -> AppError { not_implemented() } #[utoipa::path( put, path = "/devices/current/push-token", operation_id = "putPushToken", summary = "E-17 Set or clear this device's FCM token", request_body(content = PushTokenRequest, content_type = "application/json; charset=utf-8"), responses( (status = 204, description = "Stored (or cleared)."), (status = 400, response = BadRequest), ) )] pub async fn put_push_token(_device: AuthDevice) -> AppError { not_implemented() }