# == Schema Information
#
# Table name: product_records
#
#  id              :bigint           not null, primary key
#  product_sn      :string(255)
#  product_id      :bigint           not null
#  shipping_box_id :integer
#  type            :string(255)
#  status          :integer
#  created_by      :string(255)
#  remark          :string(255)
#  created_at      :datetime         not null
#  updated_at      :datetime         not null
#  lot_no          :string(255)
#
class ShippingBoxItem < ProductRecord
  belongs_to :shipping_box

  validates :lot_no, presence: true

  enum status: { initial: 0, sent: 1, tofix: 2, fixed: 3, dead: 4 }, _suffix: true

  def status_name
    self.class.human_attribute_name("status.#{self.status}")
  end
end
