Skip to content

[FE-23] Build asset disposal and retirement workflow UI — request, approve, and record disposal #960

Description

@yusuftomilola

Overview

A formal UI for the asset retirement workflow: users submit a retirement request from the asset detail page, managers approve or reject it, and the disposal is recorded with method, date, and proceeds. Depends on BE-31.

Context

  • The asset detail page (frontend/app/(dashboard)/assets/[id]/page.tsx) should get a "Request Disposal" button in the overview tab
  • API endpoints (from BE-31): POST /assets/:id/disposal, PATCH /assets/:id/disposal/:disposalId/approve, PATCH /assets/:id/disposal/:disposalId/reject
  • A separate "Retirement Requests" section is needed in a management page (or on the reports page)

Acceptance Criteria

  • Add "Request Disposal" button to the asset detail page Overview tab (visible to all users, not just admin)
  • Clicking opens a modal: disposal method dropdown (SOLD/DONATED/SCRAPPED/RECYCLED/LOST/STOLEN), sale price input (shown only if SOLD), reason textarea
  • After submission: asset detail page shows a "Pending Disposal Approval" banner
  • Create frontend/app/(dashboard)/assets/disposals/page.tsx — an admin/manager page listing all pending disposal requests with Approve and Reject buttons
  • Approve button: calls approve endpoint, shows asset as RETIRED on confirmation
  • Reject button: opens a modal to enter rejection reason, calls reject endpoint
  • Create React Query hooks: useCreateDisposalRequest(), useApproveDisposal(), useRejectDisposal(), usePendingDisposals()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions