PhoenixKitCatalogue.Schemas.AttributeValue (PhoenixKitCatalogue v0.18.0)

Copy Markdown View Source

Schema for values within an attribute ("White", "Oak", "Anthracite").

key is a stable slug unique within its attribute — generated once by the context, never cast on update. value holds the primary-language display text; other languages live in data.

is_default is explicit — display order and commercial default are independent (values may sort alphabetically while Oak is the standard). A partial unique index allows at most one default per attribute; the context flips defaults inside a transaction (unset-then-set).

Summary

Types

t()

@type t() :: %PhoenixKitCatalogue.Schemas.AttributeValue{
  __meta__: term(),
  attribute: term(),
  attribute_uuid: term(),
  data: term(),
  inserted_at: term(),
  is_default: term(),
  key: term(),
  position: term(),
  status: term(),
  updated_at: term(),
  uuid: term(),
  value: term()
}

Functions

create_changeset(value, attrs)

update_changeset(value, attrs)