transaction list api
This commit is contained in:
@@ -63,6 +63,33 @@ export interface CreateRuleBookRequest {
|
||||
*/
|
||||
export type FindAllLedgers200ResponseInner = CombinedLedgerResponse | MainLedgerResponse;
|
||||
|
||||
export interface IskTransferResponse extends TransferResponse {
|
||||
'fromLedgerId': string;
|
||||
'toLedgerId': string;
|
||||
'amount': number;
|
||||
'type'?: IskTransferResponseTypeEnum;
|
||||
}
|
||||
|
||||
export const IskTransferResponseTypeEnum = {
|
||||
Isk: 'ISK',
|
||||
} as const;
|
||||
|
||||
export type IskTransferResponseTypeEnum = typeof IskTransferResponseTypeEnum[keyof typeof IskTransferResponseTypeEnum];
|
||||
|
||||
export interface ItemTransferResponse extends TransferResponse {
|
||||
'fromLedgerId': string;
|
||||
'toLedgerId': string;
|
||||
'marketTypeId': number;
|
||||
'quantity': number;
|
||||
'type'?: ItemTransferResponseTypeEnum;
|
||||
}
|
||||
|
||||
export const ItemTransferResponseTypeEnum = {
|
||||
Item: 'ITEM',
|
||||
} as const;
|
||||
|
||||
export type ItemTransferResponseTypeEnum = typeof ItemTransferResponseTypeEnum[keyof typeof ItemTransferResponseTypeEnum];
|
||||
|
||||
export interface LedgerResponse {
|
||||
'type'?: LedgerResponseTypeEnum;
|
||||
}
|
||||
@@ -116,6 +143,28 @@ export interface SetCharacterRuleBookRequest {
|
||||
'ruleBookId': string;
|
||||
'bindings': { [key: string]: string; };
|
||||
}
|
||||
export interface TransactionResponse {
|
||||
'transactionId': string;
|
||||
'datetime': string;
|
||||
'description': string;
|
||||
'transfers': Array<TransactionResponseTransfersInner>;
|
||||
}
|
||||
/**
|
||||
* @type TransactionResponseTransfersInner
|
||||
*/
|
||||
export type TransactionResponseTransfersInner = IskTransferResponse | ItemTransferResponse;
|
||||
|
||||
export interface TransferResponse {
|
||||
'type'?: TransferResponseTypeEnum;
|
||||
}
|
||||
|
||||
export const TransferResponseTypeEnum = {
|
||||
Isk: 'ISK',
|
||||
Item: 'ITEM',
|
||||
} as const;
|
||||
|
||||
export type TransferResponseTypeEnum = typeof TransferResponseTypeEnum[keyof typeof TransferResponseTypeEnum];
|
||||
|
||||
export interface UpdateCombinedLedgerRequest {
|
||||
'name': string;
|
||||
'memberLedgerIds': Array<string>;
|
||||
@@ -1292,3 +1341,100 @@ export class RuleBookApi extends BaseAPI {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* TransactionApi - axios parameter creator
|
||||
*/
|
||||
export const TransactionApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {string} ledgerId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
finAllTransactionsInLedger: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'ledgerId' is not null or undefined
|
||||
assertParamExists('finAllTransactionsInLedger', 'ledgerId', ledgerId)
|
||||
const localVarPath = `/ledgers/{ledgerId}/transactions`
|
||||
.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,
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* TransactionApi - functional programming interface
|
||||
*/
|
||||
export const TransactionApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = TransactionApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {string} ledgerId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async finAllTransactionsInLedger(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<TransactionResponse>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.finAllTransactionsInLedger(ledgerId, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['TransactionApi.finAllTransactionsInLedger']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* TransactionApi - factory interface
|
||||
*/
|
||||
export const TransactionApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = TransactionApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {string} ledgerId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
finAllTransactionsInLedger(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<TransactionResponse>> {
|
||||
return localVarFp.finAllTransactionsInLedger(ledgerId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* TransactionApi - object-oriented interface
|
||||
*/
|
||||
export class TransactionApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @param {string} ledgerId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public finAllTransactionsInLedger(ledgerId: string, options?: RawAxiosRequestConfig) {
|
||||
return TransactionApiFp(this.configuration).finAllTransactionsInLedger(ledgerId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ export * from './ledger';
|
||||
|
||||
export {default as LedgerLabel} from './LedgerLabel.vue';
|
||||
export {default as LedgerSelect} from './LedgerSelect.vue';
|
||||
export {default as CreateLedgerModal} from './CreateLedgerModal.vue';
|
||||
export {default as EditLedgerModal} from './EditLedgerModal.vue';
|
||||
+12
-5
@@ -1,19 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import {RouterView} from 'vue-router';
|
||||
import {CreateLedgerModal} from "@/ledger";
|
||||
import {EditLedgerModal, useLedgersStore} from "@/ledger";
|
||||
import {ref} from "vue";
|
||||
import {processingApi} from "@/mammon";
|
||||
|
||||
const createLedgerModal = ref<typeof CreateLedgerModal>();
|
||||
const {refresh} = useLedgersStore();
|
||||
|
||||
const editLedgerModal = ref<typeof EditLedgerModal>();
|
||||
|
||||
const processActivities = async () => {
|
||||
await processingApi.processNewActivities();
|
||||
await refresh();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-4">
|
||||
<div class="mb-4 border-b-1 flex justify-end">
|
||||
<button class="mb-2 ms-2" @click="processingApi.processNewActivities()">Process Activities</button>
|
||||
<button class="mb-2 ms-2" @click="createLedgerModal?.open()">New Ledger</button>
|
||||
<button class="mb-2 ms-2" @click="processActivities">Process Activities</button>
|
||||
<button class="mb-2 ms-2" @click="editLedgerModal?.open()">New Ledger</button>
|
||||
</div>
|
||||
<CreateLedgerModal ref="createLedgerModal" />
|
||||
<EditLedgerModal ref="editLedgerModal" />
|
||||
<RouterView />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {CreateLedgerModal, LedgerLabel, useLedgersStore} from "@/ledger";
|
||||
import {EditLedgerModal, LedgerLabel, useLedgersStore} from "@/ledger";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {nextTick, ref} from "vue";
|
||||
import {PencilSquareIcon} from "@heroicons/vue/24/outline";
|
||||
@@ -8,7 +8,7 @@ import {formatIsk} from "@/formaters.ts";
|
||||
|
||||
const {ledgers} = storeToRefs(useLedgersStore());
|
||||
|
||||
const editModal = ref<typeof CreateLedgerModal>();
|
||||
const editModal = ref<typeof EditLedgerModal>();
|
||||
const editingLedgerId = ref("");
|
||||
|
||||
const openEdit = async (ledgerId: string) => {
|
||||
@@ -29,5 +29,5 @@ const openEdit = async (ledgerId: string) => {
|
||||
<button class="btn-icon ms-2" @click="openEdit(ledger.ledgerId)"><PencilSquareIcon /></button>
|
||||
</div>
|
||||
</div>
|
||||
<CreateLedgerModal ref="editModal" :ledger-id="editingLedgerId" />
|
||||
<EditLedgerModal ref="editModal" :ledger-id="editingLedgerId" />
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user