menu, table,rooms, orders structure
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
class CreateSeatTables < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :seat_tables do |t|
|
||||
t.references :zone, foreign_key: true
|
||||
t.string :name, :null => false
|
||||
t.integer :order_by
|
||||
t.integer :no_of_seater, :null => false, :default => 2
|
||||
t.string :table_type, :null => false, :default => "square"
|
||||
t.float :position_x, :null => false, :default => 0.0
|
||||
t.float :position_y, :null => false, :default => 0.0
|
||||
t.string :created_by
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,13 +0,0 @@
|
||||
class CreateRooms < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :rooms do |t|
|
||||
t.string :name, :null => false
|
||||
t.integer :seater, :null => false, :default => 4
|
||||
t.string :created_by
|
||||
t.boolean :is_active, :null => false, :default => true
|
||||
t.integer :order_by
|
||||
t.references :zone
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2,7 +2,7 @@ class CreateMenus < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menus do |t|
|
||||
t.string :name
|
||||
t.boolean :is_active, :null => false
|
||||
t.boolean :is_active, :null => false, :deafult => true
|
||||
t.string :valid_days, :null => false, :default => "1,2,3,4,5,6,7"
|
||||
t.time :valid_time_from, :null => false, :default => "00:00:00"
|
||||
t.time :valid_time_to, :null => false, :default => "23:59:59"
|
||||
|
||||
@@ -5,7 +5,7 @@ class CreateMenuCategories < ActiveRecord::Migration[5.0]
|
||||
t.string :name, :null => false
|
||||
t.string :alt_name
|
||||
t.integer :order_by
|
||||
t.integer :parent_category_id
|
||||
t.references :menu_category, :null => true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
19
db/migrate/20170331024749_create_menu_items.rb
Normal file
19
db/migrate/20170331024749_create_menu_items.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class CreateMenuItems < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menu_items do |t|
|
||||
t.string :item_code, :null => false
|
||||
t.string :name, :null => false
|
||||
t.string :alt_name
|
||||
t.string :type, :null => false, :default => "SimpleMenuItem"
|
||||
t.references :menu_category, foreign_key: true
|
||||
t.references :menu_item, foreign_key: true
|
||||
t.integer :min_selectable_item, :null => false, :default => 1
|
||||
t.integer :max_selectable_item, :null => false, :default => 1
|
||||
t.json :options #save value
|
||||
t.json :attributes #value IDS
|
||||
t.string :created_by
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20170402083337_create_menu_item_attributes.rb
Normal file
11
db/migrate/20170402083337_create_menu_item_attributes.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateMenuItemAttributes < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menu_item_attributes do |t|
|
||||
t.string :attribute_type, :null => false
|
||||
t.string :name, :null => false
|
||||
t.string :value, :null => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
10
db/migrate/20170402083525_create_menu_item_options.rb
Normal file
10
db/migrate/20170402083525_create_menu_item_options.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateMenuItemOptions < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menu_item_options do |t|
|
||||
t.string :name, :null => false
|
||||
t.string :value, :null => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/migrate/20170402084230_create_menu_item_instances.rb
Normal file
14
db/migrate/20170402084230_create_menu_item_instances.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateMenuItemInstances < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menu_item_instances do |t|
|
||||
t.references :menu_item, :foreign_key => true, :null => false
|
||||
t.string :item_instance_code, :null => false
|
||||
t.json :attributes
|
||||
t.decimal :price, :null => false
|
||||
t.boolean :is_available, :null => false, :default => true
|
||||
t.boolean :is_on_promotion, :null => false, :default => false
|
||||
t.decimal :promotion_price, :null => false, :default => false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
15
db/migrate/20170403135121_create_customers.rb
Normal file
15
db/migrate/20170403135121_create_customers.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class CreateCustomers < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :customers do |t|
|
||||
t.string :name, :null => false
|
||||
t.string :company
|
||||
t.string :contact_no
|
||||
t.string :email
|
||||
t.string :membership_id
|
||||
t.string :membership_type
|
||||
t.string :membership_authentication_code
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
17
db/migrate/20170403135934_create_orders.rb
Normal file
17
db/migrate/20170403135934_create_orders.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class CreateOrders < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :orders do |t|
|
||||
t.datetime :date, :null => false
|
||||
t.string :source, :null => false, :default => "emenu"
|
||||
t.string :order_type, :null => false, :default => "dine-in"
|
||||
t.references :customer, foreign_key: true
|
||||
t.integer :item_count, :null => false, :default => 0
|
||||
t.integer :quantity_count, :null => false, :default => 0
|
||||
t.string :status, :null => false, :default => "new"
|
||||
t.json :waiters
|
||||
t.json :guest_info
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
18
db/migrate/20170403140820_create_order_items.rb
Normal file
18
db/migrate/20170403140820_create_order_items.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class CreateOrderItems < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :order_items do |t|
|
||||
t.references :order, foreign_key: true, :null => false
|
||||
t.string :order_item_status, :null => false, :default => "new"
|
||||
t.string :item_code, :null => false
|
||||
t.string :item_name, :null => false
|
||||
t.integer :qty, :null => false
|
||||
t.string :item_order_by #person who order this
|
||||
t.string :remark
|
||||
t.string :options
|
||||
t.string :variants
|
||||
t.json :set_menu_items #this parameter is require to route the items correctly
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
16
db/migrate/20170403142424_create_dining_facilities.rb
Normal file
16
db/migrate/20170403142424_create_dining_facilities.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class CreateDiningFacilities < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :dining_facilities do |t|
|
||||
t.references :zone, foreign_key: true
|
||||
t.string :name, :null => false
|
||||
t.string :type, :null => false, :default => "table"
|
||||
t.integer :seater, :null => false, :default => 2
|
||||
t.integer :order_by
|
||||
|
||||
t.string :created_by
|
||||
t.boolean :is_active, :null => false, :default => true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20170403143526_create_dining_ins.rb
Normal file
11
db/migrate/20170403143526_create_dining_ins.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateDiningIns < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :dining_ins do |t|
|
||||
t.references :table
|
||||
t.references :order
|
||||
t.boolean :currently_occupied, :default => false #there will only be 1 true - where table_id+order_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
15
db/migrate/20170403144732_create_room_bookings.rb
Normal file
15
db/migrate/20170403144732_create_room_bookings.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class CreateRoomBookings < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :room_bookings do |t|
|
||||
t.references :room, :null => false
|
||||
t.datetime :checkin_at
|
||||
t.datetime :checkout_at
|
||||
t.string :checkout_by
|
||||
t.datetime :reserved_at
|
||||
t.string :reserved_by
|
||||
t.string :status, :null => false, :default => "new"
|
||||
t.boolean :is_currently_checkin, :default => false, :null => true
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20170403145042_create_room_orders.rb
Normal file
11
db/migrate/20170403145042_create_room_orders.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateRoomOrders < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :room_orders do |t|
|
||||
t.references :room, foreign_key: true
|
||||
t.references :orders, foreign_key: true
|
||||
t.string :order_by
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,14 +1,53 @@
|
||||
zone {name}
|
||||
seat_tables {table_name, seater, table_type:[square, round, ], position-x, position-y}
|
||||
room {Name, seater, created_by, is_active, order_by}
|
||||
room {name, seater, created_by, is_active, order_by}
|
||||
|
||||
menu {name, is_active, valid_days, valid_time_from, valid_time_to}
|
||||
menu_category {menu, name, alt_name, order_no, parent_category_id}
|
||||
menu_items { menu_category, order_no, product_code, picture, menu_name, alt_menu_name, price, menu_item_type:[simple| set| DIY], available_size:[],
|
||||
variants:[{product_code, name, picture, add_on_price}], allow_multiple_variants_selection: boolean, set_menu_items:[menu_items], is_sold_out, is_on_promotion
|
||||
promotion_price, promotion_qty}
|
||||
menu_category {menu, name, alt_name, order_by, parent_category_id}
|
||||
|
||||
order { id, date, order_source [tablet, order_station, emenu, api], order_type [dine-in, takeaway, delivery], item_count, quantity_count, status [new, processing, fulfilled], waiters[], guest_info: {customer_id, membership_id, }}
|
||||
menu_item_attributes: {attribute_type, name, value}
|
||||
menu_item_options: {option_type, name, value}
|
||||
|
||||
menu_item : {
|
||||
category_code : "",
|
||||
item_code : "",
|
||||
name : "",
|
||||
alt_name : "",
|
||||
type : "[SIMPLE | SET | DIY]",
|
||||
attributes : [],
|
||||
parent_items : [],
|
||||
child_items : [],
|
||||
min_selectable_item : 0,
|
||||
max_selectable_item : 0,
|
||||
menu_item_instances : [],
|
||||
options : [],
|
||||
}
|
||||
|
||||
menu_item_instance : {
|
||||
item_instance_code : "",
|
||||
menu_item_attribute_values : [],
|
||||
item_code : "",
|
||||
parent_item_code : "",
|
||||
price : 0.00,
|
||||
is_available : t/f,
|
||||
is_on_promotion : t/f,
|
||||
promotion_price : 0.00,
|
||||
}
|
||||
|
||||
order_item : {
|
||||
order_item_code : "",
|
||||
item_instance_code : "",
|
||||
quantity : 0,
|
||||
option_values : [],
|
||||
sub_order_items : [],
|
||||
}
|
||||
|
||||
menu_items { menu_category, order_by, product_code, picture, menu_name, alt_menu_name, price, menu_item_type:[simple| set| DIY], available_size:[small: {product_code, price}, medium: {product_code, price}, large: {product_code, price}],
|
||||
variants:[{product_code, name, picture, add_on_price, options {option_name, option_value} }], max_variants_selection: integer, set_menu_items:[menu_items], is_sold_out, is_on_promotion
|
||||
promotion_price, options {option_name, option_value}}
|
||||
|
||||
|
||||
order { id, date, order_ref, order_source [tablet, order_station, emenu, api], order_type [dine-in, takeaway, delivery],customer_id, item_count, quantity_count, status [new, processing, fulfilled], waiters[], guest_info: {adult_count, child_count, woman_count, man_count}}
|
||||
order_items { order_item_status, product_code, name, qty, price, remark, options , variants: [], set_menu_items :[]}
|
||||
order_delivery_info {name, address, contact_no, delivery-by [InHouse | YDoor2Door | Food2U], tracker-id, sale}
|
||||
dine-in-table {table, order, status}
|
||||
|
||||
Reference in New Issue
Block a user