* Implements advanced filters (#90) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix a bug where unauthenticated users couldn't view profiles (#92) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix being unable to see profiles when unauth * Add tables used for Siero's revival (#94) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Deploy unauthenticated profile fix (#93) * Implements advanced filters (#90) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix a bug where unauthenticated users couldn't view profiles (#92) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix being unable to see profiles when unauth * Add guidebooks migration * Implement business logic for reading Guidebooks * Change to individual guidebook columns * Properly output guidebook description * Move to 1-index guidebooks * Update party-related files for 1-index guidebooks * Add tables for Siero * Update download and export scripts * Support for Siero, raids rework and edit party rework (#96) * Add guidebooks migration * Implement business logic for reading Guidebooks * Change to individual guidebook columns * Properly output guidebook description * Move to 1-index guidebooks * Update party-related files for 1-index guidebooks * Add tables for Siero * Add raid groups table * Update raid model To belong to the RaidGroup class * Update job class To have many job skills * Add endpoint for raid groups * Update Raid blueprint with views * Added down for creating table * Add guidebooks flag and auto summon flag * Guidebooks → RaidGroup * Auto summon → Party * Add views to Raid blueprint * Add views and guidebook flag to RaidGroup blueprint * Add auto summon and Raid view to Party blueprint * Add quick summons (#97) * Adds quick summon migration * Add route to update quick summon * Add logic to update quick summon * Remove ap call * Add logic to updating summon uncap You couldn't actually update summon transcendence on staging, maybe due to a bug? Now you can. And it won't let you update outside of the bounds of what is defined on the canonical object. * Fix summon logic Updated logic for updating summon uncap and transcendence levels and quick summon status. * Fix searching in Japanese (#99) This was broken because we were using the browser-provided locale as a prefix to our method, but that is 'ja' and our methods were prefixed with 'jp'. * Fix display of base skills (#100) Base skills were not displaying due to a missing case in our search code. This is now fixed. * Update awakenings (#101) * Deploy unauthenticated profile fix (#93) * Implements advanced filters (#90) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix a bug where unauthenticated users couldn't view profiles (#92) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix being unable to see profiles when unauth * Add tables used for Siero's revival (#94) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Deploy unauthenticated profile fix (#93) * Implements advanced filters (#90) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix a bug where unauthenticated users couldn't view profiles (#92) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix being unable to see profiles when unauth * Add guidebooks migration * Implement business logic for reading Guidebooks * Change to individual guidebook columns * Properly output guidebook description * Move to 1-index guidebooks * Update party-related files for 1-index guidebooks * Add tables for Siero * Adds guidebooks and gacha tables (#95) * Implements advanced filters (#90) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix a bug where unauthenticated users couldn't view profiles (#92) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix being unable to see profiles when unauth * Add tables used for Siero's revival (#94) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Deploy unauthenticated profile fix (#93) * Implements advanced filters (#90) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix a bug where unauthenticated users couldn't view profiles (#92) * Implements advanced filters (#90) (#91) * Add advanced filters Adds new filters to search: * Full auto * Charge attack * Auto guard * Number of weapons (user-selectable now) * Number of summons * Number of characters * Maximum number of turns * Maximum number of buttons * Maximum clear time * User quality (No anonymous users) * Name quality (No untitled teams) * Remixes (Only show original teams) * Update advanced filter params * Add default to party counter cache * Fix being unable to see profiles when unauth * Add guidebooks migration * Implement business logic for reading Guidebooks * Change to individual guidebook columns * Properly output guidebook description * Move to 1-index guidebooks * Update party-related files for 1-index guidebooks * Add tables for Siero * Update download and export scripts * Support for Siero, raids rework and edit party rework (#96) * Add guidebooks migration * Implement business logic for reading Guidebooks * Change to individual guidebook columns * Properly output guidebook description * Move to 1-index guidebooks * Update party-related files for 1-index guidebooks * Add tables for Siero * Add raid groups table * Update raid model To belong to the RaidGroup class * Update job class To have many job skills * Add endpoint for raid groups * Update Raid blueprint with views * Added down for creating table * Add guidebooks flag and auto summon flag * Guidebooks → RaidGroup * Auto summon → Party * Add views to Raid blueprint * Add views and guidebook flag to RaidGroup blueprint * Add auto summon and Raid view to Party blueprint * Remove ap call * Add quick summons (#97) * Adds quick summon migration * Add route to update quick summon * Add logic to update quick summon * Add logic to updating summon uncap You couldn't actually update summon transcendence on staging, maybe due to a bug? Now you can. And it won't let you update outside of the bounds of what is defined on the canonical object. * Fix summon logic Updated logic for updating summon uncap and transcendence levels and quick summon status. * Fix searching in Japanese (#99) This was broken because we were using the browser-provided locale as a prefix to our method, but that is 'ja' and our methods were prefixed with 'jp'. * Fix display of base skills (#100) Base skills were not displaying due to a missing case in our search code. This is now fixed. * Squash migrations into one file * Add migrations This adds migrations and data migrations for the awakening update. * A new `Awakenings` table now exists that stores all possible awakenings, with a column for object type. * GridCharacter and GridWeapon now have `awakening_id` and `awakening_level` fields. Their `awakening` and `awakening_type` fields were removed. * Weapons have a mapping table, `WeaponAwakenings`, as not all weapons can be awakened. * Data migrations are included to migrate existing user data. They should be run automatically when the migration is run with `rails db:migrate:with_data` * Add and update models This updates models for the awakening update. * Awakening and WeaponAwakening models were added * Weapon, GridWeapon and GridCharacter models get relationships to the new models defined * GridCharacter had a validation on `awakening_level` that needed to be fixed * Update controllers This updates the GridCharacters and GridWeapons controllers to accept the new fields `awakening_id` and `awakening_level` from clients * Update blueprints This updates the blueprints to match the new schema. The new AwakeningBlueprint was accidentally added already, oops. * Remove re-added migrations * Implement removing job skills (#103) This lets users remove job skills, for if they accidentally set them. * Fix migration
112 lines
3 KiB
Ruby
112 lines
3 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V1
|
|
class PartyBlueprint < ApiBlueprint
|
|
view :weapons do
|
|
association :weapons,
|
|
blueprint: GridWeaponBlueprint,
|
|
view: :nested
|
|
end
|
|
|
|
view :summons do
|
|
association :summons,
|
|
blueprint: GridSummonBlueprint,
|
|
view: :nested
|
|
end
|
|
|
|
view :characters do
|
|
association :characters,
|
|
blueprint: GridCharacterBlueprint,
|
|
view: :nested
|
|
end
|
|
|
|
view :job_skills do
|
|
field :job_skills do |job|
|
|
{
|
|
'0' => !job.skill0.nil? ? JobSkillBlueprint.render_as_hash(job.skill0) : nil,
|
|
'1' => !job.skill1.nil? ? JobSkillBlueprint.render_as_hash(job.skill1) : nil,
|
|
'2' => !job.skill2.nil? ? JobSkillBlueprint.render_as_hash(job.skill2) : nil,
|
|
'3' => !job.skill3.nil? ? JobSkillBlueprint.render_as_hash(job.skill3) : nil
|
|
}
|
|
end
|
|
end
|
|
|
|
view :minimal do
|
|
fields :name, :element, :shortcode, :favorited, :extra,
|
|
:full_auto, :clear_time, :auto_guard, :auto_summon,
|
|
:created_at, :updated_at
|
|
|
|
field :remix do |p|
|
|
p.is_remix
|
|
end
|
|
|
|
field :guidebooks do |p|
|
|
{
|
|
'1' => !p.guidebook1.nil? ? GuidebookBlueprint.render_as_hash(p.guidebook1) : nil,
|
|
'2' => !p.guidebook2.nil? ? GuidebookBlueprint.render_as_hash(p.guidebook2) : nil,
|
|
'3' => !p.guidebook3.nil? ? GuidebookBlueprint.render_as_hash(p.guidebook3) : nil
|
|
}
|
|
end
|
|
|
|
association :raid,
|
|
blueprint: RaidBlueprint,
|
|
view: :full
|
|
|
|
association :job,
|
|
blueprint: JobBlueprint
|
|
|
|
association :user,
|
|
blueprint: UserBlueprint,
|
|
view: :minimal
|
|
end
|
|
|
|
view :jobs do
|
|
association :job,
|
|
blueprint: JobBlueprint
|
|
include_view :job_skills
|
|
end
|
|
|
|
view :preview do
|
|
include_view :minimal
|
|
include_view :weapons
|
|
end
|
|
|
|
view :full do
|
|
include_view :preview
|
|
include_view :summons
|
|
include_view :characters
|
|
include_view :job_skills
|
|
|
|
fields :local_id, :description, :charge_attack,
|
|
:button_count, :turn_count, :chain_count,
|
|
:master_level, :ultimate_mastery
|
|
|
|
association :accessory,
|
|
blueprint: JobAccessoryBlueprint
|
|
|
|
association :source_party,
|
|
blueprint: PartyBlueprint,
|
|
view: :minimal
|
|
|
|
# TODO: This should probably be paginated
|
|
association :remixes,
|
|
blueprint: PartyBlueprint,
|
|
view: :collection
|
|
end
|
|
|
|
view :collection do
|
|
include_view :preview
|
|
end
|
|
|
|
view :created do
|
|
include_view :full
|
|
fields :edit_key
|
|
end
|
|
|
|
view :destroyed do
|
|
fields :name, :description, :created_at, :updated_at
|
|
end
|
|
end
|
|
end
|
|
end
|