feat: implement certificate retirement API endpoint#429
Open
devAgatha wants to merge 1 commit into
Open
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the certificate retirement flow: calls
energy_tokenburn on Soroban, persists the tx hash, and emits an audit event.Changes
supabase/migrations/20240101000005_certificate_retirement.sql— addsretire_tx_hashcolumn tocertificatesand createsretirement_eventsaudit tablesrc/lib/database.types.ts— updated types forretire_tx_hashand newretirement_eventstablesrc/app/api/certificates/[id]/retire/route.ts— storesretire_tx_hashin DB, insertsretirement_eventsrecord, returns 409 if already retiredAcceptance Criteria
Closes #270