diff --git a/app/blueprints/api/v1/job_blueprint.rb b/app/blueprints/api/v1/job_blueprint.rb index fe9a079..ba2c9f1 100644 --- a/app/blueprints/api/v1/job_blueprint.rb +++ b/app/blueprints/api/v1/job_blueprint.rb @@ -17,7 +17,9 @@ module Api ] end - fields :granblue_id, :row, :ml, :order, :accessory, :accessory_type + fields :granblue_id, :row, :order, + :master_level, :ultimate_mastery, + :accessory, :accessory_type end end end diff --git a/app/blueprints/api/v1/party_blueprint.rb b/app/blueprints/api/v1/party_blueprint.rb index 61bb005..6b8e19f 100644 --- a/app/blueprints/api/v1/party_blueprint.rb +++ b/app/blueprints/api/v1/party_blueprint.rb @@ -68,7 +68,9 @@ module Api include_view :characters include_view :job_skills - fields :local_id, :description, :charge_attack, :button_count, :turn_count, :chain_count + fields :local_id, :description, :charge_attack, + :button_count, :turn_count, :chain_count, + :master_level, :ultimate_mastery association :accessory, blueprint: JobAccessoryBlueprint diff --git a/app/blueprints/api/v1/weapon_key_blueprint.rb b/app/blueprints/api/v1/weapon_key_blueprint.rb index e83d8ea..0604f3e 100644 --- a/app/blueprints/api/v1/weapon_key_blueprint.rb +++ b/app/blueprints/api/v1/weapon_key_blueprint.rb @@ -10,7 +10,7 @@ module Api } end - fields :slug, :series, :slot, :group, :order + fields :granblue_id, :slug, :series, :slot, :group, :order end end end diff --git a/app/controllers/api/v1/parties_controller.rb b/app/controllers/api/v1/parties_controller.rb index d46fa63..a4f1221 100644 --- a/app/controllers/api/v1/parties_controller.rb +++ b/app/controllers/api/v1/parties_controller.rb @@ -65,7 +65,7 @@ module Api new_party.local_id = party_params[:local_id] if !party_params.nil? if new_party.save - render json: PartyBlueprint.render(new_party, view: :full, root: :party, + render json: PartyBlueprint.render(new_party, view: :created, root: :party, meta: { remix: true }) else render_validation_error_response(new_party) diff --git a/db/migrate/20230315095656_add_granblue_id_to_weapon_keys.rb b/db/migrate/20230315095656_add_granblue_id_to_weapon_keys.rb new file mode 100644 index 0000000..31830b7 --- /dev/null +++ b/db/migrate/20230315095656_add_granblue_id_to_weapon_keys.rb @@ -0,0 +1,6 @@ +class AddGranblueIdToWeaponKeys < ActiveRecord::Migration[7.0] + def change + # This needs to be NOT NULL, but initially it will be nullable until we migrate data + add_column :weapon_keys, :granblue_id, :integer, unique: true, null: true + end +end diff --git a/db/migrate/20230315103026_add_ultimate_mastery.rb b/db/migrate/20230315103026_add_ultimate_mastery.rb new file mode 100644 index 0000000..149a2a1 --- /dev/null +++ b/db/migrate/20230315103026_add_ultimate_mastery.rb @@ -0,0 +1,6 @@ +class AddUltimateMastery < ActiveRecord::Migration[7.0] + def change + add_column :parties, :ultimate_mastery, :integer, null: true + add_column :jobs, :ultimate_mastery, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230315103037_rename_ml_to_master_level.rb b/db/migrate/20230315103037_rename_ml_to_master_level.rb new file mode 100644 index 0000000..e060330 --- /dev/null +++ b/db/migrate/20230315103037_rename_ml_to_master_level.rb @@ -0,0 +1,7 @@ +class RenameMlToMasterLevel < ActiveRecord::Migration[7.0] + def change + rename_column :parties, :ml, :master_level + rename_column :jobs, :ml, :master_level + change_column_null :jobs, :master_level, false + end +end diff --git a/db/schema.rb b/db/schema.rb index bd7970e..6095c45 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do +ActiveRecord::Schema[7.0].define(version: 2023_03_15_103037) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "pg_trgm" @@ -74,12 +74,12 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do t.datetime "updated_at", null: false t.boolean "perpetuity", default: false, null: false t.integer "transcendence_step", default: 0, null: false - t.jsonb "ring1", default: {"modifier"=>nil, "strength"=>nil}, null: false - t.jsonb "ring2", default: {"modifier"=>nil, "strength"=>nil}, null: false - t.jsonb "ring3", default: {"modifier"=>nil, "strength"=>nil}, null: false - t.jsonb "ring4", default: {"modifier"=>nil, "strength"=>nil}, null: false - t.jsonb "earring", default: {"modifier"=>nil, "strength"=>nil}, null: false - t.jsonb "awakening", default: {"type"=>1, "level"=>1}, null: false + t.jsonb "ring1", default: { "modifier" => nil, "strength" => nil }, null: false + t.jsonb "ring2", default: { "modifier" => nil, "strength" => nil }, null: false + t.jsonb "ring3", default: { "modifier" => nil, "strength" => nil }, null: false + t.jsonb "ring4", default: { "modifier" => nil, "strength" => nil }, null: false + t.jsonb "earring", default: { "modifier" => nil, "strength" => nil }, null: false + t.jsonb "awakening", default: { "type" => 1, "level" => 1 }, null: false t.index ["character_id"], name: "index_grid_characters_on_character_id" t.index ["party_id"], name: "index_grid_characters_on_party_id" end @@ -154,7 +154,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do t.integer "proficiency1" t.integer "proficiency2" t.string "row" - t.boolean "ml", default: false + t.boolean "master_level", default: false, null: false + t.boolean "ultimate_mastery", default: false, null: false t.integer "order" t.uuid "base_job_id" t.string "granblue_id" @@ -213,7 +214,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do t.integer "element" t.integer "weapons_count" t.uuid "job_id" - t.integer "ml" + t.integer "master_level" + t.integer "ultimate_mastery" t.uuid "skill1_id" t.uuid "skill2_id" t.uuid "skill3_id" @@ -299,6 +301,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do t.integer "group" t.integer "order" t.string "slug" + t.integer "granblue_id" end create_table "weapons", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|