Class: HhPackage::Package::HungryAtHome

Inherits:
Base
  • Object
show all
Includes:
ModelConcerns::AgendaType, ModelConcerns::CommonRelations, ModelConcerns::PackageTraits, ModelConcerns::Translation
Defined in:
app/models/hh_package/package/hungry_at_home.rb

Overview

Schema Information

Table name: hh_package_package_hungry_at_homes

id                                   :integer          not null, primary key
available_methods                    :string(191)      default("self_pickup_and_delivery")
benefit_type                         :string(191)      default("no_benefit"), not null
charge_amount_type                   :string(191)      default("relative")
charge_policy                        :text(65535)
charge_type                          :string(191)
commision                            :decimal(5, 2)
cover_image                          :string(191)
custom_delivery_fee                  :boolean          default(FALSE)
custom_display_duration              :integer
default_start_time                   :time
deleted_at                           :datetime
delivery_fee_cents                   :integer          default(0), not null
delivery_fee_currency                :string(191)      default("THB"), not null
delivery_fee_per_km_cents            :integer          default(0), not null
delivery_fee_per_km_currency         :string(191)      default("THB"), not null
delivery_radius                      :decimal(5, 2)
description                          :text(65535)
earn_point                           :boolean          default(TRUE)
fixed_charge_amount_cents            :integer
free_delivery_fee_threshold_cents    :integer          default(0), not null
free_delivery_km                     :integer          default(0)
is_add_on                            :boolean          default(FALSE)
kids_price_rate_backup               :integer          default(50)
menu_display_type                    :string(191)
menu_links                           :text(65535)
menu_type                            :string(191)      default("imenupro")
name                                 :string(255)
no_of_adults                         :integer          default(0)
no_of_courses                        :integer          default(0)
no_of_dishes                         :integer          default(0)
no_of_drinks                         :integer          default(0)
pay_now                              :boolean          default(FALSE)
payment_type                         :string(191)      default("qrcode_and_creditcard")
price_currency                       :string(191)
relative_charge_percent              :integer          default(100)
require_cc                           :boolean          default(FALSE)
reservation_duration                 :integer
skip_time_selection                  :boolean          default(FALSE)
special_agenda                       :boolean          default(FALSE)
tnc_image                            :string(191)
use_custom_display_duration          :boolean          default(FALSE)
created_at                           :datetime         not null
updated_at                           :datetime         not null
country_id                           :bigint
custom_label_id                      :bigint
hh_package_package_groups_id         :bigint
hh_package_package_hungry_at_home_id :integer          not null
package_group_id                     :bigint

Indexes

index_hh_package_package_hungry_at_homes_on_country_id        (country_id)
index_hh_package_package_hungry_at_homes_on_custom_label_id   (custom_label_id)
index_hh_package_package_hungry_at_homes_on_package_group_id  (package_group_id)

Foreign Keys

fk_rails_...  (custom_label_id => custom_labels.id)
fk_rails_...  (package_group_id => hh_package_package_groups.id)

Constant Summary collapse

TYPE_SHORT =
'hah'

Constants included from ModelConcerns::MixAndMatch

ModelConcerns::MixAndMatch::MINIMUM_MIX_AND_MATCH

Instance Method Summary collapse

Methods included from ModelConcerns::PackageTraits

#badge_percentage, #fetch_comemore_payless, #have_menu_quantity_limit?, #prepaid_package?, #promotion_badge, #promotion_text, #promotion_type, #reservation_duration_for_display, #validate_name_and_description

Methods included from ModelConcerns::AgendaType

#agenda_type

Methods inherited from Base

#kids_price_rate, #menu_group_id, #menu_group_id=, per_pack_or_set, #reservations, #tnc_link

Methods included from ModelConcerns::DynamicPricingsForPackage

#ala_carte?, #decide_max_seat, #decide_min_seat, #dynamic_price_comemore_payless?, #dynamic_pricings_as_json, #highest_pricing, #lowest_pricing, #price_currency, #pricing_model_and_dynamic_pricing_type, #pricing_tier, pricing_type, #pricing_type_humanize, #validate_comemore_payless_promotion, #validate_menu_v3_diy

Methods included from ModelConcerns::MixAndMatch

#allow_mix_and_match?, #allow_mix_ayce?, #mix_n_match_qty, #use_mix_and_match?

Methods included from SoftDelete

#soft_deleted?, #soft_destroy

Instance Method Details

#for_delivery?Boolean

Returns:

  • (Boolean)


106
107
108
# File 'app/models/hh_package/package/hungry_at_home.rb', line 106

def for_delivery?
  true
end

#for_dine_in?Boolean

Returns:

  • (Boolean)


102
103
104
# File 'app/models/hh_package/package/hungry_at_home.rb', line 102

def for_dine_in?
  false
end

#route_nameObject



90
91
92
# File 'app/models/hh_package/package/hungry_at_home.rb', line 90

def route_name
  'hungry_at_home'
end

#slug_codeObject



98
99
100
# File 'app/models/hh_package/package/hungry_at_home.rb', line 98

def slug_code
  'HAH'
end

#typeObject



86
87
88
# File 'app/models/hh_package/package/hungry_at_home.rb', line 86

def type
  'Hungry@Home'
end

#type_shortObject



94
95
96
# File 'app/models/hh_package/package/hungry_at_home.rb', line 94

def type_short
  'hah'
end