openapi: 3.1.0 info: title: Api version: 0.1.0 description: AssetFlow Enterprise Asset & Resource Management API servers: - url: /api description: Base API path tags: - name: health - name: auth - name: dashboard - name: departments - name: categories - name: employees - name: assets - name: allocations - name: bookings - name: maintenance - name: audit - name: notifications - name: reports paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" # ── AUTH ───────────────────────────────────────────────────────────────── /auth/signup: post: operationId: signup tags: [auth] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SignupInput" responses: "201": description: Account created (Employee role) content: application/json: schema: $ref: "#/components/schemas/AuthResponse" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /auth/login: post: operationId: login tags: [auth] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LoginInput" responses: "200": description: Logged in content: application/json: schema: $ref: "#/components/schemas/AuthResponse" "401": description: Invalid credentials content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /auth/logout: post: operationId: logout tags: [auth] responses: "200": description: Logged out /auth/me: get: operationId: getMe tags: [auth] responses: "200": description: Current user content: application/json: schema: $ref: "#/components/schemas/Employee" "401": description: Not authenticated # ── DASHBOARD ───────────────────────────────────────────────────────────── /dashboard/summary: get: operationId: getDashboardSummary tags: [dashboard] summary: KPI summary for the dashboard responses: "200": description: Dashboard summary content: application/json: schema: $ref: "#/components/schemas/DashboardSummary" /dashboard/recent-assets: get: operationId: getRecentAssets tags: [dashboard] summary: Recently active assets with health scores responses: "200": description: Recent assets content: application/json: schema: type: array items: $ref: "#/components/schemas/AssetWithHealth" /dashboard/overdue-allocations: get: operationId: getOverdueAllocations tags: [dashboard] summary: Overdue allocations past expected return date responses: "200": description: Overdue allocations content: application/json: schema: type: array items: $ref: "#/components/schemas/AllocationDetail" # ── DEPARTMENTS ──────────────────────────────────────────────────────────── /departments: get: operationId: listDepartments tags: [departments] parameters: - name: status in: query schema: type: string enum: [Active, Inactive] responses: "200": description: List of departments content: application/json: schema: type: array items: $ref: "#/components/schemas/Department" post: operationId: createDepartment tags: [departments] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DepartmentInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/Department" /departments/{id}: get: operationId: getDepartment tags: [departments] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Department content: application/json: schema: $ref: "#/components/schemas/Department" patch: operationId: updateDepartment tags: [departments] parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DepartmentUpdate" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/Department" # ── ASSET CATEGORIES ─────────────────────────────────────────────────────── /categories: get: operationId: listCategories tags: [categories] responses: "200": description: List of categories content: application/json: schema: type: array items: $ref: "#/components/schemas/AssetCategory" post: operationId: createCategory tags: [categories] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AssetCategoryInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/AssetCategory" /categories/{id}: patch: operationId: updateCategory tags: [categories] parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AssetCategoryUpdate" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/AssetCategory" # ── EMPLOYEES ────────────────────────────────────────────────────────────── /employees: get: operationId: listEmployees tags: [employees] parameters: - name: department_id in: query schema: type: integer - name: role in: query schema: type: string enum: [Admin, Asset Manager, Department Head, Employee] - name: status in: query schema: type: string enum: [Active, Inactive] responses: "200": description: List of employees content: application/json: schema: type: array items: $ref: "#/components/schemas/Employee" /employees/{id}: get: operationId: getEmployee tags: [employees] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Employee content: application/json: schema: $ref: "#/components/schemas/Employee" patch: operationId: updateEmployee tags: [employees] parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/EmployeeUpdate" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/Employee" /employees/{id}/promote: post: operationId: promoteEmployee tags: [employees] summary: Admin-only role promotion parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PromoteInput" responses: "200": description: Promoted content: application/json: schema: $ref: "#/components/schemas/Employee" "403": description: Forbidden # ── ASSETS ───────────────────────────────────────────────────────────────── /assets: get: operationId: listAssets tags: [assets] parameters: - name: search in: query schema: type: string - name: category_id in: query schema: type: integer - name: status in: query schema: type: string enum: [Available, Allocated, Reserved, Under Maintenance, Lost, Retired, Disposed] - name: department_id in: query schema: type: integer - name: location in: query schema: type: string - name: is_bookable in: query schema: type: boolean responses: "200": description: List of assets content: application/json: schema: type: array items: $ref: "#/components/schemas/AssetWithHealth" post: operationId: createAsset tags: [assets] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AssetInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/AssetWithHealth" /assets/{id}: get: operationId: getAsset tags: [assets] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Asset content: application/json: schema: $ref: "#/components/schemas/AssetWithHealth" patch: operationId: updateAsset tags: [assets] parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AssetUpdate" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/AssetWithHealth" /assets/{id}/passport: get: operationId: getAssetPassport tags: [assets] summary: Digital Passport — full timeline of events for this asset parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Asset passport timeline content: application/json: schema: type: array items: $ref: "#/components/schemas/PassportEvent" /assets/{id}/health: get: operationId: getAssetHealth tags: [assets] summary: Health score for a single asset parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Health score content: application/json: schema: $ref: "#/components/schemas/AssetHealth" # ── ALLOCATIONS ──────────────────────────────────────────────────────────── /allocations: get: operationId: listAllocations tags: [allocations] parameters: - name: asset_id in: query schema: type: integer - name: employee_id in: query schema: type: integer - name: status in: query schema: type: string enum: [Active, Returned] responses: "200": description: Allocations content: application/json: schema: type: array items: $ref: "#/components/schemas/AllocationDetail" post: operationId: createAllocation tags: [allocations] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AllocationInput" responses: "201": description: Allocated content: application/json: schema: $ref: "#/components/schemas/AllocationDetail" "409": description: Asset already allocated (conflict) content: application/json: schema: $ref: "#/components/schemas/AllocationConflict" /allocations/{id}/return: post: operationId: returnAllocation tags: [allocations] parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReturnInput" responses: "200": description: Returned content: application/json: schema: $ref: "#/components/schemas/AllocationDetail" /transfers: get: operationId: listTransfers tags: [allocations] parameters: - name: status in: query schema: type: string enum: [Requested, Approved, Re-allocated, Rejected] responses: "200": description: Transfer requests content: application/json: schema: type: array items: $ref: "#/components/schemas/TransferRequest" post: operationId: createTransfer tags: [allocations] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TransferInput" responses: "201": description: Transfer requested content: application/json: schema: $ref: "#/components/schemas/TransferRequest" /transfers/{id}/approve: post: operationId: approveTransfer tags: [allocations] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Approved and re-allocated content: application/json: schema: $ref: "#/components/schemas/TransferRequest" /transfers/{id}/reject: post: operationId: rejectTransfer tags: [allocations] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Rejected content: application/json: schema: $ref: "#/components/schemas/TransferRequest" # ── BOOKINGS ─────────────────────────────────────────────────────────────── /bookings: get: operationId: listBookings tags: [bookings] parameters: - name: resource_asset_id in: query schema: type: integer - name: booked_by in: query schema: type: integer - name: status in: query schema: type: string enum: [Upcoming, Ongoing, Completed, Cancelled] - name: from in: query schema: type: string format: date-time - name: to in: query schema: type: string format: date-time responses: "200": description: Bookings content: application/json: schema: type: array items: $ref: "#/components/schemas/BookingDetail" post: operationId: createBooking tags: [bookings] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/BookingInput" responses: "201": description: Booked content: application/json: schema: $ref: "#/components/schemas/BookingDetail" "409": description: Slot overlap conflict content: application/json: schema: $ref: "#/components/schemas/BookingConflict" /bookings/{id}/cancel: post: operationId: cancelBooking tags: [bookings] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Cancelled content: application/json: schema: $ref: "#/components/schemas/BookingDetail" /bookings/heatmap: get: operationId: getBookingHeatmap tags: [bookings] summary: Booking usage heatmap data parameters: - name: resource_asset_id in: query schema: type: integer - name: from in: query schema: type: string format: date - name: to in: query schema: type: string format: date responses: "200": description: Heatmap cells content: application/json: schema: type: array items: $ref: "#/components/schemas/HeatmapCell" # ── MAINTENANCE ──────────────────────────────────────────────────────────── /maintenance: get: operationId: listMaintenance tags: [maintenance] parameters: - name: asset_id in: query schema: type: integer - name: status in: query schema: type: string enum: [Pending, Approved, Rejected, Technician Assigned, In Progress, Resolved] - name: priority in: query schema: type: string enum: [Low, Medium, High, Critical] responses: "200": description: Maintenance requests content: application/json: schema: type: array items: $ref: "#/components/schemas/MaintenanceRequest" post: operationId: createMaintenance tags: [maintenance] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MaintenanceInput" responses: "201": description: Request raised content: application/json: schema: $ref: "#/components/schemas/MaintenanceRequest" /maintenance/{id}: get: operationId: getMaintenance tags: [maintenance] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Maintenance request content: application/json: schema: $ref: "#/components/schemas/MaintenanceRequest" patch: operationId: updateMaintenance tags: [maintenance] parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MaintenanceUpdate" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/MaintenanceRequest" /maintenance/predictions: get: operationId: getMaintenancePredictions tags: [maintenance] summary: Smart Maintenance Prediction — assets due for service responses: "200": description: Predicted maintenance list content: application/json: schema: type: array items: $ref: "#/components/schemas/MaintenancePrediction" # ── AUDIT ────────────────────────────────────────────────────────────────── /audit-cycles: get: operationId: listAuditCycles tags: [audit] responses: "200": description: Audit cycles content: application/json: schema: type: array items: $ref: "#/components/schemas/AuditCycle" post: operationId: createAuditCycle tags: [audit] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AuditCycleInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/AuditCycle" /audit-cycles/{id}: get: operationId: getAuditCycle tags: [audit] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Audit cycle content: application/json: schema: $ref: "#/components/schemas/AuditCycle" /audit-cycles/{id}/close: post: operationId: closeAuditCycle tags: [audit] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Closed content: application/json: schema: $ref: "#/components/schemas/AuditCycle" /audit-cycles/{id}/findings: get: operationId: listAuditFindings tags: [audit] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Audit findings content: application/json: schema: type: array items: $ref: "#/components/schemas/AuditFinding" post: operationId: createAuditFinding tags: [audit] parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AuditFindingInput" responses: "201": description: Finding recorded (cascade triggers fire on Missing) content: application/json: schema: $ref: "#/components/schemas/AuditFinding" # ── NOTIFICATIONS ────────────────────────────────────────────────────────── /notifications: get: operationId: listNotifications tags: [notifications] parameters: - name: unread_only in: query schema: type: boolean responses: "200": description: Notifications content: application/json: schema: type: array items: $ref: "#/components/schemas/Notification" /notifications/{id}/read: post: operationId: markNotificationRead tags: [notifications] parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Marked read content: application/json: schema: $ref: "#/components/schemas/Notification" /notifications/read-all: post: operationId: markAllNotificationsRead tags: [notifications] responses: "200": description: All marked read /activity-log: get: operationId: listActivityLog tags: [notifications] parameters: - name: limit in: query schema: type: integer default: 50 responses: "200": description: Activity log entries content: application/json: schema: type: array items: $ref: "#/components/schemas/ActivityLogEntry" # ── REPORTS ──────────────────────────────────────────────────────────────── /reports/utilization: get: operationId: getUtilizationReport tags: [reports] responses: "200": description: Asset utilization report content: application/json: schema: type: array items: $ref: "#/components/schemas/UtilizationRow" /reports/maintenance-frequency: get: operationId: getMaintenanceFrequency tags: [reports] responses: "200": description: Maintenance frequency by category content: application/json: schema: type: array items: $ref: "#/components/schemas/MaintenanceFrequencyRow" /reports/department-summary: get: operationId: getDepartmentSummary tags: [reports] responses: "200": description: Department-wise allocation summary content: application/json: schema: type: array items: $ref: "#/components/schemas/DepartmentSummaryRow" /reports/health-distribution: get: operationId: getHealthDistribution tags: [reports] summary: Distribution of asset health scores (green/amber/red) responses: "200": description: Health distribution content: application/json: schema: $ref: "#/components/schemas/HealthDistribution" components: schemas: HealthStatus: type: object properties: status: type: string required: [status] ErrorResponse: type: object properties: error: type: string required: [error] # ── AUTH ──────────────────────────────────────────────────────────────── SignupInput: type: object required: [name, email, password] properties: name: type: string email: type: string password: type: string minLength: 8 LoginInput: type: object required: [email, password] properties: email: type: string password: type: string AuthResponse: type: object required: [user] properties: user: $ref: "#/components/schemas/Employee" # ── EMPLOYEE ──────────────────────────────────────────────────────────── Employee: type: object required: [id, name, email, role, status, created_at] properties: id: type: integer name: type: string email: type: string department_id: type: ["integer", "null"] department_name: type: ["string", "null"] role: type: string enum: [Admin, Asset Manager, Department Head, Employee] status: type: string enum: [Active, Inactive] created_at: type: string format: date-time EmployeeUpdate: type: object properties: name: type: string department_id: type: ["integer", "null"] status: type: string enum: [Active, Inactive] PromoteInput: type: object required: [role] properties: role: type: string enum: [Asset Manager, Department Head, Employee] # ── DEPARTMENT ────────────────────────────────────────────────────────── Department: type: object required: [id, name, status] properties: id: type: integer name: type: string head_id: type: ["integer", "null"] head_name: type: ["string", "null"] parent_department_id: type: ["integer", "null"] parent_department_name: type: ["string", "null"] status: type: string enum: [Active, Inactive] DepartmentInput: type: object required: [name] properties: name: type: string head_id: type: ["integer", "null"] parent_department_id: type: ["integer", "null"] status: type: string enum: [Active, Inactive] default: Active DepartmentUpdate: type: object properties: name: type: string head_id: type: ["integer", "null"] parent_department_id: type: ["integer", "null"] status: type: string enum: [Active, Inactive] # ── ASSET CATEGORY ────────────────────────────────────────────────────── AssetCategory: type: object required: [id, name] properties: id: type: integer name: type: string custom_fields: type: object additionalProperties: true AssetCategoryInput: type: object required: [name] properties: name: type: string custom_fields: type: object additionalProperties: true AssetCategoryUpdate: type: object properties: name: type: string custom_fields: type: object additionalProperties: true # ── ASSET ─────────────────────────────────────────────────────────────── AssetWithHealth: type: object required: [id, asset_tag, name, status, is_bookable, created_at, health_score, health_color] properties: id: type: integer asset_tag: type: string name: type: string category_id: type: ["integer", "null"] category_name: type: ["string", "null"] serial_number: type: ["string", "null"] acquisition_date: type: ["string", "null"] format: date acquisition_cost: type: ["number", "null"] condition: type: ["string", "null"] location: type: ["string", "null"] is_bookable: type: boolean status: type: string enum: [Available, Allocated, Reserved, Under Maintenance, Lost, Retired, Disposed] current_holder_id: type: ["integer", "null"] current_holder_name: type: ["string", "null"] health_score: type: integer health_color: type: string enum: [green, amber, red] created_at: type: string format: date-time AssetInput: type: object required: [name, is_bookable] properties: name: type: string category_id: type: ["integer", "null"] serial_number: type: ["string", "null"] acquisition_date: type: ["string", "null"] format: date acquisition_cost: type: ["number", "null"] condition: type: ["string", "null"] location: type: ["string", "null"] is_bookable: type: boolean AssetUpdate: type: object properties: name: type: string category_id: type: ["integer", "null"] serial_number: type: ["string", "null"] acquisition_date: type: ["string", "null"] format: date acquisition_cost: type: ["number", "null"] condition: type: ["string", "null"] location: type: ["string", "null"] is_bookable: type: boolean status: type: string enum: [Available, Allocated, Reserved, Under Maintenance, Lost, Retired, Disposed] AssetHealth: type: object required: [asset_id, health_score, health_color] properties: asset_id: type: integer health_score: type: integer health_color: type: string enum: [green, amber, red] maintenance_count: type: integer total_days_in_repair: type: ["number", "null"] last_service_date: type: ["string", "null"] format: date-time PassportEvent: type: object required: [event_type, event_date] properties: event_type: type: string event_date: type: string format: date-time actor: type: ["string", "null"] notes: type: ["string", "null"] # ── ALLOCATION ────────────────────────────────────────────────────────── AllocationDetail: type: object required: [id, asset_id, status, allocated_date] properties: id: type: integer asset_id: type: integer asset_tag: type: string asset_name: type: string employee_id: type: ["integer", "null"] employee_name: type: ["string", "null"] department_id: type: ["integer", "null"] department_name: type: ["string", "null"] allocated_date: type: string format: date-time expected_return_date: type: ["string", "null"] format: date actual_return_date: type: ["string", "null"] format: date-time condition_check_in_notes: type: ["string", "null"] status: type: string enum: [Active, Returned] AllocationInput: type: object required: [asset_id] properties: asset_id: type: integer employee_id: type: ["integer", "null"] department_id: type: ["integer", "null"] expected_return_date: type: ["string", "null"] format: date AllocationConflict: type: object required: [error, current_holder_id, current_holder_name, suggestions] properties: error: type: string current_holder_id: type: integer current_holder_name: type: string suggestions: type: array items: $ref: "#/components/schemas/AssetWithHealth" ReturnInput: type: object properties: condition_check_in_notes: type: ["string", "null"] # ── TRANSFER ──────────────────────────────────────────────────────────── TransferRequest: type: object required: [id, asset_id, status, requested_at] properties: id: type: integer asset_id: type: integer asset_tag: type: string asset_name: type: string from_employee_id: type: ["integer", "null"] from_employee_name: type: ["string", "null"] to_employee_id: type: ["integer", "null"] to_employee_name: type: ["string", "null"] requested_by: type: integer approved_by: type: ["integer", "null"] status: type: string enum: [Requested, Approved, Re-allocated, Rejected] requested_at: type: string format: date-time TransferInput: type: object required: [asset_id, to_employee_id] properties: asset_id: type: integer to_employee_id: type: integer # ── BOOKING ───────────────────────────────────────────────────────────── BookingDetail: type: object required: [id, resource_asset_id, booked_by, starts_at, ends_at, status] properties: id: type: integer resource_asset_id: type: integer asset_name: type: string asset_tag: type: string booked_by: type: integer booked_by_name: type: string starts_at: type: string format: date-time ends_at: type: string format: date-time status: type: string enum: [Upcoming, Ongoing, Completed, Cancelled] created_at: type: string format: date-time BookingInput: type: object required: [resource_asset_id, starts_at, ends_at] properties: resource_asset_id: type: integer starts_at: type: string format: date-time ends_at: type: string format: date-time BookingConflict: type: object required: [error, conflicting_booking, suggestions] properties: error: type: string conflicting_booking: $ref: "#/components/schemas/BookingDetail" suggestions: type: array items: $ref: "#/components/schemas/AssetWithHealth" HeatmapCell: type: object required: [day, hour, booking_count] properties: day: type: string hour: type: integer booking_count: type: integer # ── MAINTENANCE ───────────────────────────────────────────────────────── MaintenanceRequest: type: object required: [id, asset_id, raised_by, status, priority, created_at] properties: id: type: integer asset_id: type: integer asset_tag: type: string asset_name: type: string raised_by: type: integer raised_by_name: type: string issue_description: type: string priority: type: string enum: [Low, Medium, High, Critical] status: type: string enum: [Pending, Approved, Rejected, Technician Assigned, In Progress, Resolved] approved_by: type: ["integer", "null"] approved_by_name: type: ["string", "null"] technician: type: ["string", "null"] resolved_at: type: ["string", "null"] format: date-time created_at: type: string format: date-time MaintenanceInput: type: object required: [asset_id, priority, issue_description] properties: asset_id: type: integer issue_description: type: string priority: type: string enum: [Low, Medium, High, Critical] MaintenanceUpdate: type: object properties: status: type: string enum: [Pending, Approved, Rejected, Technician Assigned, In Progress, Resolved] technician: type: ["string", "null"] MaintenancePrediction: type: object required: [asset_id, name, health_score, reasons] properties: asset_id: type: integer asset_tag: type: string name: type: string health_score: type: integer last_service_date: type: ["string", "null"] format: date-time months_since_service: type: ["number", "null"] reasons: type: array items: type: string # ── AUDIT ─────────────────────────────────────────────────────────────── AuditCycle: type: object required: [id, status, created_at] properties: id: type: integer scope_department_id: type: ["integer", "null"] scope_department_name: type: ["string", "null"] scope_location: type: ["string", "null"] starts_at: type: ["string", "null"] format: date ends_at: type: ["string", "null"] format: date status: type: string enum: [Open, Closed] auditor_ids: type: array items: type: integer verified_count: type: integer missing_count: type: integer damaged_count: type: integer created_at: type: string format: date-time AuditCycleInput: type: object required: [auditor_ids] properties: scope_department_id: type: ["integer", "null"] scope_location: type: ["string", "null"] starts_at: type: ["string", "null"] format: date ends_at: type: ["string", "null"] format: date auditor_ids: type: array items: type: integer AuditFinding: type: object required: [id, audit_cycle_id, asset_id, auditor_id, result, created_at] properties: id: type: integer audit_cycle_id: type: integer asset_id: type: integer asset_tag: type: string asset_name: type: string auditor_id: type: integer auditor_name: type: string result: type: string enum: [Verified, Missing, Damaged] notes: type: ["string", "null"] created_at: type: string format: date-time AuditFindingInput: type: object required: [asset_id, auditor_id, result] properties: asset_id: type: integer auditor_id: type: integer result: type: string enum: [Verified, Missing, Damaged] notes: type: ["string", "null"] # ── NOTIFICATIONS ─────────────────────────────────────────────────────── Notification: type: object required: [id, recipient_id, type, message, is_automated, is_read, created_at] properties: id: type: integer recipient_id: type: integer type: type: string message: type: string related_entity_id: type: ["integer", "null"] is_automated: type: boolean is_read: type: boolean created_at: type: string format: date-time ActivityLogEntry: type: object required: [id, actor_id, action, table_name, record_id, timestamp] properties: id: type: integer actor_id: type: integer actor_name: type: string action: type: string table_name: type: string record_id: type: integer is_automated: type: boolean timestamp: type: string format: date-time # ── DASHBOARD ─────────────────────────────────────────────────────────── DashboardSummary: type: object required: - assets_available - assets_allocated - maintenance_today - active_bookings - pending_transfers - upcoming_returns - overdue_count - unread_notifications properties: assets_available: type: integer assets_allocated: type: integer maintenance_today: type: integer active_bookings: type: integer pending_transfers: type: integer upcoming_returns: type: integer overdue_count: type: integer unread_notifications: type: integer # ── REPORTS ───────────────────────────────────────────────────────────── UtilizationRow: type: object required: [asset_id, asset_tag, name, allocation_count, total_days_allocated] properties: asset_id: type: integer asset_tag: type: string name: type: string category_name: type: ["string", "null"] allocation_count: type: integer total_days_allocated: type: ["number", "null"] MaintenanceFrequencyRow: type: object required: [category_id, category_name, request_count] properties: category_id: type: integer category_name: type: string request_count: type: integer avg_resolution_days: type: ["number", "null"] DepartmentSummaryRow: type: object required: [department_id, department_name, total_allocated] properties: department_id: type: integer department_name: type: string total_allocated: type: integer active_employees: type: integer HealthDistribution: type: object required: [green, amber, red, total] properties: green: type: integer amber: type: integer red: type: integer total: type: integer