def validate_fields
      self.class.required_fields.each do |field|
        value = public_send(field)
        if value.nil? || value.respond_to?(:empty?) && value.empty?
          raise Outbox::MissingRequiredFieldError, "Missing required field: #{field}"
        end
      end
    end
def validate_fields
      self.class.required_fields.each do |field|
        value = public_send(field)
        if value.nil? || value.respond_to?(:empty?) && value.empty?
          raise Outbox::MissingRequiredFieldError, "Missing required field: #{field}"
        end
      end
    end
Checks the current values of the fields and raises errors for any
 validation issues.