openapi: 3.1.0 info: title: Api version: 0.1.0 description: Taif Children's Hospital Research Platform API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: auth description: Authentication operations - name: users description: User management - name: landingPage description: Landing page settings - name: documents description: Document management - name: articles description: Articles and blog posts - name: calendar description: Calendar events - name: settings description: Admin settings - name: notifications description: User notifications - name: roleDashboard description: Role-based dashboard widget configuration - name: navPermissions description: Role-based navigation access configuration - name: folders description: Document folder management paths: /notifications: get: operationId: listNotifications tags: [notifications] summary: List notifications for current user parameters: - name: unread_only in: query schema: type: string - name: limit in: query schema: type: string responses: "200": description: Notification list content: application/json: schema: $ref: "#/components/schemas/NotificationList" delete: operationId: clearAllNotifications tags: [notifications] summary: Delete all notifications for current user responses: "200": description: Cleared content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /notifications/unread-count: get: operationId: getUnreadCount tags: [notifications] summary: Get unread notification count responses: "200": description: Count content: application/json: schema: $ref: "#/components/schemas/UnreadCount" /notifications/read-all: post: operationId: markAllNotificationsRead tags: [notifications] summary: Mark all notifications as read responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /notifications/{id}/read: patch: operationId: markNotificationRead tags: [notifications] summary: Mark a single notification as read parameters: - name: id in: path required: true schema: type: string responses: "200": description: Updated notification content: application/json: schema: $ref: "#/components/schemas/Notification" /notifications/broadcast: post: operationId: broadcastNotification tags: [notifications] summary: Send a notification to all users or a specific role (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/BroadcastNotificationBody" responses: "200": description: Broadcast result content: application/json: schema: $ref: "#/components/schemas/BroadcastResult" get: operationId: listBroadcasts tags: [notifications] summary: List broadcast history (admin only) responses: "200": description: Broadcast list content: application/json: schema: $ref: "#/components/schemas/BroadcastList" /notifications/{id}: delete: operationId: deleteNotification tags: [notifications] summary: Delete a notification parameters: - name: id in: path required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /auth/me: get: operationId: getMe tags: [auth] summary: Get current user profile responses: "200": description: Current user content: application/json: schema: $ref: "#/components/schemas/UserProfile" "401": description: Unauthorized patch: operationId: updateMe tags: [auth] summary: Update current user profile requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateProfileBody" responses: "200": description: Updated profile content: application/json: schema: $ref: "#/components/schemas/UserProfile" /auth/upload-avatar: post: operationId: uploadAvatar tags: [auth] summary: Upload profile avatar photo requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UploadFileBody" responses: "200": description: Uploaded avatar URL content: application/json: schema: $ref: "#/components/schemas/UploadResponse" /auth/upload-signature: post: operationId: uploadSignature tags: [auth] summary: Upload or save drawn signature (PNG/JPG/SVG). sig_type=uploaded|drawn requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UploadSignatureBody" responses: "200": description: Uploaded signature URL content: application/json: schema: $ref: "#/components/schemas/UploadResponse" /admin/users/{userId}/signatures: get: operationId: getAdminUserSignatures tags: [admin] summary: Get both signatures for a user (admin only) parameters: - name: userId in: path required: true schema: type: string responses: "200": description: User signature data content: application/json: schema: $ref: "#/components/schemas/UserSignatureData" patch: operationId: adminUpdateUserSignatures tags: [admin] summary: Set active signature type or remove a signature (admin only) parameters: - name: userId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AdminUpdateSignaturesBody" responses: "200": description: Updated signature data content: application/json: schema: $ref: "#/components/schemas/UserSignatureData" /admin/users/{userId}/upload-signature: post: operationId: adminUploadUserSignature tags: [admin] summary: Upload a signature for any user (admin only) parameters: - name: userId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UploadSignatureBody" responses: "200": description: Uploaded signature URL content: application/json: schema: $ref: "#/components/schemas/UploadResponse" /roles: get: operationId: listRoles tags: [roles] summary: List all roles with user counts responses: "200": description: Array of roles content: application/json: schema: type: array items: $ref: "#/components/schemas/Role" post: operationId: createRole tags: [roles] summary: Create a custom role (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateRoleBody" responses: "201": description: Created role content: application/json: schema: $ref: "#/components/schemas/Role" /roles/{id}: patch: operationId: updateRole tags: [roles] summary: Update a custom role label/color (admin only) parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateRoleBody" responses: "200": description: Updated role content: application/json: schema: $ref: "#/components/schemas/Role" delete: operationId: deleteRole tags: [roles] summary: Delete a custom role (admin only, must have 0 users) parameters: - name: id in: path required: true schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /users: get: operationId: listUsers tags: [users] summary: List all users (admin only) parameters: - name: role in: query schema: type: string - name: search in: query schema: type: string responses: "200": description: List of users content: application/json: schema: type: array items: $ref: "#/components/schemas/User" post: operationId: createUser tags: [users] summary: Create a new user (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateUserBody" responses: "201": description: Created user content: application/json: schema: $ref: "#/components/schemas/User" /users/{id}: get: operationId: getUser tags: [users] summary: Get user by ID parameters: - name: id in: path required: true schema: type: string responses: "200": description: User content: application/json: schema: $ref: "#/components/schemas/User" patch: operationId: updateUser tags: [users] summary: Update user (admin only) parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateUserBody" responses: "200": description: Updated user content: application/json: schema: $ref: "#/components/schemas/User" delete: operationId: deleteUser tags: [users] summary: Delete user (admin only) parameters: - name: id in: path required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/DeleteResponse" /users/{id}/set-password: post: operationId: setUserPassword tags: [users] summary: Directly set a new password for a user (admin only, no email sent) parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SetPasswordBody" responses: "200": description: Password updated content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /users/stats: get: operationId: getUserStats tags: [users] summary: Get user statistics by role responses: "200": description: User stats content: application/json: schema: $ref: "#/components/schemas/UserStats" /landing-page: get: operationId: getLandingPage tags: [landingPage] summary: Get landing page configuration responses: "200": description: Landing page config content: application/json: schema: $ref: "#/components/schemas/LandingPageConfig" patch: operationId: updateLandingPage tags: [landingPage] summary: Update landing page config (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateLandingPageBody" responses: "200": description: Updated config content: application/json: schema: $ref: "#/components/schemas/LandingPageConfig" /landing-page/sections: get: operationId: listSections tags: [landingPage] summary: List landing page sections responses: "200": description: Sections list content: application/json: schema: type: array items: $ref: "#/components/schemas/Section" post: operationId: createSection tags: [landingPage] summary: Create a new section (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateSectionBody" responses: "201": description: Created section content: application/json: schema: $ref: "#/components/schemas/Section" /landing-page/sections/{id}: patch: operationId: updateSection tags: [landingPage] summary: Update section (admin only) parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateSectionBody" responses: "200": description: Updated section content: application/json: schema: $ref: "#/components/schemas/Section" delete: operationId: deleteSection tags: [landingPage] summary: Delete section (admin only) parameters: - name: id in: path required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/DeleteResponse" /documents: get: operationId: listDocuments tags: [documents] summary: List documents parameters: - name: type in: query schema: type: string - name: search in: query schema: type: string - name: folder_id in: query description: Filter by folder UUID, or "unfiled" for documents with no folder schema: type: string - name: page in: query schema: type: integer - name: limit in: query schema: type: integer responses: "200": description: List of documents content: application/json: schema: $ref: "#/components/schemas/DocumentList" /documents/{id}: get: operationId: getDocument tags: [documents] summary: Get document by ID parameters: - name: id in: path required: true schema: type: string responses: "200": description: Document content: application/json: schema: $ref: "#/components/schemas/Document" delete: operationId: deleteDocument tags: [documents] summary: Delete document (admin only) parameters: - name: id in: path required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/DeleteResponse" /documents/stats: get: operationId: getDocumentStats tags: [documents] summary: Get document statistics by type responses: "200": description: Document stats content: application/json: schema: $ref: "#/components/schemas/DocumentStats" /documents/{id}/signatures: get: operationId: getDocumentSignatures tags: [documents] summary: List all signatures for a document parameters: - name: id in: path required: true schema: type: string responses: "200": description: Document signatures content: application/json: schema: $ref: "#/components/schemas/DocumentSignatureList" /documents/{id}/sign: post: operationId: signDocument tags: [documents] summary: Sign a document with the current user's signature parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SignDocumentBody" responses: "201": description: Signature recorded content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /documents/{id}/request-signatures: post: operationId: requestDocumentSignatures tags: [documents] summary: Request signatures from specific users (admin/director/ceo) parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RequestSignaturesBody" responses: "200": description: Requests sent content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /documents/{id}/move: patch: operationId: moveDocument tags: [documents] summary: Move document to a folder (admin only) parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MoveDocumentBody" responses: "200": description: Moved content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /folders: get: operationId: listFolders tags: [folders] summary: List all document folders with document counts responses: "200": description: Folder list content: application/json: schema: $ref: "#/components/schemas/FolderList" post: operationId: createFolder tags: [folders] summary: Create a new folder (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateFolderBody" responses: "201": description: Created folder content: application/json: schema: $ref: "#/components/schemas/Folder" /folders/{id}: patch: operationId: updateFolder tags: [folders] summary: Rename or recolor a folder (admin only) parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateFolderBody" responses: "200": description: Updated folder content: application/json: schema: $ref: "#/components/schemas/Folder" delete: operationId: deleteFolder tags: [folders] summary: Delete a folder (admin only). Documents inside become unfiled. parameters: - name: id in: path required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/SuccessResponse" /articles: get: operationId: listArticles tags: [articles] summary: List articles parameters: - name: search in: query schema: type: string - name: page in: query schema: type: integer - name: limit in: query schema: type: integer responses: "200": description: List of articles content: application/json: schema: $ref: "#/components/schemas/ArticleList" post: operationId: createArticle tags: [articles] summary: Create article requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateArticleBody" responses: "201": description: Created article content: application/json: schema: $ref: "#/components/schemas/Article" /articles/{id}: get: operationId: getArticle tags: [articles] summary: Get article by ID parameters: - name: id in: path required: true schema: type: string responses: "200": description: Article content: application/json: schema: $ref: "#/components/schemas/Article" patch: operationId: updateArticle tags: [articles] summary: Update article parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateArticleBody" responses: "200": description: Updated article content: application/json: schema: $ref: "#/components/schemas/Article" delete: operationId: deleteArticle tags: [articles] summary: Delete article parameters: - name: id in: path required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/DeleteResponse" /calendar/events: get: operationId: listEvents tags: [calendar] summary: List calendar events parameters: - name: start in: query schema: type: string - name: end in: query schema: type: string - name: type in: query schema: type: string responses: "200": description: List of events content: application/json: schema: type: array items: $ref: "#/components/schemas/CalendarEvent" post: operationId: createEvent tags: [calendar] summary: Create calendar event requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateEventBody" responses: "201": description: Created event content: application/json: schema: $ref: "#/components/schemas/CalendarEvent" /calendar/events/{id}: patch: operationId: updateEvent tags: [calendar] summary: Update calendar event parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateEventBody" responses: "200": description: Updated event content: application/json: schema: $ref: "#/components/schemas/CalendarEvent" delete: operationId: deleteEvent tags: [calendar] summary: Delete calendar event parameters: - name: id in: path required: true schema: type: string responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/DeleteResponse" /calendar/upcoming: get: operationId: getUpcomingEvents tags: [calendar] summary: Get upcoming events (next 7 days) responses: "200": description: Upcoming events content: application/json: schema: type: array items: $ref: "#/components/schemas/CalendarEvent" /settings/theme: get: operationId: getThemeSettings tags: [settings] summary: Get theme settings responses: "200": description: Theme settings content: application/json: schema: $ref: "#/components/schemas/ThemeSettings" patch: operationId: updateThemeSettings tags: [settings] summary: Update theme settings (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateThemeSettingsBody" responses: "200": description: Updated theme content: application/json: schema: $ref: "#/components/schemas/ThemeSettings" /settings/upload-logo: post: operationId: uploadLogo tags: [settings] summary: Upload hospital logo (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UploadFileBody" responses: "200": description: Logo URL content: application/json: schema: $ref: "#/components/schemas/UploadResponse" /settings/upload-background: post: operationId: uploadBackground tags: [settings] summary: Upload login background image (admin only) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UploadFileBody" responses: "200": description: Background URL content: application/json: schema: $ref: "#/components/schemas/UploadResponse" /dashboard/summary: get: operationId: getDashboardSummary tags: [settings] summary: Get dashboard summary stats responses: "200": description: Summary content: application/json: schema: $ref: "#/components/schemas/DashboardSummary" /role-dashboard/config: get: operationId: getMyDashboardConfig tags: [roleDashboard] summary: Get dashboard widget config for current user role responses: "200": description: Widget config for caller's role content: application/json: schema: $ref: "#/components/schemas/RoleDashboardConfig" /role-dashboard/configs: get: operationId: getAllDashboardConfigs tags: [roleDashboard] summary: Get all role dashboard widget configs (admin only) responses: "200": description: All role configs content: application/json: schema: $ref: "#/components/schemas/AllRoleDashboardConfigs" /role-dashboard/config/{role}: patch: operationId: updateRoleDashboardConfig tags: [roleDashboard] summary: Update dashboard widget config for a role (admin only) parameters: - name: role in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateRoleDashboardBody" responses: "200": description: Updated config content: application/json: schema: $ref: "#/components/schemas/RoleDashboardConfig" /nav-permissions/my: get: operationId: getMyNavPermissions tags: [navPermissions] summary: Get allowed nav keys for the current user responses: "200": description: Allowed nav keys content: application/json: schema: $ref: "#/components/schemas/MyNavPermissions" /nav-permissions/all: get: operationId: getAllNavPermissions tags: [navPermissions] summary: Get nav permission configs for all roles (admin only) responses: "200": description: All role configurations content: application/json: schema: $ref: "#/components/schemas/AllNavPermissions" /nav-permissions/{role}: put: operationId: updateNavPermissions tags: [navPermissions] summary: Update nav permissions for a role (admin only) parameters: - name: role in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateNavPermissionsBody" responses: "200": description: Updated permissions content: application/json: schema: $ref: "#/components/schemas/NavPermissionsConfig" components: schemas: HealthStatus: type: object properties: status: type: string required: [status] DeleteResponse: type: object properties: success: type: boolean message: type: string required: [success] UserProfile: type: object properties: id: type: string email: type: string full_name: type: ["string", "null"] full_name_ar: type: ["string", "null"] role: type: string avatar_url: type: ["string", "null"] signature_url: type: ["string", "null"] signature_drawn_url: type: ["string", "null"] signature_active_type: type: ["string", "null"] department: type: ["string", "null"] is_active: type: boolean created_at: type: string required: [id, email, role, is_active, created_at] User: type: object properties: id: type: string email: type: string full_name: type: ["string", "null"] full_name_ar: type: ["string", "null"] role: type: string department: type: ["string", "null"] avatar_url: type: ["string", "null"] signature_url: type: ["string", "null"] signature_drawn_url: type: ["string", "null"] signature_active_type: type: ["string", "null"] is_active: type: boolean created_at: type: string last_sign_in_at: type: ["string", "null"] required: [id, email, role, is_active, created_at] CreateUserBody: type: object properties: email: type: string password: type: string full_name: type: string full_name_ar: type: ["string", "null"] role: type: string department: type: ["string", "null"] required: [email, password, full_name, role] UpdateUserBody: type: object properties: full_name: type: ["string", "null"] full_name_ar: type: ["string", "null"] role: type: ["string", "null"] department: type: ["string", "null"] is_active: type: ["boolean", "null"] UserStats: type: object properties: total: type: integer by_role: type: array items: type: object properties: role: type: string count: type: integer required: [role, count] active: type: integer inactive: type: integer required: [total, by_role, active, inactive] LandingPageConfig: type: object properties: id: type: string hospital_name: type: string hospital_name_ar: type: ["string", "null"] logo_url: type: ["string", "null"] background_url: type: ["string", "null"] theme_colors: type: array items: type: string nav_items: type: array items: type: object properties: label: type: string label_ar: type: ["string", "null"] href: type: string required: [label, href] updated_at: type: string required: [id, hospital_name, theme_colors, nav_items, updated_at] UpdateLandingPageBody: type: object properties: hospital_name: type: ["string", "null"] hospital_name_ar: type: ["string", "null"] theme_colors: type: ["array", "null"] items: type: string nav_items: type: ["array", "null"] items: type: object properties: label: type: string label_ar: type: ["string", "null"] href: type: string required: [label, href] Section: type: object properties: id: type: string title: type: string title_ar: type: ["string", "null"] description: type: ["string", "null"] description_ar: type: ["string", "null"] order_index: type: integer is_visible: type: boolean created_at: type: string required: [id, title, order_index, is_visible, created_at] CreateSectionBody: type: object properties: title: type: string title_ar: type: ["string", "null"] description: type: ["string", "null"] description_ar: type: ["string", "null"] order_index: type: integer required: [title, order_index] UpdateSectionBody: type: object properties: title: type: ["string", "null"] title_ar: type: ["string", "null"] description: type: ["string", "null"] description_ar: type: ["string", "null"] order_index: type: ["integer", "null"] is_visible: type: ["boolean", "null"] Document: type: object properties: id: type: string title: type: string title_ar: type: ["string", "null"] file_name: type: string file_type: type: string file_size: type: integer file_url: type: string uploaded_by: type: string uploader_name: type: ["string", "null"] created_at: type: string description: type: ["string", "null"] can_download: type: boolean folder_id: type: ["string", "null"] required: [id, title, file_name, file_type, file_size, file_url, uploaded_by, created_at] DocumentList: type: object properties: items: type: array items: $ref: "#/components/schemas/Document" total: type: integer page: type: integer limit: type: integer required: [items, total, page, limit] DocumentSignature: type: object properties: id: type: string document_id: type: string user_id: type: string user_name: type: ["string", "null"] user_role: type: string user_email: type: ["string", "null"] signature_url: type: string notes: type: ["string", "null"] signed_at: type: string required: [id, document_id, user_id, user_role, signature_url, signed_at] DocumentSignatureList: type: object properties: signatures: type: array items: $ref: "#/components/schemas/DocumentSignature" count: type: integer required: [signatures, count] SignDocumentBody: type: object properties: signature_url: type: string notes: type: ["string", "null"] required: [signature_url] RequestSignaturesBody: type: object properties: user_ids: type: array items: type: string message: type: ["string", "null"] required: [user_ids] DocumentStats: type: object properties: total: type: integer by_type: type: array items: type: object properties: type: type: string count: type: integer required: [type, count] total_size_bytes: type: integer required: [total, by_type, total_size_bytes] Article: type: object properties: id: type: string title: type: string title_ar: type: ["string", "null"] content: type: string content_ar: type: ["string", "null"] excerpt: type: ["string", "null"] excerpt_ar: type: ["string", "null"] cover_image_url: type: ["string", "null"] author_id: type: string author_name: type: ["string", "null"] is_published: type: boolean published_at: type: ["string", "null"] created_at: type: string updated_at: type: string required: [id, title, content, author_id, is_published, created_at, updated_at] ArticleList: type: object properties: items: type: array items: $ref: "#/components/schemas/Article" total: type: integer page: type: integer limit: type: integer required: [items, total, page, limit] CreateArticleBody: type: object properties: title: type: string title_ar: type: ["string", "null"] content: type: string content_ar: type: ["string", "null"] excerpt: type: ["string", "null"] excerpt_ar: type: ["string", "null"] cover_image_url: type: ["string", "null"] is_published: type: boolean required: [title, content, is_published] UpdateArticleBody: type: object properties: title: type: ["string", "null"] title_ar: type: ["string", "null"] content: type: ["string", "null"] content_ar: type: ["string", "null"] excerpt: type: ["string", "null"] excerpt_ar: type: ["string", "null"] cover_image_url: type: ["string", "null"] is_published: type: ["boolean", "null"] CalendarEvent: type: object properties: id: type: string title: type: string title_ar: type: ["string", "null"] description: type: ["string", "null"] description_ar: type: ["string", "null"] event_type: type: string organizer: type: ["string", "null"] venue: type: ["string", "null"] participants: type: array items: type: string event_status: type: string start_time: type: string end_time: type: ["string", "null"] all_day: type: boolean location: type: ["string", "null"] created_by: type: string creator_name: type: ["string", "null"] color: type: ["string", "null"] created_at: type: string required: [id, title, event_type, start_time, all_day, created_by, created_at, event_status] CreateEventBody: type: object properties: title: type: string title_ar: type: ["string", "null"] description: type: ["string", "null"] description_ar: type: ["string", "null"] event_type: type: string organizer: type: ["string", "null"] venue: type: ["string", "null"] participants: type: array items: type: string event_status: type: string start_time: type: string end_time: type: ["string", "null"] all_day: type: boolean location: type: ["string", "null"] color: type: ["string", "null"] required: [title, event_type, start_time, all_day] UpdateEventBody: type: object properties: title: type: ["string", "null"] title_ar: type: ["string", "null"] description: type: ["string", "null"] description_ar: type: ["string", "null"] event_type: type: ["string", "null"] organizer: type: ["string", "null"] venue: type: ["string", "null"] participants: type: array items: type: string event_status: type: ["string", "null"] start_time: type: ["string", "null"] end_time: type: ["string", "null"] all_day: type: ["boolean", "null"] location: type: ["string", "null"] color: type: ["string", "null"] ThemeSettings: type: object properties: id: type: string primary_color: type: string theme_colors: type: array items: type: string font_family: type: string style: type: string logo_url: type: ["string", "null"] background_url: type: ["string", "null"] updated_at: type: string required: [id, primary_color, theme_colors, font_family, style, updated_at] UpdateThemeSettingsBody: type: object properties: primary_color: type: ["string", "null"] theme_colors: type: ["array", "null"] items: type: string font_family: type: ["string", "null"] style: type: ["string", "null"] BroadcastNotificationBody: type: object properties: title: type: string title_ar: type: ["string", "null"] body: type: string body_ar: type: ["string", "null"] type: type: string target_role: type: string link: type: ["string", "null"] required: [title, body, type, target_role] BroadcastResult: type: object properties: id: type: string recipient_count: type: integer required: [id, recipient_count] BroadcastItem: type: object properties: id: type: string created_by: type: string title: type: string title_ar: type: ["string", "null"] body: type: string body_ar: type: ["string", "null"] type: type: string target_role: type: string link: type: ["string", "null"] recipient_count: type: integer created_at: type: string required: [id, created_by, title, body, type, target_role, recipient_count, created_at] BroadcastList: type: object properties: items: type: array items: $ref: "#/components/schemas/BroadcastItem" required: [items] SetPasswordBody: type: object properties: password: type: string minLength: 8 required: [password] Role: type: object properties: id: type: string name: type: string label: type: string label_ar: type: ["string", "null"] color: type: string is_system: type: boolean user_count: type: integer created_at: type: string required: [id, name, label, color, is_system, created_at, user_count] CreateRoleBody: type: object properties: name: type: string label: type: string label_ar: type: ["string", "null"] color: type: ["string", "null"] required: [name, label] UpdateRoleBody: type: object properties: label: type: ["string", "null"] label_ar: type: ["string", "null"] color: type: ["string", "null"] UpdateProfileBody: type: object properties: full_name: type: ["string", "null"] full_name_ar: type: ["string", "null"] department: type: ["string", "null"] avatar_url: type: ["string", "null"] signature_url: type: ["string", "null"] signature_drawn_url: type: ["string", "null"] signature_active_type: type: ["string", "null"] UploadSignatureBody: type: object properties: file_base64: type: string file_name: type: string mime_type: type: string sig_type: type: string enum: [uploaded, drawn] required: [file_base64, file_name, mime_type] UserSignatureData: type: object properties: id: type: string full_name: type: ["string", "null"] email: type: string signature_url: type: ["string", "null"] signature_drawn_url: type: ["string", "null"] signature_active_type: type: ["string", "null"] required: [id, email] AdminUpdateSignaturesBody: type: object properties: signature_active_type: type: string enum: [uploaded, drawn] remove_uploaded: type: boolean remove_drawn: type: boolean Folder: type: object properties: id: type: string name: type: string name_ar: type: ["string", "null"] description: type: ["string", "null"] color: type: string created_by: type: ["string", "null"] created_at: type: string updated_at: type: string doc_count: type: integer required: [id, name, color, created_at, doc_count] FolderList: type: array items: $ref: "#/components/schemas/Folder" CreateFolderBody: type: object properties: name: type: string name_ar: type: string description: type: string color: type: string required: [name] UpdateFolderBody: type: object properties: name: type: string name_ar: type: string description: type: string color: type: string MoveDocumentBody: type: object properties: folder_id: type: ["string", "null"] description: Target folder UUID, or null to move to unfiled UploadFileBody: type: object properties: file_base64: type: string file_name: type: string mime_type: type: string required: [file_base64, file_name, mime_type] UploadResponse: type: object properties: url: type: string path: type: string required: [url, path] SuccessResponse: type: object properties: success: type: boolean message: type: ["string", "null"] required: [success] Notification: type: object properties: id: type: string user_id: type: string type: type: string title: type: string title_ar: type: ["string", "null"] body: type: string body_ar: type: ["string", "null"] link: type: ["string", "null"] is_read: type: boolean created_at: type: string required: [id, user_id, type, title, body, is_read, created_at] NotificationList: type: object properties: items: type: array items: $ref: "#/components/schemas/Notification" unread_count: type: integer required: [items, unread_count] UnreadCount: type: object properties: count: type: integer required: [count] RoleDashboardConfig: type: object properties: role: type: string widgets: type: array items: type: string updated_at: type: ["string", "null"] required: [role, widgets] AllRoleDashboardConfigs: type: object properties: configs: type: array items: $ref: "#/components/schemas/RoleDashboardConfig" required: [configs] UpdateRoleDashboardBody: type: object properties: widgets: type: array items: type: string required: [widgets] MyNavPermissions: type: object properties: allowed: type: array items: type: string required: [allowed] NavPermissionsConfig: type: object properties: role: type: string permissions: type: object additionalProperties: type: boolean required: [role, permissions] AllNavPermissions: type: object properties: configs: type: array items: $ref: "#/components/schemas/NavPermissionsConfig" required: [configs] UpdateNavPermissionsBody: type: object properties: permissions: type: object additionalProperties: type: boolean required: [permissions] DashboardSummary: type: object properties: total_users: type: integer total_documents: type: integer total_articles: type: integer upcoming_events: type: integer recent_documents: type: array items: $ref: "#/components/schemas/Document" recent_articles: type: array items: $ref: "#/components/schemas/Article" upcoming_events_list: type: array items: $ref: "#/components/schemas/CalendarEvent" required: [total_users, total_documents, total_articles, upcoming_events, recent_documents, recent_articles, upcoming_events_list]