class ExternalLinkSerializer < Blueprinter::Base
  GO_ZERO_TIME = "0001-01-01T00:00:00Z"
  TS_FORMAT    = "%Y-%m-%dT%H:%M:%S.%3NZ"

  field(:ID)         { |el| el.id }
  field(:CreatedAt)  { |el| el.created_at&.utc&.strftime(TS_FORMAT) || GO_ZERO_TIME }
  field(:UpdatedAt)  { |el| el.updated_at&.utc&.strftime(TS_FORMAT) || GO_ZERO_TIME }
  field(:DeletedAt)  { |el| el.deleted_at&.utc&.strftime(TS_FORMAT) }
  field(:softwareId) { |el| el.software_id }
  field :label
  field :url
end
