barcode update
This commit is contained in:
3
app/assets/javascripts/sellers.coffee
Normal file
3
app/assets/javascripts/sellers.coffee
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||||
3
app/assets/stylesheets/sellers.scss
Normal file
3
app/assets/stylesheets/sellers.scss
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the Sellers controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
4
app/views/api/batch_line_items/activated_list.jbuilder
Normal file
4
app/views/api/batch_line_items/activated_list.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
json.set! :status, @out[0]
|
||||||
|
json.set! :data, @out[1]
|
||||||
|
json.set! :total_page_count, @out[2]
|
||||||
|
|
||||||
2
app/views/api/batch_line_items/code_activate.jbuilder
Normal file
2
app/views/api/batch_line_items/code_activate.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
json.set! :status, @out[0]
|
||||||
|
json.set! :message, @out[1]
|
||||||
8
app/views/api/batch_line_items/seller_info.jbuilder
Normal file
8
app/views/api/batch_line_items/seller_info.jbuilder
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
if @out[0] == true
|
||||||
|
json.set! :status, @out[0]
|
||||||
|
json.set! :total_export_qty, @out[1]
|
||||||
|
json.set! :total_activated_qty, @out[2]
|
||||||
|
else
|
||||||
|
json.set! :status, @out[0]
|
||||||
|
json.set! :message, @out[1]
|
||||||
|
end
|
||||||
13
db/migrate/20180720032352_create_sellers.rb
Normal file
13
db/migrate/20180720032352_create_sellers.rb
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class CreateSellers < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
create_table :sellers do |t|
|
||||||
|
t.string :name
|
||||||
|
t.string :email
|
||||||
|
t.string :phone
|
||||||
|
t.string :address
|
||||||
|
t.string :key
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
class AddStatusBarcodeInBatchLineItems < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_column :batch_line_items, :barcode, :string, index: true
|
||||||
|
add_column :batch_line_items, :is_activated, :boolean, :default => false , index: true
|
||||||
|
add_column :batch_line_items, :activated_date, :datetime
|
||||||
|
end
|
||||||
|
end
|
||||||
6
db/migrate/20180724035749_add_export_to_in_batch.rb
Normal file
6
db/migrate/20180724035749_add_export_to_in_batch.rb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
class AddExportToInBatch < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_column :batches, :export_to_seller_id, :integer
|
||||||
|
add_column :batches, :export_to_seller_date, :datetime
|
||||||
|
end
|
||||||
|
end
|
||||||
5
db/migrate/20180724053855_add_type_in_user.rb
Normal file
5
db/migrate/20180724053855_add_type_in_user.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class AddTypeInUser < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_column :users, :user_type, :string
|
||||||
|
end
|
||||||
|
end
|
||||||
5
db/migrate/20180724072431_drop_table_seller.rb
Normal file
5
db/migrate/20180724072431_drop_table_seller.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class DropTableSeller < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
drop_table :sellers
|
||||||
|
end
|
||||||
|
end
|
||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
48
test/controllers/sellers_controller_test.rb
Normal file
48
test/controllers/sellers_controller_test.rb
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class SellersControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
setup do
|
||||||
|
@seller = sellers(:one)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get index" do
|
||||||
|
get sellers_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get new" do
|
||||||
|
get new_seller_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should create seller" do
|
||||||
|
assert_difference('Seller.count') do
|
||||||
|
post sellers_url, params: { seller: { address: @seller.address, email: @seller.email, key: @seller.key, name: @seller.name, phone: @seller.phone } }
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_redirected_to seller_url(Seller.last)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should show seller" do
|
||||||
|
get seller_url(@seller)
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get edit" do
|
||||||
|
get edit_seller_url(@seller)
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should update seller" do
|
||||||
|
patch seller_url(@seller), params: { seller: { address: @seller.address, email: @seller.email, key: @seller.key, name: @seller.name, phone: @seller.phone } }
|
||||||
|
assert_redirected_to seller_url(@seller)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should destroy seller" do
|
||||||
|
assert_difference('Seller.count', -1) do
|
||||||
|
delete seller_url(@seller)
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_redirected_to sellers_url
|
||||||
|
end
|
||||||
|
end
|
||||||
15
test/fixtures/sellers.yml
vendored
Normal file
15
test/fixtures/sellers.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
|
one:
|
||||||
|
name: MyString
|
||||||
|
email: MyString
|
||||||
|
phone: MyString
|
||||||
|
address: MyString
|
||||||
|
key: MyString
|
||||||
|
|
||||||
|
two:
|
||||||
|
name: MyString
|
||||||
|
email: MyString
|
||||||
|
phone: MyString
|
||||||
|
address: MyString
|
||||||
|
key: MyString
|
||||||
7
test/models/seller_test.rb
Normal file
7
test/models/seller_test.rb
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class SellerTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user