WalletPasses.PassData (wallet_passes v0.4.4)

Copy Markdown View Source

Platform-agnostic representation of wallet pass content.

Contains shared data consumed by both Apple and Google pass builders. Platform-specific visual configuration lives in WalletPasses.Apple.Visual and WalletPasses.Google.Visual (passed separately).

Summary

Functions

Returns the barcode message, falling back to serial_number if not set.

Formats start_date..end_date as a human-readable range.

Creates a new PassData struct from keyword options.

Types

field()

@type field() :: {key :: String.t(), label :: String.t(), value :: String.t()}

t()

@type t() :: %WalletPasses.PassData{
  auxiliary_fields: [field()],
  back_fields: [field()],
  barcode_alt_text: String.t() | nil,
  barcode_message: String.t() | nil,
  description: String.t() | nil,
  end_date: Date.t() | nil,
  event_name: String.t() | nil,
  header_fields: [field()],
  holder_name: String.t() | nil,
  latitude: float() | nil,
  location_address: String.t() | nil,
  location_name: String.t() | nil,
  longitude: float() | nil,
  nfc_encryption_public_key: String.t() | nil,
  nfc_message: String.t() | nil,
  nfc_requires_authentication: boolean() | nil,
  organization_name: String.t() | nil,
  pass_type: WalletPasses.PassType.t(),
  primary_fields: [field()],
  secondary_fields: [field()],
  serial_number: String.t(),
  start_date: Date.t() | nil,
  timezone: String.t() | nil,
  transit_type: :air | :boat | :bus | :train | :generic | nil
}

Functions

barcode_value(pass_data)

Returns the barcode message, falling back to serial_number if not set.

format_date_range(pass_data)

Formats start_date..end_date as a human-readable range.

new(opts \\ [])

Creates a new PassData struct from keyword options.