esi-issues icon indicating copy to clipboard operation
esi-issues copied to clipboard

/characters/{character_id}/wallet/journal/ gives a context_id_type of 'eve_system' for ids that are 'type_id'

Open ArtificialQualia opened this issue 7 years ago • 1 comments

Bug

Some journal entries types returned from the /wallet/journal/ endpoint contain a context_id_type of eve_system when they are not any 'special' or reserved type of value, they should simply type_id where applicable.

I have noticed this particularly on insurance transactions. When you buy insurance, the context_id contains the ID of the insurance that was purchased, so it is not surprising that this is considered an eve_system ID type. However, when insurance is paid out, the value of context_id is just the type_id of the ship that was destroyed, but it uses eve_system for the context_id_type

Request

GET /v4/characters/1858883174/wallet/journal/?datasource=tranquility&page=1 (probably applies to corporation wallet journal endpoint as well)

Response

Status Code

200

Headers

 date: Sat, 09 Jun 2018 15:22:17 GMT 
 etag: "9c3012dbf5ae8f6c73405d434feca2ac8b9318d8cd3d6b5911fa8ffb" 
 expires: Sat, 09 Jun 2018 16:15:16 GMT 
 last-modified: Sat, 09 Jun 2018 15:15:16 GMT 
 x-esi-request-id: 389e023b-bb52-4e5b-8c7c-5bfac46a1365 

Body

[
...
  {
    "amount": 3635220.8,
    "balance": 9507094895.3564,
    "context_id": 17720,
    "context_id_type": "eve_system",
    "date": "2018-06-02T19:37:58Z",
    "description": "Insurance paid by EVE Central Bank to Demogorgon Asmodeous covering loss of a Cynabal",
    "first_party_id": 2,
    "id": 15588749436,
    "ref_type": "insurance",
    "second_party_id": 1858883174
  },
...

Expected

...
  {
    "amount": 3635220.8,
    "balance": 9507094895.3564,
    "context_id": 17720,
    "context_id_type": "type_id",
    "date": "2018-06-02T19:37:58Z",
    "description": "Insurance paid by EVE Central Bank to Demogorgon Asmodeous covering loss of a Cynabal",
    "first_party_id": 2,
    "id": 15588749436,
    "ref_type": "insurance",
    "second_party_id": 1858883174
  },
...

Checklist

Check all boxes that apply to this issue:

  • [x] Bug description is provided
  • [x] Request path is provided
  • [x] Response status code is provided
  • [x] Response headers are provided
  • [x] Response body is provided
  • [x] Expected response is provided

ArtificialQualia avatar Jun 09 '18 19:06 ArtificialQualia

Of all the ref_types, this is the most special one. For most other types, server-side we evaluate the more exact type for you. In this case, we do not. It is announced as eve_system, but it actually either is or an item_id or a type_id. Knowing which is which is simple: big number? item_id. Smaller number: type_id. Not ideal, but it gets the job done for now :)

I will see if we can resolve the context-type more properly server-side. But at least now it is documented what eve_system actually means :)

ccp-pinky avatar Jul 16 '25 15:07 ccp-pinky