feat(#8): Handle polymorphic activity source
This commit is contained in:
@@ -32,9 +32,9 @@ export interface AcquisitionResponse {
|
||||
*/
|
||||
'acquisitionId': string;
|
||||
/**
|
||||
* EVE character id that made the acquisition.
|
||||
* Where the acquisition came from: a character, a corporation, or nothing.
|
||||
*/
|
||||
'characterId': number;
|
||||
'source': ActivitySourceResponse;
|
||||
/**
|
||||
* EVE market type (item) id that was acquired.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ export interface AcquisitionResponse {
|
||||
/**
|
||||
* How the item entered the inventory.
|
||||
*/
|
||||
'source': AcquisitionResponseSourceEnum;
|
||||
'origin': AcquisitionResponseOriginEnum;
|
||||
/**
|
||||
* When the acquisition occurred.
|
||||
*/
|
||||
@@ -61,12 +61,42 @@ export interface AcquisitionResponse {
|
||||
'unitCost': number;
|
||||
}
|
||||
|
||||
export const AcquisitionResponseSourceEnum = {
|
||||
export const AcquisitionResponseOriginEnum = {
|
||||
Bought: 'BOUGHT',
|
||||
Manual: 'MANUAL',
|
||||
} as const;
|
||||
|
||||
export type AcquisitionResponseSourceEnum = typeof AcquisitionResponseSourceEnum[keyof typeof AcquisitionResponseSourceEnum];
|
||||
export type AcquisitionResponseOriginEnum = typeof AcquisitionResponseOriginEnum[keyof typeof AcquisitionResponseOriginEnum];
|
||||
|
||||
/**
|
||||
* Where an activity or transaction came from: a character, a corporation wallet, or nothing (a manual entry).
|
||||
*/
|
||||
export interface ActivitySourceResponse {
|
||||
/**
|
||||
* The kind of source.
|
||||
*/
|
||||
'type': ActivitySourceResponseTypeEnum;
|
||||
/**
|
||||
* EVE character id, when the source is a character.
|
||||
*/
|
||||
'characterId': number | null;
|
||||
/**
|
||||
* EVE corporation id, when the source is a corporation.
|
||||
*/
|
||||
'corporationId': number | null;
|
||||
/**
|
||||
* Corporation wallet division (1-7), when the source is a corporation and it is known.
|
||||
*/
|
||||
'division': number | null;
|
||||
}
|
||||
|
||||
export const ActivitySourceResponseTypeEnum = {
|
||||
Character: 'CHARACTER',
|
||||
Corporation: 'CORPORATION',
|
||||
None: 'NONE',
|
||||
} as const;
|
||||
|
||||
export type ActivitySourceResponseTypeEnum = typeof ActivitySourceResponseTypeEnum[keyof typeof ActivitySourceResponseTypeEnum];
|
||||
|
||||
/**
|
||||
* The balance of a ledger: its ISK total plus the quantity of each item type held.
|
||||
@@ -604,9 +634,9 @@ export interface TransactionResponse {
|
||||
*/
|
||||
'transactionId': string;
|
||||
/**
|
||||
* EVE character id the transaction is attributed to, if any.
|
||||
* Where the transaction is attributed: a character, a corporation, or nothing.
|
||||
*/
|
||||
'characterId': number | null;
|
||||
'source': ActivitySourceResponse;
|
||||
/**
|
||||
* When the transaction occurred.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user