edit ledger

This commit is contained in:
Sirttas
2026-05-18 21:19:01 +02:00
parent 02466eea14
commit 3ca0cf23f1
5 changed files with 402 additions and 75 deletions
+274 -35
View File
@@ -23,29 +23,60 @@ import type { RequestArgs } from './base';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
export interface CombiningLedgerDto extends LedgerDto {
export interface CombiningLedgerResponse extends LedgerResponse {
'ledgerId': number;
'name': string;
'memberLedgerIds': Array<number>;
'type'?: CombiningLedgerResponseTypeEnum;
}
export interface CreateCombiningLedgerCommand {
export const CombiningLedgerResponseTypeEnum = {
Combining: 'COMBINING',
} as const;
export type CombiningLedgerResponseTypeEnum = typeof CombiningLedgerResponseTypeEnum[keyof typeof CombiningLedgerResponseTypeEnum];
export interface CreateCombiningLedgerRequest {
'name': string;
'memberLedgerIds': Array<number>;
}
export interface CreateMainLedgerCommand {
export interface CreateMainLedgerRequest {
'name': string;
}
/**
* @type FindAll200ResponseInner
*/
export type FindAll200ResponseInner = CombiningLedgerDto | MainLedgerDto;
export type FindAll200ResponseInner = CombiningLedgerResponse | MainLedgerResponse;
export interface LedgerDto {
'type': string;
export interface LedgerResponse {
'type'?: LedgerResponseTypeEnum;
}
export interface MainLedgerDto extends LedgerDto {
export const LedgerResponseTypeEnum = {
Main: 'MAIN',
Combining: 'COMBINING',
} as const;
export type LedgerResponseTypeEnum = typeof LedgerResponseTypeEnum[keyof typeof LedgerResponseTypeEnum];
export interface MainLedgerResponse extends LedgerResponse {
'ledgerId': number;
'name': string;
'type'?: MainLedgerResponseTypeEnum;
}
export const MainLedgerResponseTypeEnum = {
Main: 'MAIN',
} as const;
export type MainLedgerResponseTypeEnum = typeof MainLedgerResponseTypeEnum[keyof typeof MainLedgerResponseTypeEnum];
export interface UpdateCombiningLedgerRequest {
'name': string;
'memberLedgerIds': Array<number>;
}
export interface UpdateMainLedgerRequest {
'name': string;
}
/**
@@ -55,13 +86,13 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
return {
/**
*
* @param {CreateCombiningLedgerCommand} createCombiningLedgerCommand
* @param {CreateCombiningLedgerRequest} createCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCombiningLedger: async (createCombiningLedgerCommand: CreateCombiningLedgerCommand, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createCombiningLedgerCommand' is not null or undefined
assertParamExists('createCombiningLedger', 'createCombiningLedgerCommand', createCombiningLedgerCommand)
createCombiningLedger: async (createCombiningLedgerRequest: CreateCombiningLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createCombiningLedgerRequest' is not null or undefined
assertParamExists('createCombiningLedger', 'createCombiningLedgerRequest', createCombiningLedgerRequest)
const localVarPath = `/ledgers/combining`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -80,7 +111,7 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(createCombiningLedgerCommand, localVarRequestOptions, configuration)
localVarRequestOptions.data = serializeDataIfNeeded(createCombiningLedgerRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
@@ -89,13 +120,13 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
},
/**
*
* @param {CreateMainLedgerCommand} createMainLedgerCommand
* @param {CreateMainLedgerRequest} createMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createMainLedger: async (createMainLedgerCommand: CreateMainLedgerCommand, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createMainLedgerCommand' is not null or undefined
assertParamExists('createMainLedger', 'createMainLedgerCommand', createMainLedgerCommand)
createMainLedger: async (createMainLedgerRequest: CreateMainLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createMainLedgerRequest' is not null or undefined
assertParamExists('createMainLedger', 'createMainLedgerRequest', createMainLedgerRequest)
const localVarPath = `/ledgers/main`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -114,7 +145,7 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(createMainLedgerCommand, localVarRequestOptions, configuration)
localVarRequestOptions.data = serializeDataIfNeeded(createMainLedgerRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
@@ -145,6 +176,115 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} ledgerId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findById: async (ledgerId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'ledgerId' is not null or undefined
assertParamExists('findById', 'ledgerId', ledgerId)
const localVarPath = `/ledgers/{ledgerId}`
.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 {number} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCombiningLedger: async (ledgerId: number, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'ledgerId' is not null or undefined
assertParamExists('updateCombiningLedger', 'ledgerId', ledgerId)
// verify required parameter 'updateCombiningLedgerRequest' is not null or undefined
assertParamExists('updateCombiningLedger', 'updateCombiningLedgerRequest', updateCombiningLedgerRequest)
const localVarPath = `/ledgers/combining/{ledgerId}`
.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: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
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(updateCombiningLedgerRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateMainLedger: async (ledgerId: number, updateMainLedgerRequest: UpdateMainLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'ledgerId' is not null or undefined
assertParamExists('updateMainLedger', 'ledgerId', ledgerId)
// verify required parameter 'updateMainLedgerRequest' is not null or undefined
assertParamExists('updateMainLedger', 'updateMainLedgerRequest', updateMainLedgerRequest)
const localVarPath = `/ledgers/main/{ledgerId}`
.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: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
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(updateMainLedgerRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
@@ -161,24 +301,24 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {CreateCombiningLedgerCommand} createCombiningLedgerCommand
* @param {CreateCombiningLedgerRequest} createCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createCombiningLedger(createCombiningLedgerCommand: CreateCombiningLedgerCommand, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombiningLedgerDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createCombiningLedger(createCombiningLedgerCommand, options);
async createCombiningLedger(createCombiningLedgerRequest: CreateCombiningLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombiningLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createCombiningLedger(createCombiningLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.createCombiningLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {CreateMainLedgerCommand} createMainLedgerCommand
* @param {CreateMainLedgerRequest} createMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createMainLedger(createMainLedgerCommand: CreateMainLedgerCommand, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MainLedgerDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createMainLedger(createMainLedgerCommand, options);
async createMainLedger(createMainLedgerRequest: CreateMainLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MainLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createMainLedger(createMainLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.createMainLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -194,6 +334,44 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.findAll']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {number} ledgerId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async findById(ledgerId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FindAll200ResponseInner>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.findById(ledgerId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.findById']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {number} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateCombiningLedger(ledgerId: number, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombiningLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateCombiningLedger(ledgerId, updateCombiningLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.updateCombiningLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {number} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateMainLedger(ledgerId: number, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MainLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateMainLedger(ledgerId, updateMainLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.updateMainLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
@@ -205,21 +383,21 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
return {
/**
*
* @param {CreateCombiningLedgerCommand} createCombiningLedgerCommand
* @param {CreateCombiningLedgerRequest} createCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCombiningLedger(createCombiningLedgerCommand: CreateCombiningLedgerCommand, options?: RawAxiosRequestConfig): AxiosPromise<CombiningLedgerDto> {
return localVarFp.createCombiningLedger(createCombiningLedgerCommand, options).then((request) => request(axios, basePath));
createCombiningLedger(createCombiningLedgerRequest: CreateCombiningLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<CombiningLedgerResponse> {
return localVarFp.createCombiningLedger(createCombiningLedgerRequest, options).then((request) => request(axios, basePath));
},
/**
*
* @param {CreateMainLedgerCommand} createMainLedgerCommand
* @param {CreateMainLedgerRequest} createMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createMainLedger(createMainLedgerCommand: CreateMainLedgerCommand, options?: RawAxiosRequestConfig): AxiosPromise<MainLedgerDto> {
return localVarFp.createMainLedger(createMainLedgerCommand, options).then((request) => request(axios, basePath));
createMainLedger(createMainLedgerRequest: CreateMainLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<MainLedgerResponse> {
return localVarFp.createMainLedger(createMainLedgerRequest, options).then((request) => request(axios, basePath));
},
/**
*
@@ -229,6 +407,35 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
findAll(options?: RawAxiosRequestConfig): AxiosPromise<Array<FindAll200ResponseInner>> {
return localVarFp.findAll(options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} ledgerId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findById(ledgerId: number, options?: RawAxiosRequestConfig): AxiosPromise<FindAll200ResponseInner> {
return localVarFp.findById(ledgerId, options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCombiningLedger(ledgerId: number, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<CombiningLedgerResponse> {
return localVarFp.updateCombiningLedger(ledgerId, updateCombiningLedgerRequest, options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateMainLedger(ledgerId: number, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<MainLedgerResponse> {
return localVarFp.updateMainLedger(ledgerId, updateMainLedgerRequest, options).then((request) => request(axios, basePath));
},
};
};
@@ -238,22 +445,22 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
export class LedgerControllerApi extends BaseAPI {
/**
*
* @param {CreateCombiningLedgerCommand} createCombiningLedgerCommand
* @param {CreateCombiningLedgerRequest} createCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public createCombiningLedger(createCombiningLedgerCommand: CreateCombiningLedgerCommand, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).createCombiningLedger(createCombiningLedgerCommand, options).then((request) => request(this.axios, this.basePath));
public createCombiningLedger(createCombiningLedgerRequest: CreateCombiningLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).createCombiningLedger(createCombiningLedgerRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {CreateMainLedgerCommand} createMainLedgerCommand
* @param {CreateMainLedgerRequest} createMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public createMainLedger(createMainLedgerCommand: CreateMainLedgerCommand, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).createMainLedger(createMainLedgerCommand, options).then((request) => request(this.axios, this.basePath));
public createMainLedger(createMainLedgerRequest: CreateMainLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).createMainLedger(createMainLedgerRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
@@ -264,6 +471,38 @@ export class LedgerControllerApi extends BaseAPI {
public findAll(options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).findAll(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {number} ledgerId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public findById(ledgerId: number, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).findById(ledgerId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {number} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public updateCombiningLedger(ledgerId: number, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).updateCombiningLedger(ledgerId, updateCombiningLedgerRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {number} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public updateMainLedger(ledgerId: number, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).updateMainLedger(ledgerId, updateMainLedgerRequest, options).then((request) => request(this.axios, this.basePath));
}
}