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