hensei-api/app/blueprints/api/v1/grid_summon_blueprint.rb
Justin Edmund a6b7e26210
collection sync with orphan handling (#200)
- preview_sync endpoint shows what'll get deleted before you commit
- import services handle reconciliation (find missing items, delete them)
- grid items get flagged as orphaned when their collection source is gone
- party exposes has_orphaned_items
- blueprints include orphaned field
2025-12-23 22:44:35 -08:00

36 lines
941 B
Ruby

# frozen_string_literal: true
module Api
module V1
class GridSummonBlueprint < ApiBlueprint
fields :main, :friend, :position, :quick_summon, :uncap_level, :transcendence_step, :orphaned
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 :nested do
association :summon, blueprint: SummonBlueprint, view: :full
end
view :full do
include_view :nested
association :party, blueprint: PartyBlueprint
end
view :uncap do
association :party, blueprint: PartyBlueprint
fields :position, :uncap_level, :transcendence_step
end
view :destroyed do
fields :main, :friend, :position, :created_at, :updated_at
end
end
end
end