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] ...@@ -39,7 +39,9 @@ class CreateShotengaiProductsAndOrders < ActiveRecord::Migration[5.1]
t.datetime :receipt_time t.datetime :receipt_time
t.string :delivery_way t.string :delivery_way
t.string :delivery_cost 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 :status
t.string :type t.string :type
t.json :meta t.json :meta
......
...@@ -38,9 +38,9 @@ module Shotengai ...@@ -38,9 +38,9 @@ module Shotengai
raise 'Illegal role. Only merchant or customer' unless role.in?(['merchant', 'customer']) raise 'Illegal role. Only merchant or customer' unless role.in?(['merchant', 'customer'])
@controller_prefix = options[:namespace].blank? ? '' : (options[:namespace].camelize + '::') @controller_prefix = options[:namespace].blank? ? '' : (options[:namespace].camelize + '::')
{ {
'products' => options[:product],z 'products' => options[:product],
# orders: order, 'orders' => options[:order],
# series: "#{Product}Series" 'product_series' => "#{options[:product]}Series"
}.each do |key, klass_name| }.each do |key, klass_name|
@key, @klass_name = key, klass_name @key, @klass_name = key, klass_name
template "#{role}/#{@key}_controller.rb", template "#{role}/#{@key}_controller.rb",
......
...@@ -11,6 +11,9 @@ module Shotengai ...@@ -11,6 +11,9 @@ module Shotengai
# receipt_time :datetime # receipt_time :datetime
# delivery_way :string(255) # delivery_way :string(255)
# delivery_cost :string(255) # delivery_cost :string(255)
# merchant_remark :text(65535)
# mark :string(255)
# customer_remark :text(65535)
# status :string(255) # status :string(255)
# type :string(255) # type :string(255)
# meta :json # meta :json
...@@ -38,6 +41,7 @@ module Shotengai ...@@ -38,6 +41,7 @@ module Shotengai
}.each { |name, options| }.each { |name, options|
event(name) { transitions options } event(name) { transitions options }
} }
end end
def fill_snapshot def fill_snapshot
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
# receipt_time :datetime # receipt_time :datetime
# delivery_way :string(255) # delivery_way :string(255)
# delivery_cost :string(255) # delivery_cost :string(255)
# merchant_remark :text(65535)
# mark :string(255)
# customer_remark :text(65535)
# status :string(255) # status :string(255)
# type :string(255) # type :string(255)
# meta :json # meta :json
...@@ -18,7 +21,6 @@ ...@@ -18,7 +21,6 @@
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# #
FactoryGirl.define do FactoryGirl.define do
factory :shotengai_order 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