add collection refs and out_of_sync to grid blueprints

This commit is contained in:
Justin Edmund 2025-12-03 22:48:32 -08:00
parent 233dd4fe95
commit 274881e894
4 changed files with 30 additions and 3 deletions

View file

@ -3,10 +3,22 @@
module Api
module V1
class GridArtifactBlueprint < ApiBlueprint
fields :element, :level, :reroll_slot
fields :level, :reroll_slot
# Proficiency is only present on quirk artifacts
field :proficiency, if: ->(_field, obj, _options) { obj.proficiency.present? }
field :collection_artifact_id
field :out_of_sync, if: ->(_field, ga, _options) { ga.collection_artifact_id.present? } do |ga|
ga.out_of_sync?
end
# Return element as integer
field :element do |obj|
obj.element_before_type_cast
end
# Proficiency is only present on quirk artifacts, return as integer
field :proficiency, if: ->(_field, obj, _options) { obj.proficiency.present? } do |obj|
obj.proficiency_before_type_cast
end
field :skills do |obj|
[obj.skill1, obj.skill2, obj.skill3, obj.skill4].map do |skill|

View file

@ -9,6 +9,11 @@ module Api
gc.transcendence_step
end
field :collection_character_id
field :out_of_sync, if: ->(_field, gc, _options) { gc.collection_character_id.present? } do |gc|
gc.out_of_sync?
end
view :preview do
association :character, blueprint: CharacterBlueprint
end

View file

@ -5,6 +5,11 @@ module Api
class GridSummonBlueprint < ApiBlueprint
fields :main, :friend, :position, :quick_summon, :uncap_level, :transcendence_step
field :collection_summon_id
field :out_of_sync, if: ->(_field, gs, _options) { gs.collection_summon_id.present? } do |gs|
gs.out_of_sync?
end
view :preview do
association :summon, blueprint: SummonBlueprint
end

View file

@ -5,6 +5,11 @@ module Api
class GridWeaponBlueprint < ApiBlueprint
fields :mainhand, :position, :uncap_level, :transcendence_step, :element
field :collection_weapon_id
field :out_of_sync, if: ->(_field, gw, _options) { gw.collection_weapon_id.present? } do |gw|
gw.out_of_sync?
end
view :preview do
association :weapon, blueprint: WeaponBlueprint
end