Commit 04c3d4e2 by ivan Lan

Add merchant_remark, customer_remark and mark to order

parent 9b70d4da
......@@ -39,7 +39,9 @@ class CreateShotengaiProductsAndOrders < ActiveRecord::Migration[5.1]
t.datetime :receipt_time
t.string :delivery_way
t.string :delivery_cost
t.text :merchant_remark
t.string :mark # merchant mark, like red, blue ..
t.text :customer_remark
t.string :status
t.string :type
t.json :meta
......
......@@ -38,9 +38,9 @@ module Shotengai
raise 'Illegal role. Only merchant or customer' unless role.in?(['merchant', 'customer'])
@controller_prefix = options[:namespace].blank? ? '' : (options[:namespace].camelize + '::')
{
'products' => options[:product],z
# orders: order,
# series: "#{Product}Series"
'products' => options[:product],
'orders' => options[:order],
'product_series' => "#{options[:product]}Series"
}.each do |key, klass_name|
@key, @klass_name = key, klass_name
template "#{role}/#{@key}_controller.rb",
......
......@@ -3,21 +3,24 @@ module Shotengai
#
# Table name: shotengai_orders
#
# id :integer not null, primary key
# seq :integer
# address :string(255)
# pay_time :datetime
# delivery_time :datetime
# receipt_time :datetime
# delivery_way :string(255)
# delivery_cost :string(255)
# status :string(255)
# type :string(255)
# meta :json
# buyer_id :integer
# buyer_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# id :integer not null, primary key
# seq :integer
# address :string(255)
# pay_time :datetime
# delivery_time :datetime
# receipt_time :datetime
# delivery_way :string(255)
# delivery_cost :string(255)
# merchant_remark :text(65535)
# mark :string(255)
# customer_remark :text(65535)
# status :string(255)
# type :string(255)
# meta :json
# buyer_id :integer
# buyer_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
class Order < ActiveRecord::Base
self.table_name = 'shotengai_orders'
......@@ -38,6 +41,7 @@ module Shotengai
}.each { |name, options|
event(name) { transitions options }
}
end
def fill_snapshot
......
......@@ -2,23 +2,25 @@
#
# Table name: shotengai_orders
#
# id :integer not null, primary key
# seq :integer
# address :string(255)
# pay_time :datetime
# delivery_time :datetime
# receipt_time :datetime
# delivery_way :string(255)
# delivery_cost :string(255)
# status :string(255)
# type :string(255)
# meta :json
# buyer_id :integer
# buyer_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# id :integer not null, primary key
# seq :integer
# address :string(255)
# pay_time :datetime
# delivery_time :datetime
# receipt_time :datetime
# delivery_way :string(255)
# delivery_cost :string(255)
# merchant_remark :text(65535)
# mark :string(255)
# customer_remark :text(65535)
# status :string(255)
# type :string(255)
# meta :json
# buyer_id :integer
# buyer_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
FactoryGirl.define do
factory :shotengai_order do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment