ledger uuid

This commit is contained in:
Sirttas
2026-05-20 00:18:27 +02:00
parent 3ca0cf23f1
commit e137bec8dd
3 changed files with 36 additions and 38 deletions
+29 -29
View File
@@ -24,9 +24,9 @@ import type { RequestArgs } from './base';
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
export interface CombiningLedgerResponse extends LedgerResponse {
'ledgerId': number;
'ledgerId': string;
'name': string;
'memberLedgerIds': Array<number>;
'memberLedgerIds': Array<string>;
'type'?: CombiningLedgerResponseTypeEnum;
}
@@ -38,7 +38,7 @@ export type CombiningLedgerResponseTypeEnum = typeof CombiningLedgerResponseType
export interface CreateCombiningLedgerRequest {
'name': string;
'memberLedgerIds': Array<number>;
'memberLedgerIds': Array<string>;
}
export interface CreateMainLedgerRequest {
'name': string;
@@ -60,7 +60,7 @@ export const LedgerResponseTypeEnum = {
export type LedgerResponseTypeEnum = typeof LedgerResponseTypeEnum[keyof typeof LedgerResponseTypeEnum];
export interface MainLedgerResponse extends LedgerResponse {
'ledgerId': number;
'ledgerId': string;
'name': string;
'type'?: MainLedgerResponseTypeEnum;
}
@@ -73,7 +73,7 @@ export type MainLedgerResponseTypeEnum = typeof MainLedgerResponseTypeEnum[keyof
export interface UpdateCombiningLedgerRequest {
'name': string;
'memberLedgerIds': Array<number>;
'memberLedgerIds': Array<string>;
}
export interface UpdateMainLedgerRequest {
'name': string;
@@ -183,11 +183,11 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
},
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findById: async (ledgerId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
findById: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'ledgerId' is not null or undefined
assertParamExists('findById', 'ledgerId', ledgerId)
const localVarPath = `/ledgers/{ledgerId}`
@@ -216,12 +216,12 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
},
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCombiningLedger: async (ledgerId: number, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
updateCombiningLedger: async (ledgerId: string, 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
@@ -254,12 +254,12 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
},
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateMainLedger: async (ledgerId: number, updateMainLedgerRequest: UpdateMainLedgerRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
updateMainLedger: async (ledgerId: string, 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
@@ -336,11 +336,11 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async findById(ledgerId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FindAll200ResponseInner>> {
async findById(ledgerId: string, 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;
@@ -348,12 +348,12 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {number} ledgerId
* @param {string} 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>> {
async updateCombiningLedger(ledgerId: string, 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;
@@ -361,12 +361,12 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {number} ledgerId
* @param {string} 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>> {
async updateMainLedger(ledgerId: string, 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;
@@ -409,31 +409,31 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
},
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findById(ledgerId: number, options?: RawAxiosRequestConfig): AxiosPromise<FindAll200ResponseInner> {
findById(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise<FindAll200ResponseInner> {
return localVarFp.findById(ledgerId, options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCombiningLedger(ledgerId: number, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<CombiningLedgerResponse> {
updateCombiningLedger(ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<CombiningLedgerResponse> {
return localVarFp.updateCombiningLedger(ledgerId, updateCombiningLedgerRequest, options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateMainLedger(ledgerId: number, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<MainLedgerResponse> {
updateMainLedger(ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise<MainLedgerResponse> {
return localVarFp.updateMainLedger(ledgerId, updateMainLedgerRequest, options).then((request) => request(axios, basePath));
},
};
@@ -474,33 +474,33 @@ export class LedgerControllerApi extends BaseAPI {
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public findById(ledgerId: number, options?: RawAxiosRequestConfig) {
public findById(ledgerId: string, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).findById(ledgerId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {UpdateCombiningLedgerRequest} updateCombiningLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public updateCombiningLedger(ledgerId: number, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig) {
public updateCombiningLedger(ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).updateCombiningLedger(ledgerId, updateCombiningLedgerRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {number} ledgerId
* @param {string} ledgerId
* @param {UpdateMainLedgerRequest} updateMainLedgerRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public updateMainLedger(ledgerId: number, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig) {
public updateMainLedger(ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).updateMainLedger(ledgerId, updateMainLedgerRequest, options).then((request) => request(this.axios, this.basePath));
}
}
+3 -5
View File
@@ -8,12 +8,10 @@ import LedgerLabel from "./LedgerLabel.vue";
import {PlusIcon, TrashIcon} from '@heroicons/vue/24/outline';
interface Props {
ledgerId?: number;
ledgerId?: string;
}
const props = withDefaults(defineProps<Props>(), {
ledgerId: 0
});
const props = defineProps<Props>();
const ledgersStore = useLedgersStore();
const {ledgers} = storeToRefs(ledgersStore);
@@ -51,7 +49,7 @@ const open = () => {
}
const canSave = computed(() => name.value.trim().length > 0);
const isCreating = computed(() => props.ledgerId === 0)
const isCreating = computed(() => props.ledgerId)
const title = computed(() => {
if (isCreating.value) {
return `Creating ${type.value === LedgerTypes.Main ? 'Main' : 'Combining'} Ledger`
+4 -4
View File
@@ -46,13 +46,13 @@ export const useLedgersStore = defineStore('ledgers', () => {
return ledger;
};
const findById = (ledgerId: number): Ledger | undefined => ledgers.value.find(l => l.ledgerId === ledgerId);
const findAllById = (ledgerIds: number[]): Ledger[] => ledgerIds.map(findById).filter((x): x is Ledger => x !== undefined)
const findById = (ledgerId: string): Ledger | undefined => ledgers.value.find(l => l.ledgerId === ledgerId);
const findAllById = (ledgerIds: string[]): Ledger[] => ledgerIds.map(findById).filter((x): x is Ledger => x !== undefined)
const createMain = (ledger: CreateMainLedgerRequest) => ledgerControllerApi.createMainLedger(ledger).then(response => addLedger(response.data as Ledger));
const createCombining = (ledger: CreateCombiningLedgerRequest) => ledgerControllerApi.createCombiningLedger(ledger).then(response => addLedger(response.data as Ledger));
const updateMain = (ledgerId: number, ledger: UpdateMainLedgerRequest) => ledgerControllerApi.updateMainLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const updateCombining = (ledgerId: number, ledger: UpdateCombiningLedgerRequest) => ledgerControllerApi.updateCombiningLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const updateMain = (ledgerId: string, ledger: UpdateMainLedgerRequest) => ledgerControllerApi.updateMainLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const updateCombining = (ledgerId: string, ledger: UpdateCombiningLedgerRequest) => ledgerControllerApi.updateCombiningLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const refresh = () => ledgerControllerApi.findAll().then(response => ledgers.value = response.data as Ledger[]);