balance endpoint
This commit is contained in:
@@ -350,6 +350,29 @@ paths:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/TransactionResponse"
|
$ref: "#/components/schemas/TransactionResponse"
|
||||||
|
/ledgers/{ledgerId}/balance:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- ledger
|
||||||
|
operationId: findBalanceByLedgerId
|
||||||
|
parameters:
|
||||||
|
- name: ledgerId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
responses:
|
||||||
|
"404":
|
||||||
|
description: Not Found
|
||||||
|
"400":
|
||||||
|
description: Bad Request
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
'*/*':
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/BalanceResponse"
|
||||||
/characters:
|
/characters:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@@ -660,6 +683,30 @@ components:
|
|||||||
enum:
|
enum:
|
||||||
- ISK
|
- ISK
|
||||||
- ITEM
|
- ITEM
|
||||||
|
BalanceResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
iskBalance:
|
||||||
|
type: number
|
||||||
|
itemBalances:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/ItemBalanceResponse"
|
||||||
|
required:
|
||||||
|
- iskBalance
|
||||||
|
- itemBalances
|
||||||
|
ItemBalanceResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
typeId:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
quantity:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
required:
|
||||||
|
- quantity
|
||||||
|
- typeId
|
||||||
CharacterResponse:
|
CharacterResponse:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ import type { RequestArgs } from './base';
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
|
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
|
||||||
|
|
||||||
|
export interface BalanceResponse {
|
||||||
|
'iskBalance': number;
|
||||||
|
'itemBalances': Array<ItemBalanceResponse>;
|
||||||
|
}
|
||||||
export interface CharacterResponse {
|
export interface CharacterResponse {
|
||||||
'characterId': number;
|
'characterId': number;
|
||||||
'name': string;
|
'name': string;
|
||||||
@@ -76,6 +80,10 @@ export const IskTransferResponseTypeEnum = {
|
|||||||
|
|
||||||
export type IskTransferResponseTypeEnum = typeof IskTransferResponseTypeEnum[keyof typeof IskTransferResponseTypeEnum];
|
export type IskTransferResponseTypeEnum = typeof IskTransferResponseTypeEnum[keyof typeof IskTransferResponseTypeEnum];
|
||||||
|
|
||||||
|
export interface ItemBalanceResponse {
|
||||||
|
'typeId': number;
|
||||||
|
'quantity': number;
|
||||||
|
}
|
||||||
export interface ItemTransferResponse extends TransferResponse {
|
export interface ItemTransferResponse extends TransferResponse {
|
||||||
'fromLedgerId': string;
|
'fromLedgerId': string;
|
||||||
'toLedgerId': string;
|
'toLedgerId': string;
|
||||||
@@ -635,6 +643,39 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio
|
|||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {string} ledgerId
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
findBalanceByLedgerId: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'ledgerId' is not null or undefined
|
||||||
|
assertParamExists('findBalanceByLedgerId', 'ledgerId', ledgerId)
|
||||||
|
const localVarPath = `/ledgers/{ledgerId}/balance`
|
||||||
|
.replace('{ledgerId}', encodeURIComponent(String(ledgerId)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
localVarHeaderParameter['Accept'] = '*/*';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} ledgerId
|
* @param {string} ledgerId
|
||||||
@@ -788,6 +829,18 @@ export const LedgerApiFp = function(configuration?: Configuration) {
|
|||||||
const localVarOperationServerBasePath = operationServerMap['LedgerApi.findAllLedgers']?.[localVarOperationServerIndex]?.url;
|
const localVarOperationServerBasePath = operationServerMap['LedgerApi.findAllLedgers']?.[localVarOperationServerIndex]?.url;
|
||||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {string} ledgerId
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async findBalanceByLedgerId(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BalanceResponse>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.findBalanceByLedgerId(ledgerId, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['LedgerApi.findBalanceByLedgerId']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} ledgerId
|
* @param {string} ledgerId
|
||||||
@@ -861,6 +914,15 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat
|
|||||||
findAllLedgers(options?: RawAxiosRequestConfig): AxiosPromise<Array<FindAllLedgers200ResponseInner>> {
|
findAllLedgers(options?: RawAxiosRequestConfig): AxiosPromise<Array<FindAllLedgers200ResponseInner>> {
|
||||||
return localVarFp.findAllLedgers(options).then((request) => request(axios, basePath));
|
return localVarFp.findAllLedgers(options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {string} ledgerId
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
findBalanceByLedgerId(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise<BalanceResponse> {
|
||||||
|
return localVarFp.findBalanceByLedgerId(ledgerId, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} ledgerId
|
* @param {string} ledgerId
|
||||||
@@ -926,6 +988,16 @@ export class LedgerApi extends BaseAPI {
|
|||||||
return LedgerApiFp(this.configuration).findAllLedgers(options).then((request) => request(this.axios, this.basePath));
|
return LedgerApiFp(this.configuration).findAllLedgers(options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {string} ledgerId
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
public findBalanceByLedgerId(ledgerId: string, options?: RawAxiosRequestConfig) {
|
||||||
|
return LedgerApiFp(this.configuration).findBalanceByLedgerId(ledgerId, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} ledgerId
|
* @param {string} ledgerId
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {RouterLink, RouterView} from 'vue-router';
|
import {RouterLink, RouterView} from 'vue-router';
|
||||||
import {useLedgerParam} from "@/ledger";
|
import {isMain, useLedgerParam} from "@/ledger";
|
||||||
import {routeNames} from "@/routes.ts";
|
import {routeNames} from "@/routes.ts";
|
||||||
|
|
||||||
const {ledgerId, ledger} = useLedgerParam();
|
const {ledgerId, ledger} = useLedgerParam();
|
||||||
@@ -8,12 +8,12 @@ const {ledgerId, ledger} = useLedgerParam();
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mt-4">
|
<div v-if="ledger" class="mt-4">
|
||||||
<div class="flex border-b-2 border-emerald-500">
|
<div class="flex border-b-2 border-emerald-500">
|
||||||
<RouterLink :to="{name: routeNames.viewLedgerBalance}" class="tab">
|
<RouterLink :to="{name: routeNames.viewLedgerBalance}" class="tab">
|
||||||
<span>Balance</span>
|
<span>Balance</span>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<RouterLink :to="{name: routeNames.listLedgerTransactions}" class="tab">
|
<RouterLink v-if="isMain(ledger)" :to="{name: routeNames.listLedgerTransactions}" class="tab">
|
||||||
<span>Transactions</span>
|
<span>Transactions</span>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user