Feat/organizer functions - #107
Merged
Merged
Conversation
Organizers can grant/revoke/list on-chain ticket admins so other HostIT users can scan attendees in. On-chain the ticketAdminRole is keyed by the per-type on-chain ticket id, so an event-level grant fans out across all of the event's ticket types via organizer-signed addTicketAdmins / removeTicketAdmins. The check-in worker already signs with the scanner's own wallet, so a granted delegate is picked up automatically. Delegates are tracked in a new EventTicketAdmin table (the contract has no getter for the admin set), which backs the list endpoint. Targets are resolved to their wallet on the event's chain; a missing wallet kicks provisioning and is rejected with a retry hint. Platform admins and self-delegation are rejected; non-owners get 403. Endpoints: GET/POST/DELETE /organizer/events/:id/ticket-admins. Closes #101
Add PATCH /organizer/events/:id/tickets/:ticketTypeId/fee so an organizer can change a published ticket's price. The new NGN price is converted to the on-chain USDC 6-dp ticketFee exactly as publish does (computeUsdcFees) and written via organizer-signed updateTicketFees; the DB price is updated only after a successful submit. Only future mints are affected. Guardrails: owner-only (403 otherwise), published + paid events only, locked once the event has started, and the ticket type must already be on-chain. Bounds mirror event creation (500..500000 NGN). Closes #102
… spec Keeps tsc --noEmit green; the jest.fn had a no-arg signature so mock.calls indexing tripped noUncheckedIndexedAccess.
Add organizer dashboard reads straight from the Diamond (pure view calls,
no signing): claimable/escrow USDC balance per ticket type
(getTicketBalance), check-in totals per ticket type + event total
(getCheckedIn), and per-day check-in counts (getCheckedInForDay).
New BlockchainReadService wrappers for the three views; a resilient
OnchainReadsService that resolves the event's on-chain ticket types and
tolerates RPC hiccups per-ticket (a failed read becomes an `error` entry
rather than failing the whole response). Owner-only (403 otherwise).
Endpoints: GET /organizer/events/:id/onchain/{balance,checkins,
checkins/day/:day}.
Closes #103
Each chain's Diamond issues ticket ids from its own counter starting at 1, so the same numeric id legitimately recurs across chains. The global @unique on TicketType.onChainTicketId made an Arc event's id collide with an existing Base Sepolia id, failing publish with a unique-constraint error and rolling the event back to DRAFT. An event is bound to a single chain, so (eventId, onChainTicketId) is the correct scope. No code depends on the field being globally unique.
Strip async from value-returning jest mocks, drop an unused import, and apply prettier formatting the CI lint step flagged. No behavior change.
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.
closes #101
closes #102
closes #103