character in transaction list

This commit is contained in:
Sirttas
2026-06-05 18:41:59 +02:00
parent 8d0e5ffc1a
commit bef14bcdcc
3 changed files with 248 additions and 159 deletions
+137 -68
View File
@@ -153,6 +153,7 @@ export interface SetCharacterRuleBookRequest {
}
export interface TransactionResponse {
'transactionId': string;
'characterId': number;
'datetime': string;
'description': string;
'transfers': Array<TransactionResponseTransfersInner>;
@@ -193,7 +194,8 @@ export const ActivityApiAxiosParamCreator = function (configuration?: Configurat
return {
/**
*
* @param {number} characterId
* @summary Fetch new activities for a character from the EVE API
* @param {number} characterId Id of the character
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -234,7 +236,8 @@ export const ActivityApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {number} characterId
* @summary Fetch new activities for a character from the EVE API
* @param {number} characterId Id of the character
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -255,7 +258,8 @@ export const ActivityApiFactory = function (configuration?: Configuration, baseP
return {
/**
*
* @param {number} characterId
* @summary Fetch new activities for a character from the EVE API
* @param {number} characterId Id of the character
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -271,7 +275,8 @@ export const ActivityApiFactory = function (configuration?: Configuration, baseP
export class ActivityApi extends BaseAPI {
/**
*
* @param {number} characterId
* @summary Fetch new activities for a character from the EVE API
* @param {number} characterId Id of the character
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -289,6 +294,7 @@ export const CharacterApiAxiosParamCreator = function (configuration?: Configura
return {
/**
*
* @summary Find all characters with a usable token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -327,6 +333,7 @@ export const CharacterApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary Find all characters with a usable token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -347,6 +354,7 @@ export const CharacterApiFactory = function (configuration?: Configuration, base
return {
/**
*
* @summary Find all characters with a usable token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -362,6 +370,7 @@ export const CharacterApiFactory = function (configuration?: Configuration, base
export class CharacterApi extends BaseAPI {
/**
*
* @summary Find all characters with a usable token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -379,7 +388,8 @@ export const CharacterRuleBookApiAxiosParamCreator = function (configuration?: C
return {
/**
*
* @param {number} characterId
* @summary Find the rule book assigned to a character
* @param {number} characterId Id of the character
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -412,8 +422,9 @@ export const CharacterRuleBookApiAxiosParamCreator = function (configuration?: C
},
/**
*
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @summary Assign a rule book to a character
* @param {number} characterId Id of the character
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest Rule book and ledger bindings to assign
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -459,7 +470,8 @@ export const CharacterRuleBookApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {number} characterId
* @summary Find the rule book assigned to a character
* @param {number} characterId Id of the character
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -471,8 +483,9 @@ export const CharacterRuleBookApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @summary Assign a rule book to a character
* @param {number} characterId Id of the character
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest Rule book and ledger bindings to assign
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -493,7 +506,8 @@ export const CharacterRuleBookApiFactory = function (configuration?: Configurati
return {
/**
*
* @param {number} characterId
* @summary Find the rule book assigned to a character
* @param {number} characterId Id of the character
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -502,8 +516,9 @@ export const CharacterRuleBookApiFactory = function (configuration?: Configurati
},
/**
*
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @summary Assign a rule book to a character
* @param {number} characterId Id of the character
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest Rule book and ledger bindings to assign
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -519,7 +534,8 @@ export const CharacterRuleBookApiFactory = function (configuration?: Configurati
export class CharacterRuleBookApi extends BaseAPI {
/**
*
* @param {number} characterId
* @summary Find the rule book assigned to a character
* @param {number} characterId Id of the character
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -529,8 +545,9 @@ export class CharacterRuleBookApi extends BaseAPI {
/**
*
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @summary Assign a rule book to a character
* @param {number} characterId Id of the character
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest Rule book and ledger bindings to assign
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -548,7 +565,8 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio
return {
/**
*
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
* @summary Create a combined ledger
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest Combined ledger to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -582,7 +600,8 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio
},
/**
*
* @param {CreateMainLedgerRequest} createMainLedgerRequest
* @summary Create a main ledger
* @param {CreateMainLedgerRequest} createMainLedgerRequest Main ledger to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -616,6 +635,7 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio
},
/**
*
* @summary Find all ledgers
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -645,7 +665,8 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio
},
/**
*
* @param {string} ledgerId
* @summary Find the balance of a ledger
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -678,7 +699,8 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio
},
/**
*
* @param {string} ledgerId
* @summary Find a ledger by its id
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -711,8 +733,9 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio
},
/**
*
* @param {string} ledgerId
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest
* @summary Update a combined ledger
* @param {string} ledgerId Id of the combined ledger
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest New state of the combined ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -749,8 +772,9 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio
},
/**
*
* @param {string} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @summary Update a main ledger
* @param {string} ledgerId Id of the main ledger
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest New state of the main ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -796,7 +820,8 @@ export const LedgerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
* @summary Create a combined ledger
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest Combined ledger to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -808,7 +833,8 @@ export const LedgerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {CreateMainLedgerRequest} createMainLedgerRequest
* @summary Create a main ledger
* @param {CreateMainLedgerRequest} createMainLedgerRequest Main ledger to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -820,6 +846,7 @@ export const LedgerApiFp = function(configuration?: Configuration) {
},
/**
*
* @summary Find all ledgers
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -831,7 +858,8 @@ export const LedgerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {string} ledgerId
* @summary Find the balance of a ledger
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -843,7 +871,8 @@ export const LedgerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {string} ledgerId
* @summary Find a ledger by its id
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -855,8 +884,9 @@ export const LedgerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {string} ledgerId
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest
* @summary Update a combined ledger
* @param {string} ledgerId Id of the combined ledger
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest New state of the combined ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -868,8 +898,9 @@ export const LedgerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {string} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @summary Update a main ledger
* @param {string} ledgerId Id of the main ledger
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest New state of the main ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -890,7 +921,8 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
return {
/**
*
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
* @summary Create a combined ledger
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest Combined ledger to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -899,7 +931,8 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
},
/**
*
* @param {CreateMainLedgerRequest} createMainLedgerRequest
* @summary Create a main ledger
* @param {CreateMainLedgerRequest} createMainLedgerRequest Main ledger to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -908,6 +941,7 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
},
/**
*
* @summary Find all ledgers
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -916,7 +950,8 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
},
/**
*
* @param {string} ledgerId
* @summary Find the balance of a ledger
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -925,7 +960,8 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
},
/**
*
* @param {string} ledgerId
* @summary Find a ledger by its id
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -934,8 +970,9 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
},
/**
*
* @param {string} ledgerId
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest
* @summary Update a combined ledger
* @param {string} ledgerId Id of the combined ledger
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest New state of the combined ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -944,8 +981,9 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
},
/**
*
* @param {string} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @summary Update a main ledger
* @param {string} ledgerId Id of the main ledger
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest New state of the main ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -961,7 +999,8 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
export class LedgerApi extends BaseAPI {
/**
*
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
* @summary Create a combined ledger
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest Combined ledger to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -971,7 +1010,8 @@ export class LedgerApi extends BaseAPI {
/**
*
* @param {CreateMainLedgerRequest} createMainLedgerRequest
* @summary Create a main ledger
* @param {CreateMainLedgerRequest} createMainLedgerRequest Main ledger to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -981,6 +1021,7 @@ export class LedgerApi extends BaseAPI {
/**
*
* @summary Find all ledgers
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -990,7 +1031,8 @@ export class LedgerApi extends BaseAPI {
/**
*
* @param {string} ledgerId
* @summary Find the balance of a ledger
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1000,7 +1042,8 @@ export class LedgerApi extends BaseAPI {
/**
*
* @param {string} ledgerId
* @summary Find a ledger by its id
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1010,8 +1053,9 @@ export class LedgerApi extends BaseAPI {
/**
*
* @param {string} ledgerId
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest
* @summary Update a combined ledger
* @param {string} ledgerId Id of the combined ledger
* @param {UpdateCombinedLedgerRequest} updateCombinedLedgerRequest New state of the combined ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1021,8 +1065,9 @@ export class LedgerApi extends BaseAPI {
/**
*
* @param {string} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @summary Update a main ledger
* @param {string} ledgerId Id of the main ledger
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest New state of the main ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1040,6 +1085,7 @@ export const ProcessingApiAxiosParamCreator = function (configuration?: Configur
return {
/**
*
* @summary Process new activities for all characters with a usable token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1077,6 +1123,7 @@ export const ProcessingApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary Process new activities for all characters with a usable token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1097,6 +1144,7 @@ export const ProcessingApiFactory = function (configuration?: Configuration, bas
return {
/**
*
* @summary Process new activities for all characters with a usable token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1112,6 +1160,7 @@ export const ProcessingApiFactory = function (configuration?: Configuration, bas
export class ProcessingApi extends BaseAPI {
/**
*
* @summary Process new activities for all characters with a usable token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1129,7 +1178,8 @@ export const RuleBookApiAxiosParamCreator = function (configuration?: Configurat
return {
/**
*
* @param {CreateRuleBookRequest} createRuleBookRequest
* @summary Create a rule book
* @param {CreateRuleBookRequest} createRuleBookRequest Rule book to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1163,6 +1213,7 @@ export const RuleBookApiAxiosParamCreator = function (configuration?: Configurat
},
/**
*
* @summary Find all rule books
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1192,7 +1243,8 @@ export const RuleBookApiAxiosParamCreator = function (configuration?: Configurat
},
/**
*
* @param {string} ruleBookId
* @summary Find a rule book by its id
* @param {string} ruleBookId Id of the rule book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1225,8 +1277,9 @@ export const RuleBookApiAxiosParamCreator = function (configuration?: Configurat
},
/**
*
* @param {string} ruleBookId
* @param {UpdateRuleBookRequest} updateRuleBookRequest
* @summary Update a rule book
* @param {string} ruleBookId Id of the rule book
* @param {UpdateRuleBookRequest} updateRuleBookRequest New state of the rule book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1272,7 +1325,8 @@ export const RuleBookApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {CreateRuleBookRequest} createRuleBookRequest
* @summary Create a rule book
* @param {CreateRuleBookRequest} createRuleBookRequest Rule book to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1284,6 +1338,7 @@ export const RuleBookApiFp = function(configuration?: Configuration) {
},
/**
*
* @summary Find all rule books
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1295,7 +1350,8 @@ export const RuleBookApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {string} ruleBookId
* @summary Find a rule book by its id
* @param {string} ruleBookId Id of the rule book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1307,8 +1363,9 @@ export const RuleBookApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {string} ruleBookId
* @param {UpdateRuleBookRequest} updateRuleBookRequest
* @summary Update a rule book
* @param {string} ruleBookId Id of the rule book
* @param {UpdateRuleBookRequest} updateRuleBookRequest New state of the rule book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1329,7 +1386,8 @@ export const RuleBookApiFactory = function (configuration?: Configuration, baseP
return {
/**
*
* @param {CreateRuleBookRequest} createRuleBookRequest
* @summary Create a rule book
* @param {CreateRuleBookRequest} createRuleBookRequest Rule book to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1338,6 +1396,7 @@ export const RuleBookApiFactory = function (configuration?: Configuration, baseP
},
/**
*
* @summary Find all rule books
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1346,7 +1405,8 @@ export const RuleBookApiFactory = function (configuration?: Configuration, baseP
},
/**
*
* @param {string} ruleBookId
* @summary Find a rule book by its id
* @param {string} ruleBookId Id of the rule book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1355,8 +1415,9 @@ export const RuleBookApiFactory = function (configuration?: Configuration, baseP
},
/**
*
* @param {string} ruleBookId
* @param {UpdateRuleBookRequest} updateRuleBookRequest
* @summary Update a rule book
* @param {string} ruleBookId Id of the rule book
* @param {UpdateRuleBookRequest} updateRuleBookRequest New state of the rule book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1372,7 +1433,8 @@ export const RuleBookApiFactory = function (configuration?: Configuration, baseP
export class RuleBookApi extends BaseAPI {
/**
*
* @param {CreateRuleBookRequest} createRuleBookRequest
* @summary Create a rule book
* @param {CreateRuleBookRequest} createRuleBookRequest Rule book to create
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1382,6 +1444,7 @@ export class RuleBookApi extends BaseAPI {
/**
*
* @summary Find all rule books
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1391,7 +1454,8 @@ export class RuleBookApi extends BaseAPI {
/**
*
* @param {string} ruleBookId
* @summary Find a rule book by its id
* @param {string} ruleBookId Id of the rule book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1401,8 +1465,9 @@ export class RuleBookApi extends BaseAPI {
/**
*
* @param {string} ruleBookId
* @param {UpdateRuleBookRequest} updateRuleBookRequest
* @summary Update a rule book
* @param {string} ruleBookId Id of the rule book
* @param {UpdateRuleBookRequest} updateRuleBookRequest New state of the rule book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1420,7 +1485,8 @@ export const TransactionApiAxiosParamCreator = function (configuration?: Configu
return {
/**
*
* @param {string} ledgerId
* @summary Find all transactions in a ledger
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1462,7 +1528,8 @@ export const TransactionApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {string} ledgerId
* @summary Find all transactions in a ledger
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1483,7 +1550,8 @@ export const TransactionApiFactory = function (configuration?: Configuration, ba
return {
/**
*
* @param {string} ledgerId
* @summary Find all transactions in a ledger
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -1499,7 +1567,8 @@ export const TransactionApiFactory = function (configuration?: Configuration, ba
export class TransactionApi extends BaseAPI {
/**
*
* @param {string} ledgerId
* @summary Find all transactions in a ledger
* @param {string} ledgerId Id of the ledger
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
+12 -3
View File
@@ -3,13 +3,15 @@
import {findAllTransactionInLeger, useLedgerParam} from "@/ledger";
import {computedAsync} from "@vueuse/core";
import {TransactionResponse} from "@/generated/mammon";
import {formatEveDate} from "@/formaters.ts";
import {IskLabel} from "@/market";
import {SortableHeader, useSort, VirtualScrollTable} from "@/components/table";
import {TransferList, TransferTypes} from "@/transaction";
import {Dropdown} from "@/components";
import {CharacterLabel, useCharactersStore} from "@/characters";
import {formatEveDate} from "@/formaters.ts";
const {ledgerId} = useLedgerParam();
const {findById} = useCharactersStore();
const transactions = computedAsync<TransactionResponse[]>(async () => {
if (ledgerId.value) {
@@ -18,15 +20,18 @@ const transactions = computedAsync<TransactionResponse[]>(async () => {
return [];
}, []);
const { sortedArray, headerProps } = useSort(() => transactions.value.map(transaction => {
const { sortedArray, headerProps } = useSort(computedAsync(() => Promise.all(transactions.value.map(async transaction => {
const character = await findById(transaction.characterId);
return {
character,
characterName: character?.name ?? "",
transactionId: transaction.transactionId,
description: transaction.description,
date: new Date(transaction.datetime),
balance: getIskBalance(transaction),
transfers: transaction.transfers
}
}), { defaultSortKey: 'date', defaultSortDirection: 'desc' });
})), []), { defaultSortKey: 'date', defaultSortDirection: 'desc' });
const getIskBalance = (transaction: TransactionResponse) => {
if (!ledgerId.value) {
@@ -54,6 +59,7 @@ const getIskBalance = (transaction: TransactionResponse) => {
<template #default="{ list }">
<thead>
<tr>
<SortableHeader v-bind="headerProps" sortKey="characterName">Character</SortableHeader>
<SortableHeader v-bind="headerProps" sortKey="date">Date</SortableHeader>
<SortableHeader v-bind="headerProps" sortKey="balance">Isk Change</SortableHeader>
<SortableHeader v-bind="headerProps" sortKey="description">Description</SortableHeader>
@@ -61,6 +67,9 @@ const getIskBalance = (transaction: TransactionResponse) => {
</thead>
<tbody>
<tr v-for="t in list" :key="t.data.transactionId">
<td>
<CharacterLabel v-if="t.data.character" :character="t.data.character" />
</td>
<td>
<Dropdown class="transfer-dropdown">
<template #button>