Skip to content

Feat/organizer functions - #107

Merged
manoahLinks merged 6 commits into
mainfrom
feat/organizer-functions
Jul 19, 2026
Merged

Feat/organizer functions#107
manoahLinks merged 6 commits into
mainfrom
feat/organizer-functions

Conversation

@manoahLinks

Copy link
Copy Markdown
Contributor

closes #101
closes #102
closes #103

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.
@manoahLinks
manoahLinks merged commit 3511347 into main Jul 19, 2026
3 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

1 participant