Skip to content

feat: RWA asset lifecycle status model, badge, and timeline UI - #174

Merged
El-swaggerito merged 2 commits into
Raegis-RWA:mainfrom
Justine-Ifedozie:feat/rwa-asset-lifecycle-status-ui
Jul 29, 2026
Merged

feat: RWA asset lifecycle status model, badge, and timeline UI#174
El-swaggerito merged 2 commits into
Raegis-RWA:mainfrom
Justine-Ifedozie:feat/rwa-asset-lifecycle-status-ui

Conversation

@Justine-Ifedozie

Copy link
Copy Markdown
Contributor

Closes #30

Summary

Adds a typed lifecycle state machine for already-minted RWA assets
(active/paused/matured/redeemed/defaulted) with fail-closed transition
validation, a badge + full status/timeline UI, and integration into the
existing portfolio view.

Changes

  • src/lib/assetLifecycle.ts — pure state machine: valid transitions,
    terminal-state detection, transition validation with clear rejection
    reasons for every invalid case
  • src/features/assets/components/AssetLifecycleBadge.tsx — small badge,
    same conventions as the existing ComplianceBadge/TransferEligibilityBadge
  • src/features/assets/components/AssetLifecycleTimeline.tsx — full status
    UI: current state, detail copy, ordered history, optional admin action
    buttons (read-only by default)
  • src/lib/aegis/types.ts — adds optional lifecycleStatus field to
    PortfolioAsset (additive, non-breaking)
  • src/fixtures/portfolio.ts — populates 3 lifecycle states across
    existing assets; deliberately omits it on the asset that already has
    isDataAvailable: false
  • src/features/assets/components/AssetCard.tsx — renders the badge when
    present
  • docs/asset-lifecycle-status.md — state diagram, edge cases, compliance
    wording notes, known limitations
  • README.md / docs/README.md — links to the new doc

Testing

  • 21 new unit tests for the state machine (assetLifecycle.test.ts)
  • 6 new component tests for the timeline (AssetLifecycleTimeline.test.tsx)
  • Full suite passes with zero regressions
  • tsc --noEmit and next lint clean

Known limitations (documented in the doc)

  • Lifecycle state does not yet gate transfer eligibility or minting —
    that would need to flow through the existing eligibility.ts
    assetPaused input. Intentionally left as a follow-up to keep this PR
    focused.
  • No admin page in this PR wires AssetLifecycleTimeline's action buttons
    to a real mutation — the component supports it via the onTransition
    prop, but nothing calls it yet.

- Add pure lifecycle state machine (src/lib/assetLifecycle.ts): active,
  paused, matured, redeemed, defaulted, with fail-closed transition
  validation (rejects same-state, out-of-terminal-state, and
  state-skipping transitions)
- Add AssetLifecycleBadge (small badge, matches ComplianceBadge/
  TransferEligibilityBadge conventions) and AssetLifecycleTimeline (full
  status UI: current state, history, optional admin action buttons)
- Extend PortfolioAsset with optional lifecycleStatus field (additive,
  non-breaking) and wire it through fixtures/portfolio.ts and AssetCard
- Deliberately omit lifecycleStatus on the existing 'data unavailable'
  fixture asset to exercise the no-default-assumed edge case
- Add 21 unit tests for the state machine and 6 component tests for the
  timeline UI; full suite passes with zero regressions
- Document the model, state diagram, edge cases, and known limitations
  (lifecycle state does not yet gate transfer eligibility or minting;
  no admin page wires the action buttons to a real mutation) in
  docs/asset-lifecycle-status.md, linked from README.md and docs/README.md

Closes #30
@El-swaggerito

Copy link
Copy Markdown
Contributor
\nThis PR is currently blocked by merge conflicts.\n\nPlease update the branch with the latest main branch and resolve the conflicts before it can be merged.

@El-swaggerito
El-swaggerito merged commit fd5e1c4 into Raegis-RWA:main Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement RWA asset lifecycle status UI

2 participants