ledger and a pair of boolean flags: access_status and access_entry.
| Flag | Meaning |
|---|---|
access_status: false, access_entry: false | Never scanned — ticket is unseen at the gate |
access_status: true, access_entry: true | Currently inside the venue |
access_status: true, access_entry: false | Was inside, has exited |
Access control functions only act on tickets where
status = false (sold tickets). A ticket that has not been sold cannot be scanned for entry.List Checkpoints
events_list_checkpoints returns all active checkpoint assignments for a collaborator. Checkpoints are stored as sub-documents of the collaborator in u_collaborators/{userd_id}/checkpoints.
The UID of the collaborator (checkpoint operator). Filters checkpoints with
status of "Activo" or "En Progreso".Response Fields
Array of checkpoint objects.
The Firestore document ID (used as key) for this checkpoint.
Display name of the checkpoint (e.g.
"Entrada Principal").Checkpoint type identifier.
"Activo" or "En Progreso".When this checkpoint assignment begins.
When this checkpoint assignment ends.
Media metadata for the associated event (sourced from
data.event.media).List Credentials
events_list_credentials returns all active credentials for an event from events/{event_id}/credentials.
The event to list credentials for. Only documents with
status: true are returned.Response Fields
Array of active credential objects.
Firestore document ID of the credential.
Credential display name.
Name of the person holding this credential.
Description or role notes for the credential.
true — only active credentials are returned.When the credential was created (
data.date.created).When the credential was last updated (
data.date.updated).Ticket Access Control Flow
Scan ticket QR at entry gate
The gate app calls
tickets_access_control_in with the scanned ticket_id.Look up ticket in PostgreSQL
The function queries
tickets for ticket_id = ? AND status = false. A ticket that has not been sold (status = true) is rejected with "Ticket no valido".Evaluate current access state
Three cases are handled based on
access_status and access_entry:- Both
false→ First entry. Setsaccess_status = true,access_entry = true, appendsaccessedto ledger. access_status = true,access_entry = false→ Re-entry after previous exit. Setsaccess_entry = trueonly.- Both
true→ Already inside. Returns error"Ticket ya Utilizado no puede volver Ingresar".
Write updates
Changes are written to Firestore (
events/{eventId}/tickets/{docId}) and PostgreSQL (tickets) simultaneously.Ticket Entry
tickets_access_control_in
The full composite ticket ID to scan for entry.
| Scenario | Response message | valido |
|---|---|---|
| First entry | "Ticket Ingresando" | true |
| Re-entry after exit | "Ticket ReIngreso" | true |
| Already inside | "Ticket ya Utilizado no puede volver Ingresar" | false |
| Not a sold ticket | "Ticket no valido" | false |
Ticket Exit
tickets_access_control_out
The full composite ticket ID to scan for exit.
| Scenario | Response message | valido |
|---|---|---|
| Valid exit | "Ticket Salida" | true |
| Never entered | "Ticket no Ingreso no puede salir" | false |
| Not a sold ticket | "Ticket no valido" | false |
Credential Entry
credentials_access_control_in handles entry for staff/VIP credentials stored in Firestore. Unlike tickets, credentials do not use PostgreSQL — all state is managed directly in events/{event_id}/credentials/{credential_id}.
The event the credential belongs to.
The Firestore document ID of the credential to scan.
| Scenario | Response message | valido |
|---|---|---|
| First entry | "Credencial valida Ingresando" | true |
| Re-entry | "Credencial valida Re-Ingresando" | true |
| Already inside | "Credencial ya Entro" | false |
| Not found | "Credencial no valida" | false |
Credential Exit
credentials_access_control_out
The event the credential belongs to.
The Firestore document ID of the credential to scan for exit.
| Scenario | Response message | valido |
|---|---|---|
| Valid exit | "Credencial valida Saliendo" | true |
| Never entered | "Credencial NO Entro" | false |
| Not found | "Credencial no valida" | false |
Cold (Offline) Sync
tickets_access_control_cold synchronises a batch of entry/exit events that were captured by a gate device operating without connectivity. All events in the batch are applied in order and deduplicated by ticket_id — only the first occurrence of each ticket in the array is processed.
Array of cold-sync entries. Each object must include
ticket_id, date, and tipo.The composite ticket ID that was scanned offline.
ISO 8601 timestamp of when the scan occurred on the offline device.
"in" for entry (writes accessed to ledger, sets access_entry = true) or "out" for exit (writes came-out, sets access_entry = false).