Skip to content

Fetch from EVE for the cargo before / cargo after fields #47

Closed

Description

@Fazorath

Parent

#38

What to build

A "Fetch from EVE" button next to each of Cargo before and Cargo after on the Abyss page. It fills the field with the cargo value of the active ship's cargo hold, read from ESI.

Cargo reader (ESI):

  • Takes a signed-in client and returns a cargo valuation: value in millions, the number of unpriced item types, and when ESI last answered for the asset list.
  • Gets ship_item_id from the character's ship endpoint (the esi-location.read_ship_type.v1 scope is already requested), so whichever ship EVE says is active at that moment is the one used.
  • From the paged asset list it keeps items whose location_id is that ship and whose location_flag is Cargo. Drone bay, fitted modules and loaded ammo (other flags in the same ship), other ships, hangars and items inside containers are all out.
  • Blueprint copies are left out, as in the current asset reader. Items are valued with the existing market price reader: CCP's average price, or the adjusted price when there is no average.
  • Unpriced items are left out of the value and counted by item type.
  • Reuse or reshape the existing asset and price readers. The current asset reader totals quantities by type and throws away location and flag, which this reader needs.
  • Malformed ESI responses raise ValueError, like the existing readers.
  • Confirm against real data that the cargo hold's flag is Cargo and that location_id is the ship's item id. Use a real character's asset list (ask the owner if you can't sign in) and note what you found in the PR.

Abyss page:

  • Each field has its own button and status note. A successful fetch fills the field to two decimals. The note reads "From EVE at HH:MM" (ESI's fetched-at time, not now), adds " · N unpriced" when N > 0, and says ESI can lag up to an hour and the value can be edited.
  • The fetched value stays editable.
  • Errors (signed out, ESI error, rate limit) appear in the note in the critical colour, the same way the old wallet fetch did, and the field is left as it was.

Acceptance criteria

  • Only items in the active ship with flag Cargo count: not other flags in the same ship, not other ships, not hangars, not container contents
  • Ammo in the cargo hold counts
  • Asset paging is followed
  • Blueprint copies are left out
  • Unpriced item types are counted and left out of the value
  • The fetched-at time from ESI is passed through
  • Malformed ship, asset or price bodies raise ValueError
  • Both Fetch buttons fill their own field and note, including the unpriced count
  • Fetch errors show in the note in the critical colour and leave the field untouched
  • Signed out, the fields still work by hand and Fetch says to sign in
  • Real-data check of the Cargo flag and location id, written up in the PR
  • Tests:
    • Cargo reader against a fake ESI client serving canned ship, asset and price bodies, covering the cases above (prior art: the existing fake client and item builder in the loot tests, and the wallet tests)
    • GUI through gui.App with the cargo reader mocked: fill, stamp, unpriced count, error note
  • Full test suite green

Blocked by

Activity

  1. added
    esiEVE Online ESI integration
    ready-for-agentSpec'd and safe for the night shift to build
    on Oct 25, 2026
  2. self-assigned this
    on Oct 27, 2026
  3. Fazorath commented on Oct 28, 2026

    @Fazorath
    OwnerAuthor

    Done in #54, merged into the #38 branch issue-38-cargo-runs. It reaches main when that branch does (along with #45 and #48).

  4. added a commit that references this issue on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

esiEVE Online ESI integrationready-for-agentSpec'd and safe for the night shift to build

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions