feat: event proposal and approval workflow #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/event-approval-workflow"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add an approval workflow so non-admin users can propose events that require admin review before going live. Closes #6.
Changes
Model + Migration:
statusfield toEventmodel (proposed,approved,rejected)approvedfor backward compatibility — existing events unaffectedm008_add_event_statusadds the columnCRUD:
get_public_events()— returns approved, non-canceled events (replacesget_all_eventsin public endpoint)get_pending_events()— returns proposed events for admin reviewAPI Endpoints:
POST /api/v1/events/propose— submit event proposal (invoice key, any user)GET /api/v1/events/pending— list proposed events (admin key)PUT /api/v1/events/{id}/approve— approve event (admin key)PUT /api/v1/events/{id}/reject— reject event (admin key)GET /api/v1/events/public— now returns only approved, non-canceled eventsBug fix (included):
promo_codeandrefund_addressoptional on the GET ticket endpointTest plan
status=approvedafter migrationPOST /events/proposecreates event withstatus=proposed/events/publicPUT /events/{id}/approvetransitions to approved, event appears in public listingPUT /events/{id}/rejecttransitions to rejected* add extra column * add conditional events * refunds * conditional events working * adding promo codes * promo codes logic --------- Co-authored-by: dni ⚡ <office@dnilabs.com>- POST /api/v1/events/propose — submit event for approval (invoice key) - GET /api/v1/events/pending — list proposed events (admin key) - PUT /api/v1/events/{id}/approve — approve proposed event (admin key) - PUT /api/v1/events/{id}/reject — reject proposed event (admin key) - GET /api/v1/events/public — now returns only approved, non-canceled events Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>Remove separate /events/propose endpoint. POST /events now uses invoice key (any user) and determines approval status based on: - LNbits admin → auto-approved - auto_approve setting → auto-approved - Otherwise → proposed (requires admin approval) Separate PUT /events/{id} for updates (admin key, event owner). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>Update: API consolidation
The separate
POST /events/proposeendpoint has been removed. There is now a singlePOST /eventsendpoint that handles all event creation:require_invoice_key(any authenticated user can call it)auto_approvesetting enabled → auto-approvedproposed(requires admin approval)The
auto_approvetoggle is exposed in the admin UI and accessible via:GET /api/v1/settingsPUT /api/v1/settingsThis simplifies the API surface (one endpoint instead of two) while preserving the same behavior. The webapp's
TicketApiService.proposeEvent()was removed;createEvent()now uses the invoice key.Closes #4, #5, #6, #11.
Pull request closed