add new api

This commit is contained in:
Sunandar
2017-02-03 17:56:27 +06:30
parent b4c9e8cc8e
commit 538c898e06
12 changed files with 117 additions and 75 deletions

View File

@@ -3,6 +3,7 @@ class CreateBatches < ActiveRecord::Migration[5.0]
create_table :batches do |t|
t.datetime :date,:null => false
t.references :user
t.references :client
t.string :order_ref,:null => false
t.boolean :batch_start
t.boolean :batch_end

View File

@@ -2,11 +2,13 @@ class CreateBatchLineItems < ActiveRecord::Migration[5.0]
def change
create_table :batch_line_items do |t|
t.references :batch
t.string :serial_no , null: false
t.string :wristband_code , null: false
t.string :manufacture_uid ,null:false
t.string :card_type,:default => "child"
t.timestamps null: false
t.string :serial_no , null: false
t.string :asset_identity , null: false
t.string :manufacture_uid ,null:false
t.string :asset_type,:default => "child"
t.datetime :encoded_at
t.datetime :verified_at
t.timestamps null: false
end
end
end

View File

@@ -6,8 +6,7 @@ class CreateUser < ActiveRecord::Migration[5.0]
t.string :email
t.boolean :is_active,:default =>false
t.string :phone
t.string :address
t.string :secrect_key
t.string :address
t.timestamps null: false
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170126074122) do
ActiveRecord::Schema.define(version: 20170203091136) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -18,9 +18,11 @@ ActiveRecord::Schema.define(version: 20170126074122) do
create_table "batch_line_items", force: :cascade do |t|
t.integer "batch_id"
t.string "serial_no", null: false
t.string "wristband_code", null: false
t.string "asset_identity", null: false
t.string "manufacture_uid", null: false
t.string "card_type", default: "child"
t.string "asset_type", default: "child"
t.datetime "encoded_at"
t.datetime "verified_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["batch_id"], name: "index_batch_line_items_on_batch_id", using: :btree
@@ -29,6 +31,7 @@ ActiveRecord::Schema.define(version: 20170126074122) do
create_table "batches", force: :cascade do |t|
t.datetime "date", null: false
t.integer "user_id"
t.integer "client_id"
t.string "order_ref", null: false
t.boolean "batch_start"
t.boolean "batch_end"
@@ -43,9 +46,22 @@ ActiveRecord::Schema.define(version: 20170126074122) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "adult_or_child", default: "CHILD"
t.index ["client_id"], name: "index_batches_on_client_id", using: :btree
t.index ["user_id"], name: "index_batches_on_user_id", using: :btree
end
create_table "clients", force: :cascade do |t|
t.string "name", null: false
t.string "nrc"
t.string "email"
t.string "phone"
t.string "address"
t.string "product_type"
t.string "secrect_key"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "lookups", force: :cascade do |t|
t.string "name", null: false
t.integer "max_value"
@@ -87,15 +103,14 @@ ActiveRecord::Schema.define(version: 20170126074122) do
end
create_table "users", force: :cascade do |t|
t.string "name", null: false
t.string "name", null: false
t.string "nrc"
t.string "email"
t.boolean "is_active", default: false
t.boolean "is_active", default: false
t.string "phone"
t.string "address"
t.string "secrect_key"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
end