From e137bec8dd494684f2851b99db6edb086a9f7b0d Mon Sep 17 00:00:00 2001 From: Sirttas Date: Wed, 20 May 2026 00:18:27 +0200 Subject: [PATCH] ledger uuid --- src/generated/mammon/api.ts | 58 ++++++++++++++++---------------- src/ledger/CreateLedgerModal.vue | 8 ++--- src/ledger/ledger.ts | 8 ++--- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/generated/mammon/api.ts b/src/generated/mammon/api.ts index ec314c8..a363669 100644 --- a/src/generated/mammon/api.ts +++ b/src/generated/mammon/api.ts @@ -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; + 'memberLedgerIds': Array; 'type'?: CombiningLedgerResponseTypeEnum; } @@ -38,7 +38,7 @@ export type CombiningLedgerResponseTypeEnum = typeof CombiningLedgerResponseType export interface CreateCombiningLedgerRequest { 'name': string; - 'memberLedgerIds': Array; + 'memberLedgerIds': Array; } 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; + 'memberLedgerIds': Array; } 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 => { + findById: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise => { // 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 => { + updateCombiningLedger: async (ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options: RawAxiosRequestConfig = {}): Promise => { // 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 => { + updateMainLedger: async (ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options: RawAxiosRequestConfig = {}): Promise => { // 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> { + async findById(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { 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> { + async updateCombiningLedger(ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { 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> { + async updateMainLedger(ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { 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 { + findById(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise { 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 { + updateCombiningLedger(ledgerId: string, updateCombiningLedgerRequest: UpdateCombiningLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise { 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 { + updateMainLedger(ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig): AxiosPromise { 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)); } } diff --git a/src/ledger/CreateLedgerModal.vue b/src/ledger/CreateLedgerModal.vue index 87e4979..80e58d1 100644 --- a/src/ledger/CreateLedgerModal.vue +++ b/src/ledger/CreateLedgerModal.vue @@ -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(), { - ledgerId: 0 -}); +const props = defineProps(); 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` diff --git a/src/ledger/ledger.ts b/src/ledger/ledger.ts index b06ed2f..788bd84 100644 --- a/src/ledger/ledger.ts +++ b/src/ledger/ledger.ts @@ -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[]);