Skip to content

HELD: Staff map: boot SeatLayerView with a manage grant - #21

Draft
pietechsolution wants to merge 2 commits into
mainfrom
navin/staff-map-mode
Draft

pietechsolution wants to merge 2 commits into
mainfrom
navin/staff-map-mode

Conversation

@pietechsolution

Copy link
Copy Markdown
Contributor

HELD. Do not merge or publish. This waits for a SeatLayer renderer release that advertises staff-map-v1. That release is pinned in a separate change; until then the load fails cleanly with SeatLayerError.incompatible.

Staff map

A new mode of SeatLayerView for apps used by an organizer's own staff, such as a box office. Boot the view with an event-scoped manage grant (mse_…) instead of buyer access, and it shows the organizer's live board. Staff pick seats (held and sold seats included), the selection arrives on onSelectionChanged, and no hold is placed.

API

// Configuration
SeatLayerConfiguration(
  event: 'ev_xxx',
  manageAccessToken: ManageAccessToken(token: 'mse_…', expiresAt: 1790000000000), // optional
  manageAccessTokenProvider: (ManageAccessRequestContext context) async => ManageAccessToken(...), // renews; also mints when no token
);

// Controller (staff map)
Stream<List<SelectedSeat>> onSelectionChanged;           // the picked seats
Stream<GAArea> onGAClick;                                 // a standing area was tapped
Stream<StaffConnectionState> onStaffConnectionChanged;    // live / reconnecting / ended
Future<bool> focusSection(String? label);                 // null frames the whole venue
Future<void> setUnavailableObjects(List<String> objects, {String? reason});
Future<void> setCategoryPrices(Map<String, StaffCategoryPrice>? prices);
// plus selectObjects, deselectObjects, clearSelection, getSelection, zoomToFit

New types: ManageAccessToken, ManageAccessTokenProvider, ManageAccessRequestContext, ManageAccessRefreshReason (initial, refresh), StaffConnectionState, StaffCategoryPrice, seatLayerStaffMapCapability.

Rules

  • The grant is minted for one event with the event:view capability and seatLayerMobileOrigin (https://cdn.seatlayer.io) as its allowed origin.
  • A token that is not mse_…, or a grant combined with publicKey, buyerAccessToken or buyerAccessTokenProvider, throws an ArgumentError from the configuration.
  • The handshake requires staff-map-v1; without it the load fails with SeatLayerError.incompatible.
  • SeatLayerPicker refuses a manage grant with bad_payload.
  • Renewals go through the existing access.token.request round trip. A provider failure, or anything that is not an mse_ grant, answers access.token.unavailable and never puts a token in an event.
  • semanticallyEquals covers the new fields, so a rebuilt configuration does not reload the map.

Changes

  • lib/src/staff_map.dart (new) and its export from lib/seatlayer.dart.
  • lib/src/seat_layer_configuration.dart: fields, validation, init payload, equality.
  • lib/src/seat_layer_controller.dart: capability gate, grant renewal, staff.connection, three commands.
  • test/staff_map_test.dart (new, 12 tests).
  • README section and an Unreleased changelog entry.

Checks

  • flutter analyze: no issues.
  • flutter test test/staff_map_test.dart test/bridge_profile_test.dart test/ready_timing_test.dart test/file_size_test.dart test/payloads_test.dart test/bridge_client_test.dart test/negotiation_test.dart test/seat_layer_view_reload_test.dart: 73/73.
  • flutter test test/staff_map_test.dart test/file_size_test.dart test/package_version_test.dart: 14/14, run after the docs change.

SeatLayerConfiguration gains manageAccessToken and manageAccessTokenProvider.
The view then shows the organizer's live board: staff pick seats, held and sold
seats included, and the selection arrives on onSelectionChanged with no hold
placed. onStaffConnectionChanged reports the live connection; focusSection,
setUnavailableObjects and setCategoryPrices drive the board. The handshake
requires staff-map-v1 and fails with SeatLayerError.incompatible without it.
A grant that is not mse_, or one mixed with buyer access, throws an
ArgumentError; the picker surface is refused.
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.

2 participants