Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.
API operations
Data model
Attributes
Relationships
System-computed
- session_event_id — generated via gen_random_uuid() DB default; also initialised in-process via randomUUID() as the ORM default value
- created_at — set by MikroORM onCreate hook to new Date() at insert time; never updated
- token_issued_at — sourced from decoded Firebase ID token iat field by firebase.strategy.ts; NOT user-supplied
- event_type — derived from decoded.auth_time vs decoded.iat comparison in firebase.strategy.ts; default ‘login’
- Dedup on (membership_pk, token_issued_at) — enforced at the DB layer by the unique index; SessionEventRepository.recordIfNew catches SQLSTATE 23505 with constraint name session_events_membership_pk_token_issued_at_unique for silent dedup without swallowing unrelated unique violations
- No deleted_at — the table is append-only by design; soft-delete does not apply to this entity
Example
apps/api/src/database/entities/SessionEvent.ts · domain: platform · tier: Activity