Skip to content

feat: implement certificate retirement API endpoint#429

Merged
AnnabelJoe merged 2 commits into
AnnabelJoe:mainfrom
devAgatha:feat/270-certificate-retirement
Jun 3, 2026
Merged

feat: implement certificate retirement API endpoint#429
AnnabelJoe merged 2 commits into
AnnabelJoe:mainfrom
devAgatha:feat/270-certificate-retirement

Conversation

@devAgatha
Copy link
Copy Markdown
Contributor

Summary

Completes the certificate retirement flow: calls energy_token burn on Soroban, persists the tx hash, and emits an audit event.

Changes

  • supabase/migrations/20240101000005_certificate_retirement.sql — adds retire_tx_hash column to certificates and creates retirement_events audit table
  • src/lib/database.types.ts — updated types for retire_tx_hash and new retirement_events table
  • src/app/api/certificates/[id]/retire/route.ts — stores retire_tx_hash in DB, inserts retirement_events record, returns 409 if already retired

Acceptance Criteria

  • POST /api/certificates/:id/retire endpoint
  • Calls energy_token burn function on Soroban
  • Records retirement timestamp, beneficiary, and tx hash in DB
  • Returns 409 if certificate already retired
  • Emits retirement event for audit log

Closes #270

devAgatha and others added 2 commits June 1, 2026 11:06
- POST /api/certificates/:id/retire calls energy_token burn on Soroban
- Records retirement timestamp, beneficiary, and retire_tx_hash in certificates table
- Returns 409 if certificate already retired
- Emits retirement_events record for audit log
- Add migration 005: retire_tx_hash column + retirement_events table
- Update database.types.ts with new fields

Closes AnnabelJoe#270
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 3, 2026

@devAgatha Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@AnnabelJoe AnnabelJoe merged commit 455bc44 into AnnabelJoe:main Jun 3, 2026
5 of 14 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 certificate retirement API endpoint

2 participants