SwissQrBill.Address (swiss_qr_bill v0.1.2)

Copy Markdown View Source

Structured address for Swiss QR bills (type "S"). Per v2.3, only structured addresses are allowed.

Summary

Functions

Returns the address type constant ("S" for structured).

Returns 7 empty fields (placeholder for empty address positions).

Returns the full formatted address as a multi-line string.

Creates a structured address without street information.

Creates a structured address with street information.

Returns the QR code data fields for this address.

Types

t()

@type t() :: %SwissQrBill.Address{
  building_number: String.t() | nil,
  city: String.t(),
  country: String.t(),
  name: String.t(),
  postal_code: String.t(),
  street: String.t() | nil
}

Functions

address_type()

@spec address_type() :: String.t()

Returns the address type constant ("S" for structured).

empty_qr_code_data()

@spec empty_qr_code_data() :: [nil]

Returns 7 empty fields (placeholder for empty address positions).

full_address(addr)

@spec full_address(t()) :: String.t()

Returns the full formatted address as a multi-line string.

new(name, postal_code, city, country)

@spec new(String.t(), String.t(), String.t(), String.t()) :: t()

Creates a structured address without street information.

new(name, street, building_number, postal_code, city, country)

@spec new(String.t(), String.t(), String.t(), String.t(), String.t(), String.t()) ::
  t()

Creates a structured address with street information.

qr_code_data(addr)

@spec qr_code_data(t()) :: [String.t() | nil]

Returns the QR code data fields for this address.