Handle polymorphic activity source (character · corporation · none) in the UI #8

Closed
opened 2026-07-03 13:41:17 +02:00 by Sirttas · 0 comments
Owner

Follow-up to mammon #16 ([domain-ownership] 5 — Polymorphic activity source).

Why

mammon #16 replaced the bare characterId on activities/transactions/acquisitions with a polymorphic source that can be a character, a corporation (with an optional wallet division), or nothing (a manual entry). The regenerated API client already reflects this:

  • TransactionResponse.characterIdTransactionResponse.source: ActivitySourceResponse
  • AcquisitionResponse.source: ActivitySourceResponse
  • ActivitySourceResponse = { type, characterId | null, corporationId | null, division | null }

The frontend still assumes the old character-only model, so it no longer type-checks / renders correctly.

Scope

  1. src/pages/ledger/ListLedgerTransactions.vue — reads transaction.characterId (line ~24), which no longer exists. Resolve/display the source instead: character label when the source is a character, corporation when it is a corporation, and nothing for a manual/sourceless transaction. The "Character" column and its sort key should become a generic "Source" column.
  2. src/market/acquisition/acquisition.tsRawAcquiredType.source is typed as AcquisitionResponseSourceEnum but is now assigned an ActivitySourceResponse object; reconcile the type and downstream usage in src/pages/market/TypeInfo.vue.
  3. Source rendering — introduce a shared way to render an ActivitySourceResponse (character portrait/label, corporation, or "—") reused by transactions and acquisitions. Corporation source may expose a division (1–7) that can be null (e.g. limit buy orders — see mammon #16 / the division-null fix).

Acceptance criteria

  • Transactions and acquisitions render for all three source kinds (character, corporation, none) without errors.
  • No remaining references to the removed characterId field on transaction/acquisition responses.
  • null division on a corporation source is handled gracefully.
  • Type-check (npm run build) passes.

🤖 Generated with Claude Code

Follow-up to mammon #16 (*[domain-ownership] 5 — Polymorphic activity source*). ## Why mammon #16 replaced the bare `characterId` on activities/transactions/acquisitions with a polymorphic **source** that can be a character, a corporation (with an optional wallet `division`), or nothing (a manual entry). The regenerated API client already reflects this: - `TransactionResponse.characterId` → `TransactionResponse.source: ActivitySourceResponse` - `AcquisitionResponse.source: ActivitySourceResponse` - `ActivitySourceResponse = { type, characterId | null, corporationId | null, division | null }` The frontend still assumes the old character-only model, so it no longer type-checks / renders correctly. ## Scope 1. **`src/pages/ledger/ListLedgerTransactions.vue`** — reads `transaction.characterId` (line ~24), which no longer exists. Resolve/display the source instead: character label when the source is a character, corporation when it is a corporation, and nothing for a manual/sourceless transaction. The "Character" column and its sort key should become a generic "Source" column. 2. **`src/market/acquisition/acquisition.ts`** — `RawAcquiredType.source` is typed as `AcquisitionResponseSourceEnum` but is now assigned an `ActivitySourceResponse` object; reconcile the type and downstream usage in `src/pages/market/TypeInfo.vue`. 3. **Source rendering** — introduce a shared way to render an `ActivitySourceResponse` (character portrait/label, corporation, or "—") reused by transactions and acquisitions. Corporation source may expose a `division` (1–7) that can be null (e.g. limit buy orders — see mammon #16 / the division-null fix). ## Acceptance criteria - [x] Transactions and acquisitions render for all three source kinds (character, corporation, none) without errors. - [x] No remaining references to the removed `characterId` field on transaction/acquisition responses. - [x] `null` `division` on a corporation source is handled gracefully. - [x] Type-check (`npm run build`) passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eveal/gemory#8