update activity call
This commit is contained in:
+96
-5
@@ -254,15 +254,38 @@ paths:
|
||||
$ref: "#/components/schemas/RuleBookResponse"
|
||||
"400":
|
||||
description: Invalid request (e.g. blank name)
|
||||
/process-activities:
|
||||
/reprocessing:
|
||||
post:
|
||||
tags:
|
||||
- processing
|
||||
summary: Process new activities for all characters with a usable token
|
||||
operationId: processNewActivities
|
||||
- reprocessing
|
||||
summary: "Reprocess the given item stacks for a character, appraising the input\
|
||||
\ and resulting materials"
|
||||
operationId: reprocessItems
|
||||
parameters:
|
||||
- name: locationId
|
||||
in: query
|
||||
description: Location to derive reprocessing efficiency at; defaults to the
|
||||
character's current location when omitted
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
requestBody:
|
||||
description: Character and item stacks to reprocess
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ReprocessItemsRequest"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: New activities processed
|
||||
description: The reprocessing result for each input stack
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/ReprocessingResultResponse"
|
||||
/ledgers/main:
|
||||
post:
|
||||
tags:
|
||||
@@ -350,6 +373,15 @@ paths:
|
||||
description: New activities fetched and stored
|
||||
"400":
|
||||
description: No character with this id
|
||||
/activities/process:
|
||||
post:
|
||||
tags:
|
||||
- activity
|
||||
summary: Process new activities for all characters with a usable token
|
||||
operationId: processNewActivities
|
||||
responses:
|
||||
"200":
|
||||
description: New activities processed
|
||||
/rule-books/script-definitions:
|
||||
get:
|
||||
tags:
|
||||
@@ -901,6 +933,65 @@ components:
|
||||
- name
|
||||
- script
|
||||
- usedForAcquisitions
|
||||
MarketTypeStackRequest:
|
||||
type: object
|
||||
properties:
|
||||
marketTypeId:
|
||||
type: integer
|
||||
format: int64
|
||||
quantity:
|
||||
type: integer
|
||||
format: int64
|
||||
required:
|
||||
- marketTypeId
|
||||
- quantity
|
||||
ReprocessItemsRequest:
|
||||
type: object
|
||||
properties:
|
||||
characterId:
|
||||
type: integer
|
||||
format: int64
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/MarketTypeStackRequest"
|
||||
required:
|
||||
- characterId
|
||||
- items
|
||||
MarketTypeStackAppraisalResponse:
|
||||
type: object
|
||||
properties:
|
||||
marketTypeId:
|
||||
type: integer
|
||||
format: int64
|
||||
quantity:
|
||||
type: integer
|
||||
format: int64
|
||||
buy:
|
||||
type: number
|
||||
sell:
|
||||
type: number
|
||||
orderCount:
|
||||
type: integer
|
||||
format: int64
|
||||
required:
|
||||
- buy
|
||||
- marketTypeId
|
||||
- orderCount
|
||||
- quantity
|
||||
- sell
|
||||
ReprocessingResultResponse:
|
||||
type: object
|
||||
properties:
|
||||
input:
|
||||
$ref: "#/components/schemas/MarketTypeStackAppraisalResponse"
|
||||
output:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/MarketTypeStackAppraisalResponse"
|
||||
required:
|
||||
- input
|
||||
- output
|
||||
CreateMainLedgerRequest:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
+119
-23
@@ -136,6 +136,25 @@ export interface MarketTypeResponse {
|
||||
'portionSize': number;
|
||||
'iconId': number;
|
||||
}
|
||||
export interface MarketTypeStackAppraisalResponse {
|
||||
'marketTypeId': number;
|
||||
'quantity': number;
|
||||
'buy': number;
|
||||
'sell': number;
|
||||
'orderCount': number;
|
||||
}
|
||||
export interface MarketTypeStackRequest {
|
||||
'marketTypeId': number;
|
||||
'quantity': number;
|
||||
}
|
||||
export interface ReprocessItemsRequest {
|
||||
'characterId': number;
|
||||
'items': Array<MarketTypeStackRequest>;
|
||||
}
|
||||
export interface ReprocessingResultResponse {
|
||||
'input': MarketTypeStackAppraisalResponse;
|
||||
'output': Array<MarketTypeStackAppraisalResponse>;
|
||||
}
|
||||
export interface RuleBookResponse {
|
||||
'ruleBookId': string;
|
||||
'name': string;
|
||||
@@ -329,6 +348,35 @@ export const ActivityApiAxiosParamCreator = function (configuration?: Configurat
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Process new activities for all characters with a usable token
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
processNewActivities: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/activities/process`;
|
||||
// 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: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
@@ -372,6 +420,18 @@ export const ActivityApiFp = function(configuration?: Configuration) {
|
||||
const localVarOperationServerBasePath = operationServerMap['ActivityApi.fetchNewActivitiesForCharacter']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Process new activities for all characters with a usable token
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async processNewActivities(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.processNewActivities(options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['ActivityApi.processNewActivities']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@@ -400,6 +460,15 @@ export const ActivityApiFactory = function (configuration?: Configuration, baseP
|
||||
fetchNewActivitiesForCharacter(characterId: number, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
||||
return localVarFp.fetchNewActivitiesForCharacter(characterId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Process new activities for all characters with a usable token
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
processNewActivities(options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
||||
return localVarFp.processNewActivities(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -427,6 +496,16 @@ export class ActivityApi extends BaseAPI {
|
||||
public fetchNewActivitiesForCharacter(characterId: number, options?: RawAxiosRequestConfig) {
|
||||
return ActivityApiFp(this.configuration).fetchNewActivitiesForCharacter(characterId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Process new activities for all characters with a usable token
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public processNewActivities(options?: RawAxiosRequestConfig) {
|
||||
return ActivityApiFp(this.configuration).processNewActivities(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1791,18 +1870,22 @@ export class MarketApi extends BaseAPI {
|
||||
|
||||
|
||||
/**
|
||||
* ProcessingApi - axios parameter creator
|
||||
* ReprocessingApi - axios parameter creator
|
||||
*/
|
||||
export const ProcessingApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
export const ReprocessingApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary Process new activities for all characters with a usable token
|
||||
* @summary Reprocess the given item stacks for a character, appraising the input and resulting materials
|
||||
* @param {ReprocessItemsRequest} reprocessItemsRequest Character and item stacks to reprocess
|
||||
* @param {number} [locationId] Location to derive reprocessing efficiency at; defaults to the character\'s current location when omitted
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
processNewActivities: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/process-activities`;
|
||||
reprocessItems: async (reprocessItemsRequest: ReprocessItemsRequest, locationId?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'reprocessItemsRequest' is not null or undefined
|
||||
assertParamExists('reprocessItems', 'reprocessItemsRequest', reprocessItemsRequest)
|
||||
const localVarPath = `/reprocessing`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
@@ -1814,10 +1897,17 @@ export const ProcessingApiAxiosParamCreator = function (configuration?: Configur
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
if (locationId !== undefined) {
|
||||
localVarQueryParameter['locationId'] = locationId;
|
||||
}
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||
localVarHeaderParameter['Accept'] = '*/*';
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(reprocessItemsRequest, localVarRequestOptions, configuration)
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
@@ -1828,56 +1918,62 @@ export const ProcessingApiAxiosParamCreator = function (configuration?: Configur
|
||||
};
|
||||
|
||||
/**
|
||||
* ProcessingApi - functional programming interface
|
||||
* ReprocessingApi - functional programming interface
|
||||
*/
|
||||
export const ProcessingApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = ProcessingApiAxiosParamCreator(configuration)
|
||||
export const ReprocessingApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = ReprocessingApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary Process new activities for all characters with a usable token
|
||||
* @summary Reprocess the given item stacks for a character, appraising the input and resulting materials
|
||||
* @param {ReprocessItemsRequest} reprocessItemsRequest Character and item stacks to reprocess
|
||||
* @param {number} [locationId] Location to derive reprocessing efficiency at; defaults to the character\'s current location when omitted
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async processNewActivities(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.processNewActivities(options);
|
||||
async reprocessItems(reprocessItemsRequest: ReprocessItemsRequest, locationId?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ReprocessingResultResponse>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.reprocessItems(reprocessItemsRequest, locationId, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['ProcessingApi.processNewActivities']?.[localVarOperationServerIndex]?.url;
|
||||
const localVarOperationServerBasePath = operationServerMap['ReprocessingApi.reprocessItems']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ProcessingApi - factory interface
|
||||
* ReprocessingApi - factory interface
|
||||
*/
|
||||
export const ProcessingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = ProcessingApiFp(configuration)
|
||||
export const ReprocessingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = ReprocessingApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary Process new activities for all characters with a usable token
|
||||
* @summary Reprocess the given item stacks for a character, appraising the input and resulting materials
|
||||
* @param {ReprocessItemsRequest} reprocessItemsRequest Character and item stacks to reprocess
|
||||
* @param {number} [locationId] Location to derive reprocessing efficiency at; defaults to the character\'s current location when omitted
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
processNewActivities(options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
||||
return localVarFp.processNewActivities(options).then((request) => request(axios, basePath));
|
||||
reprocessItems(reprocessItemsRequest: ReprocessItemsRequest, locationId?: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<ReprocessingResultResponse>> {
|
||||
return localVarFp.reprocessItems(reprocessItemsRequest, locationId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* ProcessingApi - object-oriented interface
|
||||
* ReprocessingApi - object-oriented interface
|
||||
*/
|
||||
export class ProcessingApi extends BaseAPI {
|
||||
export class ReprocessingApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @summary Process new activities for all characters with a usable token
|
||||
* @summary Reprocess the given item stacks for a character, appraising the input and resulting materials
|
||||
* @param {ReprocessItemsRequest} reprocessItemsRequest Character and item stacks to reprocess
|
||||
* @param {number} [locationId] Location to derive reprocessing efficiency at; defaults to the character\'s current location when omitted
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public processNewActivities(options?: RawAxiosRequestConfig) {
|
||||
return ProcessingApiFp(this.configuration).processNewActivities(options).then((request) => request(this.axios, this.basePath));
|
||||
public reprocessItems(reprocessItemsRequest: ReprocessItemsRequest, locationId?: number, options?: RawAxiosRequestConfig) {
|
||||
return ReprocessingApiFp(this.configuration).reprocessItems(reprocessItemsRequest, locationId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
CharacterRuleBookApi,
|
||||
LedgerApi,
|
||||
MarketApi,
|
||||
ProcessingApi,
|
||||
RuleBookApi,
|
||||
TransactionApi
|
||||
} from "@/generated/mammon";
|
||||
@@ -30,6 +29,5 @@ export const characterApi = new CharacterApi(undefined, mammonUrl, mammonAxiosIn
|
||||
export const ruleBookApi = new RuleBookApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const characterRuleBookApi = new CharacterRuleBookApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const activityApi = new ActivityApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const processingApi = new ProcessingApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const acquisitionApi = new AcquisitionApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const marketApi = new MarketApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {RouterView} from 'vue-router';
|
||||
import {EditLedgerModal, useLedgersStore} from "@/ledger";
|
||||
import {ref} from "vue";
|
||||
import {activityApi, processingApi} from "@/mammon";
|
||||
import {activityApi} from "@/mammon";
|
||||
|
||||
const ledgersStore = useLedgersStore();
|
||||
|
||||
@@ -10,7 +10,7 @@ const editLedgerModal = ref<typeof EditLedgerModal>();
|
||||
|
||||
const processActivities = async () => {
|
||||
await activityApi.fetchAllNewActivities();
|
||||
await processingApi.processNewActivities();
|
||||
await activityApi.processNewActivities();
|
||||
await ledgersStore.refresh();
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {getMarketTypes, MarketTypePrice, useApraisalStore} from "@/market";
|
||||
import {AcquiredType, AcquisitionResultTable, BuyModal, SellModal, useAcquiredTypesStore} from '@/market/acquisition';
|
||||
import {ref, watch} from 'vue';
|
||||
import {activityApi, processingApi} from "@/mammon";
|
||||
import {activityApi} from "@/mammon";
|
||||
|
||||
const buyModal = ref<typeof BuyModal>();
|
||||
const sellModal = ref<typeof SellModal>();
|
||||
@@ -13,7 +13,7 @@ const items = ref<AcquiredType[]>([]);
|
||||
|
||||
const refresh = async () => {
|
||||
await activityApi.fetchAllNewActivities();
|
||||
await processingApi.processNewActivities();
|
||||
await activityApi.processNewActivities();
|
||||
await acquiredTypesStore.refresh();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user