Usher.InvitationUsage (Usher v0.5.1)

View Source

Schema for tracking invitation usage by entities.

An invitation usage record represents when an entity (user, company, device, etc.) interacts with an invitation. This could be visiting a signup page, completing registration, or any other trackable action.

Summary

Functions

Changeset for creating invitation usage records.

Types

t()

@type t() :: %Usher.InvitationUsage{
  __meta__: term(),
  action: atom(),
  entity_id: String.t(),
  entity_type: atom(),
  id: Ecto.UUID.t(),
  inserted_at: DateTime.t(),
  invitation: Usher.Invitation.t() | Ecto.Association.NotLoaded.t(),
  invitation_id: Ecto.UUID.t(),
  metadata: map(),
  updated_at: DateTime.t()
}

Functions

changeset(usage, attrs)

Changeset for creating invitation usage records.

Required fields

  • invitation_id: The invitation being used
  • entity_type: A string describing what kind of entity (e.g., :user, :company, :device)
  • entity_id: ID of the entity
  • action: What action was performed (e.g., :visited, :registered, :activated)

Optional fields

  • metadata: Additional context (user agent, IP, custom data, etc.)