Adding Redeem at payment
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class CreateZones < ActiveRecord::Migration[5.0]
|
||||
class CreateZones < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :zones do |t|
|
||||
t.string :name, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateMenus < ActiveRecord::Migration[5.0]
|
||||
class CreateMenus < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menus do |t|
|
||||
t.string :name
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateMenuCategories < ActiveRecord::Migration[5.0]
|
||||
class CreateMenuCategories < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_categories do |t|
|
||||
t.references :menu, foreign_key: true
|
||||
|
||||
10
db/migrate/20170331024747_create_accounts.rb
Normal file
10
db/migrate/20170331024747_create_accounts.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateAccounts < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :accounts do |t|
|
||||
t.string :title
|
||||
t.string :account_type
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateMenuItems < ActiveRecord::Migration[5.0]
|
||||
class CreateMenuItems < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_items do |t|
|
||||
t.string :item_code, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateMenuItemAttributes < ActiveRecord::Migration[5.0]
|
||||
class CreateMenuItemAttributes < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_item_attributes do |t|
|
||||
t.string :attribute_type, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateMenuItemOptions < ActiveRecord::Migration[5.0]
|
||||
class CreateMenuItemOptions < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_item_options do |t|
|
||||
t.string :name, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateMenuItemInstances < ActiveRecord::Migration[5.0]
|
||||
class CreateMenuItemInstances < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_item_instances do |t|
|
||||
t.references :menu_item, :foreign_key => true, :null => false
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
class CreateCustomers < ActiveRecord::Migration[5.0]
|
||||
class CreateCustomers < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :customers, :id => false do |t|
|
||||
t.string :customer_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync
|
||||
t.string :name, :null => false
|
||||
t.string :company
|
||||
t.string :contact_no
|
||||
t.string :contact_no, :unique => true
|
||||
t.string :email
|
||||
t.date :date_of_birth
|
||||
t.string :membership_id
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateOrders < ActiveRecord::Migration[5.0]
|
||||
class CreateOrders < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :orders, :id => false do |t|
|
||||
t.string :order_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateOrderItems < ActiveRecord::Migration[5.0]
|
||||
class CreateOrderItems < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :order_items, :id => false do |t|
|
||||
t.string :order_items_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateDiningFacilities < ActiveRecord::Migration[5.0]
|
||||
class CreateDiningFacilities < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :dining_facilities do |t|
|
||||
t.references :zone, foreign_key: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateOrderQueueStations < ActiveRecord::Migration[5.0]
|
||||
class CreateOrderQueueStations < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :order_queue_stations do |t|
|
||||
t.string :station_name, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateOrderQueueProcessByZones < ActiveRecord::Migration[5.0]
|
||||
class CreateOrderQueueProcessByZones < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :order_queue_process_by_zones do |t|
|
||||
t.references :order_queue_station, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreatePaymentMethodSettings < ActiveRecord::Migration[5.0]
|
||||
class CreatePaymentMethodSettings < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :payment_method_settings do |t|
|
||||
t.string :payment_method, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateEmployees < ActiveRecord::Migration[5.0]
|
||||
class CreateEmployees < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :employees do |t|
|
||||
t.string :name, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateCashierTerminals < ActiveRecord::Migration[5.0]
|
||||
class CreateCashierTerminals < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :cashier_terminals do |t|
|
||||
t.string :name, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateCashierLoginLogs < ActiveRecord::Migration[5.0]
|
||||
class CreateCashierLoginLogs < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :cashier_login_logs, :id => false, :primary_key => :cashier_login_log_id do |t|
|
||||
t.string :cashier_login_log_id, :limit => 16, :null => false, :index => true, :unique => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSales < ActiveRecord::Migration[5.0]
|
||||
class CreateSales < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :sales, :id => false do |t|
|
||||
t.string :sale_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSaleItems < ActiveRecord::Migration[5.0]
|
||||
class CreateSaleItems < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :sale_items, :id => false do |t|
|
||||
t.string :sale_item_id, :limit => 16, :primary_key => true#custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSaleTaxes < ActiveRecord::Migration[5.0]
|
||||
class CreateSaleTaxes < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :sale_taxes, :id => false do |t|
|
||||
t.string :sale_tax_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSalePayments < ActiveRecord::Migration[5.0]
|
||||
class CreateSalePayments < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :sale_payments, :id => false do |t|
|
||||
t.string :sale_payment_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSaleOrders < ActiveRecord::Migration[5.0]
|
||||
class CreateSaleOrders < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :sale_orders, :id => false do |t|
|
||||
t.primary_key :sale_order_id #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSaleAudits < ActiveRecord::Migration[5.0]
|
||||
class CreateSaleAudits < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :sale_audits, :id => false do |t|
|
||||
t.string :sale_audit_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateLookups < ActiveRecord::Migration[5.0]
|
||||
class CreateLookups < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :lookups do |t|
|
||||
t.string :lookup_type, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateTaxProfiles < ActiveRecord::Migration[5.0]
|
||||
class CreateTaxProfiles < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :tax_profiles do |t|
|
||||
t.string :name, :null => false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateBookings < ActiveRecord::Migration[5.0]
|
||||
class CreateBookings < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :bookings, :id => false do |t|
|
||||
t.string :booking_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateSeedGenerators < ActiveRecord::Migration[5.0]
|
||||
class CreateSeedGenerators < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :seed_generators do |t|
|
||||
t.string :model, :null => false, :default => "sale"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateMembershipSettings < ActiveRecord::Migration[5.0]
|
||||
class CreateMembershipSettings < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :membership_settings do |t|
|
||||
t.string :membership_type, :null => false, :default => "internal"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateAssignedOrderItems < ActiveRecord::Migration[5.0]
|
||||
class CreateAssignedOrderItems < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :assigned_order_items, :id => false do |t|
|
||||
t.string :assigned_order_item_id, :limit => 16, :primary_key => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class CreateBookingOrders < ActiveRecord::Migration[5.0]
|
||||
class CreateBookingOrders < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :booking_orders, :id => false do |t|
|
||||
#t.string :booking_order_id, :limit => 16, :null => false, :index => true, :unique => true #custom primary key - to ensure consistence for cloud syncing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class AddCompanyAddressEmail < ActiveRecord::Migration[5.0]
|
||||
class AddCompanyAddressEmail < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class OrderItemsCompletedBy < ActiveRecord::Migration[5.0]
|
||||
class OrderItemsCompletedBy < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
add_column :order_items, :completed_by, :string
|
||||
add_column :order_items, :completed_at, :datetime
|
||||
|
||||
@@ -9,7 +9,7 @@ class CreateShops < ActiveRecord::Migration[5.1]
|
||||
t.string :state, :null => false
|
||||
t.string :country, :null => false
|
||||
t.string :phone_no, :null => false
|
||||
t.string :reserviation_no, :null => false
|
||||
t.string :reservation_no, :null => false
|
||||
t.string :license, :null => false
|
||||
t.datetime :activated_at, :null => false
|
||||
t.text :license_data, :null => false
|
||||
|
||||
@@ -75,9 +75,8 @@ account_type = Lookup.create([{lookup_type:'account_type', name: 'Income', value
|
||||
{lookup_type:'account_type', name: 'Expense', value: 'expense'}])
|
||||
|
||||
#WALK CUSTOMER - Default CUSTOMER (take key 1)
|
||||
customer = Customer.create({id:1, name:"WALK-IN", contact_no:"000000000"})
|
||||
customer = Customer.create({id:2, name:"TAKEAWAY", contact_no:"000000000"})
|
||||
|
||||
customer = Customer.create({name:"WALK-IN", email: "cus1@customer.com", contact_no:"000000000"})
|
||||
customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contact_no:"111111111"})
|
||||
|
||||
#Default ZOne
|
||||
zone = Zone.create({id:1, name: "Default Zone", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
@@ -108,7 +107,7 @@ menu_category4 = MenuCategory.create({menu: menu, code:"C006", name: "Sample Men
|
||||
|
||||
#Default Menu items
|
||||
menu_category1_menu_item0 = SimpleMenuItem.create({item_code:"01001", name: "Default Menu Item Name 0", alt_name: "Alternate Menu Item Name 0",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food })
|
||||
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"half portion",item_instance_code:"01001-1", menu_item: menu_category1_menu_item0, price:12.00, is_on_promotion:false}])
|
||||
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"half portion",item_instance_code:"II0101", menu_item: menu_category1_menu_item0, price:12.00, is_on_promotion:false}])
|
||||
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"full portion",item_instance_code:"01001-2", menu_item: menu_category1_menu_item0, price:18.00, is_on_promotion:false}])
|
||||
|
||||
menu_category1_menu_item1 = SetMenuItem.create({item_code:"I004", name: "Default Menu Item Name 1", alt_name: "Alternate Menu Item Name 1",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1 , account: food})
|
||||
|
||||
Reference in New Issue
Block a user